From 05cfb9d917a39bf36eb2e6fe0f7f2d864a81063c Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 20:35:24 +0530 Subject: [PATCH 01/35] Fixing Terraform syntax errors --- .github/workflows/terrafrom.yml | 61 +++++++++++++++++++++++++++++++++ terraform/terraform.tf | 8 +++-- terraform/variables.tf | 12 +++++-- 3 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/terrafrom.yml diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml new file mode 100644 index 000000000..601706538 --- /dev/null +++ b/.github/workflows/terrafrom.yml @@ -0,0 +1,61 @@ +name: "Vprofile IAC" +on: + push: + branches: + - main + - stage + paths: + - terraform/** + pull_request: + branches: + - main + paths: + - terraform/** + +env: + # Credentials for deployment to AWS + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # S3 bucket for the Terraform state + 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 with specified version on the runner + 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 diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 67b75c673..7d5033ac0 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -27,9 +27,13 @@ terraform { } backend "s3" { - bucket = "gitopsterrastate" + bucket = "gitops2003" key = "terraform.tfstate" - region = "us-east-2" +<<<<<<< HEAD + region = "us-east-1" +======= + region = "us-east-1" +>>>>>>> e8d4b8d (Initial commit - added Terraform configurations and GitHub Actions workflow) } required_version = "~> 1.6.3" diff --git a/terraform/variables.tf b/terraform/variables.tf index a41d982a0..f09d82d49 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,11 +1,19 @@ variable "region" { description = "AWS region" type = string - default = "us-east-2" +<<<<<<< HEAD + default = "us-east-1" +======= + default = "us-east-1" +>>>>>>> e8d4b8d (Initial commit - added Terraform configurations and GitHub Actions workflow) } variable "clusterName" { description = "Name of the EKS cluster" type = string - default = "kitops-eks" +<<<<<<< HEAD + default = "Vprofile-eks" +======= + default = "Vprofile-eks" +>>>>>>> e8d4b8d (Initial commit - added Terraform configurations and GitHub Actions workflow) } From ed9792d18964e6470c8149bdc628b5722c23d612 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 20:46:58 +0530 Subject: [PATCH 02/35] fix error --- terraform/terraform.tf | 4 ---- terraform/variables.tf | 8 -------- 2 files changed, 12 deletions(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 7d5033ac0..46ef7fc02 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -29,11 +29,7 @@ terraform { backend "s3" { bucket = "gitops2003" key = "terraform.tfstate" -<<<<<<< HEAD region = "us-east-1" -======= - region = "us-east-1" ->>>>>>> e8d4b8d (Initial commit - added Terraform configurations and GitHub Actions workflow) } required_version = "~> 1.6.3" diff --git a/terraform/variables.tf b/terraform/variables.tf index f09d82d49..5dd162c8a 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,19 +1,11 @@ variable "region" { description = "AWS region" type = string -<<<<<<< HEAD default = "us-east-1" -======= - default = "us-east-1" ->>>>>>> e8d4b8d (Initial commit - added Terraform configurations and GitHub Actions workflow) } variable "clusterName" { description = "Name of the EKS cluster" type = string -<<<<<<< HEAD - default = "Vprofile-eks" -======= default = "Vprofile-eks" ->>>>>>> e8d4b8d (Initial commit - added Terraform configurations and GitHub Actions workflow) } From 38e0994c4dfa1b0b834c35fcb8ef3dced6bdf000 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 20:57:29 +0530 Subject: [PATCH 03/35] fix it --- .github/workflows/terrafrom.yml | 88 ++++++++++++++++----------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 601706538..b0d997e49 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -13,49 +13,49 @@ on: - terraform/** env: - # Credentials for deployment to AWS - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # S3 bucket for the Terraform state - BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} - AWS_REGION: us-east-2 - EKS_CLUSTER: vprofile-eks + # Credentials for deployment to AWS + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # S3 bucket for the Terraform state + BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE }} + AWS_REGION: us-east-1 + 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 with specified version on the runner - 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 + 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 on the runner + 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 76048b498a10da0acff9eb1698e50b1b3befe193 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 21:12:06 +0530 Subject: [PATCH 04/35] fix --- .github/workflows/terrafrom.yml | 55 ++++++++++++++++----------------- terraform/terraform.tf | 49 +++++++++++++---------------- 2 files changed, 48 insertions(+), 56 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index b0d997e49..92ddcadce 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -4,7 +4,7 @@ on: branches: - main - stage - paths: + paths: - terraform/** pull_request: branches: @@ -13,49 +13,48 @@ on: - terraform/** env: - # Credentials for deployment to AWS - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # S3 bucket for the Terraform state - BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE }} - AWS_REGION: us-east-1 - EKS_CLUSTER: vprofile-eks + TF_VERSION: "1.6.3" + AWS_REGION: "us-east-1" jobs: terraform: - name: "Apply terraform code changes" - runs-on: ubuntu-latest + name: "Terraform CI" + runs-on: ubuntu-22.04 + permissions: + contents: read + id-token: write + defaults: run: - shell: bash working-directory: ./terraform steps: - - name: Checkout source code + - name: Checkout code uses: actions/checkout@v4 - - name: Setup Terraform with specified version on the runner - uses: hashicorp/setup-terraform@v2 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + aws-region: ${{ env.AWS_REGION }} + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3 with: - terraform_version: 1.6.3 + terraform_version: ${{ env.TF_VERSION }} + terraform_wrapper: false + + - name: Verify Terraform Version + run: terraform version - name: Terraform Init - id: init - run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" + run: terraform init - name: Terraform Format - id: fmt - run: terraform fmt -check + run: terraform fmt -check -recursive - name: Terraform Validate - id: validate - run: terraform validate + run: terraform validate -no-color - 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 + run: terraform plan -input=false -no-color \ No newline at end of file diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 46ef7fc02..79d7c82c5 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -1,39 +1,32 @@ terraform { + required_version = "= 1.6.3" # Exact version match + + backend "s3" { + bucket = "gitops2003" + key = "terraform.tfstate" + region = "us-east-1" + encrypt = true + dynamodb_table = "terraform-lock" # Recommended for state locking + } + required_providers { aws = { source = "hashicorp/aws" - version = "~> 5.25.0" - } - - random = { - source = "hashicorp/random" - version = "~> 3.5.1" - } - - tls = { - source = "hashicorp/tls" - version = "~> 4.0.4" + version = "5.31.0" # Pinned version for AWS provider } - - cloudinit = { - source = "hashicorp/cloudinit" - version = "~> 2.3.2" - } - kubernetes = { source = "hashicorp/kubernetes" - version = "~> 2.23.0" + version = "2.23.0" # Pinned version for Kubernetes provider } } +} - backend "s3" { - bucket = "gitops2003" - key = "terraform.tfstate" - region = "us-east-1" +provider "aws" { + region = "us-east-1" + default_tags { + tags = { + Environment = "stage" + ManagedBy = "terraform" + } } - - required_version = "~> 1.6.3" -} -## -## -## +} \ No newline at end of file From 356d0701551560f0811dc4f7beff33df2410d2ad Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 21:32:14 +0530 Subject: [PATCH 05/35] fix code --- .github/workflows/terrafrom.yml | 39 ++++++++++++++++----------------- terraform/terraform.tf | 16 +++----------- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 92ddcadce..e80372304 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -13,48 +13,47 @@ on: - terraform/** env: - TF_VERSION: "1.6.3" + TF_VERSION: "1.6.3" # Explicit version control AWS_REGION: "us-east-1" jobs: terraform: name: "Terraform CI" - runs-on: ubuntu-22.04 + runs-on: ubuntu-22.04 # Specific runner version permissions: contents: read id-token: write - defaults: - run: - working-directory: ./terraform - steps: - name: Checkout code uses: actions/checkout@v4 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: ${{ env.AWS_REGION }} + # First remove any pre-installed Terraform + - name: Remove system Terraform + run: | + sudo rm -rf /usr/local/bin/terraform + sudo rm -rf /opt/hostedtoolcache/terraform - - name: Setup Terraform + # Then install exact version + - name: Install exact Terraform version uses: hashicorp/setup-terraform@v3 with: terraform_version: ${{ env.TF_VERSION }} - terraform_wrapper: false + terraform_wrapper: false # Critical to prevent version conflicts - - name: Verify Terraform Version - run: terraform version + - name: Verify Terraform version + run: | + terraform version + if ! terraform version | grep -q "Terraform v${{ env.TF_VERSION }}"; then + echo "Terraform version mismatch!" + exit 1 + fi - name: Terraform Init run: terraform init - - name: Terraform Format - run: terraform fmt -check -recursive - - name: Terraform Validate - run: terraform validate -no-color + run: terraform validate - name: Terraform Plan - run: terraform plan -input=false -no-color \ No newline at end of file + run: terraform plan \ No newline at end of file diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 79d7c82c5..fc0037f72 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -1,5 +1,5 @@ terraform { - required_version = "= 1.6.3" # Exact version match + required_version = "= 1.6.3" # MUST use exact version match backend "s3" { bucket = "gitops2003" @@ -12,21 +12,11 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "5.31.0" # Pinned version for AWS provider + version = "5.31.0" # Pinned version known to work with TF 1.6.3 } kubernetes = { source = "hashicorp/kubernetes" - version = "2.23.0" # Pinned version for Kubernetes provider - } - } -} - -provider "aws" { - region = "us-east-1" - default_tags { - tags = { - Environment = "stage" - ManagedBy = "terraform" + version = "2.23.0" } } } \ No newline at end of file From 9d4a6f2a3e43092e2c7ea0c815f03fff0916f81e Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 21:39:44 +0530 Subject: [PATCH 06/35] fix the committed --- .github/workflows/terrafrom.yml | 88 +++++++++++++++++---------------- terraform/terraform.tf | 43 +++++++++++----- 2 files changed, 75 insertions(+), 56 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index e80372304..d71d5e212 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -4,7 +4,7 @@ on: branches: - main - stage - paths: + paths: - terraform/** pull_request: branches: @@ -13,47 +13,49 @@ on: - terraform/** env: - TF_VERSION: "1.6.3" # Explicit version control - AWS_REGION: "us-east-1" + # Credentials for deployment to AWS + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # S3 bucket for the Terraform state + BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} + AWS_REGION: us-east-1 + EKS_CLUSTER: vprofile-eks jobs: - terraform: - name: "Terraform CI" - runs-on: ubuntu-22.04 # Specific runner version - permissions: - contents: read - id-token: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # First remove any pre-installed Terraform - - name: Remove system Terraform - run: | - sudo rm -rf /usr/local/bin/terraform - sudo rm -rf /opt/hostedtoolcache/terraform - - # Then install exact version - - name: Install exact Terraform version - uses: hashicorp/setup-terraform@v3 - with: - terraform_version: ${{ env.TF_VERSION }} - terraform_wrapper: false # Critical to prevent version conflicts - - - name: Verify Terraform version - run: | - terraform version - if ! terraform version | grep -q "Terraform v${{ env.TF_VERSION }}"; then - echo "Terraform version mismatch!" - exit 1 - fi - - - name: Terraform Init - run: terraform init - - - name: Terraform Validate - run: terraform validate - - - name: Terraform Plan - run: terraform plan \ No newline at end of file + 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 on the runner + 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 diff --git a/terraform/terraform.tf b/terraform/terraform.tf index fc0037f72..46ef7fc02 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -1,22 +1,39 @@ terraform { - required_version = "= 1.6.3" # MUST use exact version match - - backend "s3" { - bucket = "gitops2003" - key = "terraform.tfstate" - region = "us-east-1" - encrypt = true - dynamodb_table = "terraform-lock" # Recommended for state locking - } - required_providers { aws = { source = "hashicorp/aws" - version = "5.31.0" # Pinned version known to work with TF 1.6.3 + version = "~> 5.25.0" + } + + random = { + source = "hashicorp/random" + version = "~> 3.5.1" + } + + tls = { + source = "hashicorp/tls" + version = "~> 4.0.4" } + + cloudinit = { + source = "hashicorp/cloudinit" + version = "~> 2.3.2" + } + kubernetes = { source = "hashicorp/kubernetes" - version = "2.23.0" + version = "~> 2.23.0" } } -} \ No newline at end of file + + backend "s3" { + bucket = "gitops2003" + key = "terraform.tfstate" + region = "us-east-1" + } + + required_version = "~> 1.6.3" +} +## +## +## From 73adfb9a5fb812fc5c8744961c925e77f4765e35 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 21:46:34 +0530 Subject: [PATCH 07/35] test --- terraform/variables.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/terraform/variables.tf b/terraform/variables.tf index 5dd162c8a..3eff71fdc 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -9,3 +9,6 @@ variable "clusterName" { type = string default = "Vprofile-eks" } + + +## \ No newline at end of file From 57a15b2ff855b02f6a3aec20b9fd7a21113479fb Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 22:04:10 +0530 Subject: [PATCH 08/35] fix code --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 3eff71fdc..c7929608a 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -7,7 +7,7 @@ variable "region" { variable "clusterName" { description = "Name of the EKS cluster" type = string - default = "Vprofile-eks" + default = "vprofile-eks" } From 42033e77803906d535cb7555fff88b2e2836a3e7 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 22:39:44 +0530 Subject: [PATCH 09/35] Fix: Set Terraform version to 1.6.3 in GitHub Actions --- .github/workflows/terrafrom.yml | 71 +++++++-------------------------- 1 file changed, 15 insertions(+), 56 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index d71d5e212..c98f8b062 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -1,61 +1,20 @@ -name: "Vprofile IAC" -on: - push: - branches: - - main - - stage - paths: - - terraform/** - pull_request: - branches: - - main - paths: - - terraform/** - -env: - # Credentials for deployment to AWS - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # S3 bucket for the Terraform state - BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} - AWS_REGION: us-east-1 - 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 with specified version on the runner - 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" + terraform: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 - - name: Terraform format - id: fmt - run: terraform fmt -check + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.6.3 # Set the correct version - - name: Terraform validate - id: validate - run: terraform validate + - name: Terraform Init + run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" - - name: Terraform plan - id: plan - run: terraform plan -no-color -input=false -out planfile - continue-on-error: true + - name: Terraform Plan + run: terraform plan - - name: Terraform plan status - if: steps.plan.outcome == 'failure' - run: exit 1 + - name: Terraform Apply + run: terraform apply -auto-approve From 1fe3ed338a2835c8d4d563e06f13c502d93c1502 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 23:02:50 +0530 Subject: [PATCH 10/35] fix the error --- .github/workflows/terrafrom.yml | 28 +++++++++++++++++++++------- terraform/terraform.tf | 1 + 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index c98f8b062..d358a6a4f 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -1,20 +1,34 @@ +name: Terraform CI/CD + +on: + push: + branches: + - main + pull_request: + branches: + - main + jobs: terraform: runs-on: ubuntu-latest + steps: - - name: Checkout code + - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Terraform + - name: Install Terraform 1.11.3 uses: hashicorp/setup-terraform@v3 with: - terraform_version: 1.6.3 # Set the correct version + terraform_version: 1.11.3 # Ensure correct version - - name: Terraform Init + - name: Verify Terraform version + run: terraform --version # Check that GitHub is using 1.11.3 + + - name: Initialize Terraform run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" + - name: Validate Terraform + run: terraform validate + - name: Terraform Plan run: terraform plan - - - name: Terraform Apply - run: terraform apply -auto-approve diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 46ef7fc02..f52d69cbe 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -33,6 +33,7 @@ terraform { } required_version = "~> 1.6.3" + } ## ## From c93e9e59204ab0b5289336e24c5dab65507fc806 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 23:08:38 +0530 Subject: [PATCH 11/35] fix the code --- .github/workflows/terrafrom.yml | 6 +++--- terraform/terraform.tf | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index d358a6a4f..53893e90a 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -16,13 +16,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Install Terraform 1.11.3 + - name: Install Terraform 1.6.3 uses: hashicorp/setup-terraform@v3 with: - terraform_version: 1.11.3 # Ensure correct version + terraform_version: 1.6.3 # Match required version - name: Verify Terraform version - run: terraform --version # Check that GitHub is using 1.11.3 + run: terraform --version # Check that GitHub is using 1.6.3 - name: Initialize Terraform run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" diff --git a/terraform/terraform.tf b/terraform/terraform.tf index f52d69cbe..b0707a59f 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -32,7 +32,8 @@ terraform { region = "us-east-1" } - required_version = "~> 1.6.3" + required_version = ">= 1.6.3" + } ## From a52a19eefda117db74ea4cc89bdcf91ea4eaf590 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 23:11:50 +0530 Subject: [PATCH 12/35] other error --- .github/workflows/terrafrom.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 53893e90a..0ba0a2a53 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -19,10 +19,10 @@ jobs: - name: Install Terraform 1.6.3 uses: hashicorp/setup-terraform@v3 with: - terraform_version: 1.6.3 # Match required version + terraform_version: 1.6.3 # Make sure GitHub Actions uses 1.6.3 - name: Verify Terraform version - run: terraform --version # Check that GitHub is using 1.6.3 + run: terraform --version # This should now show 1.6.3 - name: Initialize Terraform run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" From 9888b286a5c7de92749475385a9a0bea5e823532 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Wed, 2 Apr 2025 23:17:45 +0530 Subject: [PATCH 13/35] fixnext --- .github/workflows/terrafrom.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 0ba0a2a53..24e797a65 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -16,13 +16,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Remove Pre-installed Terraform (if any) + run: sudo rm -f $(which terraform) || true + - name: Install Terraform 1.6.3 uses: hashicorp/setup-terraform@v3 with: - terraform_version: 1.6.3 # Make sure GitHub Actions uses 1.6.3 + terraform_version: 1.6.3 # Ensure GitHub Actions installs 1.6.3 - name: Verify Terraform version - run: terraform --version # This should now show 1.6.3 + run: terraform --version # Ensure the correct version is installed - name: Initialize Terraform run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" From 09ca4e2dfff5aaa0249fd59df5191c491bd61ee5 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 12:45:59 +0530 Subject: [PATCH 14/35] now done --- .github/workflows/terrafrom.yml | 80 +++++++++++++++++++++------------ terraform/terraform.tf | 2 +- 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 24e797a65..601706538 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -1,37 +1,61 @@ -name: Terraform CI/CD - +name: "Vprofile IAC" on: push: branches: - main + - stage + paths: + - terraform/** pull_request: branches: - main + paths: + - terraform/** + +env: + # Credentials for deployment to AWS + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # S3 bucket for the Terraform state + BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} + AWS_REGION: us-east-2 + EKS_CLUSTER: vprofile-eks jobs: - terraform: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Remove Pre-installed Terraform (if any) - run: sudo rm -f $(which terraform) || true - - - name: Install Terraform 1.6.3 - uses: hashicorp/setup-terraform@v3 - with: - terraform_version: 1.6.3 # Ensure GitHub Actions installs 1.6.3 - - - name: Verify Terraform version - run: terraform --version # Ensure the correct version is installed - - - name: Initialize Terraform - run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" - - - name: Validate Terraform - run: terraform validate - - - name: Terraform Plan - run: terraform plan + 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 on the runner + 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 diff --git a/terraform/terraform.tf b/terraform/terraform.tf index b0707a59f..5c48bbd4f 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -32,7 +32,7 @@ terraform { region = "us-east-1" } - required_version = ">= 1.6.3" + required_version = "= 1.11.3" } From 7ef41f91e027a59222d3afd981adafe7d7d01b46 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 12:48:53 +0530 Subject: [PATCH 15/35] fixed --- terraform/terraform.tf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 5c48bbd4f..ecd3654dc 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -31,9 +31,8 @@ terraform { key = "terraform.tfstate" region = "us-east-1" } - - required_version = "= 1.11.3" - + + required_version = ">= 1.6.3, <= 1.11.3" } ## From 001ebe075e07105155db9f6ecff4ad6cc095dbee Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 12:52:28 +0530 Subject: [PATCH 16/35] Formatted terraform.tf using terraform fmt --- terraform/terraform.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index ecd3654dc..d08db4c5c 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -31,7 +31,7 @@ terraform { key = "terraform.tfstate" region = "us-east-1" } - + required_version = ">= 1.6.3, <= 1.11.3" } From b9ee94704cb20db35e7f3bb2ca490e427bc412d3 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 13:03:18 +0530 Subject: [PATCH 17/35] fix now --- .github/workflows/terrafrom.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 601706538..d71d5e212 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -18,7 +18,7 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # S3 bucket for the Terraform state BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} - AWS_REGION: us-east-2 + AWS_REGION: us-east-1 EKS_CLUSTER: vprofile-eks jobs: From 72a00e701330110cb2e5e9dc77e938899fe91857 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 13:16:52 +0530 Subject: [PATCH 18/35] fix the code --- .github/workflows/terrafrom.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index d71d5e212..b1d15d18e 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -33,6 +33,8 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup Terraform with specified version on the runner uses: hashicorp/setup-terraform@v2 From d7f4344567fb839ac3c0d626a971eb926e6aaab7 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 13:18:05 +0530 Subject: [PATCH 19/35] run the code --- .github/workflows/terrafrom.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index b1d15d18e..d71d5e212 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -33,8 +33,6 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Setup Terraform with specified version on the runner uses: hashicorp/setup-terraform@v2 From 9557cd1b8f510813a35ede32f53b06c8f577a860 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 15:52:03 +0530 Subject: [PATCH 20/35] comiit From 45d2958c2a16da8ce38437bd19edebc5da38a1ec Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 16:00:35 +0530 Subject: [PATCH 21/35] fix the committed --- terraform/eks-cluster.tf | 46 ++++++++++++---------------------------- terraform/main.tf | 13 +----------- terraform/outputs.tf | 21 ++++-------------- terraform/variables.tf | 19 +++++++++-------- 4 files changed, 29 insertions(+), 70 deletions(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index 2c4610920..b9a6d6dde 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -1,38 +1,20 @@ module "eks" { - source = "terraform-aws-modules/eks/aws" - version = "19.19.1" - - cluster_name = local.cluster_name + source = "terraform-aws-modules/eks/aws" + cluster_name = var.cluster_name cluster_version = "1.27" - vpc_id = module.vpc.vpc_id - subnet_ids = module.vpc.private_subnets - cluster_endpoint_public_access = true - - eks_managed_node_group_defaults = { - ami_type = "AL2_x86_64" - - } - - eks_managed_node_groups = { - one = { - name = "node-group-1" + vpc_id = var.vpc_id + subnet_ids = var.subnet_ids - instance_types = ["t3.small"] - - min_size = 1 - max_size = 3 - desired_size = 2 - } - - two = { - name = "node-group-2" - - instance_types = ["t3.small"] + cluster_encryption_config = [{ + provider_key_arn = module.kms.key_arn + resources = ["secrets"] + }] +} - min_size = 1 - max_size = 2 - desired_size = 1 - } - } +module "kms" { + source = "terraform-aws-modules/kms/aws" + description = "KMS key for EKS" + enable_key_rotation = true + deletion_window_in_days = 10 } diff --git a/terraform/main.tf b/terraform/main.tf index 94b6fc75a..721b97b4c 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -1,16 +1,5 @@ provider "kubernetes" { host = module.eks.cluster_endpoint - cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data) + cluster_ca_certificate = module.eks.cluster_certificate_authority_data } -provider "aws" { - region = var.region -} - -data "aws_availability_zones" "available" {} - -locals { - cluster_name = var.clusterName -} - -## \ No newline at end of file diff --git a/terraform/outputs.tf b/terraform/outputs.tf index 7d55c64ae..e37c0b7a7 100644 --- a/terraform/outputs.tf +++ b/terraform/outputs.tf @@ -1,20 +1,7 @@ -output "cluster_name" { - description = "Amazon Web Service EKS Cluster Name" - value = module.eks.cluster_name +output "eks_cluster_id" { + value = module.eks.cluster_id } -output "cluster_endpoint" { - description = "Endpoint for Amazon Web Service EKS " - value = module.eks.cluster_endpoint -} - -output "region" { - description = "Amazon Web Service EKS Cluster region" - value = var.region -} - - -output "cluster_security_group_id" { - description = "Security group ID for the Amazon Web Service EKS Cluster " - value = module.eks.cluster_security_group_id +output "kms_key_arn" { + value = module.kms.key_arn } diff --git a/terraform/variables.tf b/terraform/variables.tf index c7929608a..42051bb00 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,14 +1,15 @@ -variable "region" { - description = "AWS region" +variable "vpc_id" { + description = "VPC ID where the cluster will be deployed" type = string - default = "us-east-1" } -variable "clusterName" { - description = "Name of the EKS cluster" - type = string - default = "vprofile-eks" +variable "subnet_ids" { + description = "List of subnet IDs for the EKS cluster" + type = list(string) } - -## \ No newline at end of file +variable "cluster_name" { + description = "EKS Cluster name" + type = string + default = "my-eks-cluster" +} From 3c692a1be0a5ef72a9fab3def71a1e7a0f8ad47b Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 16:05:38 +0530 Subject: [PATCH 22/35] correct the code --- terraform/eks-cluster.tf | 46 ++++++++++++++++++++++++++++------------ terraform/main.tf | 13 +++++++++++- terraform/outputs.tf | 21 ++++++++++++++---- terraform/terraform.tf | 2 +- terraform/variables.tf | 19 ++++++++--------- 5 files changed, 71 insertions(+), 30 deletions(-) diff --git a/terraform/eks-cluster.tf b/terraform/eks-cluster.tf index b9a6d6dde..2c4610920 100644 --- a/terraform/eks-cluster.tf +++ b/terraform/eks-cluster.tf @@ -1,20 +1,38 @@ module "eks" { - source = "terraform-aws-modules/eks/aws" - cluster_name = var.cluster_name + source = "terraform-aws-modules/eks/aws" + version = "19.19.1" + + cluster_name = local.cluster_name cluster_version = "1.27" - vpc_id = var.vpc_id - subnet_ids = var.subnet_ids + vpc_id = module.vpc.vpc_id + subnet_ids = module.vpc.private_subnets + cluster_endpoint_public_access = true - cluster_encryption_config = [{ - provider_key_arn = module.kms.key_arn - resources = ["secrets"] - }] -} + eks_managed_node_group_defaults = { + ami_type = "AL2_x86_64" + + } + + eks_managed_node_groups = { + one = { + name = "node-group-1" + + instance_types = ["t3.small"] + + min_size = 1 + max_size = 3 + desired_size = 2 + } + + two = { + name = "node-group-2" + + instance_types = ["t3.small"] -module "kms" { - source = "terraform-aws-modules/kms/aws" - description = "KMS key for EKS" - enable_key_rotation = true - deletion_window_in_days = 10 + min_size = 1 + max_size = 2 + desired_size = 1 + } + } } diff --git a/terraform/main.tf b/terraform/main.tf index 721b97b4c..94b6fc75a 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -1,5 +1,16 @@ provider "kubernetes" { host = module.eks.cluster_endpoint - cluster_ca_certificate = module.eks.cluster_certificate_authority_data + cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data) } +provider "aws" { + region = var.region +} + +data "aws_availability_zones" "available" {} + +locals { + cluster_name = var.clusterName +} + +## \ No newline at end of file diff --git a/terraform/outputs.tf b/terraform/outputs.tf index e37c0b7a7..7d55c64ae 100644 --- a/terraform/outputs.tf +++ b/terraform/outputs.tf @@ -1,7 +1,20 @@ -output "eks_cluster_id" { - value = module.eks.cluster_id +output "cluster_name" { + description = "Amazon Web Service EKS Cluster Name" + value = module.eks.cluster_name } -output "kms_key_arn" { - value = module.kms.key_arn +output "cluster_endpoint" { + description = "Endpoint for Amazon Web Service EKS " + value = module.eks.cluster_endpoint +} + +output "region" { + description = "Amazon Web Service EKS Cluster region" + value = var.region +} + + +output "cluster_security_group_id" { + description = "Security group ID for the Amazon Web Service EKS Cluster " + value = module.eks.cluster_security_group_id } diff --git a/terraform/terraform.tf b/terraform/terraform.tf index d08db4c5c..cb4f5cff6 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -32,8 +32,8 @@ terraform { region = "us-east-1" } + required_version = ">= 1.6.3, <= 1.11.3" - } ## ## diff --git a/terraform/variables.tf b/terraform/variables.tf index 42051bb00..c7929608a 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,15 +1,14 @@ -variable "vpc_id" { - description = "VPC ID where the cluster will be deployed" +variable "region" { + description = "AWS region" type = string + default = "us-east-1" } -variable "subnet_ids" { - description = "List of subnet IDs for the EKS cluster" - type = list(string) -} - -variable "cluster_name" { - description = "EKS Cluster name" +variable "clusterName" { + description = "Name of the EKS cluster" type = string - default = "my-eks-cluster" + default = "vprofile-eks" } + + +## \ No newline at end of file From c0eb02d0ba9d59e07099e2e58e84efefbca2ca30 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 16:13:50 +0530 Subject: [PATCH 23/35] check the code --- terraform/terraform.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index cb4f5cff6..cc1ecd97b 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -31,10 +31,10 @@ terraform { key = "terraform.tfstate" region = "us-east-1" } - - required_version = ">= 1.6.3, <= 1.11.3" } + + ## ## ## From 7e31b0d347f436bbc88d3908c4b90719e1368495 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 16:26:38 +0530 Subject: [PATCH 24/35] now correct --- terraform/terraform.tf | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index cc1ecd97b..f806dc4c9 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -4,22 +4,18 @@ terraform { source = "hashicorp/aws" version = "~> 5.25.0" } - random = { source = "hashicorp/random" version = "~> 3.5.1" } - tls = { source = "hashicorp/tls" version = "~> 4.0.4" } - cloudinit = { source = "hashicorp/cloudinit" version = "~> 2.3.2" } - kubernetes = { source = "hashicorp/kubernetes" version = "~> 2.23.0" @@ -31,10 +27,6 @@ terraform { key = "terraform.tfstate" region = "us-east-1" } - required_version = ">= 1.6.3, <= 1.11.3" -} - -## -## -## + required_version = ">=1.6.3, <=1.11.3" +} From 338470548b5a7abe4bc6bab7a499a7ddd347c60b Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Thu, 3 Apr 2025 16:33:07 +0530 Subject: [PATCH 25/35] check --- terraform/outputs.tf | 3 +++ terraform/terraform.tf | 3 +++ 2 files changed, 6 insertions(+) diff --git a/terraform/outputs.tf b/terraform/outputs.tf index 7d55c64ae..a42e3c8c5 100644 --- a/terraform/outputs.tf +++ b/terraform/outputs.tf @@ -18,3 +18,6 @@ output "cluster_security_group_id" { description = "Security group ID for the Amazon Web Service EKS Cluster " value = module.eks.cluster_security_group_id } + + +## \ No newline at end of file diff --git a/terraform/terraform.tf b/terraform/terraform.tf index f806dc4c9..3a5154d42 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -30,3 +30,6 @@ terraform { required_version = ">=1.6.3, <=1.11.3" } + + +#### \ No newline at end of file From 74cda7615d24e1dc7ad06f2d8b2672c2237c977e Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 13:02:34 +0530 Subject: [PATCH 26/35] terrafrom apply --- .github/workflows/terrafrom.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index d71d5e212..077f7c415 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -18,7 +18,7 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # S3 bucket for the Terraform state BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} - AWS_REGION: us-east-1 + AWS_REGION: us-east-2 EKS_CLUSTER: vprofile-eks jobs: @@ -59,3 +59,24 @@ jobs: - name: Terraform plan status 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: 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.1.3/deploy/static/provider/aws/deploy.yaml From a3a6bb69ebd6284f5a1a3a869283cbb5108a5c45 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 13:03:54 +0530 Subject: [PATCH 27/35] stage test --- terraform/variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/variables.tf b/terraform/variables.tf index c7929608a..c6797d221 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -11,4 +11,5 @@ variable "clusterName" { } +## ## \ No newline at end of file From 3713305e22dc49d374f087ecb7df70c5a57eddd2 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 13:35:36 +0530 Subject: [PATCH 28/35] changed --- .github/workflows/terrafrom.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 077f7c415..69dc79b67 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -18,7 +18,7 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # S3 bucket for the Terraform state BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} - AWS_REGION: us-east-2 + AWS_REGION: us-east-1 EKS_CLUSTER: vprofile-eks jobs: From 5372703f442624d8f91eaa099268c41b4600de18 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 13:39:42 +0530 Subject: [PATCH 29/35] correct regins --- terraform/variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/variables.tf b/terraform/variables.tf index c6797d221..4972bb195 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -11,5 +11,6 @@ variable "clusterName" { } +## ## ## \ No newline at end of file From 9339cfd9160c66f6a0db22d5d99680b3acf9a8ae Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 13:46:39 +0530 Subject: [PATCH 30/35] commit --- .github/workflows/terrafrom.yml | 123 ++++++++++++++++++-------------- terraform/terraform.tf | 2 +- terraform/variables.tf | 2 - 3 files changed, 69 insertions(+), 58 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 69dc79b67..9a72dc22c 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -1,4 +1,5 @@ name: "Vprofile IAC" + on: push: branches: @@ -13,70 +14,82 @@ on: - terraform/** env: - # Credentials for deployment to AWS - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # S3 bucket for the Terraform state - BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} - AWS_REGION: us-east-1 - EKS_CLUSTER: vprofile-eks + # Credentials for deployment to AWS + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # S3 bucket for the Terraform state + 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 + 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 on the runner + uses: hashicorp/setup-terraform@v2 - steps: - - name: Checkout source code - uses: actions/checkout@v4 + - name: Terraform init + id: init + run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" - - name: Setup Terraform with specified version on the runner - uses: hashicorp/setup-terraform@v2 - #with: - # terraform_version: 1.6.3 + - name: Terraform format + id: fmt + run: terraform fmt -check - - name: Terraform init - id: init - run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" + - name: Terraform validate + id: validate + run: terraform validate - - name: Terraform format - id: fmt - run: terraform fmt -check + - name: Terraform plan + id: plan + run: terraform plan -no-color -input=false -out planfile + continue-on-error: true - - name: Terraform validate - id: validate - run: terraform validate + - name: Terraform plan status + if: steps.plan.outcome == 'failure' + run: exit 1 - - name: Terraform plan - id: plan - run: terraform plan -no-color -input=false -out planfile - continue-on-error: true + - 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: Terraform plan status - if: steps.plan.outcome == 'failure' - run: exit 1 + - 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: 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: Wait for EKS to become active + if: steps.apple.outcome == 'success' + run: | + echo "Waiting for EKS to become ACTIVE..." + for i in {1..30}; do + status=$(aws eks describe-cluster --region $AWS_REGION --name $EKS_CLUSTER --query "cluster.status" --output text) + if [ "$status" == "ACTIVE" ]; then + echo "EKS cluster is active." + break + fi + echo "Still waiting... ($i)" + sleep 10 + done - - 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: Get Kube config file + id: getconfig + if: steps.apple.outcome == 'success' + run: aws eks update-kubeconfig --region $AWS_REGION --name $EKS_CLUSTER - - 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.1.3/deploy/static/provider/aws/deploy.yaml + - 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.1.3/deploy/static/provider/aws/deploy.yaml diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 3a5154d42..75ea8d97c 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -32,4 +32,4 @@ terraform { } -#### \ No newline at end of file +###### \ No newline at end of file diff --git a/terraform/variables.tf b/terraform/variables.tf index 4972bb195..dc976bde1 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -12,5 +12,3 @@ variable "clusterName" { ## -## -## \ No newline at end of file From 0662dcd17fe3fa2bf40c873d3d34830c234d0929 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 13:49:16 +0530 Subject: [PATCH 31/35] correct --- .github/workflows/terrafrom.yml | 123 ++++++++++++++------------------ 1 file changed, 55 insertions(+), 68 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 9a72dc22c..69dc79b67 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -1,5 +1,4 @@ name: "Vprofile IAC" - on: push: branches: @@ -14,82 +13,70 @@ on: - terraform/** env: - # Credentials for deployment to AWS - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # S3 bucket for the Terraform state - BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE }} - AWS_REGION: us-east-2 - EKS_CLUSTER: vprofile-eks + # Credentials for deployment to AWS + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # S3 bucket for the Terraform state + BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} + AWS_REGION: us-east-1 + 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 with specified version on the runner - uses: hashicorp/setup-terraform@v2 + terraform: + name: "Apply terraform code changes" + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./terraform - - name: Terraform init - id: init - run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" + steps: + - name: Checkout source code + uses: actions/checkout@v4 - - name: Terraform format - id: fmt - run: terraform fmt -check + - name: Setup Terraform with specified version on the runner + uses: hashicorp/setup-terraform@v2 + #with: + # terraform_version: 1.6.3 - - name: Terraform validate - id: validate - run: terraform validate + - name: Terraform init + id: init + run: terraform init -backend-config="bucket=$BUCKET_TF_STATE" - - name: Terraform plan - id: plan - run: terraform plan -no-color -input=false -out planfile - continue-on-error: true + - name: Terraform format + id: fmt + run: terraform fmt -check - - name: Terraform plan status - if: steps.plan.outcome == 'failure' - run: exit 1 + - name: Terraform validate + id: validate + run: terraform validate - - 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: Terraform plan + id: plan + run: terraform plan -no-color -input=false -out planfile + continue-on-error: true - - 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: Terraform plan status + if: steps.plan.outcome == 'failure' + run: exit 1 - - name: Wait for EKS to become active - if: steps.apple.outcome == 'success' - run: | - echo "Waiting for EKS to become ACTIVE..." - for i in {1..30}; do - status=$(aws eks describe-cluster --region $AWS_REGION --name $EKS_CLUSTER --query "cluster.status" --output text) - if [ "$status" == "ACTIVE" ]; then - echo "EKS cluster is active." - break - fi - echo "Still waiting... ($i)" - sleep 10 - done + - 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: Get Kube config file - id: getconfig - if: steps.apple.outcome == 'success' - run: aws eks update-kubeconfig --region $AWS_REGION --name $EKS_CLUSTER + - 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: 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.1.3/deploy/static/provider/aws/deploy.yaml + - 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.1.3/deploy/static/provider/aws/deploy.yaml From cd0eea440a48410dbaf9e87c8117af234d16f696 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 14:02:03 +0530 Subject: [PATCH 32/35] regian --- .github/workflows/terrafrom.yml | 2 +- terraform/terraform.tf | 2 +- terraform/variables.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 69dc79b67..077f7c415 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -18,7 +18,7 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # S3 bucket for the Terraform state BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} - AWS_REGION: us-east-1 + AWS_REGION: us-east-2 EKS_CLUSTER: vprofile-eks jobs: diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 75ea8d97c..c07da7f42 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -25,7 +25,7 @@ terraform { backend "s3" { bucket = "gitops2003" key = "terraform.tfstate" - region = "us-east-1" + region = "us-east-2" } required_version = ">=1.6.3, <=1.11.3" diff --git a/terraform/variables.tf b/terraform/variables.tf index dc976bde1..aa0b32e43 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,7 +1,7 @@ variable "region" { description = "AWS region" type = string - default = "us-east-1" + default = "us-east-2" } variable "clusterName" { From 2043848a8adcae8e69c349ee36ccade4eca933c6 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 14:17:59 +0530 Subject: [PATCH 33/35] Changes --- terraform/main.tf | 69 +++++++++++++++++++++++++++++++++++++----- terraform/variables.tf | 4 +-- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/terraform/main.tf b/terraform/main.tf index 94b6fc75a..563bbab9e 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -1,8 +1,3 @@ -provider "kubernetes" { - host = module.eks.cluster_endpoint - cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data) -} - provider "aws" { region = var.region } @@ -10,7 +5,67 @@ provider "aws" { data "aws_availability_zones" "available" {} locals { - cluster_name = var.clusterName + cluster_name = var.cluster_name +} + +module "vpc" { + source = "terraform-aws-modules/vpc/aws" + version = "5.1.2" + + name = local.cluster_name + cidr = "172.20.0.0/16" + azs = slice(data.aws_availability_zones.available.names, 0, 3) + + private_subnets = [ + "172.20.1.0/24", + "172.20.2.0/24", + "172.20.3.0/24" + ] + + public_subnets = [ + "172.20.4.0/24", + "172.20.5.0/24", + "172.20.6.0/24" + ] + + enable_nat_gateway = true + single_nat_gateway = true + enable_dns_hostnames = true + + public_subnet_tags = { + "kubernetes.io/cluster/${local.cluster_name}" = "shared" + "kubernetes.io/role/elb" = 1 + } + + private_subnet_tags = { + "kubernetes.io/cluster/${local.cluster_name}" = "shared" + "kubernetes.io/role/internal-elb" = 1 + } } -## \ No newline at end of file +module "eks" { + source = "terraform-aws-modules/eks/aws" + version = "20.8.4" + + cluster_name = local.cluster_name + cluster_version = "1.29" + + subnet_ids = module.vpc.private_subnets + vpc_id = module.vpc.vpc_id + + enable_irsa = true + + eks_managed_node_groups = { + default = { + instance_types = ["t3.medium"] + desired_size = 2 + max_size = 3 + min_size = 1 + } + } + + tags = { + Environment = "dev" + Terraform = "true" + } +} diff --git a/terraform/variables.tf b/terraform/variables.tf index aa0b32e43..a19305832 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -4,11 +4,11 @@ variable "region" { default = "us-east-2" } -variable "clusterName" { +variable "cluster_name" { description = "Name of the EKS cluster" type = string default = "vprofile-eks" } -## +## \ No newline at end of file From cdc3b8336df1bae4f9019e9b2bbe7fbb3b5cb679 Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 14:38:18 +0530 Subject: [PATCH 34/35] correct --- .github/workflows/terrafrom.yml | 112 +++++++++++++------------------- 1 file changed, 46 insertions(+), 66 deletions(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 077f7c415..8754309b7 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -11,72 +11,52 @@ on: - main paths: - terraform/** - + env: - # Credentials for deployment to AWS - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # S3 bucket for the Terraform state - BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} - AWS_REGION: us-east-2 - EKS_CLUSTER: vprofile-eks + # Credentials for deployment to AWS + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # S3 bucket for the Terraform state + BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} + AWS_REGION: us-east-1 # Update this to the correct region + 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 with specified version on the runner - 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 - - - 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: 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.1.3/deploy/static/provider/aws/deploy.yaml + 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 on the runner + 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 + + - name: Update kubeconfig + run: aws eks update-kubeconfig --region $AWS_REGION --name $EKS_CLUSTER \ No newline at end of file From 0a6ca2b17c67e758ac0c3ee8f8f08b5216a494aa Mon Sep 17 00:00:00 2001 From: "narendrasin2003@gmail.com" Date: Fri, 4 Apr 2025 14:40:47 +0530 Subject: [PATCH 35/35] ... --- .github/workflows/terrafrom.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terrafrom.yml b/.github/workflows/terrafrom.yml index 8754309b7..42ed75618 100644 --- a/.github/workflows/terrafrom.yml +++ b/.github/workflows/terrafrom.yml @@ -18,7 +18,7 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # S3 bucket for the Terraform state BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}} - AWS_REGION: us-east-1 # Update this to the correct region + AWS_REGION: us-east-1 # Update this to the correct region if needed EKS_CLUSTER: vprofile-eks jobs: