From 1187d6dae13a82fc6780bb9eed392aa3bc9fa04f Mon Sep 17 00:00:00 2001 From: Rahul94827 Date: Fri, 9 Jan 2026 11:56:41 +0530 Subject: [PATCH 1/9] stagging workflow --- terraform/terraform.tf | 4 ++-- terraform/variables.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 67b75c673..af2114e44 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -27,9 +27,9 @@ terraform { } backend "s3" { - bucket = "gitopsterrastate" + bucket = "vprofileactions25323" key = "terraform.tfstate" - region = "us-east-2" + region = "us-east-1" } required_version = "~> 1.6.3" diff --git a/terraform/variables.tf b/terraform/variables.tf index a41d982a0..3e49f4a09 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -7,5 +7,5 @@ variable "region" { variable "clusterName" { description = "Name of the EKS cluster" type = string - default = "kitops-eks" + default = "vprofile-eks" } From b7f75ce9b74801776529e57907028d6329c35cd0 Mon Sep 17 00:00:00 2001 From: Rahul94827 Date: Fri, 9 Jan 2026 11:58:23 +0530 Subject: [PATCH 2/9] Stagging Workflow --- .github/workflows/terraform.yml | 62 +++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/terraform.yml diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml new file mode 100644 index 000000000..08f5aa4a3 --- /dev/null +++ b/.github/workflows/terraform.yml @@ -0,0 +1,62 @@ +name: "Vprofile IAC" +on: + push: + branches: + - main + - stage + paths: + - terraform/** + pull_request: + branches: + - main + - stage + 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 + EKS_CLUSTER_NAME: vprofile-eks + +jobs: + terraform: + name: "Apply terraform code changes" + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./terraform + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Setup Terraform with specified version + uses: hashicorp/setup-terraform@v2 + + - name: Terraform Init + id: init + run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" + + - name: Terraform 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 planfile + continue-on-error: true + + - name: Terraform plan status + if: steps.plan.outcome == 'failure' + run: exit 1 + + + From ddb79ff236e5385dfac38de97255b16758ec986a Mon Sep 17 00:00:00 2001 From: Rahul94827 Date: Fri, 9 Jan 2026 12:20:39 +0530 Subject: [PATCH 3/9] fixed code --- .github/workflows/terraform.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 08f5aa4a3..0c1beb2c1 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -12,7 +12,9 @@ on: - stage paths: - terraform/** - +permissions: + contents: read + env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -36,6 +38,8 @@ jobs: - name: Setup Terraform with specified version uses: hashicorp/setup-terraform@v2 + with: + terraform_version: 1.6.6 - name: Terraform Init id: init From 1020234c104ef935790153a55dcccbc4e75ed06a Mon Sep 17 00:00:00 2001 From: Rahul94827 Date: Fri, 9 Jan 2026 12:29:59 +0530 Subject: [PATCH 4/9] Test workflow --- terraform/variables.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform/variables.tf b/terraform/variables.tf index 3e49f4a09..c4845c671 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -9,3 +9,5 @@ variable "clusterName" { type = string default = "vprofile-eks" } + +## From 01cb16163ac5745fafaa6a9c668f58bc78e602d5 Mon Sep 17 00:00:00 2001 From: Rahul94827 Date: Fri, 9 Jan 2026 12:42:26 +0530 Subject: [PATCH 5/9] terraform apply steps included --- .github/workflows/terraform.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 0c1beb2c1..bb4535052 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -14,7 +14,7 @@ on: - terraform/** permissions: contents: read - + env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -62,5 +62,25 @@ jobs: if: steps.plan.outcome == 'failure' run: exit 1 + - 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@v1 + 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.14.1/deploy/static/provider/aws/deploy.yaml From 3e424f6f7e23f632753b23bdf5ded93ed83deb52 Mon Sep 17 00:00:00 2001 From: Rahul94827 Date: Fri, 9 Jan 2026 12:43:15 +0530 Subject: [PATCH 6/9] Stage-test --- terraform/variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/variables.tf b/terraform/variables.tf index c4845c671..9c3cd407f 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -11,3 +11,4 @@ variable "clusterName" { } ## +###### From d8a0570cf3762e199d59bb6267704e9e2be602cd Mon Sep 17 00:00:00 2001 From: Rahul94827 Date: Fri, 9 Jan 2026 12:58:41 +0530 Subject: [PATCH 7/9] Updated EKS version --- terraform/eks-cluster.tf | 2 +- terraform/variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index 2c4610920..755d4fe15 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.29" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets diff --git a/terraform/variables.tf b/terraform/variables.tf index 9c3cd407f..4566c4c7c 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,7 +1,7 @@ variable "region" { description = "AWS region" type = string - default = "us-east-2" + default = "us-east-1" } variable "clusterName" { From 38b090623d375f49313cf158f3c19551bf03b364 Mon Sep 17 00:00:00 2001 From: Rahul94827 Date: Fri, 9 Jan 2026 13:01:06 +0530 Subject: [PATCH 8/9] Updated 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 755d4fe15..ca3efe718 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.29" + cluster_version = "1.28" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets From 0b2173c4987e8d9f0c8f6522b01559e41545dd7d Mon Sep 17 00:00:00 2001 From: Rahul94827 Date: Fri, 9 Jan 2026 13:05:00 +0530 Subject: [PATCH 9/9] Updated 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 ca3efe718..755d4fe15 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.28" + cluster_version = "1.29" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets