Skip to content

Commit

Permalink
Update example for ASG's subnets data source (#142)
Browse files Browse the repository at this point in the history
* Update subnets data source

* updates
  • Loading branch information
max-lobur authored Jul 5, 2023
1 parent c1a4477 commit 3216f97
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/autoscalinggroup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ resource "aws_launch_template" "default" {
resource "aws_autoscaling_group" "default" {
# terraform-null-label example used here: Set ASG name prefix
name_prefix = "${module.label.id}-"
vpc_zone_identifier = data.aws_subnet_ids.all.ids
vpc_zone_identifier = data.aws_subnets.all.ids
max_size = "1"
min_size = "1"
desired_capacity = "1"
Expand Down Expand Up @@ -81,8 +81,11 @@ data "aws_vpc" "default" {
default = true
}

data "aws_subnet_ids" "all" {
vpc_id = data.aws_vpc.default.id
data "aws_subnets" "all" {
filter {
name = "vpc-id"
values = [data.aws_vpc.default.id]
}
}

data "aws_security_group" "default" {
Expand Down

0 comments on commit 3216f97

Please sign in to comment.