2015-06-05 17:14:24 +02:00
|
|
|
---
|
|
|
|
layout: "aws"
|
2015-06-05 23:47:50 +02:00
|
|
|
page_title: "AWS: aws_autoscaling_notification"
|
2015-06-05 17:14:24 +02:00
|
|
|
sidebar_current: "docs-aws-resource-autoscaling-notification"
|
|
|
|
description: |-
|
|
|
|
Provides an AutoScaling Group with Notification support
|
|
|
|
---
|
|
|
|
|
2015-06-05 23:47:50 +02:00
|
|
|
# aws\_autoscaling\_notification
|
2015-06-05 17:14:24 +02:00
|
|
|
|
2015-06-05 22:42:04 +02:00
|
|
|
Provides an AutoScaling Group with Notification support, via SNS Topics. Each of
|
|
|
|
the `notifications` map to a [Notification Configuration][2] inside Amazon Web
|
|
|
|
Services, and are applied to each AutoScaling Group you supply.
|
2015-06-05 17:14:24 +02:00
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
Basic usage:
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "aws_autoscaling_notification" "example_notifications" {
|
|
|
|
group_names = [
|
|
|
|
"${aws_autoscaling_group.bar.name}",
|
|
|
|
"${aws_autoscaling_group.foo.name}",
|
|
|
|
]
|
2017-02-18 23:48:50 +01:00
|
|
|
|
|
|
|
notifications = [
|
|
|
|
"autoscaling:EC2_INSTANCE_LAUNCH",
|
2015-06-05 17:14:24 +02:00
|
|
|
"autoscaling:EC2_INSTANCE_TERMINATE",
|
2017-02-18 23:48:50 +01:00
|
|
|
"autoscaling:EC2_INSTANCE_LAUNCH_ERROR",
|
2015-06-05 17:14:24 +02:00
|
|
|
]
|
2017-02-18 23:48:50 +01:00
|
|
|
|
2015-06-05 17:14:24 +02:00
|
|
|
topic_arn = "${aws_sns_topic.example.arn}"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_sns_topic" "example" {
|
|
|
|
name = "example-topic"
|
2017-02-18 23:48:50 +01:00
|
|
|
|
2015-06-05 17:14:24 +02:00
|
|
|
# arn is an exported attribute
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_autoscaling_group" "bar" {
|
|
|
|
name = "foobar1-terraform-test"
|
2017-02-18 23:48:50 +01:00
|
|
|
|
|
|
|
# ...
|
2015-06-05 17:14:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_autoscaling_group" "foo" {
|
|
|
|
name = "barfoo-terraform-test"
|
2017-02-18 23:48:50 +01:00
|
|
|
|
|
|
|
# ...
|
2015-06-05 17:14:24 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `group_names` - (Required) A list of AutoScaling Group Names
|
|
|
|
* `notifications` - (Required) A list of Notification Types that trigger
|
2016-03-07 20:18:49 +01:00
|
|
|
notifications. Acceptable values are documented [in the AWS documentation here][1]
|
2015-06-05 17:14:24 +02:00
|
|
|
* `topic_arn` - (Required) The Topic ARN for notifications to be sent through
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
2017-02-18 23:48:50 +01:00
|
|
|
* `group_names`
|
2015-06-05 17:14:24 +02:00
|
|
|
* `notifications`
|
2017-02-18 23:48:50 +01:00
|
|
|
* `topic_arn`
|
2015-06-05 17:14:24 +02:00
|
|
|
|
|
|
|
|
2016-01-14 21:55:39 +01:00
|
|
|
[1]: https://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_NotificationConfiguration.html
|
2017-02-18 23:48:50 +01:00
|
|
|
[2]: https://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_DescribeNotificationConfigurations.html
|