github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/aws/r/autoscaling_notification.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_autoscaling_notification"
     4  sidebar_current: "docs-aws-resource-autoscaling-notification"
     5  description: |-
     6    Provides an AutoScaling Group with Notification support
     7  ---
     8  
     9  # aws\_autoscaling\_notification
    10  
    11  Provides an AutoScaling Group with Notification support, via SNS Topics. Each of
    12  the `notifications` map to a [Notification Configuration][2] inside Amazon Web
    13  Services, and are applied to each AutoScaling Group you supply.
    14  
    15  ## Example Usage
    16  
    17  Basic usage:
    18  
    19  ```hcl
    20  resource "aws_autoscaling_notification" "example_notifications" {
    21    group_names = [
    22      "${aws_autoscaling_group.bar.name}",
    23      "${aws_autoscaling_group.foo.name}",
    24    ]
    25  
    26    notifications = [
    27      "autoscaling:EC2_INSTANCE_LAUNCH",
    28      "autoscaling:EC2_INSTANCE_TERMINATE",
    29      "autoscaling:EC2_INSTANCE_LAUNCH_ERROR",
    30    ]
    31  
    32    topic_arn = "${aws_sns_topic.example.arn}"
    33  }
    34  
    35  resource "aws_sns_topic" "example" {
    36    name = "example-topic"
    37  
    38    # arn is an exported attribute
    39  }
    40  
    41  resource "aws_autoscaling_group" "bar" {
    42    name = "foobar1-terraform-test"
    43  
    44    # ...
    45  }
    46  
    47  resource "aws_autoscaling_group" "foo" {
    48    name = "barfoo-terraform-test"
    49  
    50    # ...
    51  }
    52  ```
    53  
    54  ## Argument Reference
    55  
    56  The following arguments are supported:
    57  
    58  * `group_names` - (Required) A list of AutoScaling Group Names
    59  * `notifications` - (Required) A list of Notification Types that trigger
    60  notifications. Acceptable values are documented [in the AWS documentation here][1]
    61  * `topic_arn` - (Required) The Topic ARN for notifications to be sent through
    62  
    63  ## Attributes Reference
    64  
    65  The following attributes are exported:
    66  
    67  * `group_names`
    68  * `notifications`
    69  * `topic_arn`
    70  
    71  
    72  [1]: https://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_NotificationConfiguration.html
    73  [2]: https://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_DescribeNotificationConfigurations.html