Skip to content

Commit

Permalink
Update subnets data source
Browse files Browse the repository at this point in the history
  • Loading branch information
max-lobur committed Jun 28, 2023
1 parent c1a4477 commit f300e58
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 = [var.vpc_id]
}
}

data "aws_security_group" "default" {
Expand Down

0 comments on commit f300e58

Please sign in to comment.