Skip to content

Commit

Permalink
Changes to get vpc_id and subnet_ids as input.
Browse files Browse the repository at this point in the history
  • Loading branch information
zawac002 committed Sep 5, 2023
1 parent f01a728 commit 627341a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
23 changes: 0 additions & 23 deletions main.tf
Original file line number Diff line number Diff line change
@@ -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" {
Expand Down
11 changes: 5 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 627341a

Please sign in to comment.