Creates and updates the configuration aggregator with the selected source accounts and regions. The source account can be individual account(s) or an organization.
accountIds that are passed will be replaced with existing accounts. If you want to add additional accounts into the aggregator, call DescribeConfigurationAggregators to get the previous accounts and then append new ones.
Config should be enabled in source accounts and regions you want to aggregate.
If your source type is an organization, you must be signed in to the management account or a registered delegated administrator and all the features must be enabled in your organization. If the caller is a management account, Config calls EnableAwsServiceAccess API to enable integration between Config and Organizations. If the caller is a registered delegated administrator, Config calls ListDelegatedAdministrators API to verify whether the caller is a valid delegated administrator.
To register a delegated administrator, see Register a Delegated Administrator in the Config developer guide.
Tags are added at creation and cannot be updated with this operation
PutConfigurationAggregator is an idempotent API. Subsequent requests won’t create a duplicate resource if one was already created. If a following request has different tags values, Config will ignore these differences and treat it as an idempotent request of the previous. In this case, tags will not be updated, even if they are different.
Use TagResource and UntagResource to update tags after creation.
Parameters:
Raises:
-
InvalidParameterValueException
–
One or more of the specified parameters are not valid. Verify that your parameters are valid and try again.
-
InvalidRoleException
–
You have provided a null or empty Amazon Resource Name (ARN) for the IAM role assumed by Config and used by the customer managed configuration recorder.
-
LimitExceededException
–
For PutServiceLinkedConfigurationRecorder API, this exception is thrown if the number of service-linked roles in the account exceeds the limit.
For StartConfigRulesEvaluation API, this exception is thrown if an evaluation is in progress or if you call the StartConfigRulesEvaluation API more than once per minute.
For PutConfigurationAggregator API, this exception is thrown if the number of accounts and aggregators exceeds the limit.
-
NoAvailableOrganizationException
–
Organization is no longer available.
-
OrganizationAccessDeniedException
–
For PutConfigurationAggregator API, you can see this exception for the following reasons:
-
No permission to call EnableAWSServiceAccess API
-
The configuration aggregator cannot be updated because your Amazon Web Services Organization management account or the delegated administrator role changed. Delete this aggregator and create a new one with the current Amazon Web Services Organization.
-
The configuration aggregator is associated with a previous Amazon Web Services Organization and Config cannot aggregate data with current Amazon Web Services Organization. Delete this aggregator and create a new one with the current Amazon Web Services Organization.
-
You are not a registered delegated administrator for Config with permissions to call ListDelegatedAdministrators API. Ensure that the management account registers delagated administrator for Config service principal name before the delegated administrator creates an aggregator.
For all OrganizationConfigRule and OrganizationConformancePack APIs, Config throws an exception if APIs are called from member accounts. All APIs must be called from organization management account.
-
OrganizationAllFeaturesNotEnabledException
–
Config resource cannot be created because your organization does not have all features enabled.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_config_service/_services/config_service.py
| def put_configuration_aggregator(
self,
configuration_aggregator_name: "capo_config_service.types.configuration_aggregator_name.ConfigurationAggregatorName",
*,
config_overrides: Optional[ConfigServiceClientConfig] = None,
account_aggregation_sources: Optional[
"capo_config_service.types.account_aggregation_source_list.AccountAggregationSourceList"
] = None,
organization_aggregation_source: Optional[
"capo_config_service.types.organization_aggregation_source.OrganizationAggregationSource"
] = None,
tags: Optional["capo_config_service.types.tags_list.TagsList"] = None,
aggregator_filters: Optional[
"capo_config_service.types.aggregator_filters.AggregatorFilters"
] = None,
) -> "capo_config_service.types.put_configuration_aggregator_response.PutConfigurationAggregatorResponse":
"""<p>Creates and updates the configuration aggregator with the selected source accounts and regions. The source account can be individual account(s) or an organization.</p> <p> <code>accountIds</code> that are passed will be replaced with existing accounts. If you want to add additional accounts into the aggregator, call <code>DescribeConfigurationAggregators</code> to get the previous accounts and then append new ones.</p> <note> <p>Config should be enabled in source accounts and regions you want to aggregate.</p> <p>If your source type is an organization, you must be signed in to the management account or a registered delegated administrator and all the features must be enabled in your organization. If the caller is a management account, Config calls <code>EnableAwsServiceAccess</code> API to enable integration between Config and Organizations. If the caller is a registered delegated administrator, Config calls <code>ListDelegatedAdministrators</code> API to verify whether the caller is a valid delegated administrator.</p> <p>To register a delegated administrator, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/set-up-aggregator-cli.html#register-a-delegated-administrator-cli">Register a Delegated Administrator</a> in the <i>Config developer guide</i>. </p> </note> <note> <p> <b>Tags are added at creation and cannot be updated with this operation</b> </p> <p> <code>PutConfigurationAggregator</code> is an idempotent API. Subsequent requests won’t create a duplicate resource if one was already created. If a following request has different <code>tags</code> values, Config will ignore these differences and treat it as an idempotent request of the previous. In this case, <code>tags</code> will not be updated, even if they are different.</p> <p>Use <a href="https://docs.aws.amazon.com/config/latest/APIReference/API_TagResource.html">TagResource</a> and <a href="https://docs.aws.amazon.com/config/latest/APIReference/API_UntagResource.html">UntagResource</a> to update tags after creation.</p> </note>
Args:
configuration_aggregator_name: <p>The name of the configuration aggregator.</p>
account_aggregation_sources: <p>A list of AccountAggregationSource object. </p>
organization_aggregation_source: <p>An OrganizationAggregationSource object.</p>
tags: <p>An array of tag object.</p>
aggregator_filters: <p>An object to filter configuration recorders in an aggregator. Either <code>ResourceType</code> or <code>ServicePrincipal</code> is required.</p>
Raises:
capo_config_service.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more of the specified parameters are not valid. Verify that your parameters are valid and try again.</p>
capo_config_service.errors.invalid_role_exception.InvalidRoleException: <p>You have provided a null or empty Amazon Resource Name (ARN) for the IAM role assumed by Config and used by the customer managed configuration recorder.</p>
capo_config_service.errors.limit_exceeded_exception.LimitExceededException: <p>For <code>PutServiceLinkedConfigurationRecorder</code> API, this exception is thrown if the number of service-linked roles in the account exceeds the limit.</p> <p>For <code>StartConfigRulesEvaluation</code> API, this exception is thrown if an evaluation is in progress or if you call the <a>StartConfigRulesEvaluation</a> API more than once per minute.</p> <p>For <code>PutConfigurationAggregator</code> API, this exception is thrown if the number of accounts and aggregators exceeds the limit.</p>
capo_config_service.errors.no_available_organization_exception.NoAvailableOrganizationException: <p>Organization is no longer available.</p>
capo_config_service.errors.organization_access_denied_exception.OrganizationAccessDeniedException: <p>For <code>PutConfigurationAggregator</code> API, you can see this exception for the following reasons:</p> <ul> <li> <p>No permission to call <code>EnableAWSServiceAccess</code> API</p> </li> <li> <p>The configuration aggregator cannot be updated because your Amazon Web Services Organization management account or the delegated administrator role changed. Delete this aggregator and create a new one with the current Amazon Web Services Organization.</p> </li> <li> <p>The configuration aggregator is associated with a previous Amazon Web Services Organization and Config cannot aggregate data with current Amazon Web Services Organization. Delete this aggregator and create a new one with the current Amazon Web Services Organization.</p> </li> <li> <p>You are not a registered delegated administrator for Config with permissions to call <code>ListDelegatedAdministrators</code> API. Ensure that the management account registers delagated administrator for Config service principal name before the delegated administrator creates an aggregator.</p> </li> </ul> <p>For all <code>OrganizationConfigRule</code> and <code>OrganizationConformancePack</code> APIs, Config throws an exception if APIs are called from member accounts. All APIs must be called from organization management account.</p>
capo_config_service.errors.organization_all_features_not_enabled_exception.OrganizationAllFeaturesNotEnabledException: <p>Config resource cannot be created because your organization does not have all features enabled.</p>
capo_config_service.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_config_service.types.put_configuration_aggregator_request.PutConfigurationAggregatorRequest]",
) -> OperationResponse[
"capo_config_service.types.put_configuration_aggregator_response.PutConfigurationAggregatorResponse"
]:
import capo_config_service._operations.starling_dove_service.put_configuration_aggregator
output, http_response = (
capo_config_service._operations.starling_dove_service.put_configuration_aggregator.put_configuration_aggregator(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutConfigurationAggregator")
)
input_: capo_config_service.types.put_configuration_aggregator_request.PutConfigurationAggregatorRequest = {
"configuration_aggregator_name": configuration_aggregator_name
}
if account_aggregation_sources is not None:
input_["account_aggregation_sources"] = account_aggregation_sources
if organization_aggregation_source is not None:
input_["organization_aggregation_source"] = organization_aggregation_source
if tags is not None:
input_["tags"] = tags
if aggregator_filters is not None:
input_["aggregator_filters"] = aggregator_filters
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|