Skip to content

Commit 70a27fd

Browse files
fix: Update subnet data source to use aws_subnets and correct local variable reference
1 parent f6f401f commit 70a27fd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

infra/terraform/media_relay/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ locals {
2222
vpc_id = var.vpc_id != null ? var.vpc_id : data.aws_vpc.default[0].id
2323
}
2424

25-
data "aws_subnet_ids" "selected" {
26-
vpc_id = local.vpc_id
25+
data "aws_subnets" "selected" {
26+
filter {
27+
name = "vpc-id"
28+
values = [local.vpc_id]
29+
}
2730
}
2831

2932
data "aws_eip" "existing" {
@@ -32,7 +35,7 @@ data "aws_eip" "existing" {
3235
}
3336

3437
locals {
35-
subnet_id = var.subnet_id != null ? var.subnet_id : data.aws_subnet_ids.selected.ids[0]
38+
subnet_id = var.subnet_id != null ? var.subnet_id : data.aws_subnets.selected.ids[0]
3639
tcp_ports = [8554, 1935, 8888, 8889, 9998, 9999]
3740
udp_ports = [8200]
3841
port_rules = concat(

0 commit comments

Comments
 (0)