@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
127 lines • 4.95 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.ContactChannel = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS SSM Contacts Contact Channel.
*
* > **NOTE:** The contact channel needs to be activated in the AWS Systems Manager console, otherwise it can't be used to engage the contact. See the [Contacts section of the Incident Manager User Guide](https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html) for more information.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ssmcontacts.ContactChannel("example", {
* contactId: "arn:aws:ssm-contacts:us-west-2:123456789012:contact/contactalias",
* deliveryAddress: {
* simpleAddress: "email@example.com",
* },
* name: "Example contact channel",
* type: "EMAIL",
* });
* ```
*
* ### Usage with SSM Contact
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleContact = new aws.ssmcontacts.Contact("example_contact", {
* alias: "example_contact",
* type: "PERSONAL",
* });
* const example = new aws.ssmcontacts.ContactChannel("example", {
* contactId: exampleContact.arn,
* deliveryAddress: {
* simpleAddress: "email@example.com",
* },
* name: "Example contact channel",
* type: "EMAIL",
* });
* ```
*
* ## Import
*
* ### Identity Schema
*
* #### Required
*
* - `arn` (String) Amazon Resource Name (ARN) of the contact channel.
*
* Using `pulumi import`, import SSM Contact Channel using the `arn`. For example:
*
* console
*
* % pulumi import aws_ssmcontacts_contact_channel.example arn:aws:ssm-contacts:us-west-2:123456789012:contact-channel/example
*/
class ContactChannel extends pulumi.CustomResource {
/**
* Get an existing ContactChannel 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 ContactChannel(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ContactChannel. 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'] === ContactChannel.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activationStatus"] = state?.activationStatus;
resourceInputs["arn"] = state?.arn;
resourceInputs["contactId"] = state?.contactId;
resourceInputs["deliveryAddress"] = state?.deliveryAddress;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.contactId === undefined && !opts.urn) {
throw new Error("Missing required property 'contactId'");
}
if (args?.deliveryAddress === undefined && !opts.urn) {
throw new Error("Missing required property 'deliveryAddress'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["contactId"] = args?.contactId;
resourceInputs["deliveryAddress"] = args?.deliveryAddress;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["type"] = args?.type;
resourceInputs["activationStatus"] = undefined /*out*/;
resourceInputs["arn"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ContactChannel.__pulumiType, name, resourceInputs, opts);
}
}
exports.ContactChannel = ContactChannel;
/** @internal */
ContactChannel.__pulumiType = 'aws:ssmcontacts/contactChannel:ContactChannel';
//# sourceMappingURL=contactChannel.js.map