From f300e58c94265f9d331101ca9470bf7573f674dd Mon Sep 17 00:00:00 2001 From: Max Lobur Date: Wed, 28 Jun 2023 18:29:42 +0300 Subject: [PATCH 1/2] Update subnets data source --- examples/autoscalinggroup/main.tf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/autoscalinggroup/main.tf b/examples/autoscalinggroup/main.tf index 629c31a..1bf74d0 100644 --- a/examples/autoscalinggroup/main.tf +++ b/examples/autoscalinggroup/main.tf @@ -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" @@ -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" { From f33d7ab3ea9daa414f3e7fabcd7973a274673a72 Mon Sep 17 00:00:00 2001 From: Max Lobur Date: Wed, 28 Jun 2023 18:33:18 +0300 Subject: [PATCH 2/2] updates --- examples/autoscalinggroup/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/autoscalinggroup/main.tf b/examples/autoscalinggroup/main.tf index 1bf74d0..bec1c01 100644 --- a/examples/autoscalinggroup/main.tf +++ b/examples/autoscalinggroup/main.tf @@ -84,7 +84,7 @@ data "aws_vpc" "default" { data "aws_subnets" "all" { filter { name = "vpc-id" - values = [var.vpc_id] + values = [data.aws_vpc.default.id] } }