Notification
Provides an AutoScaling Group with Notification support, via SNS Topics. Each of
the notifications map to a Notification Configuration inside Amazon Web
Services, and are applied to each AutoScaling Group you supply.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Sns.Topic("example", new Aws.Sns.TopicArgs
{
});
var bar = new Aws.AutoScaling.Group("bar", new Aws.AutoScaling.GroupArgs
{
});
var foo = new Aws.AutoScaling.Group("foo", new Aws.AutoScaling.GroupArgs
{
});
var exampleNotifications = new Aws.AutoScaling.Notification("exampleNotifications", new Aws.AutoScaling.NotificationArgs
{
GroupNames =
{
bar.Name,
foo.Name,
},
Notifications =
{
"autoscaling:EC2_INSTANCE_LAUNCH",
"autoscaling:EC2_INSTANCE_TERMINATE",
"autoscaling:EC2_INSTANCE_LAUNCH_ERROR",
"autoscaling:EC2_INSTANCE_TERMINATE_ERROR",
},
TopicArn = example.Arn,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/autoscaling"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/sns"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := sns.NewTopic(ctx, "example", nil)
if err != nil {
return err
}
bar, err := autoscaling.NewGroup(ctx, "bar", nil)
if err != nil {
return err
}
foo, err := autoscaling.NewGroup(ctx, "foo", nil)
if err != nil {
return err
}
_, err = autoscaling.NewNotification(ctx, "exampleNotifications", &autoscaling.NotificationArgs{
GroupNames: pulumi.StringArray{
bar.Name,
foo.Name,
},
Notifications: pulumi.StringArray{
pulumi.String("autoscaling:EC2_INSTANCE_LAUNCH"),
pulumi.String("autoscaling:EC2_INSTANCE_TERMINATE"),
pulumi.String("autoscaling:EC2_INSTANCE_LAUNCH_ERROR"),
pulumi.String("autoscaling:EC2_INSTANCE_TERMINATE_ERROR"),
},
TopicArn: example.Arn,
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.sns.Topic("example")
bar = aws.autoscaling.Group("bar")
foo = aws.autoscaling.Group("foo")
example_notifications = aws.autoscaling.Notification("exampleNotifications",
group_names=[
bar.name,
foo.name,
],
notifications=[
"autoscaling:EC2_INSTANCE_LAUNCH",
"autoscaling:EC2_INSTANCE_TERMINATE",
"autoscaling:EC2_INSTANCE_LAUNCH_ERROR",
"autoscaling:EC2_INSTANCE_TERMINATE_ERROR",
],
topic_arn=example.arn)import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.sns.Topic("example", {});
const bar = new aws.autoscaling.Group("bar", {});
const foo = new aws.autoscaling.Group("foo", {});
const exampleNotifications = new aws.autoscaling.Notification("example_notifications", {
groupNames: [
bar.name,
foo.name,
],
notifications: [
"autoscaling:EC2_INSTANCE_LAUNCH",
"autoscaling:EC2_INSTANCE_TERMINATE",
"autoscaling:EC2_INSTANCE_LAUNCH_ERROR",
"autoscaling:EC2_INSTANCE_TERMINATE_ERROR",
],
topicArn: example.arn,
});Create a Notification Resource
new Notification(name: string, args: NotificationArgs, opts?: CustomResourceOptions);def Notification(resource_name, opts=None, group_names=None, notifications=None, topic_arn=None, __props__=None);func NewNotification(ctx *Context, name string, args NotificationArgs, opts ...ResourceOption) (*Notification, error)public Notification(string name, NotificationArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args NotificationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NotificationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NotificationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Notification Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Notification resource accepts the following input properties:
- Group
Names List<string> A list of AutoScaling Group Names
- Notifications List<string>
A list of Notification Types that trigger notifications. Acceptable values are documented in the AWS documentation here
- Topic
Arn string The Topic ARN for notifications to be sent through
- Group
Names []string A list of AutoScaling Group Names
- Notifications []string
A list of Notification Types that trigger notifications. Acceptable values are documented in the AWS documentation here
- Topic
Arn string The Topic ARN for notifications to be sent through
- group
Names string[] A list of AutoScaling Group Names
- notifications
Notification
Type[] A list of Notification Types that trigger notifications. Acceptable values are documented in the AWS documentation here
- topic
Arn string The Topic ARN for notifications to be sent through
- group_
names List[str] A list of AutoScaling Group Names
- notifications
List[Notification
Type] A list of Notification Types that trigger notifications. Acceptable values are documented in the AWS documentation here
- topic_
arn str The Topic ARN for notifications to be sent through
Outputs
All input properties are implicitly available as output properties. Additionally, the Notification resource produces the following output properties:
Look up an Existing Notification Resource
Get an existing Notification resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NotificationState, opts?: CustomResourceOptions): Notificationstatic get(resource_name, id, opts=None, group_names=None, notifications=None, topic_arn=None, __props__=None);func GetNotification(ctx *Context, name string, id IDInput, state *NotificationState, opts ...ResourceOption) (*Notification, error)public static Notification Get(string name, Input<string> id, NotificationState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Group
Names List<string> A list of AutoScaling Group Names
- Notifications List<string>
A list of Notification Types that trigger notifications. Acceptable values are documented in the AWS documentation here
- Topic
Arn string The Topic ARN for notifications to be sent through
- Group
Names []string A list of AutoScaling Group Names
- Notifications []string
A list of Notification Types that trigger notifications. Acceptable values are documented in the AWS documentation here
- Topic
Arn string The Topic ARN for notifications to be sent through
- group
Names string[] A list of AutoScaling Group Names
- notifications
Notification
Type[] A list of Notification Types that trigger notifications. Acceptable values are documented in the AWS documentation here
- topic
Arn string The Topic ARN for notifications to be sent through
- group_
names List[str] A list of AutoScaling Group Names
- notifications
List[Notification
Type] A list of Notification Types that trigger notifications. Acceptable values are documented in the AWS documentation here
- topic_
arn str The Topic ARN for notifications to be sent through
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.