Resource: aws_config_remediation_configuration

Provides an AWS Config Remediation Configuration.

Example Usage

AWS managed rules can be used by setting the source owner to AWS and the source identifier to the name of the managed rule. More information about AWS managed rules can be found in the AWS Config Developer Guide.

resource "aws_config_config_rule" "this" {
  name = "example"

  source {
    owner             = "AWS"
    source_identifier = "S3_BUCKET_VERSIONING_ENABLED"
  }
}

resource "aws_config_remediation_configuration" "this" {
  config_rule_name = aws_config_config_rule.this.name
  resource_type    = "AWS::S3::Bucket"
  target_type      = "SSM_DOCUMENT"
  target_id        = "AWS-EnableS3BucketEncryption"
  target_version   = "1"

  parameter {
    name         = "AutomationAssumeRole"
    static_value = "arn:aws:iam::875924563244:role/security_config"
  }
  parameter {
    name           = "BucketName"
    resource_value = "RESOURCE_ID"
  }
  parameter {
    name         = "SSEAlgorithm"
    static_value = "AES256"
  }

  automatic                  = true
  maximum_automatic_attempts = 10
  retry_attempt_seconds      = 600

  execution_controls {
    ssm_controls {
      concurrent_execution_rate_percentage = 25
      error_percentage                     = 20
    }
  }
}

Argument Reference

The following arguments are required:

The following arguments are optional:

execution_controls

ssm_controls

One or both of these values are required.

parameter

The value is either a dynamic (resource) value or a static value. You must select either a dynamic value or a static value.

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import Remediation Configurations using the name config_rule_name. For example:

import {
  to = aws_config_remediation_configuration.this
  id = "example"
}

Using terraform import, import Remediation Configurations using the name config_rule_name. For example:

% terraform import aws_config_remediation_configuration.this example