@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
90 lines • 3.94 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.ChannelAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS User Notifications Channel Association. This resource associates a channel (such as an email contact) with a notification configuration.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.notifications.NotificationConfiguration("example", {
* name: "example-notification-config",
* description: "Example notification configuration",
* });
* const exampleContactsEmailContact = new aws.notifications.ContactsEmailContact("example", {
* name: "example-contact",
* emailAddress: "example@example.com",
* });
* const exampleChannelAssociation = new aws.notifications.ChannelAssociation("example", {
* arn: exampleContactsEmailContact.arn,
* notificationConfigurationArn: example.arn,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import User Notifications Channel Association using the `notification_configuration_arn,channel_arn` format. For example:
*
* ```sh
* $ pulumi import aws:notifications/channelAssociation:ChannelAssociation example arn:aws:notifications:us-west-2:123456789012:configuration:example-notification-config,arn:aws:notificationscontacts:us-west-2:123456789012:emailcontact:example-contact
* ```
*/
class ChannelAssociation extends pulumi.CustomResource {
/**
* Get an existing ChannelAssociation 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 ChannelAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ChannelAssociation. 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'] === ChannelAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["notificationConfigurationArn"] = state?.notificationConfigurationArn;
}
else {
const args = argsOrState;
if (args?.arn === undefined && !opts.urn) {
throw new Error("Missing required property 'arn'");
}
if (args?.notificationConfigurationArn === undefined && !opts.urn) {
throw new Error("Missing required property 'notificationConfigurationArn'");
}
resourceInputs["arn"] = args?.arn;
resourceInputs["notificationConfigurationArn"] = args?.notificationConfigurationArn;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ChannelAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.ChannelAssociation = ChannelAssociation;
/** @internal */
ChannelAssociation.__pulumiType = 'aws:notifications/channelAssociation:ChannelAssociation';
//# sourceMappingURL=channelAssociation.js.map