put_organization_conformance_pack
async
¶
put_organization_conformance_pack(
organization_conformance_pack_name: OrganizationConformancePackName,
*,
config_overrides: Optional[AsyncConfigServiceClientConfig] = 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/async_config_service.py
6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 | |