Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_subnet_ids datasource deprecated in latest aws provider #30

Open
sergeisourcepoint opened this issue Jun 20, 2024 · 0 comments
Open

Comments

@sergeisourcepoint
Copy link

sergeisourcepoint commented Jun 20, 2024

fix

diff --git a/vpce.tf b/vpce.tf
index 69f35cf..ea6a22d 100644
--- a/vpce.tf
+++ b/vpce.tf
@@ -1,11 +1,14 @@
 locals {
   region  = var.vpc_endpoints_enabled && var.vpc_id != null ? split(":", data.aws_vpc.selected[0].arn)[3] : data.aws_region.current.name
-  subnets = var.vpc_endpoints_enabled ? var.subnet_ids != [] ? var.subnet_ids : data.aws_subnet_ids.selected[0].ids : []
+  subnets = var.vpc_endpoints_enabled ? var.subnet_ids != [] ? var.subnet_ids : data.aws_subnets.selected[0].ids : []
 }

-data "aws_subnet_ids" "selected" {
+data "aws_subnets" "selected" {
   count  = var.vpc_endpoints_enabled ? 1 : 0
-  vpc_id = var.vpc_id
+  filter {
+    name   = "vpc-id"
+    values = [var.vpc_id]
+  }
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant