RemediationConfiguration class

Provides an AWS Config Remediation Configuration.

> Note: Config Remediation Configuration requires an existing Config Rule to be present.

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.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const _this = new aws.cfg.Rule("this", {
    source: {
        owner: "AWS",
        sourceIdentifier: "S3_BUCKET_VERSIONING_ENABLED",
    },
    name: "example",
});
const thisRemediationConfiguration = new aws.cfg.RemediationConfiguration("this", {
    executionControls: {
        ssmControls: {
            concurrentExecutionRatePercentage: 25,
            errorPercentage: 20,
        },
    },
    parameters: [
        {
            name: "AutomationAssumeRole",
            staticValue: "arn:aws:iam::875924563244:role/security_config",
        },
        {
            name: "BucketName",
            resourceValue: "RESOURCE_ID",
        },
        {
            name: "SSEAlgorithm",
            staticValue: "AES256",
        },
    ],
    configRuleName: _this.name,
    resourceType: "AWS::S3::Bucket",
    targetType: "SSM_DOCUMENT",
    targetId: "AWS-EnableS3BucketEncryption",
    targetVersion: "1",
    automatic: true,
    maximumAutomaticAttempts: 10,
    retryAttemptSeconds: 600,
});
import pulumi
import pulumi_aws as aws

this = aws.cfg.Rule("this",
    source={
        "owner": "AWS",
        "source_identifier": "S3_BUCKET_VERSIONING_ENABLED",
    },
    name="example")
this_remediation_configuration = aws.cfg.RemediationConfiguration("this",
    execution_controls={
        "ssm_controls": {
            "concurrent_execution_rate_percentage": 25,
            "error_percentage": 20,
        },
    },
    parameters=[
        {
            "name": "AutomationAssumeRole",
            "static_value": "arn:aws:iam::875924563244:role/security_config",
        },
        {
            "name": "BucketName",
            "resource_value": "RESOURCE_ID",
        },
        {
            "name": "SSEAlgorithm",
            "static_value": "AES256",
        },
    ],
    config_rule_name=this.name,
    resource_type="AWS::S3::Bucket",
    target_type="SSM_DOCUMENT",
    target_id="AWS-EnableS3BucketEncryption",
    target_version="1",
    automatic=True,
    maximum_automatic_attempts=10,
    retry_attempt_seconds=600)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var @this = new Aws.Cfg.Rule("this", new()
    {
        Source = new Aws.Cfg.Inputs.RuleSourceArgs
        {
            Owner = "AWS",
            SourceIdentifier = "S3_BUCKET_VERSIONING_ENABLED",
        },
        Name = "example",
    });

    var thisRemediationConfiguration = new Aws.Cfg.RemediationConfiguration("this", new()
    {
        ExecutionControls = new Aws.Cfg.Inputs.RemediationConfigurationExecutionControlsArgs
        {
            SsmControls = new Aws.Cfg.Inputs.RemediationConfigurationExecutionControlsSsmControlsArgs
            {
                ConcurrentExecutionRatePercentage = 25,
                ErrorPercentage = 20,
            },
        },
        Parameters = new[]
        {
            new Aws.Cfg.Inputs.RemediationConfigurationParameterArgs
            {
                Name = "AutomationAssumeRole",
                StaticValue = "arn:aws:iam::875924563244:role/security_config",
            },
            new Aws.Cfg.Inputs.RemediationConfigurationParameterArgs
            {
                Name = "BucketName",
                ResourceValue = "RESOURCE_ID",
            },
            new Aws.Cfg.Inputs.RemediationConfigurationParameterArgs
            {
                Name = "SSEAlgorithm",
                StaticValue = "AES256",
            },
        },
        ConfigRuleName = @this.Name,
        ResourceType = "AWS::S3::Bucket",
        TargetType = "SSM_DOCUMENT",
        TargetId = "AWS-EnableS3BucketEncryption",
        TargetVersion = "1",
        Automatic = true,
        MaximumAutomaticAttempts = 10,
        RetryAttemptSeconds = 600,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cfg"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		this, err := cfg.NewRule(ctx, "this", &cfg.RuleArgs{
			Source: &cfg.RuleSourceArgs{
				Owner:            pulumi.String("AWS"),
				SourceIdentifier: pulumi.String("S3_BUCKET_VERSIONING_ENABLED"),
			},
			Name: pulumi.String("example"),
		})
		if err != nil {
			return err
		}
		_, err = cfg.NewRemediationConfiguration(ctx, "this", &cfg.RemediationConfigurationArgs{
			ExecutionControls: &cfg.RemediationConfigurationExecutionControlsArgs{
				SsmControls: &cfg.RemediationConfigurationExecutionControlsSsmControlsArgs{
					ConcurrentExecutionRatePercentage: pulumi.Int(25),
					ErrorPercentage:                   pulumi.Int(20),
				},
			},
			Parameters: cfg.RemediationConfigurationParameterArray{
				&cfg.RemediationConfigurationParameterArgs{
					Name:        pulumi.String("AutomationAssumeRole"),
					StaticValue: pulumi.String("arn:aws:iam::875924563244:role/security_config"),
				},
				&cfg.RemediationConfigurationParameterArgs{
					Name:          pulumi.String("BucketName"),
					ResourceValue: pulumi.String("RESOURCE_ID"),
				},
				&cfg.RemediationConfigurationParameterArgs{
					Name:        pulumi.String("SSEAlgorithm"),
					StaticValue: pulumi.String("AES256"),
				},
			},
			ConfigRuleName:           this.Name,
			ResourceType:             pulumi.String("AWS::S3::Bucket"),
			TargetType:               pulumi.String("SSM_DOCUMENT"),
			TargetId:                 pulumi.String("AWS-EnableS3BucketEncryption"),
			TargetVersion:            pulumi.String("1"),
			Automatic:                pulumi.Bool(true),
			MaximumAutomaticAttempts: pulumi.Int(10),
			RetryAttemptSeconds:      pulumi.Int(600),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_cfg_rule" "this" {
  source = {
    owner             = "AWS"
    source_identifier = "S3_BUCKET_VERSIONING_ENABLED"
  }
  name = "example"
}
resource "aws_cfg_remediationconfiguration" "this" {
  execution_controls = {
    ssm_controls = {
      concurrent_execution_rate_percentage = 25
      error_percentage                     = 20
    }
  }
  parameters {
    name         = "AutomationAssumeRole"
    static_value = "arn:aws:iam::875924563244:role/security_config"
  }
  parameters {
    name           = "BucketName"
    resource_value = "RESOURCE_ID"
  }
  parameters {
    name         = "SSEAlgorithm"
    static_value = "AES256"
  }
  config_rule_name           = aws_cfg_rule.this.name
  resource_type              = "AWS::S3::Bucket"
  target_type                = "SSM_DOCUMENT"
  target_id                  = "AWS-EnableS3BucketEncryption"
  target_version             = "1"
  automatic                  = true
  maximum_automatic_attempts = 10
  retry_attempt_seconds      = 600
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cfg.Rule;
import com.pulumi.aws.cfg.RuleArgs;
import com.pulumi.aws.cfg.inputs.RuleSourceArgs;
import com.pulumi.aws.cfg.RemediationConfiguration;
import com.pulumi.aws.cfg.RemediationConfigurationArgs;
import com.pulumi.aws.cfg.inputs.RemediationConfigurationExecutionControlsArgs;
import com.pulumi.aws.cfg.inputs.RemediationConfigurationExecutionControlsSsmControlsArgs;
import com.pulumi.aws.cfg.inputs.RemediationConfigurationParameterArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var this_ = new Rule("this", RuleArgs.builder()
            .source(RuleSourceArgs.builder()
                .owner("AWS")
                .sourceIdentifier("S3_BUCKET_VERSIONING_ENABLED")
                .build())
            .name("example")
            .build());

        var thisRemediationConfiguration = new RemediationConfiguration("thisRemediationConfiguration", RemediationConfigurationArgs.builder()
            .executionControls(RemediationConfigurationExecutionControlsArgs.builder()
                .ssmControls(RemediationConfigurationExecutionControlsSsmControlsArgs.builder()
                    .concurrentExecutionRatePercentage(25)
                    .errorPercentage(20)
                    .build())
                .build())
            .parameters(
                RemediationConfigurationParameterArgs.builder()
                    .name("AutomationAssumeRole")
                    .staticValue("arn:aws:iam::875924563244:role/security_config")
                    .build(),
                RemediationConfigurationParameterArgs.builder()
                    .name("BucketName")
                    .resourceValue("RESOURCE_ID")
                    .build(),
                RemediationConfigurationParameterArgs.builder()
                    .name("SSEAlgorithm")
                    .staticValue("AES256")
                    .build())
            .configRuleName(this_.name())
            .resourceType("AWS::S3::Bucket")
            .targetType("SSM_DOCUMENT")
            .targetId("AWS-EnableS3BucketEncryption")
            .targetVersion("1")
            .automatic(true)
            .maximumAutomaticAttempts(10)
            .retryAttemptSeconds(600)
            .build());

    }
}
resources:
  this:
    type: aws:cfg:Rule
    properties:
      source:
        owner: AWS
        sourceIdentifier: S3_BUCKET_VERSIONING_ENABLED
      name: example
  thisRemediationConfiguration:
    type: aws:cfg:RemediationConfiguration
    name: this
    properties:
      executionControls:
        ssmControls:
          concurrentExecutionRatePercentage: 25
          errorPercentage: 20
      parameters:
        - name: AutomationAssumeRole
          staticValue: arn:aws:iam::875924563244:role/security_config
        - name: BucketName
          resourceValue: RESOURCE_ID
        - name: SSEAlgorithm
          staticValue: AES256
      configRuleName: ${this.name}
      resourceType: AWS::S3::Bucket
      targetType: SSM_DOCUMENT
      targetId: AWS-EnableS3BucketEncryption
      targetVersion: '1'
      automatic: true
      maximumAutomaticAttempts: 10
      retryAttemptSeconds: 600

Import

Identity Schema

Required

  • configRuleName (String) Name of the AWS Config rule.

Optional

  • accountId (String) AWS Account where this resource is managed.
  • region (String) Region where this resource is managed.

Using pulumi import, import Remediation Configurations using the configRuleName. For example:

$ pulumi import aws:cfg/remediationConfiguration:RemediationConfiguration example example

Constructors

RemediationConfiguration(String name, {RemediationConfigurationArgs? args, CustomResourceOptions? options})
Creates a new RemediationConfiguration. name The Pulumi resource name. args Arguments used to configure this RemediationConfiguration. The set of arguments for RemediationConfiguration. options Resource options controlling this resource's behavior.
RemediationConfiguration.reference(String urn)
Creates a typed reference to an existing RemediationConfiguration resource.

Properties

arn ↔ Output<String>
ARN of the Config Remediation Configuration.
latefinal
automatic ↔ Output<bool?>
Remediation is triggered automatically if true.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
configRuleName ↔ Output<String>
Name of the AWS Config rule.
latefinal
executionControls ↔ Output<RemediationConfigurationExecutionControls?>
Configuration block for execution controls. See below.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
maximumAutomaticAttempts ↔ Output<int?>
Maximum number of failed attempts for auto-remediation. If you do not select a number, the default is 5.
latefinal
parameters ↔ Output<List<RemediationConfigurationParameter>?>
Can be specified multiple times for each parameter. Each parameter block supports arguments below.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
resourceType ↔ Output<String?>
Type of resource.
latefinal
retryAttemptSeconds ↔ Output<int?>
Maximum time in seconds that AWS Config runs auto-remediation. If you do not select a number, the default is 60 seconds.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
targetId ↔ Output<String>
Target ID is the name of the public document.
latefinal
targetType ↔ Output<String>
Type of the target. Target executes remediation. For example, SSM document.
latefinal
targetVersion ↔ Output<String?>
Version of the target. For example, version of the SSM document
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {RemediationConfigurationState? state, CustomResourceOptions? options}) → RemediationConfiguration
Gets an existing RemediationConfiguration resource's state with the given name and id.