@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
95 lines • 4.05 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.Notification = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an AutoScaling Group with Notification support, via SNS Topics. Each of
* the `notifications` map to a [Notification Configuration](https://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_DescribeNotificationConfigurations.html) inside Amazon Web
* Services, and are applied to each AutoScaling Group you supply.
*
* ## Example Usage
*
* Basic usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.sns.Topic("example", {name: "example-topic"});
* const bar = new aws.autoscaling.Group("bar", {name: "foobar1-test"});
* const foo = new aws.autoscaling.Group("foo", {name: "barfoo-test"});
* const exampleNotifications = new aws.autoscaling.Notification("example_notifications", {
* groupNames: [
* bar.name,
* foo.name,
* ],
* notifications: [
* aws.autoscaling.NotificationType.InstanceLaunch,
* aws.autoscaling.NotificationType.InstanceTerminate,
* aws.autoscaling.NotificationType.InstanceLaunchError,
* aws.autoscaling.NotificationType.InstanceTerminateError,
* ],
* topicArn: example.arn,
* });
* ```
*/
class Notification extends pulumi.CustomResource {
/**
* Get an existing Notification 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 Notification(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Notification. 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'] === Notification.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["groupNames"] = state?.groupNames;
resourceInputs["notifications"] = state?.notifications;
resourceInputs["region"] = state?.region;
resourceInputs["topicArn"] = state?.topicArn;
}
else {
const args = argsOrState;
if (args?.groupNames === undefined && !opts.urn) {
throw new Error("Missing required property 'groupNames'");
}
if (args?.notifications === undefined && !opts.urn) {
throw new Error("Missing required property 'notifications'");
}
if (args?.topicArn === undefined && !opts.urn) {
throw new Error("Missing required property 'topicArn'");
}
resourceInputs["groupNames"] = args?.groupNames;
resourceInputs["notifications"] = args?.notifications;
resourceInputs["region"] = args?.region;
resourceInputs["topicArn"] = args?.topicArn;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Notification.__pulumiType, name, resourceInputs, opts);
}
}
exports.Notification = Notification;
/** @internal */
Notification.__pulumiType = 'aws:autoscaling/notification:Notification';
//# sourceMappingURL=notification.js.map