2017-01-20 14:21:12 +01:00
---
layout: "aws"
page_title: "AWS: aws_autoscaling_groups"
sidebar_current: "docs-aws-datasource-autoscaling-groups"
description: |-
2017-02-04 16:47:25 +01:00
Provides a list of Autoscaling Groups within a specific region.
2017-01-20 14:21:12 +01:00
---
# aws\_autoscaling\_groups
The Autoscaling Groups data source allows access to the list of AWS
2017-02-04 16:47:25 +01:00
ASGs within a specific region. This will allow you to pass a list of AutoScaling Groups to other resources.
2017-01-20 14:21:12 +01:00
## Example Usage
2017-04-07 17:54:28 +02:00
```hcl
2017-05-18 17:40:49 +02:00
data "aws_autoscaling_groups" "groups" {
filter {
name = "key"
values = ["Team"]
}
filter {
name = "value"
values = ["Pets"]
}
}
2017-01-20 14:21:12 +01:00
resource "aws_autoscaling_notification" "slack_notifications" {
group_names = ["${data.aws_autoscaling_groups.groups.names}"]
2017-02-18 23:48:50 +01:00
notifications = [
2017-01-20 14:21:12 +01:00
"autoscaling:EC2_INSTANCE_LAUNCH",
"autoscaling:EC2_INSTANCE_TERMINATE",
"autoscaling:EC2_INSTANCE_LAUNCH_ERROR",
2017-02-18 23:48:50 +01:00
"autoscaling:EC2_INSTANCE_TERMINATE_ERROR",
2017-01-20 14:21:12 +01:00
]
2017-02-18 23:48:50 +01:00
2017-01-20 14:21:12 +01:00
topic_arn = "TOPIC ARN"
}
```
## Argument Reference
2017-05-18 17:40:49 +02:00
* `filter` - (Optional) A filter used to scope the list e.g. by tags. See [related docs ](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_Filter.html ).
* `name` - (Required) The name of the filter. The valid values are: `auto-scaling-group` , `key` , `value` , and `propagate-at-launch` .
* `values` - (Required) The value of the filter.
2017-01-20 14:21:12 +01:00
## Attributes Reference
The following attributes are exported:
2017-02-04 16:47:25 +01:00
* `names` - A list of the Autoscaling Groups in the current region.