From ed67b8600855727e4b8ebd83564e4762eba91826 Mon Sep 17 00:00:00 2001 From: BryanFauble <17128019+BryanFauble@users.noreply.github.com> Date: Mon, 20 May 2024 12:10:54 -0700 Subject: [PATCH] Corrections --- modules/internal-k8-infra/data.tf | 12 ++++++++++-- modules/internal-k8-infra/main.tf | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/internal-k8-infra/data.tf b/modules/internal-k8-infra/data.tf index c74b2769..fb63bda4 100644 --- a/modules/internal-k8-infra/data.tf +++ b/modules/internal-k8-infra/data.tf @@ -16,8 +16,16 @@ data "aws_secretsmanager_secret_version" "secret_credentials" { # TODO: This should search for the VPC using some other value as ID would change # on first startup and teardown/restart -data "aws_vpc" "selected" { - id = "spacelift-created-vpc vpc-0f30cfca319ebc521" +data "aws_subnets" "node_subnets" { + filter { + name = "vpc-id" + values = ["vpc-0f30cfca319ebc521"] + } +} + +data "aws_eks_node_group" "profile" { + cluster_name = var.cluster_name + node_group_name = "one" } data "aws_security_group" "eks_cluster_security_group" { diff --git a/modules/internal-k8-infra/main.tf b/modules/internal-k8-infra/main.tf index 5aac701c..7ba02144 100644 --- a/modules/internal-k8-infra/main.tf +++ b/modules/internal-k8-infra/main.tf @@ -18,7 +18,7 @@ module "ocean-aws-k8s" { # Configuration cluster_name = var.cluster_name region = var.region - subnet_ids = data.aws_vpc.selected.private_subnets + subnet_ids = data.aws_subnets.node_subnets.ids worker_instance_profile_arn = data.aws_eks_node_group.profile.node_role_arn security_groups = [data.aws_security_group.eks_cluster_security_group.id] is_aggressive_scale_down_enabled = true