From 627341a5be27536fafb94cc0bae49c84777a78c2 Mon Sep 17 00:00:00 2001 From: Anthony Zawacki Date: Tue, 5 Sep 2023 10:54:02 -0400 Subject: [PATCH] Changes to get vpc_id and subnet_ids as input. --- main.tf | 23 ----------------------- variables.tf | 11 +++++------ 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/main.tf b/main.tf index 39b20a2..98f49e3 100644 --- a/main.tf +++ b/main.tf @@ -1,26 +1,3 @@ -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 -} - data "aws_ebs_default_kms_key" "current" {} data "aws_kms_key" "ebs_key" { diff --git a/variables.tf b/variables.tf index d73a8db..e9d7c6a 100644 --- a/variables.tf +++ b/variables.tf @@ -3,15 +3,14 @@ variable "cluster_name" { type = string } -variable "vpc_name" { - description = "Define the VPC name that will be used by this cluster" +variable "vpc_id" { + description = "Specify the VPC id that is used by this cluster" type = string } -variable "subnets_name" { - description = "Define the name of the subnets to be used by this cluster" - type = string - default = "*-container-*" +variable "subnets" { + description = "Specify the subnets used by this cluster" + type = list(string) } variable "security_group_all_worker_mgmt_id" {