AWS Config Conformance Pack

This page shows how to write Terraform and CloudFormation for AWS Config Conformance Pack and write them securely.

aws_config_conformance_pack (Terraform)

The Conformance Pack in AWS Config can be configured in Terraform with the resource name aws_config_conformance_pack. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

config-cmmc-level3.tf#L1
resource "aws_config_conformance_pack" "cmmc_level3_conformance_pack" {
  name          = "operational-best-practices-for-cmmc-level3"
  template_body = data.http.conformance_pack.body

  depends_on = [aws_config_configuration_recorder.config_recorder]
}
main.tf#L1
resource "aws_config_conformance_pack" "default" {
  name = module.this.name

  dynamic "input_parameter" {
    for_each = var.parameter_overrides
    content {
rules.tf#L46
resource "aws_config_conformance_pack" "this" {
  for_each = { for pack in var.conformance_packs : pack.name => pack }
  name     = each.value.name

  dynamic "input_parameter" {
    for_each = { for param in each.value.input_parameters : param.name => param }
config-conformance-pack.tf#L7
resource "aws_config_conformance_pack" "organization" {
  provider           = aws.Tokyo
  name               = "my-rule"
  delivery_s3_bucket = aws_s3_bucket.delivery.bucket

  template_body = <<EOT

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Config Conformance Pack. More information about this collection of Config rules and remediation actions can be found in the Conformance Packs documentation. Sample Conformance Pack templates may be found in the AWS Config Rules Repository.

NOTE: The account must have a Configuration Recorder with proper IAM permissions before the Conformance Pack will successfully create or update. See also the aws_config_configuration_recorder resource.

Tips: Best Practices for The Other AWS Config Resources

In addition to the aws_config_configuration_aggregator, AWS Config has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

aws_config_configuration_aggregator

Ensure to enable AWS Config in all Regions

It's better to enable AWS Config in all Regions. AWS Config can aggregate configurations from all regions. It will reduce the risk that unmonitored configurations might cause.

Review your AWS Config settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

AWS::Config::ConformancePack (CloudFormation)

The ConformancePack in Config can be configured in CloudFormation with the resource name AWS::Config::ConformancePack. The following sections describe 9 examples of how to use the resource and its parameters.

Example Usage from GitHub

AwsBiotechBlueprint.template.quickstart.yml#L854
    Type: AWS::Config::ConformancePack
  ConfigPacksCPOperationalBestPracticesForAWSIdentityAndAccessManagement7100FE82:
    DependsOn:
    - ConfigEnabledPromiseConfigRecorder0A75B039
    Metadata:
      aws:cdk:path: AwsBiotechBlueprint/ConfigPacks/CP-Operational-Best-Practices-For-AWS-Identity-And-Access-Management
AccountEnableConformancePack.yml#L25
    Type: 'AWS::Config::ConformancePack'
    Properties:
      ConformancePackName: IAMBestPractices
      ConformancePackInputParameters:
      -
        ParameterName: AccessKeysRotatedParameterMaxAccessKeyAge
AccountEnableConformancePack.yml#L25
    Type: 'AWS::Config::ConformancePack'
    Properties:
      ConformancePackName: IAMBestPractices
      ConformancePackInputParameters:
      -
        ParameterName: AccessKeysRotatedParameterMaxAccessKeyAge
aws-pci-conformancepack-update-v1.yml#L21
    Type: 'AWS::Config::ConformancePack'
    Properties:
      ConformancePackName: CustomPCIEC2LambdaConfPack
      DeliveryS3Bucket: !Ref DeliveryS3Bucket
      TemplateBody: |-
        Resources:
aws-pci-conformancepack-v1.yml#L21
    Type: 'AWS::Config::ConformancePack'
    Properties:
      ConformancePackName: CustomPCIEC2LambdaConfPack
      DeliveryS3Bucket: !Ref DeliveryS3Bucket
      TemplateBody: |-
        Resources:
ConfigConformancePackSpecification.json#L3
    "AWS::Config::ConformancePack.ConformancePackInputParameter": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-conformancepack-conformancepackinputparameter.html",
      "Properties": {
        "ParameterName": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-conformancepack-conformancepackinputparameter.html#cfn-config-conformancepack-conformancepackinputparameter-parametername",
          "UpdateType": "Mutable",
AwsDiGavBlueprint.template.json#L2781
      "Type": "AWS::Config::ConformancePack",
      "Properties": {
        "ConformancePackName": "Operational-Best-Practices-For-AWS-Identity-And-Access-Management",
        "ConformancePackInputParameters": [],
        "DeliveryS3Bucket": {
          "Ref": "ConfigEnabledPromiseConfigBucket2F967063"
template.json#L2675
    "AWS::Config::ConformancePack": {
      "Type": "AWS::Config::ConformancePack",
      "Properties": {}
    },
    "AWS::Amplify::Domain": {
      "Type": "AWS::Amplify::Domain",
awsResouceIconMatches.json#L2290
        "resourceType": "AWS::Config::ConformancePack",
        "filePath": null
      }
    ]
  },
  {

Parameters

Explanation in CloudFormation Registry

A conformance pack is a collection of AWS Config rules and remediation actions that can be easily deployed in an account and a region. ConformancePack creates a service linked role in your account. The service linked role is created only when the role does not exist in your account.

Frequently asked questions

What is AWS Config Conformance Pack?

AWS Config Conformance Pack is a resource for Config of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Config Conformance Pack?

For Terraform, the danielkkelly/iac, cloudposse/terraform-aws-config and marshall7m/terraform-aws-landing-zone source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the aws-quickstart/quickstart-aws-biotech-blueprint-cdk, aws-samples/aws-cloud-compliance-assurance and aws-samples/aws-config-pci-fsbp-ssmremediations source code examples are useful. See the CloudFormation Example section for further details.