@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
128 lines • 4.75 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.DeliveryChannel = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an AWS Config Delivery Channel.
*
* > **Note:** Delivery Channel requires a Configuration Recorder 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: "example-awsconfig",
* forceDestroy: true,
* });
* 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: "awsconfig-example",
* assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json),
* });
* const fooRecorder = new aws.cfg.Recorder("foo", {
* name: "example",
* roleArn: r.arn,
* });
* const foo = new aws.cfg.DeliveryChannel("foo", {
* name: "example",
* s3BucketName: b.bucket,
* }, {
* dependsOn: [fooRecorder],
* });
* 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 Delivery Channel using the name. For example:
*
* ```sh
* $ pulumi import aws:cfg/deliveryChannel:DeliveryChannel foo example
* ```
*/
class DeliveryChannel extends pulumi.CustomResource {
/**
* Get an existing DeliveryChannel 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 DeliveryChannel(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DeliveryChannel. 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'] === DeliveryChannel.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["s3BucketName"] = state?.s3BucketName;
resourceInputs["s3KeyPrefix"] = state?.s3KeyPrefix;
resourceInputs["s3KmsKeyArn"] = state?.s3KmsKeyArn;
resourceInputs["snapshotDeliveryProperties"] = state?.snapshotDeliveryProperties;
resourceInputs["snsTopicArn"] = state?.snsTopicArn;
}
else {
const args = argsOrState;
if (args?.s3BucketName === undefined && !opts.urn) {
throw new Error("Missing required property 's3BucketName'");
}
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["s3BucketName"] = args?.s3BucketName;
resourceInputs["s3KeyPrefix"] = args?.s3KeyPrefix;
resourceInputs["s3KmsKeyArn"] = args?.s3KmsKeyArn;
resourceInputs["snapshotDeliveryProperties"] = args?.snapshotDeliveryProperties;
resourceInputs["snsTopicArn"] = args?.snsTopicArn;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DeliveryChannel.__pulumiType, name, resourceInputs, opts);
}
}
exports.DeliveryChannel = DeliveryChannel;
/** @internal */
DeliveryChannel.__pulumiType = 'aws:cfg/deliveryChannel:DeliveryChannel';
//# sourceMappingURL=deliveryChannel.js.map