@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
140 lines • 5.46 kB
JavaScript
// *** 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.ConformancePack = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a Config Conformance Pack. More information about this collection of Config rules and remediation actions can be found in the
* [Conformance Packs](https://docs.aws.amazon.com/config/latest/developerguide/conformance-packs.html) documentation.
* Sample Conformance Pack templates may be found in the
* [AWS Config Rules Repository](https://github.com/awslabs/aws-config-rules/tree/master/aws-config-conformance-packs).
*
* > **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.cfg.Recorder` resource.
*
* ## Example Usage
*
* ### Template Body
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.cfg.ConformancePack("example", {
* name: "example",
* inputParameters: [{
* parameterName: "AccessKeysRotatedParameterMaxAccessKeyAge",
* parameterValue: "90",
* }],
* templateBody: `Parameters:
* AccessKeysRotatedParameterMaxAccessKeyAge:
* Type: String
* Resources:
* IAMPasswordPolicy:
* Properties:
* ConfigRuleName: IAMPasswordPolicy
* Source:
* Owner: AWS
* SourceIdentifier: IAM_PASSWORD_POLICY
* Type: AWS::Config::ConfigRule
* `,
* }, {
* dependsOn: [exampleAwsConfigConfigurationRecorder],
* });
* ```
*
* ### Template S3 URI
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleBucket = new aws.s3.Bucket("example", {bucket: "example"});
* const exampleBucketObjectv2 = new aws.s3.BucketObjectv2("example", {
* bucket: exampleBucket.id,
* key: "example-key",
* content: `Resources:
* IAMPasswordPolicy:
* Properties:
* ConfigRuleName: IAMPasswordPolicy
* Source:
* Owner: AWS
* SourceIdentifier: IAM_PASSWORD_POLICY
* Type: AWS::Config::ConfigRule
* `,
* });
* const example = new aws.cfg.ConformancePack("example", {
* name: "example",
* templateS3Uri: pulumi.interpolate`s3://${exampleBucket.bucket}/${exampleBucketObjectv2.key}`,
* }, {
* dependsOn: [exampleAwsConfigConfigurationRecorder],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Config Conformance Packs using the `name`. For example:
*
* ```sh
* $ pulumi import aws:cfg/conformancePack:ConformancePack example example
* ```
*/
class ConformancePack extends pulumi.CustomResource {
/**
* Get an existing ConformancePack 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 ConformancePack(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ConformancePack. 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'] === ConformancePack.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["deliveryS3Bucket"] = state?.deliveryS3Bucket;
resourceInputs["deliveryS3KeyPrefix"] = state?.deliveryS3KeyPrefix;
resourceInputs["inputParameters"] = state?.inputParameters;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["templateBody"] = state?.templateBody;
resourceInputs["templateS3Uri"] = state?.templateS3Uri;
}
else {
const args = argsOrState;
resourceInputs["deliveryS3Bucket"] = args?.deliveryS3Bucket;
resourceInputs["deliveryS3KeyPrefix"] = args?.deliveryS3KeyPrefix;
resourceInputs["inputParameters"] = args?.inputParameters;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["templateBody"] = args?.templateBody;
resourceInputs["templateS3Uri"] = args?.templateS3Uri;
resourceInputs["arn"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ConformancePack.__pulumiType, name, resourceInputs, opts);
}
}
exports.ConformancePack = ConformancePack;
/** @internal */
ConformancePack.__pulumiType = 'aws:cfg/conformancePack:ConformancePack';
//# sourceMappingURL=conformancePack.js.map
;