From 89821d12b2ad26dad2e1e589eddb2d14b002806f Mon Sep 17 00:00:00 2001 From: emanny Date: Sun, 21 Apr 2024 23:55:48 -0500 Subject: [PATCH 01/20] first commit --- terraform/terraform.tf | 4 ++-- terraform/variables.tf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 67b75c673..55fdf7843 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -27,9 +27,9 @@ terraform { } backend "s3" { - bucket = "gitopsterrastate" + bucket = "tf-gitops" 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..d19424a8e 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -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" } From e5eaad64b5ad56857d0a106358734715b98fcf0f Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 23 Apr 2024 16:24:13 -0500 Subject: [PATCH 02/20] staging-new --- .github/workflow/terraform.yml | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflow/terraform.yml diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml new file mode 100644 index 000000000..096b4b2cb --- /dev/null +++ b/.github/workflow/terraform.yml @@ -0,0 +1,60 @@ +name: "Vprofile 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 }} +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: + working-directory: ./terraform + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Install Terraform + uses: hashicorp/setup-terraform@v2 + + - name: terraform init + id: init + run: terraform init -backend-config="$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 2 \ No newline at end of file From a9ba7a8794e99f9ccd0015c12b217a33f48edec7 Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 23 Apr 2024 16:50:43 -0500 Subject: [PATCH 03/20] staging workflow2 --- .github/workflow/terraform.yml | 71 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml index 096b4b2cb..8772b0dc6 100644 --- a/.github/workflow/terraform.yml +++ b/.github/workflow/terraform.yml @@ -13,48 +13,49 @@ on: - terraform/** env: -#credentials for AWS -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: vprofile-eks - + # credentials for AWS + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # tf state 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: - working-directory: ./terraform + terraform: + name: "APPLY terraform code changes" + runs on: ubuntu-latest + defaults: + run: + shell: + working-directory: ./terraform - steps: - - name: Checkout source code - uses: actions/checkout@v4 + steps: + - name: Checkout source code + uses: actions/checkout@v4 - - name: Install Terraform - uses: hashicorp/setup-terraform@v2 + - name: Install Terraform + uses: hashicorp/setup-terraform@v2 - - name: terraform init - id: init - run: terraform init -backend-config="$BUCKET_TF_STATE" + - name: terraform init + id: init + run: terraform init -backend-config="$BUCKET_TF_STATE" - - name: terraform format - id: fmt - run: terraform fmt -check + - name: terraform format + id: fmt + run: terraform fmt -check - - name: terraform validate - id: validate - run: terraform validate + - 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 + 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 2 \ No newline at end of file + - name: terraform plan status + if: steps.plan.outcome == 'failure' + run: exit 1 \ No newline at end of file From f94c5191b557ec11954bcda975e7d29117e5fb94 Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 23 Apr 2024 16:53:45 -0500 Subject: [PATCH 04/20] new --- .github/workflow/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml index 8772b0dc6..44333f08b 100644 --- a/.github/workflow/terraform.yml +++ b/.github/workflow/terraform.yml @@ -58,4 +58,4 @@ jobs: - name: terraform plan status if: steps.plan.outcome == 'failure' - run: exit 1 \ No newline at end of file + run: exit 3 \ No newline at end of file From 33ede90b625927e0ace33c589dff8d0eb4361237 Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 23 Apr 2024 16:56:03 -0500 Subject: [PATCH 05/20] new staging --- .github/workflow/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml index 44333f08b..8772b0dc6 100644 --- a/.github/workflow/terraform.yml +++ b/.github/workflow/terraform.yml @@ -58,4 +58,4 @@ jobs: - name: terraform plan status if: steps.plan.outcome == 'failure' - run: exit 3 \ No newline at end of file + run: exit 1 \ No newline at end of file From c20510f1d79463a8c6a7571fe16c7e8b7c984b58 Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 23 Apr 2024 16:57:37 -0500 Subject: [PATCH 06/20] staging new --- .github/workflow/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml index 8772b0dc6..30c59681c 100644 --- a/.github/workflow/terraform.yml +++ b/.github/workflow/terraform.yml @@ -58,4 +58,4 @@ jobs: - name: terraform plan status if: steps.plan.outcome == 'failure' - run: exit 1 \ No newline at end of file + run: exit 2 \ No newline at end of file From c2fa33aab4461d158b771bae8f357201e1df981c Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 23 Apr 2024 17:01:10 -0500 Subject: [PATCH 07/20] test --- .github/workflow/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml index 30c59681c..1753251c2 100644 --- a/.github/workflow/terraform.yml +++ b/.github/workflow/terraform.yml @@ -14,7 +14,7 @@ on: env: # credentials for AWS - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} +AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # tf state bucket BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE }} From 343fd322b733354d80f9f01e3ccd77341dc51603 Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 23 Apr 2024 17:14:39 -0500 Subject: [PATCH 08/20] test --- .github/workflow/terraform.yml | 36 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml index 1753251c2..be90c014a 100644 --- a/.github/workflow/terraform.yml +++ b/.github/workflow/terraform.yml @@ -13,13 +13,11 @@ on: - terraform/** env: - # credentials for AWS -AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # tf state bucket - BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE }} - AWS_REGION: us-east-1 - EKS_CLUSTER: vprofile-eks + 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: vprofile-eks jobs: terraform: @@ -30,32 +28,32 @@ jobs: shell: working-directory: ./terraform - steps: - - name: Checkout source code - uses: actions/checkout@v4 + steps: + - name: Checkout source code + uses: actions/checkout@v4 - - name: Install Terraform - uses: hashicorp/setup-terraform@v2 + - name: Install Terraform + uses: hashicorp/setup-terraform@v2 - - name: terraform init - id: init - run: terraform init -backend-config="$BUCKET_TF_STATE" + - name: terraform init + id: init + run: terraform init -backend-config="$BUCKET_TF_STATE" - - name: terraform format + - name: terraform format id: fmt run: terraform fmt -check - - name: terraform validate + - name: terraform validate id: validate run: terraform validate - - name: terraform plan + - name: terraform plan id: plan run: terraform plan -no-color -input=false -out planfile continue-on-error: true - - name: terraform plan status + - name: terraform plan status if: steps.plan.outcome == 'failure' run: exit 2 \ No newline at end of file From d14b8ba5a0898d06aa4c4982a83aba7dd9c75e04 Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 23 Apr 2024 17:15:59 -0500 Subject: [PATCH 09/20] latest commit --- .github/workflow/terraform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml index be90c014a..99504277d 100644 --- a/.github/workflow/terraform.yml +++ b/.github/workflow/terraform.yml @@ -55,5 +55,5 @@ jobs: continue-on-error: true - name: terraform plan status - if: steps.plan.outcome == 'failure' - run: exit 2 \ No newline at end of file + if: steps.plan.outcome == "failure" + run: exit 1 \ No newline at end of file From 92e54625e910dd21534075afd35a6bde2c9b767f Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 23 Apr 2024 17:25:13 -0500 Subject: [PATCH 10/20] tested --- .github/workflow/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml index 99504277d..ace4194b9 100644 --- a/.github/workflow/terraform.yml +++ b/.github/workflow/terraform.yml @@ -55,5 +55,5 @@ jobs: continue-on-error: true - name: terraform plan status - if: steps.plan.outcome == "failure" + if: steps.plan.outcome == 'failure' run: exit 1 \ No newline at end of file From 285e40962eaeaa3f3c6f25fd21c00eb5c659624c Mon Sep 17 00:00:00 2001 From: emanny Date: Thu, 25 Apr 2024 15:28:41 -0500 Subject: [PATCH 11/20] just with ### --- .github/workflow/terraform.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml index ace4194b9..ba8dc5b18 100644 --- a/.github/workflow/terraform.yml +++ b/.github/workflow/terraform.yml @@ -56,4 +56,6 @@ jobs: - name: terraform plan status if: steps.plan.outcome == 'failure' - run: exit 1 \ No newline at end of file + run: exit 1 + +### \ No newline at end of file From 9e8de2fc25429543c1dc8f1e37687911ade34802 Mon Sep 17 00:00:00 2001 From: emanny0018 <95097412+emanny0018@users.noreply.github.com> Date: Thu, 25 Apr 2024 15:33:26 -0500 Subject: [PATCH 12/20] Delete .github/workflow directory --- .github/workflow/terraform.yml | 61 ---------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 .github/workflow/terraform.yml diff --git a/.github/workflow/terraform.yml b/.github/workflow/terraform.yml deleted file mode 100644 index ba8dc5b18..000000000 --- a/.github/workflow/terraform.yml +++ /dev/null @@ -1,61 +0,0 @@ -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-1 - EKS_CLUSTER: vprofile-eks - -jobs: - terraform: - name: "APPLY terraform code changes" - runs on: ubuntu-latest - defaults: - run: - shell: - working-directory: ./terraform - - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Install Terraform - uses: hashicorp/setup-terraform@v2 - - - name: terraform init - id: init - run: terraform init -backend-config="$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 4514fb065a57fee97f284fdaae3c8d5949f0d424 Mon Sep 17 00:00:00 2001 From: emanny Date: Thu, 25 Apr 2024 16:08:22 -0500 Subject: [PATCH 13/20] staging worflow --- .DS_Store | Bin 0 -> 6148 bytes terraform/.github/workflows/terraform.yml | 59 ++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .DS_Store create mode 100644 terraform/.github/workflows/terraform.yml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7698e7e1659d0fbc34dae9fe53a1ce06cf07187a GIT binary patch literal 6148 zcmeHKOHRWu5FLjs646E3vGfU$dV^4f6LgQD6be$KRH$9C@p-rf3&e&Ka0l+d8_%f3 zO6U?*)l4;h&U_r_Im&d1$W6D43DKB{3MgY%Vi*wiv-TuY3p*XJv06@McWtxoMVjGI z8Q`4KK@M4R;dUO&3NrmgGws-44DjJ`h0m+$w>)W6v4Uq5!z#v z57YvibO&c|!%^M65QS^q%fNa~`@5_Ck;(qZUSU2U6Jx*_I9di!vssE$K^u($W55{L zF~Hvk4`r+rgJAr0V2CXMFo!t`=G;qgj#sP{gCIN*C#gV5b=qP$Nr&BQT%{NUC7ql$ zA5QP=v_o<6?pWW)aB`KPjmCg6kTP&0mt(H~SAX~aX_8$T1IEBnG2rrgR!{LrT3dS$ u$F Date: Thu, 25 Apr 2024 16:13:11 -0500 Subject: [PATCH 14/20] test --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a7eba6d64..95975da4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .terraform* DS_Store +.DS_Store From 1c46539eae6ded74ab3a3a99d6322013665c85e7 Mon Sep 17 00:00:00 2001 From: emanny Date: Thu, 25 Apr 2024 16:13:29 -0500 Subject: [PATCH 15/20] vpc --- .DS_Store | Bin 6148 -> 6148 bytes terraform/vpc.tf | 1 + 2 files changed, 1 insertion(+) diff --git a/.DS_Store b/.DS_Store index 7698e7e1659d0fbc34dae9fe53a1ce06cf07187a..0992a8fc10a72af83c69163b2a28b02399252206 100644 GIT binary patch delta 128 zcmZoMXffEJ#uT@!hk=2Cg+Y%YogtH5xw^ssL8MJ8iW0L_RbApigX delta 129 zcmZoMXffEJ#uT^eI0FL%3xgg*IzuKyNp8N2OHxjL5>SkT=hhj{>bFN7QRP$c$`@o9 q1}Ep|76A1yFfb`FO#a6tHhC5kKjT3#>i`q~ Date: Thu, 25 Apr 2024 16:14:36 -0500 Subject: [PATCH 16/20] test --- .DS_Store | Bin 6148 -> 6148 bytes terraform/.github/workflows/terraform.yml | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.DS_Store b/.DS_Store index 0992a8fc10a72af83c69163b2a28b02399252206..e5a60780eac85ddddd63901555ae394ccd7d383a 100644 GIT binary patch delta 128 zcmZoMXffEJ#uRtpIRgU&3xgg*IzuKyNp8N2OHxjL5>Sj|rBZA|{oA9CsPZXrd7yY5 tx_m)~VQ_MOZUIn^fq^-JVe&sFvB|TT_!&=uSqGT-ne6H}Ut}^C1pt^7BBB5Q delta 128 zcmZoMXffEJ#uT@!hk=2Cg+Y%YogtH5xw^ssL8MJ8iW0L_RbApigX diff --git a/terraform/.github/workflows/terraform.yml b/terraform/.github/workflows/terraform.yml index 9094cf32b..d12677012 100644 --- a/terraform/.github/workflows/terraform.yml +++ b/terraform/.github/workflows/terraform.yml @@ -56,4 +56,5 @@ jobs: - name: terraform plan status if: steps.plan.outcome == 'failure' - run: exit 1 \ No newline at end of file + run: exit 1 +##### \ No newline at end of file From 50852e7e72f4ad419171c0b2f3c01d7f59ad8fdd Mon Sep 17 00:00:00 2001 From: emanny0018 <95097412+emanny0018@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:15:28 -0500 Subject: [PATCH 17/20] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index e5a60780eac85ddddd63901555ae394ccd7d383a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKOHRWu5FNK!q+(NcEG-Uz)C-_cg%flQDy2}68l|e*6%zP5+=2}oF2agC@WwNW zViL9pRWsH2CG)YJ=P1)5A~)SHCq!c+%At&d5r!UNKWj$@YGJ42Io7Mm?6$5pok%nM zR|fd(GCHFbJ<={czqik}ud2&(v91@e<*%n#;pOZ7BK0pDKkUyx{hNo@yD^+2ghsTZ zJKExRL-$kzt8@p)AN^77y%2?SU8`rls&4NpTtCUKdm@wlk-frvKqkh3F>tU9pk}k= zM}jsQ1IBr1&&_-jx7)Tiy%I%oz|K;!ff0|@>#(*(!Pz<=N zoRw2NlGfJF!*Q+k&^eTa DKsihn From 9761246a47b1d75ee00f746fa708042c355b299e Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 30 Apr 2024 16:57:34 -0500 Subject: [PATCH 18/20] test-stage-2 --- terraform/vpc.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/vpc.tf b/terraform/vpc.tf index 3889c73f2..6c66fcb51 100644 --- a/terraform/vpc.tf +++ b/terraform/vpc.tf @@ -24,4 +24,4 @@ module "vpc" { "kubernetes.io/role/internal-elb" = 1 } } -### \ No newline at end of file +####### \ No newline at end of file From 9a1a965ab6219567e77e296b64c72b636bc7dce3 Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 30 Apr 2024 16:59:04 -0500 Subject: [PATCH 19/20] ... --- terraform/.github/workflows/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/.github/workflows/terraform.yml b/terraform/.github/workflows/terraform.yml index d12677012..263d89993 100644 --- a/terraform/.github/workflows/terraform.yml +++ b/terraform/.github/workflows/terraform.yml @@ -19,7 +19,7 @@ env: AWS_REGION: us-east-1 EKS_CLUSTER: vprofile-eks -jobs: +job: terraform: name: "APPLY terraform code changes" runs on: ubuntu-latest From 83a3f7cec4f06096e1abfea28d0e50868b0f5d90 Mon Sep 17 00:00:00 2001 From: emanny Date: Tue, 30 Apr 2024 17:12:25 -0500 Subject: [PATCH 20/20] vpc-change on stage --- terraform/vpc.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/vpc.tf b/terraform/vpc.tf index 6c66fcb51..5cdb9c9a2 100644 --- a/terraform/vpc.tf +++ b/terraform/vpc.tf @@ -24,4 +24,4 @@ module "vpc" { "kubernetes.io/role/internal-elb" = 1 } } -####### \ No newline at end of file +##### \ No newline at end of file