diff --git a/deploy/infrastructure/dependencies/terraform-aws-kubernetes/cluster.tf b/deploy/infrastructure/dependencies/terraform-aws-kubernetes/cluster.tf index 1c5153026..72e57417b 100644 --- a/deploy/infrastructure/dependencies/terraform-aws-kubernetes/cluster.tf +++ b/deploy/infrastructure/dependencies/terraform-aws-kubernetes/cluster.tf @@ -1,7 +1,7 @@ resource "aws_eks_cluster" "kubernetes_cluster" { name = var.cluster_name role_arn = aws_iam_role.dss-cluster.arn - + vpc_config { subnet_ids = aws_subnet.dss[*].id endpoint_public_access = true @@ -13,7 +13,11 @@ resource "aws_eks_cluster" "kubernetes_cluster" { # Ensure that IAM Role permissions are created before and deleted after EKS Cluster handling. # Otherwise, EKS will not be able to properly delete EKS managed EC2 infrastructure such as Security Groups. depends_on = [ + aws_iam_role.dss-cluster-node-group, aws_iam_role_policy_attachment.dss-cluster-service, + aws_iam_role_policy_attachment.AmazonEKSWorkerNodePolicy, + aws_iam_role_policy_attachment.AmazonEKS_CNI_Policy, + aws_iam_role_policy_attachment.AWSLoadBalancerControllerPolicy, aws_internet_gateway.dss ] @@ -39,4 +43,9 @@ resource "aws_eks_node_group" "eks_node_group" { lifecycle { create_before_destroy = true } + + depends_on = [ + aws_eip.gateway, + aws_eip.ip_crdb + ] }