From d92fc97615b65f349d9a69745d37abc224f06a31 Mon Sep 17 00:00:00 2001 From: Aakib khan <101191261+Aakibgithuber@users.noreply.github.com> Date: Tue, 30 Jan 2024 15:04:31 +0530 Subject: [PATCH] Update main.tf --- Eks-terraform/main.tf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Eks-terraform/main.tf b/Eks-terraform/main.tf index b7e231e..bb4adad 100644 --- a/Eks-terraform/main.tf +++ b/Eks-terraform/main.tf @@ -31,6 +31,10 @@ data "aws_subnets" "public" { name = "vpc-id" values = [data.aws_vpc.default.id] } + filter { + name = "availabilityZone" + values = ["us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1f"] + } } #cluster provision resource "aws_eks_cluster" "example" { @@ -83,7 +87,15 @@ resource "aws_eks_node_group" "example" { cluster_name = aws_eks_cluster.example.name node_group_name = "Node-cloud" node_role_arn = aws_iam_role.example1.arn - subnet_ids = data.aws_subnets.public.ids + subnet_ids = [ + # Add only the subnets you want, excluding us-east-1e + data.aws_subnet_ids.public.ids[0], # us-east-1a + data.aws_subnet_ids.public.ids[1], # us-east-1b + data.aws_subnet_ids.public.ids[2], # us-east-1c + data.aws_subnet_ids.public.ids[3], # us-east-1d + data.aws_subnet_ids.public.ids[4], # us-east-1f + ] + scaling_config { desired_size = 1