put_conformance_pack
async
¶
put_conformance_pack(
conformance_pack_name: ConformancePackName,
*,
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,
template_ssm_document_details: Optional[TemplateSSMDocumentDetails] = None,
tags: Optional[TagsList] = None,
source: Optional[ConformancePackSource] = None,
scope: Optional[ConformancePackScope] = None,
) -> PutConformancePackResponse
Creates or updates a conformance pack. A conformance pack is a collection of Config rules that can be easily deployed in an account and a region and across an organization. For information on how many conformance packs you can have per account, see Service Limits in the Config Developer Guide.
When you use PutConformancePack to deploy conformance packs in your account, the operation can create Config rules and remediation actions without requiring config:PutConfigRule or config:PutRemediationConfigurations permissions in your account IAM policies.
This API uses the AWSServiceRoleForConfigConforms service-linked role in your account to create conformance pack resources. This service-linked role includes the permissions to create Config rules and remediation configurations, even if your account IAM policies explicitly deny these actions.
This API creates a service-linked role AWSServiceRoleForConfigConforms in your account. The service-linked role is created only when the role does not exist in your account.
For custom conformance packs, you must specify only one of TemplateS3Uri, TemplateBody, TemplateSSMDocumentDetails.
For managed conformance packs, you must specify Source. Do not specify TemplateS3Uri, TemplateBody, TemplateSSMDocumentDetails, DeliveryS3Bucket, or DeliveryS3KeyPrefix.
Tags are added at creation and cannot be updated with this operation
PutConformancePack 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:
-
conformance_pack_name(ConformancePackName) –The unique name of the conformance pack you want to deploy.
-
template_s3_uri(Optional[TemplateS3Uri], default:None) –The location of the file containing the template body (
s3://bucketname/prefix). The uri must point to a conformance pack template (max size: 300 KB) that is located in an Amazon S3 bucket in the same Region as the conformance pack.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. The structure containing the template body has a minimum length of 1 byte and a maximum length of 51,200 bytes.
You can use a YAML template with two resource types: Config rule (
AWS::Config::ConfigRule) and remediation action (AWS::Config::RemediationConfiguration). -
delivery_s3_bucket(Optional[DeliveryS3Bucket], default:None) –The name of the Amazon S3 bucket where Config stores conformance pack templates.
This field is optional.
-
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. Custom conformance packs can have at most 60 input parameters. Managed conformance packs can have at most 330 input parameters. -
template_ssm_document_details(Optional[TemplateSSMDocumentDetails], default:None) –An object of type
TemplateSSMDocumentDetails, which contains the name or the Amazon Resource Name (ARN) of the Amazon Web Services Systems Manager document (SSM document) and the version of the SSM document that is used to create a conformance pack. -
tags(Optional[TagsList], default:None) –The tags for the conformance pack. Each tag consists of a key and an optional value, both of which you define.
-
source(Optional[ConformancePackSource], default:None) –An object of type
ConformancePackSource, which contains the identifier of the managed conformance pack that you want to deploy. If you specify a source, Config creates a managed conformance pack. Managed conformance packs are predefined collections of Config rules that are created and maintained by Amazon Web Services.If you specify a source, you cannot specify
TemplateS3Uri,TemplateBody,TemplateSSMDocumentDetails,DeliveryS3Bucket, orDeliveryS3KeyPrefix. You cannot convert an existing conformance pack between a managed conformance pack and a custom conformance pack. You also cannot change the source of an existing managed conformance pack. -
scope(Optional[ConformancePackScope], default:None) –An object of type
ConformancePackScopethat defines which resources can trigger an evaluation for Config rules in the conformance pack. The scope can include a tag key and optional tag value. Specify a scope to constrain the resources that can trigger an evaluation for rules in the conformance pack. If you do not specify a scope, all rules in the conformance pack are unscoped.This field is optional and is supported only for managed conformance packs. If you specify a scope, you must also specify
Source.
Raises:
-
ConformancePackTemplateValidationException–You have specified a template that is not valid or supported.
-
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.
-
-
InvalidParameterValueException–One or more of the specified parameters are not valid. Verify that your parameters are valid and try again.
-
MaxNumberOfConformancePacksExceededException–You have reached the limit of the number of conformance packs you can create in an account. For more information, see Service Limits in the Config Developer Guide.
-
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.
-
-
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
6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 | |