UNPKG

@pulumi/aws

Version:

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

214 lines (213 loc) • 9.92 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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 * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: ConformancePackState, opts?: pulumi.CustomResourceOptions): ConformancePack; /** * 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: any): obj is ConformancePack; /** * Amazon Resource Name (ARN) of the conformance pack. */ readonly arn: pulumi.Output<string>; /** * Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63. */ readonly deliveryS3Bucket: pulumi.Output<string | undefined>; /** * The prefix for the Amazon S3 bucket. Maximum length of 1024. */ readonly deliveryS3KeyPrefix: pulumi.Output<string | undefined>; /** * Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`. */ readonly inputParameters: pulumi.Output<outputs.cfg.ConformancePackInputParameter[] | undefined>; /** * The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens. */ readonly name: pulumi.Output<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument. */ readonly templateBody: pulumi.Output<string | undefined>; /** * Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The uri must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. * * > **Note:** If both `templateBody` and `templateS3Uri` are specified, AWS Config uses the `templateS3Uri` and ignores the `templateBody`. */ readonly templateS3Uri: pulumi.Output<string | undefined>; /** * Create a ConformancePack resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: ConformancePackArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ConformancePack resources. */ export interface ConformancePackState { /** * Amazon Resource Name (ARN) of the conformance pack. */ arn?: pulumi.Input<string>; /** * Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63. */ deliveryS3Bucket?: pulumi.Input<string>; /** * The prefix for the Amazon S3 bucket. Maximum length of 1024. */ deliveryS3KeyPrefix?: pulumi.Input<string>; /** * Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`. */ inputParameters?: pulumi.Input<pulumi.Input<inputs.cfg.ConformancePackInputParameter>[]>; /** * The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens. */ name?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument. */ templateBody?: pulumi.Input<string>; /** * Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The uri must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. * * > **Note:** If both `templateBody` and `templateS3Uri` are specified, AWS Config uses the `templateS3Uri` and ignores the `templateBody`. */ templateS3Uri?: pulumi.Input<string>; } /** * The set of arguments for constructing a ConformancePack resource. */ export interface ConformancePackArgs { /** * Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63. */ deliveryS3Bucket?: pulumi.Input<string>; /** * The prefix for the Amazon S3 bucket. Maximum length of 1024. */ deliveryS3KeyPrefix?: pulumi.Input<string>; /** * Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`. */ inputParameters?: pulumi.Input<pulumi.Input<inputs.cfg.ConformancePackInputParameter>[]>; /** * The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens. */ name?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument. */ templateBody?: pulumi.Input<string>; /** * Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The uri must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. * * > **Note:** If both `templateBody` and `templateS3Uri` are specified, AWS Config uses the `templateS3Uri` and ignores the `templateBody`. */ templateS3Uri?: pulumi.Input<string>; }