From e7c3a6548fc1a597fc4b32fff1092c542ea2a6a5 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 00:21:55 -0500 Subject: [PATCH 01/39] update --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/terraform.yml | 62 ++++++++++++++++++++++++++++++++ terraform/terraform.tf | 4 +-- terraform/variables.tf | 4 +-- terraform/vpc.tf | 2 +- 5 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 .DS_Store create mode 100644 .github/workflows/terraform.yml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7fd0e5aa3db6dc43ca35256b32906d5c292fe914 GIT binary patch literal 6148 zcmeHK%}T>S5T0$TO(;SS3OxqA7HriP#7l_v1&ruHr6x3LFwK@UwTDv3SzpK}@p+ut z-HN3Oo+67JTXw(Rn9Vx- zt)|oNcIHiIc0~5!L3cj4t)1Pyabr)10E0$$MgVrEZ%mL@X2$LOMR zQNhRzFaylMx-ek&KdZJb6Xtm`1I)mW8KC{aK_zqz78=#ofel?BDPAEYL7UzZgpNVi zV4)EsC_QZ5z7($n$-!XZv!9t@h2cbsB@0gK=d7%h3I{F=z4#L&QEi=FjEHhBn z-8!BBr{BN-my5W^3@`)#iUCpS`8^M(WX{%=$ Date: Tue, 16 Dec 2025 13:11:24 -0500 Subject: [PATCH 02/39] update --- .github/workflows/terraform.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index ef2bf0f1a..099b3f07e 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -41,8 +41,7 @@ jobs: - name: "Terraform Init" id: init - run: terraform init \ - -backend-config="bucket=${{ env.BUCKET_TF_STATE }}" + run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" - name: "Terrform Format" id: fmt From ebfad7b86f15dcd61f4099e4a1e9aa07613b1d33 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 13:18:06 -0500 Subject: [PATCH 03/39] staging workflow-1 --- .github/workflows/terraform.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 099b3f07e..578f522e8 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -41,7 +41,9 @@ jobs: - name: "Terraform Init" id: init - run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" + run: | + terraform init \ + -backend-config="bucket=$BUCKET_TF_STATE" - name: "Terrform Format" id: fmt From da82564457ea4d68f61e1ae7c4fea85e45e0e499 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 13:20:10 -0500 Subject: [PATCH 04/39] update staging workflow --- .github/workflows/terraform.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 578f522e8..099b3f07e 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -41,9 +41,7 @@ jobs: - name: "Terraform Init" id: init - run: | - terraform init \ - -backend-config="bucket=$BUCKET_TF_STATE" + run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" - name: "Terrform Format" id: fmt From 5bc559f861f18b40d02603fa5ffc93eaf5e53223 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 13:24:35 -0500 Subject: [PATCH 05/39] update stage workflow --- .github/workflows/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 099b3f07e..cf61a2957 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -41,7 +41,7 @@ jobs: - name: "Terraform Init" id: init - run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" + run: terraform init -backend-config="bucket=${{ env.BUCKET_TF_STATE }}" - name: "Terrform Format" id: fmt From 6adcd16db29180eca9bba9ba9485f0c4a6b1ed33 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 13:26:44 -0500 Subject: [PATCH 06/39] update --- .../{terraform.yml => terraform-1.yml} | 0 .github/workflows/terraform.old | 61 +++++++++++++++++++ 2 files changed, 61 insertions(+) rename .github/workflows/{terraform.yml => terraform-1.yml} (100%) create mode 100644 .github/workflows/terraform.old diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform-1.yml similarity index 100% rename from .github/workflows/terraform.yml rename to .github/workflows/terraform-1.yml diff --git a/.github/workflows/terraform.old b/.github/workflows/terraform.old new file mode 100644 index 000000000..cf61a2957 --- /dev/null +++ b/.github/workflows/terraform.old @@ -0,0 +1,61 @@ +name: "Nomad IaC" +on: + push: + branches: + - main + - stage + paths: + - terraform/** + pull_request: + branches: + - main + paths: + - terraform/** + +env: + #Credentials for AWS + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + #Storage for Terraform State + BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE }} + AWS_REGION: "us-east-1" + EKS_CLUSTER_NAME: "nomadapp-eks" + +jobs: + terraform: + name: "Terraform Apply" + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./terraform + + steps: + - name: "Checkout Repo" + uses: actions/checkout@v4 + + - name: "Setup Terraform" + uses: hashicorp/setup-terraform@v2 + # with: + # terraform_version: "1.6.3" + + - name: "Terraform Init" + id: init + run: terraform init -backend-config="bucket=${{ env.BUCKET_TF_STATE }}" + + - name: "Terrform Format" + id: fmt + run: terraform fmt -check + + - name: "Terraform Validate" + id: validate + run: terraform validate + + - name: "Terraform Plan" + id: plan + run: terraform plan -no-color -input=false -out=tfplan + continue-on-error: true + + - name: Terraform plan status + if: steps.plan.outcome == 'failure' + run: echo "Terraform plan failed. Please check the configuration." \ No newline at end of file From 729b26d9dea5530e146bc07a9079478517c437ee Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 13:31:40 -0500 Subject: [PATCH 07/39] new workflow --- .github/workflows/terraform-1.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terraform-1.yml b/.github/workflows/terraform-1.yml index cf61a2957..8a7f2faed 100644 --- a/.github/workflows/terraform-1.yml +++ b/.github/workflows/terraform-1.yml @@ -41,9 +41,9 @@ jobs: - name: "Terraform Init" id: init - run: terraform init -backend-config="bucket=${{ env.BUCKET_TF_STATE }}" + run: terraform init -backend-config="bucket=${{ env.BUCKET_TF_STATE }}" -input=false - - name: "Terrform Format" + - name: "Terraform Format" id: fmt run: terraform fmt -check From c63e873be3fc882868e33620969bdb76669d2fb3 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 13:33:34 -0500 Subject: [PATCH 08/39] new workflow --- terraform/variables.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform/variables.tf b/terraform/variables.tf index efeb89aa0..40a573c49 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -9,3 +9,5 @@ variable "clusterName" { type = string default = "nomadops-eks" } + +## \ No newline at end of file From 707741e9556709ac684db0fa3c3c0bee9873eadb Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 13:35:51 -0500 Subject: [PATCH 09/39] fix workflow --- .github/workflows/terraform-1.yml | 4 ++-- terraform/variables.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform-1.yml b/.github/workflows/terraform-1.yml index 8a7f2faed..8d71baf23 100644 --- a/.github/workflows/terraform-1.yml +++ b/.github/workflows/terraform-1.yml @@ -36,8 +36,8 @@ jobs: - name: "Setup Terraform" uses: hashicorp/setup-terraform@v2 - # with: - # terraform_version: "1.6.3" + with: + terraform_version: "1.6.3" - name: "Terraform Init" id: init diff --git a/terraform/variables.tf b/terraform/variables.tf index 40a573c49..ae4508e28 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -## \ No newline at end of file +### \ No newline at end of file From 01d64ed6a63376ab645518a54a9b047cea8db267 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 14:01:17 -0500 Subject: [PATCH 10/39] terraform apply steps included --- .github/workflows/terraform-1.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform-1.yml b/.github/workflows/terraform-1.yml index 8d71baf23..93a037b26 100644 --- a/.github/workflows/terraform-1.yml +++ b/.github/workflows/terraform-1.yml @@ -58,4 +58,26 @@ jobs: - name: Terraform plan status if: steps.plan.outcome == 'failure' - run: echo "Terraform plan failed. Please check the configuration." \ No newline at end of file + run: echo "Terraform plan failed. Please check the configuration." + + - name: "Terraform Apply" + id: apple + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + run: terraform apply -auto-approve -input=false -parallelism=1 planfile + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Get Kube config file + id: getconfig + if: "steps.apple.outcome == 'success' + run: aws eks update-kubeconfig --region ${{ env.AWS_REGION }} --name ${{ env.EKS_CLUSTER_NAME }} + + - name: Install Ingress Controller + if: steps.apple.outcome == 'success' && steps.getconfig.outcome == 'success' + run: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.1/deploy/static/provider/aws/deploy.yaml + From 4ea3ae6259cfc5101d971e7c488b08ab09774dc1 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 14:02:41 -0500 Subject: [PATCH 11/39] updated on stage --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index ae4508e28..782683782 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -### \ No newline at end of file +#### \ No newline at end of file From 8045334ea5d32de31a8cf3fb6499c1e22c3792ec Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 14:03:56 -0500 Subject: [PATCH 12/39] fix stage --- .github/workflows/terraform-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-1.yml b/.github/workflows/terraform-1.yml index 93a037b26..f98a7a3c8 100644 --- a/.github/workflows/terraform-1.yml +++ b/.github/workflows/terraform-1.yml @@ -74,7 +74,7 @@ jobs: - name: Get Kube config file id: getconfig - if: "steps.apple.outcome == 'success' + if: steps.apple.outcome == 'success' run: aws eks update-kubeconfig --region ${{ env.AWS_REGION }} --name ${{ env.EKS_CLUSTER_NAME }} - name: Install Ingress Controller From 1e6f494dc14199a038ec0ee7f2a39c83fc286336 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 14:04:31 -0500 Subject: [PATCH 13/39] fixed code stag --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 782683782..789aeb3e6 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -#### \ No newline at end of file +##### \ No newline at end of file From 8c716df4d3ed91aff3e2720fd131d2355dc1bba4 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 14:20:02 -0500 Subject: [PATCH 14/39] update --- .github/workflows/terraform-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-1.yml b/.github/workflows/terraform-1.yml index f98a7a3c8..343427f78 100644 --- a/.github/workflows/terraform-1.yml +++ b/.github/workflows/terraform-1.yml @@ -53,7 +53,7 @@ jobs: - name: "Terraform Plan" id: plan - run: terraform plan -no-color -input=false -out=tfplan + run: terraform plan -no-color -input=false -out planfile continue-on-error: true - name: Terraform plan status From 9758042c310f5c0012605082c2b1d0b02da4b8e4 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 14:25:24 -0500 Subject: [PATCH 15/39] update to stage --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 789aeb3e6..ab81e5900 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -##### \ No newline at end of file +###### \ No newline at end of file From acb43653e6c2f0b8539350bd18e2149f87249d8d Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 20:16:33 -0500 Subject: [PATCH 16/39] update eks version --- terraform/eks-cluster.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index 2c4610920..bc088d42e 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -3,7 +3,7 @@ module "eks" { version = "19.19.1" cluster_name = local.cluster_name - cluster_version = "1.27" + cluster_version = "1.33" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets From a09dbb7f490c5308f0a68d15065f63645bd41e92 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 20:46:45 -0500 Subject: [PATCH 17/39] update node group --- terraform/eks-cluster.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index bc088d42e..334718f29 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -10,7 +10,7 @@ module "eks" { cluster_endpoint_public_access = true eks_managed_node_group_defaults = { - ami_type = "AL2_x86_64" + ami_type = "AL2023_x86_64_STANDARD" } From be28109b09b69c648dcd6656d5592659c96751a2 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 20:58:14 -0500 Subject: [PATCH 18/39] update node group --- terraform/eks-cluster.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index 334718f29..bc088d42e 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -10,7 +10,7 @@ module "eks" { cluster_endpoint_public_access = true eks_managed_node_group_defaults = { - ami_type = "AL2023_x86_64_STANDARD" + ami_type = "AL2_x86_64" } From 3876568513e1752f713b261e07bab12b0ee0dbf5 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 21:00:39 -0500 Subject: [PATCH 19/39] update node group --- terraform/eks-cluster.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index bc088d42e..1187c197e 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -3,7 +3,7 @@ module "eks" { version = "19.19.1" cluster_name = local.cluster_name - cluster_version = "1.33" + cluster_version = "1.32" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets From 49a3e2ca494a98c2624ea0f9b749ca97de37a1e0 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 21:08:15 -0500 Subject: [PATCH 20/39] update node group --- terraform/eks-cluster.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index 1187c197e..ff127a86d 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -10,7 +10,7 @@ module "eks" { cluster_endpoint_public_access = true eks_managed_node_group_defaults = { - ami_type = "AL2_x86_64" + ami_type = "AL2023_x86_64_STANDARD" } From e6582fb01503433e2e5c1fed732f807881b75137 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 21:15:30 -0500 Subject: [PATCH 21/39] update ami --- terraform/eks-cluster.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index ff127a86d..a60f10346 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -10,7 +10,8 @@ module "eks" { cluster_endpoint_public_access = true eks_managed_node_group_defaults = { - ami_type = "AL2023_x86_64_STANDARD" + ami_type = "CUSTOM" + ami_id = data.aws_ssm_parameter.eks_al2023_ami.value } From 0936e8fe03832c30cfa0423b987fade92f21f438 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 21:18:31 -0500 Subject: [PATCH 22/39] update ami --- terraform/eks-cluster.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index a60f10346..483fbb1d6 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -1,3 +1,8 @@ +# Fetch the AL2023 EKS-optimized AMI for Kubernetes 1.32 +data "aws_ssm_parameter" "eks_al2023_ami" { + name = "/aws/service/eks/optimized-ami/1.32/amazon-linux-2023/x86_64/standard/recommended/image_id" +} + module "eks" { source = "terraform-aws-modules/eks/aws" version = "19.19.1" From b41155aea6545524aacb08acf35357fa6a0098e5 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 21:20:40 -0500 Subject: [PATCH 23/39] update ami --- terraform/eks-cluster.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index 483fbb1d6..e6429a43f 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -8,7 +8,7 @@ module "eks" { version = "19.19.1" cluster_name = local.cluster_name - cluster_version = "1.32" + cluster_version = "1.33" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets From 05503e28c17eb8757afdd39db4bb7a44fc1ae8f4 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 21:59:26 -0500 Subject: [PATCH 24/39] update --- terraform/eks-cluster.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index e6429a43f..f892178cc 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -17,6 +17,7 @@ module "eks" { eks_managed_node_group_defaults = { ami_type = "CUSTOM" ami_id = data.aws_ssm_parameter.eks_al2023_ami.value + wait_for_nodes = false } From 3b80d948d17bbdae87d3d23eebc8efc1ef8c0cf5 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 22:02:00 -0500 Subject: [PATCH 25/39] update --- terraform/eks-cluster.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index f892178cc..a86d8acbe 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -17,7 +17,7 @@ module "eks" { eks_managed_node_group_defaults = { ami_type = "CUSTOM" ami_id = data.aws_ssm_parameter.eks_al2023_ami.value - wait_for_nodes = false + } @@ -30,6 +30,7 @@ module "eks" { min_size = 1 max_size = 3 desired_size = 2 + wait_for_nodes = false } two = { @@ -40,6 +41,7 @@ module "eks" { min_size = 1 max_size = 2 desired_size = 1 + wait_for_nodes = false } } } From 0d134d6443b5a655419293516208feb8e627b076 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 22:04:35 -0500 Subject: [PATCH 26/39] update --- terraform/eks-cluster.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index a86d8acbe..5a944a20a 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -1,6 +1,6 @@ # Fetch the AL2023 EKS-optimized AMI for Kubernetes 1.32 data "aws_ssm_parameter" "eks_al2023_ami" { - name = "/aws/service/eks/optimized-ami/1.32/amazon-linux-2023/x86_64/standard/recommended/image_id" + name = "/aws/service/eks/optimized-ami/1.33/amazon-linux-2023/x86_64/standard/recommended/image_id" } module "eks" { From e577c0e93d9abc3961dedb39b7ef611497d57a11 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 22:07:38 -0500 Subject: [PATCH 27/39] update --- .github/workflows/terraform-destoy.yml | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/terraform-destoy.yml diff --git a/.github/workflows/terraform-destoy.yml b/.github/workflows/terraform-destoy.yml new file mode 100644 index 000000000..e0ec0c284 --- /dev/null +++ b/.github/workflows/terraform-destoy.yml @@ -0,0 +1,38 @@ +name: "Terraform Destroy" + +# Manual trigger only +on: + workflow_dispatch: + +jobs: + terraform-destroy: + name: "Terraform Destroy" + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./terraform # path to your Terraform files + + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: "ca-central-1" # update to your region + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: 1.5.7 + + - name: Terraform Init + run: | + terraform init \ + -backend-config="bucket=${{ secrets.TF_STATE_BUCKET }}" \ + -backend-config="key=terraform.tfstate" \ + -backend-config="region=${{ env.AWS_REGION }}" + + - name: Terraform Destroy + run: terraform destroy -auto-approve -var="environment=${{ github.event.inputs.environment }}" From 3a338c2985e62d11b3fc42ebc1822d59c754e10f Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 22:09:03 -0500 Subject: [PATCH 28/39] update --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index ab81e5900..38ac2fd6f 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -###### \ No newline at end of file +######! \ No newline at end of file From 08be2f85664fd4b2d53601a7d6392778a11ebd58 Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 22:16:44 -0500 Subject: [PATCH 29/39] update --- .github/workflows/terraform-destoy.yml | 38 -------------------------- terraform/eks-cluster.tf | 2 -- terraform/variables.tf | 2 +- 3 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 .github/workflows/terraform-destoy.yml diff --git a/.github/workflows/terraform-destoy.yml b/.github/workflows/terraform-destoy.yml deleted file mode 100644 index e0ec0c284..000000000 --- a/.github/workflows/terraform-destoy.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: "Terraform Destroy" - -# Manual trigger only -on: - workflow_dispatch: - -jobs: - terraform-destroy: - name: "Terraform Destroy" - runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: ./terraform # path to your Terraform files - - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: "ca-central-1" # update to your region - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Setup Terraform - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.5.7 - - - name: Terraform Init - run: | - terraform init \ - -backend-config="bucket=${{ secrets.TF_STATE_BUCKET }}" \ - -backend-config="key=terraform.tfstate" \ - -backend-config="region=${{ env.AWS_REGION }}" - - - name: Terraform Destroy - run: terraform destroy -auto-approve -var="environment=${{ github.event.inputs.environment }}" diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index 5a944a20a..4db418a7c 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -30,7 +30,6 @@ module "eks" { min_size = 1 max_size = 3 desired_size = 2 - wait_for_nodes = false } two = { @@ -41,7 +40,6 @@ module "eks" { min_size = 1 max_size = 2 desired_size = 1 - wait_for_nodes = false } } } diff --git a/terraform/variables.tf b/terraform/variables.tf index 38ac2fd6f..2826fdf3b 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -######! \ No newline at end of file +####### \ No newline at end of file From 8a5e32459175094c136846d21f2768706f7450ee Mon Sep 17 00:00:00 2001 From: hgure Date: Tue, 16 Dec 2025 22:17:59 -0500 Subject: [PATCH 30/39] update --- terraform/eks-cluster.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index 4db418a7c..2ac111e05 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -17,7 +17,7 @@ module "eks" { eks_managed_node_group_defaults = { ami_type = "CUSTOM" ami_id = data.aws_ssm_parameter.eks_al2023_ami.value - + } From 80dac22322dd15056966aa116d639d5892e39ed4 Mon Sep 17 00:00:00 2001 From: hgure Date: Wed, 17 Dec 2025 21:28:30 -0500 Subject: [PATCH 31/39] update --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 2826fdf3b..b7bf365aa 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -####### \ No newline at end of file +######## \ No newline at end of file From 29d5793431e482d33b158158b1679218f7cd5762 Mon Sep 17 00:00:00 2001 From: hgure Date: Wed, 17 Dec 2025 23:01:12 -0500 Subject: [PATCH 32/39] update --- terraform/eks-cluster.tf | 8 +------- terraform/variables.tf | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index 2ac111e05..27ce584e5 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -1,8 +1,3 @@ -# Fetch the AL2023 EKS-optimized AMI for Kubernetes 1.32 -data "aws_ssm_parameter" "eks_al2023_ami" { - name = "/aws/service/eks/optimized-ami/1.33/amazon-linux-2023/x86_64/standard/recommended/image_id" -} - module "eks" { source = "terraform-aws-modules/eks/aws" version = "19.19.1" @@ -15,8 +10,7 @@ module "eks" { cluster_endpoint_public_access = true eks_managed_node_group_defaults = { - ami_type = "CUSTOM" - ami_id = data.aws_ssm_parameter.eks_al2023_ami.value + ami_type = "BOTTLEROCKET_x86_64" } diff --git a/terraform/variables.tf b/terraform/variables.tf index b7bf365aa..62c4b9bca 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -######## \ No newline at end of file +######### \ No newline at end of file From b9a1474bf2c0bcd5d9cff6060dfff66f72da2e6b Mon Sep 17 00:00:00 2001 From: hgure Date: Wed, 17 Dec 2025 23:14:41 -0500 Subject: [PATCH 33/39] update --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 62c4b9bca..f852acae6 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -######### \ No newline at end of file +########## \ No newline at end of file From b8dfd9c106dc35db19790b2b71ccd0c8fad0bc52 Mon Sep 17 00:00:00 2001 From: hgure Date: Wed, 17 Dec 2025 23:16:56 -0500 Subject: [PATCH 34/39] update --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index f852acae6..d1fe75a26 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -########## \ No newline at end of file +########### \ No newline at end of file From 7f918dfbb0cf842d71ea92f442a4b5e27eab21f2 Mon Sep 17 00:00:00 2001 From: hgure Date: Wed, 17 Dec 2025 23:21:56 -0500 Subject: [PATCH 35/39] add fix --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index d1fe75a26..92752169c 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -########### \ No newline at end of file +############ \ No newline at end of file From 6a3e831b0a4fc8f382217b56f7d4d9ef9ee7942f Mon Sep 17 00:00:00 2001 From: hgure Date: Wed, 17 Dec 2025 23:25:23 -0500 Subject: [PATCH 36/39] add fix --- .github/workflows/terraform-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-1.yml b/.github/workflows/terraform-1.yml index 343427f78..3fb8f7714 100644 --- a/.github/workflows/terraform-1.yml +++ b/.github/workflows/terraform-1.yml @@ -19,7 +19,7 @@ env: #Storage for Terraform State BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE }} AWS_REGION: "us-east-1" - EKS_CLUSTER_NAME: "nomadapp-eks" + EKS_CLUSTER_NAME: "nomadops-eks" jobs: terraform: From 3095344bf62d748c3e92ff00a36af226c674c2dc Mon Sep 17 00:00:00 2001 From: hgure Date: Wed, 17 Dec 2025 23:26:32 -0500 Subject: [PATCH 37/39] add fix --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 92752169c..2b9cb6a2d 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -############ \ No newline at end of file +############# \ No newline at end of file From f3ec7a6b2fbeec0df1757faa6213adb6f59fff40 Mon Sep 17 00:00:00 2001 From: hgure Date: Wed, 17 Dec 2025 23:33:50 -0500 Subject: [PATCH 38/39] add destroy workflow --- .github/workflows/terraform-destroy.yml | 49 +++++++++++++++++++++++++ terraform/variables.tf | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/terraform-destroy.yml diff --git a/.github/workflows/terraform-destroy.yml b/.github/workflows/terraform-destroy.yml new file mode 100644 index 000000000..fb1032202 --- /dev/null +++ b/.github/workflows/terraform-destroy.yml @@ -0,0 +1,49 @@ +name: "Nomad IaC Destroy" + +on: + workflow_dispatch: # Allows manual trigger from GitHub Actions + push: + branches: + - main + paths: + - terraform/** + +env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE }} + AWS_REGION: "us-east-1" + +jobs: + terraform-destroy: + name: "Terraform Destroy" + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./terraform + + steps: + - name: "Checkout Repo" + uses: actions/checkout@v4 + + - name: "Setup Terraform" + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "1.6.3" + + - name: "Configure AWS credentials" + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: "Terraform Init" + run: terraform init -backend-config="bucket=${{ env.BUCKET_TF_STATE }}" -input=false + + - name: "Terraform Validate" + run: terraform validate + + - name: "Terraform Destroy" + run: terraform destroy -auto-approve -input=false -parallelism=1 diff --git a/terraform/variables.tf b/terraform/variables.tf index 2b9cb6a2d..4d754a441 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -############# \ No newline at end of file +############## \ No newline at end of file From 1b5d0b8d5b0b9689f35a8ae00adc87d3d042febd Mon Sep 17 00:00:00 2001 From: hgure Date: Sun, 21 Dec 2025 15:59:47 -0500 Subject: [PATCH 39/39] update --- .github/workflows/terraform-destroy.yml | 6 +----- terraform/variables.tf | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/terraform-destroy.yml b/.github/workflows/terraform-destroy.yml index fb1032202..cf341526b 100644 --- a/.github/workflows/terraform-destroy.yml +++ b/.github/workflows/terraform-destroy.yml @@ -2,11 +2,7 @@ name: "Nomad IaC Destroy" on: workflow_dispatch: # Allows manual trigger from GitHub Actions - push: - branches: - - main - paths: - - terraform/** + env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/terraform/variables.tf b/terraform/variables.tf index 4d754a441..7e2330628 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -10,4 +10,4 @@ variable "clusterName" { default = "nomadops-eks" } -############## \ No newline at end of file +############### \ No newline at end of file