put_organization_conformance_pack
¶
put_organization_conformance_pack(
organization_conformance_pack_name: OrganizationConformancePackName,
*,
config_overrides: Optional[ConfigServiceClientConfig] = None,
template_s3_uri: Optional[TemplateS3Uri] = None,
template_body: Optional[TemplateBody] = None,
delivery_s3_bucket: Optional[DeliveryS3Bucket] = None,
delivery_s3_key_prefix: Optional[DeliveryS3KeyPrefix] = None,
conformance_pack_input_parameters: Optional[ConformancePackInputParameters] = None,
excluded_accounts: Optional[ExcludedAccounts] = None,
tags: Optional[TagsList] = None,
) -> PutOrganizationConformancePackResponse
Deploys conformance packs across member accounts in an Amazon Web Services Organization. For information on how many organization conformance packs and how many Config rules you can have per account, see Service Limits in the Config Developer Guide.
Only a management account and a delegated administrator can call this API. When calling this API with a delegated administrator, you must ensure Organizations ListDelegatedAdministrator permissions are added. An organization can have up to 3 delegated administrators.
When you use PutOrganizationConformancePack to deploy conformance packs across member accounts, the operation can create Config rules and remediation actions without requiring config:PutConfigRule or config:PutRemediationConfigurations permissions in member account IAM policies.
This API uses the AWSServiceRoleForConfigConforms service-linked role in each member account to create conformance pack resources. This service-linked role includes the permissions to create Config rules and remediation configurations, even if member account IAM policies explicitly deny these actions.
This API enables organization service access for config-multiaccountsetup.amazonaws.com through the EnableAWSServiceAccess action and creates a service-linked role AWSServiceRoleForConfigMultiAccountSetup in the management or delegated administrator account of your organization. The service-linked role is created only when the role does not exist in the caller account. To use this API with delegated administrator, register a delegated administrator by calling Amazon Web Services Organization register-delegate-admin for config-multiaccountsetup.amazonaws.com.
Prerequisite: Ensure you call EnableAllFeatures API to enable all features in an organization.
You must specify either the TemplateS3Uri or the TemplateBody parameter, but not both. If you provide both Config uses the TemplateS3Uri parameter and ignores the TemplateBody parameter.
Config sets the state of a conformance pack to CREATE_IN_PROGRESS and UPDATE_IN_PROGRESS until the conformance pack is created or updated. You cannot update a conformance pack while it is in this state.
Parameters:
-
organization_conformance_pack_name(OrganizationConformancePackName) –Name of the organization conformance pack you want to create.
-
template_s3_uri(Optional[TemplateS3Uri], default:None) –Location of file containing the template body. The uri must point to the conformance pack template (max size: 300 KB).
You must have access to read Amazon S3 bucket. In addition, in order to ensure a successful deployment, the template object must not be in an archived storage class if this parameter is passed.
-
template_body(Optional[TemplateBody], default:None) –A string that contains the full conformance pack template body. Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes.
-
delivery_s3_bucket(Optional[DeliveryS3Bucket], default:None) –The name of the Amazon S3 bucket where Config stores conformance pack templates.
This field is optional. If used, it must be prefixed with
awsconfigconforms. -
delivery_s3_key_prefix(Optional[DeliveryS3KeyPrefix], default:None) –The prefix for the Amazon S3 bucket.
This field is optional.
-
conformance_pack_input_parameters(Optional[ConformancePackInputParameters], default:None) –A list of
ConformancePackInputParameterobjects. -
excluded_accounts(Optional[ExcludedAccounts], default:None) –A list of Amazon Web Services accounts to be excluded from an organization conformance pack while deploying a conformance pack.
-
tags(Optional[TagsList], default:None) –The tags for the organization conformance pack. Each tag consists of a key and an optional value, both of which you define.
Raises:
-
InsufficientPermissionsException–Indicates one of the following errors:
-
For PutConfigRule, the rule cannot be created because the IAM role assigned to Config lacks permissions to perform the config:Put* action.
-
For PutConfigRule, the Lambda function cannot be invoked. Check the function ARN, and check the function's permissions.
-
For PutOrganizationConfigRule, organization Config rule cannot be created because you do not have permissions to call IAM
GetRoleaction or create a service-linked role. -
For PutConformancePack and PutOrganizationConformancePack, a conformance pack cannot be created because you do not have the following permissions:
-
You do not have permission to call IAM
GetRoleaction or create a service-linked role. -
You do not have permission to read Amazon S3 bucket or call SSM:GetDocument.
-
-
For PutServiceLinkedConfigurationRecorder, a service-linked configuration recorder cannot be created because you do not have the following permissions: IAM
CreateServiceLinkedRole. -
For PutConnector, a connector cannot be created because you do not have the following permissions: IAM
CreateServiceLinkedRole.
-
-
MaxNumberOfOrganizationConformancePacksExceededException–You have reached the limit of the number of organization conformance packs you can create in an account. For more information, see Service Limits in the Config Developer Guide.
-
NoAvailableOrganizationException–Organization is no longer available.
-
OrganizationAccessDeniedException–For
PutConfigurationAggregatorAPI, you can see this exception for the following reasons:-
No permission to call
EnableAWSServiceAccessAPI -
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
ListDelegatedAdministratorsAPI. Ensure that the management account registers delagated administrator for Config service principal name before the delegated administrator creates an aggregator.
For all
OrganizationConfigRuleandOrganizationConformancePackAPIs, 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.
-
OrganizationConformancePackTemplateValidationException–You have specified a template that is not valid or supported.
-
ResourceInUseException–You see this exception in the following cases:
-
For DeleteConfigRule, Config is deleting this rule. Try your request again later.
-
For DeleteConfigRule, the rule is deleting your evaluation results. Try your request again later.
-
For DeleteConfigRule, a remediation action is associated with the rule and Config cannot delete this rule. Delete the remediation action associated with the rule before deleting the rule and try your request again later.
-
For PutConfigOrganizationRule, organization Config rule deletion is in progress. Try your request again later.
-
For DeleteOrganizationConfigRule, organization Config rule creation is in progress. Try your request again later.
-
For PutConformancePack and PutOrganizationConformancePack, a conformance pack creation, update, and deletion is in progress. Try your request again later.
-
For DeleteConformancePack, a conformance pack creation, update, and deletion is in progress. Try your request again later.
-
-
ValidationException–The requested operation is not valid. You will see this exception if there are missing required fields or if the input value fails the validation.
For PutStoredQuery, one of the following errors:
-
There are missing required fields.
-
The input value fails the validation.
-
You are trying to create more than 300 queries.
For DescribeConfigurationRecorders and DescribeConfigurationRecorderStatus, one of the following errors:
-
You have specified more than one configuration recorder.
-
You have provided a service principal for service-linked configuration recorder that is not valid.
For AssociateResourceTypes and DisassociateResourceTypes, one of the following errors:
-
Your configuraiton recorder has a recording strategy that does not allow the association or disassociation of resource types.
-
One or more of the specified resource types are already associated or disassociated with the configuration recorder.
-
For service-linked configuration recorders, the configuration recorder does not record one or more of the specified resource types.
For DeleteServiceLinkedConfigurationRecorder, one of the following errors:
-
You have provided both
ArnandServicePrincipal. Only one ofArnorServicePrincipalcan be specified. -
You have provided a service principal for service-linked configuration recorder that is not valid.
-
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_config_service/_services/config_service.py
6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 | |