put_conformance_pack
¶
put_conformance_pack(
conformance_pack_name: ConformancePackName,
*,
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,
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/config_service.py
5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 | |