UNPKG

@pulumi/aws

Version:

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

140 lines 6.07 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, { ...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?.arn; resourceInputs["automatic"] = state?.automatic; resourceInputs["configRuleName"] = state?.configRuleName; resourceInputs["executionControls"] = state?.executionControls; resourceInputs["maximumAutomaticAttempts"] = state?.maximumAutomaticAttempts; resourceInputs["parameters"] = state?.parameters; resourceInputs["region"] = state?.region; resourceInputs["resourceType"] = state?.resourceType; resourceInputs["retryAttemptSeconds"] = state?.retryAttemptSeconds; resourceInputs["targetId"] = state?.targetId; resourceInputs["targetType"] = state?.targetType; resourceInputs["targetVersion"] = state?.targetVersion; } else { const args = argsOrState; if (args?.configRuleName === undefined && !opts.urn) { throw new Error("Missing required property 'configRuleName'"); } if (args?.targetId === undefined && !opts.urn) { throw new Error("Missing required property 'targetId'"); } if (args?.targetType === undefined && !opts.urn) { throw new Error("Missing required property 'targetType'"); } resourceInputs["automatic"] = args?.automatic; resourceInputs["configRuleName"] = args?.configRuleName; resourceInputs["executionControls"] = args?.executionControls; resourceInputs["maximumAutomaticAttempts"] = args?.maximumAutomaticAttempts; resourceInputs["parameters"] = args?.parameters; resourceInputs["region"] = args?.region; resourceInputs["resourceType"] = args?.resourceType; resourceInputs["retryAttemptSeconds"] = args?.retryAttemptSeconds; resourceInputs["targetId"] = args?.targetId; resourceInputs["targetType"] = args?.targetType; resourceInputs["targetVersion"] = args?.targetVersion; 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