Table of Contents
ConfigService.
Client
¶A low-level client representing AWS Config (Config Service):
client = session.create_client('config')
These are the available methods:
can_paginate()
delete_delivery_channel()
deliver_config_snapshot()
describe_configuration_recorder_status()
describe_configuration_recorders()
describe_delivery_channel_status()
describe_delivery_channels()
generate_presigned_url()
get_paginator()
get_resource_config_history()
get_waiter()
put_configuration_recorder()
put_delivery_channel()
start_configuration_recorder()
stop_configuration_recorder()
can_paginate
(operation_name)¶Check if an operation can be paginated.
Parameters: | operation_name (string) -- The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo , and you'd normally invoke the
operation as client.create_foo(**kwargs) , if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo") . |
---|---|
Returns: | True if the operation can be paginated,
False otherwise. |
delete_delivery_channel
(**kwargs)¶Deletes the specified delivery channel.
The delivery channel cannot be deleted if it is the only delivery channel and the configuration recorder is still running. To delete the delivery channel, stop the running configuration recorder using the StopConfigurationRecorder action.
Request Syntax
response = client.delete_delivery_channel(
DeliveryChannelName='string'
)
Parameters: | DeliveryChannelName (string) -- [REQUIRED] The name of the delivery channel to delete. |
---|---|
Returns: | None |
deliver_config_snapshot
(**kwargs)¶Schedules delivery of a configuration snapshot to the Amazon S3 bucket in the specified delivery channel. After the delivery has started, AWS Config sends following notifications using an Amazon SNS topic that you have specified.
Request Syntax
response = client.deliver_config_snapshot(
deliveryChannelName='string'
)
Parameters: | deliveryChannelName (string) -- [REQUIRED] The name of the delivery channel through which the snapshot is delivered. |
---|---|
Return type: | dict |
Returns: | Response Syntax{
'configSnapshotId': 'string'
}
Response Structure
|
describe_configuration_recorder_status
(**kwargs)¶Returns the current status of the specified configuration recorder. If a configuration recorder is not specified, this action returns the status of all configuration recorder associated with the account.
Note
Currently, you can specify only one configuration recorder per account.
Request Syntax
response = client.describe_configuration_recorder_status(
ConfigurationRecorderNames=[
'string',
]
)
Parameters: | ConfigurationRecorderNames (list) -- The name(s) of the configuration recorder. If the name is not specified, the action returns the current status of all the configuration recorders associated with the account.
|
---|---|
Return type: | dict |
Returns: | Response Syntax{
'ConfigurationRecordersStatus': [
{
'name': 'string',
'lastStartTime': datetime(2015, 1, 1),
'lastStopTime': datetime(2015, 1, 1),
'recording': True|False,
'lastStatus': 'Pending'|'Success'|'Failure',
'lastErrorCode': 'string',
'lastErrorMessage': 'string',
'lastStatusChangeTime': datetime(2015, 1, 1)
},
]
}
Response Structure
|
describe_configuration_recorders
(**kwargs)¶Returns the name of one or more specified configuration recorders. If the recorder name is not specified, this action returns the names of all the configuration recorders associated with the account.
Note
Currently, you can specify only one configuration recorder per account.
Request Syntax
response = client.describe_configuration_recorders(
ConfigurationRecorderNames=[
'string',
]
)
Parameters: | ConfigurationRecorderNames (list) -- A list of configuration recorder names.
|
---|---|
Return type: | dict |
Returns: | Response Syntax{
'ConfigurationRecorders': [
{
'name': 'string',
'roleARN': 'string',
'recordingGroup': {
'allSupported': True|False,
'resourceTypes': [
'AWS::EC2::CustomerGateway'|'AWS::EC2::EIP'|'AWS::EC2::Instance'|'AWS::EC2::InternetGateway'|'AWS::EC2::NetworkAcl'|'AWS::EC2::NetworkInterface'|'AWS::EC2::RouteTable'|'AWS::EC2::SecurityGroup'|'AWS::EC2::Subnet'|'AWS::CloudTrail::Trail'|'AWS::EC2::Volume'|'AWS::EC2::VPC'|'AWS::EC2::VPNConnection'|'AWS::EC2::VPNGateway',
]
}
},
]
}
Response Structure
|
describe_delivery_channel_status
(**kwargs)¶Returns the current status of the specified delivery channel. If a delivery channel is not specified, this action returns the current status of all delivery channels associated with the account.
Note
Currently, you can specify only one delivery channel per account.
Request Syntax
response = client.describe_delivery_channel_status(
DeliveryChannelNames=[
'string',
]
)
Parameters: | DeliveryChannelNames (list) -- A list of delivery channel names.
|
---|---|
Return type: | dict |
Returns: | Response Syntax{
'DeliveryChannelsStatus': [
{
'name': 'string',
'configSnapshotDeliveryInfo': {
'lastStatus': 'Success'|'Failure'|'Not_Applicable',
'lastErrorCode': 'string',
'lastErrorMessage': 'string',
'lastAttemptTime': datetime(2015, 1, 1),
'lastSuccessfulTime': datetime(2015, 1, 1)
},
'configHistoryDeliveryInfo': {
'lastStatus': 'Success'|'Failure'|'Not_Applicable',
'lastErrorCode': 'string',
'lastErrorMessage': 'string',
'lastAttemptTime': datetime(2015, 1, 1),
'lastSuccessfulTime': datetime(2015, 1, 1)
},
'configStreamDeliveryInfo': {
'lastStatus': 'Success'|'Failure'|'Not_Applicable',
'lastErrorCode': 'string',
'lastErrorMessage': 'string',
'lastStatusChangeTime': datetime(2015, 1, 1)
}
},
]
}
Response Structure
|
describe_delivery_channels
(**kwargs)¶Returns details about the specified delivery channel. If a delivery channel is not specified, this action returns the details of all delivery channels associated with the account.
Note
Currently, you can specify only one delivery channel per account.
Request Syntax
response = client.describe_delivery_channels(
DeliveryChannelNames=[
'string',
]
)
Parameters: | DeliveryChannelNames (list) -- A list of delivery channel names.
|
---|---|
Return type: | dict |
Returns: | Response Syntax{
'DeliveryChannels': [
{
'name': 'string',
's3BucketName': 'string',
's3KeyPrefix': 'string',
'snsTopicARN': 'string'
},
]
}
Response Structure
|
generate_presigned_url
(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
Parameters: |
|
---|---|
Returns: | The presigned url |
get_paginator
(operation_name)¶Create a paginator for an operation.
Parameters: | operation_name (string) -- The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo , and you'd normally invoke the
operation as client.create_foo(**kwargs) , if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo") . |
---|---|
Raises OperationNotPageableError: | |
Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
|
Return type: | L{botocore.paginate.Paginator} |
Returns: | A paginator object. |
get_resource_config_history
(**kwargs)¶Returns a list of configuration items for the specified resource. The list contains details about each state of the resource during the specified time interval. You can specify a limit
on the number of results returned on the page. If a limit is specified, a nextToken
is returned as part of the result that you can use to continue this request.
Note
Each call to the API is limited to span a duration of seven days. It is likely that the number of records returned is smaller than the specified limit
. In such cases, you can make another call, using the nextToken
.
Request Syntax
response = client.get_resource_config_history(
resourceType='AWS::EC2::CustomerGateway'|'AWS::EC2::EIP'|'AWS::EC2::Instance'|'AWS::EC2::InternetGateway'|'AWS::EC2::NetworkAcl'|'AWS::EC2::NetworkInterface'|'AWS::EC2::RouteTable'|'AWS::EC2::SecurityGroup'|'AWS::EC2::Subnet'|'AWS::CloudTrail::Trail'|'AWS::EC2::Volume'|'AWS::EC2::VPC'|'AWS::EC2::VPNConnection'|'AWS::EC2::VPNGateway',
resourceId='string',
laterTime=datetime(2015, 1, 1),
earlierTime=datetime(2015, 1, 1),
chronologicalOrder='Reverse'|'Forward',
limit=123,
nextToken='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'configurationItems': [
{
'version': 'string',
'accountId': 'string',
'configurationItemCaptureTime': datetime(2015, 1, 1),
'configurationItemStatus': 'Ok'|'Failed'|'Discovered'|'Deleted',
'configurationStateId': 'string',
'configurationItemMD5Hash': 'string',
'arn': 'string',
'resourceType': 'AWS::EC2::CustomerGateway'|'AWS::EC2::EIP'|'AWS::EC2::Instance'|'AWS::EC2::InternetGateway'|'AWS::EC2::NetworkAcl'|'AWS::EC2::NetworkInterface'|'AWS::EC2::RouteTable'|'AWS::EC2::SecurityGroup'|'AWS::EC2::Subnet'|'AWS::CloudTrail::Trail'|'AWS::EC2::Volume'|'AWS::EC2::VPC'|'AWS::EC2::VPNConnection'|'AWS::EC2::VPNGateway',
'resourceId': 'string',
'availabilityZone': 'string',
'resourceCreationTime': datetime(2015, 1, 1),
'tags': {
'string': 'string'
},
'relatedEvents': [
'string',
],
'relationships': [
{
'resourceType': 'AWS::EC2::CustomerGateway'|'AWS::EC2::EIP'|'AWS::EC2::Instance'|'AWS::EC2::InternetGateway'|'AWS::EC2::NetworkAcl'|'AWS::EC2::NetworkInterface'|'AWS::EC2::RouteTable'|'AWS::EC2::SecurityGroup'|'AWS::EC2::Subnet'|'AWS::CloudTrail::Trail'|'AWS::EC2::Volume'|'AWS::EC2::VPC'|'AWS::EC2::VPNConnection'|'AWS::EC2::VPNGateway',
'resourceId': 'string',
'relationshipName': 'string'
},
],
'configuration': 'string'
},
],
'nextToken': 'string'
}
Response Structure
|
get_waiter
(waiter_name)¶put_configuration_recorder
(**kwargs)¶Creates a new configuration recorder to record the selected resource configurations.
You can use this action to change the role roleARN
and/or the recordingGroup
of an existing recorder. To change the role, call the action on the existing configuration recorder and specify a role.
Note
Currently, you can specify only one configuration recorder per account.
If ConfigurationRecorder
does not have the recordingGroup parameter specified, the default is to record all supported resource types.
Request Syntax
response = client.put_configuration_recorder(
ConfigurationRecorder={
'name': 'string',
'roleARN': 'string',
'recordingGroup': {
'allSupported': True|False,
'resourceTypes': [
'AWS::EC2::CustomerGateway'|'AWS::EC2::EIP'|'AWS::EC2::Instance'|'AWS::EC2::InternetGateway'|'AWS::EC2::NetworkAcl'|'AWS::EC2::NetworkInterface'|'AWS::EC2::RouteTable'|'AWS::EC2::SecurityGroup'|'AWS::EC2::Subnet'|'AWS::CloudTrail::Trail'|'AWS::EC2::Volume'|'AWS::EC2::VPC'|'AWS::EC2::VPNConnection'|'AWS::EC2::VPNGateway',
]
}
}
)
Parameters: | ConfigurationRecorder (dict) -- [REQUIRED] The configuration recorder object that records each configuration change made to the resources.
|
---|---|
Returns: | None |
put_delivery_channel
(**kwargs)¶Creates a new delivery channel object to deliver the configuration information to an Amazon S3 bucket, and to an Amazon SNS topic.
You can use this action to change the Amazon S3 bucket or an Amazon SNS topic of the existing delivery channel. To change the Amazon S3 bucket or an Amazon SNS topic, call this action and specify the changed values for the S3 bucket and the SNS topic. If you specify a different value for either the S3 bucket or the SNS topic, this action will keep the existing value for the parameter that is not changed.
Note
Currently, you can specify only one delivery channel per account.
Request Syntax
response = client.put_delivery_channel(
DeliveryChannel={
'name': 'string',
's3BucketName': 'string',
's3KeyPrefix': 'string',
'snsTopicARN': 'string'
}
)
Parameters: | DeliveryChannel (dict) -- [REQUIRED] The configuration delivery channel object that delivers the configuration information to an Amazon S3 bucket, and to an Amazon SNS topic.
|
---|---|
Returns: | None |
start_configuration_recorder
(**kwargs)¶Starts recording configurations of the AWS resources you have selected to record in your AWS account.
You must have created at least one delivery channel to successfully start the configuration recorder.
Request Syntax
response = client.start_configuration_recorder(
ConfigurationRecorderName='string'
)
Parameters: | ConfigurationRecorderName (string) -- [REQUIRED] The name of the recorder object that records each configuration change made to the resources. |
---|---|
Returns: | None |
stop_configuration_recorder
(**kwargs)¶Stops recording configurations of the AWS resources you have selected to record in your AWS account.
Request Syntax
response = client.stop_configuration_recorder(
ConfigurationRecorderName='string'
)
Parameters: | ConfigurationRecorderName (string) -- [REQUIRED] The name of the recorder object that records each configuration change made to the resources. |
---|---|
Returns: | None |