Skip to content

New request #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a8748ce
yes
Jun 12, 2025
465114f
new form
Jun 14, 2025
79d233c
staging workflow
Jun 14, 2025
3095dd6
test
Jun 14, 2025
e5eae96
Fixed WF
Jun 14, 2025
f4ce600
Test 2
Jun 14, 2025
3ad0f7d
Fixed Line 21
Jun 14, 2025
4ee78af
Test3
Jun 14, 2025
329a93e
Test 4
Jun 14, 2025
08c7a4e
removed hash
Jun 14, 2025
f81e9f2
Fixed terraform version
Jun 14, 2025
de7ab4f
Changed Key value
Jun 14, 2025
5f8ee45
Changes Fixed
Jun 14, 2025
614ff6f
Fixed Access Key
Jun 14, 2025
40c36cc
Test 5
Jun 14, 2025
b21ba7d
Edit Bucket Var
Jun 14, 2025
ff50819
Edit Bucket var1
Jun 14, 2025
18ce96d
terraform aplly steps
Jun 15, 2025
3737f99
stage test
Jun 15, 2025
b73a97b
Merge branch 'stage'
Jun 15, 2025
3ed5ab8
Fix syntax
Jun 15, 2025
80da6bf
Update README.md
Gpower00717 Jun 15, 2025
25ec39f
test push
Jun 15, 2025
7880a0f
Merge branch 'main' of github.com:Gpower00717/iac-vprofile
Jun 15, 2025
502037b
fixed spelling
Jun 15, 2025
7888dce
Fixed Errors
Jun 15, 2025
5338991
merged
Jun 15, 2025
396cf3a
Update variables.tf
Gpower00717 Jun 15, 2025
3845f74
Update README.md
Gpower00717 Jun 15, 2025
6da2e56
changed #
Jun 15, 2025
367efeb
Changed TF
Jun 15, 2025
8110c41
Merge branch 'main' of github.com:Gpower00717/iac-vprofile
Jun 15, 2025
74f7052
Your descriptive commit message
Jun 15, 2025
ec86fb2
Your descriptive commit message
Jun 15, 2025
b0c57e3
TERR Changes
Jun 15, 2025
df49142
Merge branch 'stage'
Jun 15, 2025
f2e0d7b
edit tf
Jun 15, 2025
245a980
Update variables.tf
Gpower00717 Jun 15, 2025
8dd581a
Corrected Apply line
Jun 15, 2025
e97e6f8
Changed TF file
Jun 15, 2025
738c2cc
Merge branch 'stage'
Jun 15, 2025
3e269b3
changed WF syntax
Jun 15, 2025
b2836fc
Merge branch 'main' of github.com:Gpower00717/iac-vprofile
Jun 15, 2025
78aa049
Merge branch 'stage' 2
Jun 15, 2025
62cff90
Updated tf form
Jun 15, 2025
111e779
Changed Apply plan
Jun 15, 2025
8b5a45c
Changed Apply plan
Jun 15, 2025
415be79
Merge branch 'main' of github.com:Gpower00717/iac-vprofile
Jun 15, 2025
32005a9
Corrected TF form
Jun 15, 2025
d5a69d6
fixed errors
Jun 15, 2025
95714d3
Merge branch 'main' of github.com:Gpower00717/iac-vprofile
Jun 15, 2025
0d2001b
Merge branch 'stage' 1
Jun 15, 2025
d6a5e82
Added file
Jun 15, 2025
9059206
New tf file
Jun 15, 2025
4d72788
made tf change
Jun 15, 2025
dc4abc4
stage test
Jun 16, 2025
a7ab65d
Edit TF
Jun 16, 2025
4603068
edit TF main
Jun 16, 2025
4755886
Edit kube config
Jun 17, 2025
d70ff1b
Sync TF change
Jun 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: "Vprofile IAC"
on:
push:
branches:
- main
- stage
paths:
- terraform/**
pull_request:
branches:
- main
paths:
- terraform/**

env:
# Creds for AWS Deployment
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

# S# Bucket
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

- 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 Engress 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Terraform version 1.6.3
* terraform plan -out planfile
* terraform apply -auto-approve -input=false -parallelism=1 planfile
####
#####
####
11 changes: 4 additions & 7 deletions terraform/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,10 @@ terraform {
}

backend "s3" {
bucket = "gitopsterrastate"
bucket = "vprobucket777"
key = "terraform.tfstate"
region = "us-east-2"
region = "us-east-1"
}

required_version = "~> 1.6.3"
}
##
##
##
required_version = "~> 1.12.2"
}
4 changes: 2 additions & 2 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
variable "region" {
description = "AWS region"
type = string
default = "us-east-2"
default = "us-east-1"
}

variable "clusterName" {
description = "Name of the EKS cluster"
type = string
default = "kitops-eks"
default = "vprofile-eks"
}