From ed2816f5636881bccfc2b1911f10fdef822ab417 Mon Sep 17 00:00:00 2001 From: Tanjimul-Adnan Date: Fri, 10 Apr 2026 12:21:22 +0600 Subject: [PATCH 1/9] modified terraform/terraform.tf --- terraform/terraform.tf | 2 +- terraform/variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 67b75c673..6be29b70d 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -27,7 +27,7 @@ terraform { } backend "s3" { - bucket = "gitopsterrastate" + bucket = "vprofileactions2920" key = "terraform.tfstate" region = "us-east-2" } 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 5ba10fdde55e6b7085510504e680c5845509b5dd Mon Sep 17 00:00:00 2001 From: Tanjimul-Adnan Date: Fri, 10 Apr 2026 14:20:23 +0600 Subject: [PATCH 2/9] staging workflow for terraform --- .github/workflows/terraform.yml | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 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..e5ed173dc --- /dev/null +++ b/.github/workflows/terraform.yml @@ -0,0 +1,53 @@ +name: "Vprofile IAC" +on: + push: + branches: + - main + - stage + paths: + - 'terraform/**' + pull_request: + 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-2 + EKS_CLUSTER: 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 + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: 1.6.3 + - 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 + \ No newline at end of file From b1915e3716470b0de87fbc38a2e6bf07b55a7684 Mon Sep 17 00:00:00 2001 From: Tanjimul-Adnan Date: Fri, 10 Apr 2026 14:24:21 +0600 Subject: [PATCH 3/9] test --- terraform/variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/variables.tf b/terraform/variables.tf index 3e49f4a09..88499465f 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -9,3 +9,4 @@ variable "clusterName" { type = string default = "vprofile-eks" } +## \ No newline at end of file From 609d6950f886ae22a4dbf1a21700b825547b7e31 Mon Sep 17 00:00:00 2001 From: Tanjimul-Adnan Date: Fri, 10 Apr 2026 14:45:39 +0600 Subject: [PATCH 4/9] terraform apply steps included --- .github/workflows/terraform.yml | 19 ++++++++++++++++++- terraform/variables.tf | 1 - 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index e5ed173dc..e02d35215 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -50,4 +50,21 @@ jobs: - name: Terraform plan status if: steps.plan.outcome == 'failure' run: exit 1 - \ No newline at end of file + - name: Terraform apply + id: apply + 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.apply.outcome == 'success' + run: aws eks update-kubeconfig --name $EKS_CLUSTER --region ${{ env.AWS_REGION }} --name $EKS_CLUSTER + + - name: Install Ingress controller + if: steps.apply.outcoome == 'success' && steps.getconfig.outcome == 'success' + run: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.7.0/deploy/static/provider/aws/deploy.yaml \ No newline at end of file diff --git a/terraform/variables.tf b/terraform/variables.tf index 88499465f..3e49f4a09 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -9,4 +9,3 @@ variable "clusterName" { type = string default = "vprofile-eks" } -## \ No newline at end of file From 6c4171e6219ec4456bb9b556ba8f6a332a3ed156 Mon Sep 17 00:00:00 2001 From: Tanjimul-Adnan Date: Fri, 10 Apr 2026 15:05:04 +0600 Subject: [PATCH 5/9] eks cluster versioon renewed --- 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..ece3e5a2d 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.34" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets From 39334f9acdaf0c61c916666740b3be766d2ffafa Mon Sep 17 00:00:00 2001 From: Tanjimul-Adnan <74046569+Tanjimul-Adnan@users.noreply.github.com> Date: Fri, 10 Apr 2026 15:23:33 +0600 Subject: [PATCH 6/9] Update AMI type for EKS managed 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 ece3e5a2d..4ae8460f1 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 ea900c02073f4f662cbfb493a0ccfcb01c303866 Mon Sep 17 00:00:00 2001 From: Tanjimul-Adnan <74046569+Tanjimul-Adnan@users.noreply.github.com> Date: Fri, 10 Apr 2026 15:57:22 +0600 Subject: [PATCH 7/9] Update AWS provider version to 5.40.0 --- terraform/terraform.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 6be29b70d..ec8b29fa1 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -2,7 +2,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 5.25.0" + version = "~> 5.40.0" } random = { From 9063ebdf0a8c09429c90e53b337fd9ff4b8a8939 Mon Sep 17 00:00:00 2001 From: Tanjimul-Adnan <74046569+Tanjimul-Adnan@users.noreply.github.com> Date: Fri, 10 Apr 2026 19:24:04 +0600 Subject: [PATCH 8/9] Update terraform.yml --- .github/workflows/terraform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index e02d35215..f602d5433 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -66,5 +66,5 @@ jobs: run: aws eks update-kubeconfig --name $EKS_CLUSTER --region ${{ env.AWS_REGION }} --name $EKS_CLUSTER - name: Install Ingress controller - if: steps.apply.outcoome == 'success' && steps.getconfig.outcome == 'success' - run: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.7.0/deploy/static/provider/aws/deploy.yaml \ No newline at end of file + if: steps.apply.outcome == 'success' && steps.getconfig.outcome == 'success' + run: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.7.0/deploy/static/provider/aws/deploy.yaml From 0fe3070eb702ca442fdf79e641995252083c3aef Mon Sep 17 00:00:00 2001 From: Tanjimul-Adnan Date: Fri, 10 Apr 2026 19:32:56 +0600 Subject: [PATCH 9/9] some changes --- terraform/terraform.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index ec8b29fa1..761debd3e 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -36,4 +36,4 @@ terraform { } ## ## -## +####