From 713652b7fb4a0962659deb12191c94f8355c789b Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Thu, 12 Feb 2026 18:03:40 -0500 Subject: [PATCH] vpc/subnet handling --- common/data.tf | 23 +++++++++++++++++++++++ common/variables.product.tf | 12 ++++++++++++ 2 files changed, 35 insertions(+) diff --git a/common/data.tf b/common/data.tf index 8f58564..e370d25 100644 --- a/common/data.tf +++ b/common/data.tf @@ -1,3 +1,26 @@ +data "aws_vpc" "eks_vpc" { + filter { + name = "tag:Name" + values = [var.vpc_name] + } +} + +data "aws_subnets" "subnets" { + filter { + name = "tag:Name" + values = [var.subnets_name] + } + filter { + name = "vpc-id" + values = [data.aws_vpc.eks_vpc.id] + } +} + +data "aws_subnet" "subnets" { + for_each = toset(data.aws_subnets.subnets.ids) + id = each.key +} + # Get portfolio details if we provided the ID data "aws_servicecatalog_portfolio" "by_id" { count = var.portfolio_id != null ? 1 : 0 diff --git a/common/variables.product.tf b/common/variables.product.tf index af57f28..0ede96b 100644 --- a/common/variables.product.tf +++ b/common/variables.product.tf @@ -91,4 +91,16 @@ variable "timeout_delete" { description = "Timeout for provisioned product deletion" type = string default = "60m" +} + +variable "vpc_name" { + description = "Name tag of the VPC to deploy into" + type = string + default = "vpc2-csvd-dev" +} + +variable "subnets_name" { + description = "Name tag of the subnets to deploy into" + type = string + default = "apps" } \ No newline at end of file