Skip to content

Commit f71c6e4

Browse files
committed
fix: replace aws_subnet_ids with aws_subnets
1 parent 57599d6 commit f71c6e4

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

.terraform.lock.hcl

Lines changed: 0 additions & 21 deletions
This file was deleted.

main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ data "aws_vpc" "this" {
1414
state = "available"
1515
}
1616

17-
data "aws_subnet_ids" "this" {
17+
data "aws_subnets" "this" {
1818
dynamic "filter" {
1919
for_each = length(data.aws_availability_zones.this.names) > 0 ? range(1) : range(0)
2020

@@ -24,11 +24,14 @@ data "aws_subnet_ids" "this" {
2424
}
2525
}
2626

27-
vpc_id = data.aws_vpc.this.id
27+
filter {
28+
name = "vpc-id"
29+
values = [data.aws_vpc.this.id]
30+
}
2831
}
2932

3033
data "aws_subnet" "this" {
31-
for_each = data.aws_subnet_ids.this.ids
34+
for_each = data.aws_subnets.this.ids
3235

3336
id = each.value
3437
}

0 commit comments

Comments
 (0)