UNPKG

@pulumi/aws

Version:

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

142 lines (141 loc) 5.08 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages status (recording / stopped) of an AWS Config Configuration Recorder. * * > **Note:** Starting Configuration Recorder requires a Delivery Channel to be present. Use of `dependsOn` (as shown below) is recommended to avoid race conditions. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const b = new aws.s3.Bucket("b", {bucket: "awsconfig-example"}); * const fooDeliveryChannel = new aws.cfg.DeliveryChannel("foo", { * name: "example", * s3BucketName: b.bucket, * }); * const assumeRole = aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * principals: [{ * type: "Service", * identifiers: ["config.amazonaws.com"], * }], * actions: ["sts:AssumeRole"], * }], * }); * const r = new aws.iam.Role("r", { * name: "example-awsconfig", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const fooRecorder = new aws.cfg.Recorder("foo", { * name: "example", * roleArn: r.arn, * }); * const foo = new aws.cfg.RecorderStatus("foo", { * name: fooRecorder.name, * isEnabled: true, * }, { * dependsOn: [fooDeliveryChannel], * }); * const a = new aws.iam.RolePolicyAttachment("a", { * role: r.name, * policyArn: "arn:aws:iam::aws:policy/service-role/AWS_ConfigRole", * }); * const p = aws.iam.getPolicyDocumentOutput({ * statements: [{ * effect: "Allow", * actions: ["s3:*"], * resources: [ * b.arn, * pulumi.interpolate`${b.arn}/*`, * ], * }], * }); * const pRolePolicy = new aws.iam.RolePolicy("p", { * name: "awsconfig-example", * role: r.id, * policy: p.apply(p => p.json), * }); * ``` * * ## Import * * Using `pulumi import`, import Configuration Recorder Status using the name of the Configuration Recorder. For example: * * ```sh * $ pulumi import aws:cfg/recorderStatus:RecorderStatus foo example * ``` */ export declare class RecorderStatus extends pulumi.CustomResource { /** * Get an existing RecorderStatus 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?: RecorderStatusState, opts?: pulumi.CustomResourceOptions): RecorderStatus; /** * Returns true if the given object is an instance of RecorderStatus. 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 RecorderStatus; /** * Whether the configuration recorder should be enabled or disabled. */ readonly isEnabled: pulumi.Output<boolean>; /** * The name of the recorder */ 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>; /** * Create a RecorderStatus 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: RecorderStatusArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RecorderStatus resources. */ export interface RecorderStatusState { /** * Whether the configuration recorder should be enabled or disabled. */ isEnabled?: pulumi.Input<boolean>; /** * The name of the recorder */ 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>; } /** * The set of arguments for constructing a RecorderStatus resource. */ export interface RecorderStatusArgs { /** * Whether the configuration recorder should be enabled or disabled. */ isEnabled: pulumi.Input<boolean>; /** * The name of the recorder */ 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>; }