UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

140 lines 6.56 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.RemediationConfiguration = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const _this = new aws.cfg.Rule("this", { * name: "example", * source: { * owner: "AWS", * sourceIdentifier: "S3_BUCKET_VERSIONING_ENABLED", * }, * }); * const thisRemediationConfiguration = new aws.cfg.RemediationConfiguration("this", { * configRuleName: _this.name, * resourceType: "AWS::S3::Bucket", * targetType: "SSM_DOCUMENT", * targetId: "AWS-EnableS3BucketEncryption", * targetVersion: "1", * parameters: [ * { * name: "AutomationAssumeRole", * staticValue: "arn:aws:iam::875924563244:role/security_config", * }, * { * name: "BucketName", * resourceValue: "RESOURCE_ID", * }, * { * name: "SSEAlgorithm", * staticValue: "AES256", * }, * ], * automatic: true, * maximumAutomaticAttempts: 10, * retryAttemptSeconds: 600, * executionControls: { * ssmControls: { * concurrentExecutionRatePercentage: 25, * errorPercentage: 20, * }, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Remediation Configurations using the name config_rule_name. For example: * * ```sh * $ pulumi import aws:cfg/remediationConfiguration:RemediationConfiguration this example * ``` */ class RemediationConfiguration extends pulumi.CustomResource { /** * Get an existing RemediationConfiguration resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new RemediationConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RemediationConfiguration. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === RemediationConfiguration.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["automatic"] = state ? state.automatic : undefined; resourceInputs["configRuleName"] = state ? state.configRuleName : undefined; resourceInputs["executionControls"] = state ? state.executionControls : undefined; resourceInputs["maximumAutomaticAttempts"] = state ? state.maximumAutomaticAttempts : undefined; resourceInputs["parameters"] = state ? state.parameters : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["resourceType"] = state ? state.resourceType : undefined; resourceInputs["retryAttemptSeconds"] = state ? state.retryAttemptSeconds : undefined; resourceInputs["targetId"] = state ? state.targetId : undefined; resourceInputs["targetType"] = state ? state.targetType : undefined; resourceInputs["targetVersion"] = state ? state.targetVersion : undefined; } else { const args = argsOrState; if ((!args || args.configRuleName === undefined) && !opts.urn) { throw new Error("Missing required property 'configRuleName'"); } if ((!args || args.targetId === undefined) && !opts.urn) { throw new Error("Missing required property 'targetId'"); } if ((!args || args.targetType === undefined) && !opts.urn) { throw new Error("Missing required property 'targetType'"); } resourceInputs["automatic"] = args ? args.automatic : undefined; resourceInputs["configRuleName"] = args ? args.configRuleName : undefined; resourceInputs["executionControls"] = args ? args.executionControls : undefined; resourceInputs["maximumAutomaticAttempts"] = args ? args.maximumAutomaticAttempts : undefined; resourceInputs["parameters"] = args ? args.parameters : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["resourceType"] = args ? args.resourceType : undefined; resourceInputs["retryAttemptSeconds"] = args ? args.retryAttemptSeconds : undefined; resourceInputs["targetId"] = args ? args.targetId : undefined; resourceInputs["targetType"] = args ? args.targetType : undefined; resourceInputs["targetVersion"] = args ? args.targetVersion : undefined; resourceInputs["arn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RemediationConfiguration.__pulumiType, name, resourceInputs, opts); } } exports.RemediationConfiguration = RemediationConfiguration; /** @internal */ RemediationConfiguration.__pulumiType = 'aws:cfg/remediationConfiguration:RemediationConfiguration'; //# sourceMappingURL=remediationConfiguration.js.map