From bd84d097da9caa9cdc116ef67c2b4973f38a0826 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Fri, 5 Feb 2021 19:28:10 +0530 Subject: [PATCH 01/84] Update index.php --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 18ac52f..70bbc24 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,4 @@ From 495fe84c087f24d30028f2740c91dc609e9a93e9 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Feb 2021 11:19:21 +0530 Subject: [PATCH 02/84] Update appspec.yml --- appspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appspec.yml b/appspec.yml index 5e69e5e..a7ce903 100644 --- a/appspec.yml +++ b/appspec.yml @@ -2,7 +2,7 @@ version: 0.0 os: linux files: - - source: ./ + - source: / destination: /var/www/html overwrite: yes From 5fa14f822335673b20e3a79e147dea843d2737a0 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Feb 2021 11:20:54 +0530 Subject: [PATCH 03/84] Update index.php changes in index.php --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 70bbc24..4e2ce9b 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,4 @@ From e7cb8b8c3a7d224dd6f8ff0d7f0ecd42d5b6099d Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Feb 2021 11:36:09 +0530 Subject: [PATCH 04/84] Update appspec.yml latest changes --- appspec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appspec.yml b/appspec.yml index a7ce903..cca9a55 100644 --- a/appspec.yml +++ b/appspec.yml @@ -9,6 +9,7 @@ files: hooks: BeforeInstall: - location: scripts/stop_apache.sh + timeout: 3600 runas: root ApplicationStart: - location: scripts/changepermission.sh From c703c75badc9fbea391797e94ce7463db7989f89 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Feb 2021 16:56:49 +0530 Subject: [PATCH 05/84] Delete stop_apache.sh --- scripts/stop_apache.sh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 scripts/stop_apache.sh diff --git a/scripts/stop_apache.sh b/scripts/stop_apache.sh deleted file mode 100644 index 65b5455..0000000 --- a/scripts/stop_apache.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# stoping apache -rm -rf /var/www/html/* -service httpd stop From 493db13388f928a78b91a60e46edba5c866f07e3 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Feb 2021 16:58:40 +0530 Subject: [PATCH 06/84] Update appspec.yml --- appspec.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/appspec.yml b/appspec.yml index cca9a55..9a09f83 100644 --- a/appspec.yml +++ b/appspec.yml @@ -7,17 +7,13 @@ files: overwrite: yes hooks: - BeforeInstall: - - location: scripts/stop_apache.sh - timeout: 3600 - runas: root - ApplicationStart: - - location: scripts/changepermission.sh - timeout: 3600 AfterInstall: - location: scripts/start_apache.sh timeout: 180 runas: root + ApplicationStart: + - location: scripts/changepermission.sh + timeout: 3600 ValidateService: - location: scripts/status_apache.sh timeout: 3600 From 76fc27b61f83ec4984374e32b40a291e6a48d04c Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Wed, 15 Sep 2021 23:01:21 +0530 Subject: [PATCH 07/84] Delete scripts directory --- scripts/changepermission.sh | 3 --- scripts/getpull.sh | 4 ---- scripts/start_apache.sh | 3 --- scripts/status_apache.sh | 3 --- 4 files changed, 13 deletions(-) delete mode 100644 scripts/changepermission.sh delete mode 100644 scripts/getpull.sh delete mode 100644 scripts/start_apache.sh delete mode 100644 scripts/status_apache.sh diff --git a/scripts/changepermission.sh b/scripts/changepermission.sh deleted file mode 100644 index 07c20c9..0000000 --- a/scripts/changepermission.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -# apache config . -chown apache:apache -R /var/www/html diff --git a/scripts/getpull.sh b/scripts/getpull.sh deleted file mode 100644 index 74294b2..0000000 --- a/scripts/getpull.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# apache config . -cd /var/www/html -chown apache:apache -R ./ diff --git a/scripts/start_apache.sh b/scripts/start_apache.sh deleted file mode 100644 index 9bb3368..0000000 --- a/scripts/start_apache.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -# starting service -service httpd start diff --git a/scripts/status_apache.sh b/scripts/status_apache.sh deleted file mode 100644 index 3b44858..0000000 --- a/scripts/status_apache.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -#getting status -service httpd status From 13a65bc751b4411f7c66fc71ebbd16cbb539bf70 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Wed, 15 Sep 2021 23:01:38 +0530 Subject: [PATCH 08/84] Delete appspec.yml --- appspec.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 appspec.yml diff --git a/appspec.yml b/appspec.yml deleted file mode 100644 index 9a09f83..0000000 --- a/appspec.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 0.0 -os: linux - -files: - - source: / - destination: /var/www/html - overwrite: yes - -hooks: - AfterInstall: - - location: scripts/start_apache.sh - timeout: 180 - runas: root - ApplicationStart: - - location: scripts/changepermission.sh - timeout: 3600 - ValidateService: - - location: scripts/status_apache.sh - timeout: 3600 - runas: root From 0b38bf284ec48aa740c68be2cd5b4c678e86213f Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Wed, 15 Sep 2021 23:02:00 +0530 Subject: [PATCH 09/84] Delete index.php --- index.php | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 index.php diff --git a/index.php b/index.php deleted file mode 100644 index 4e2ce9b..0000000 --- a/index.php +++ /dev/null @@ -1,4 +0,0 @@ - From 994a6f2233908a27b00aea7df784e429c976eb65 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:05:08 +0530 Subject: [PATCH 10/84] add files --- .github/workflows/release.yml | 36 +++++++++ environments/production/vpc.tf | 7 ++ environments/sandbox/vpc.tf | 7 ++ modules/vpc/main.tf | 136 +++++++++++++++++++++++++++++++++ modules/vpc/variables.tf | 31 ++++++++ provider.tf | 4 + 6 files changed, 221 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 environments/production/vpc.tf create mode 100644 environments/sandbox/vpc.tf create mode 100644 modules/vpc/main.tf create mode 100644 modules/vpc/variables.tf create mode 100644 provider.tf diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..84239cb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: "Terraform-Plan-Infra-Plan" + +on: + push: + branches: + - dev + +jobs: + terraform: + name: "Terraform" + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + AWS_REGION: 'us-west-2' + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v1 + + - name: Terraform Init + id: init + run: terraform init + env: + TF_WORKSPACE: sandbox + + - name: Terraform Plan + id: plan + if: github.event_name == 'push' + run: terraform plan -no-color + # - name: Terraform Apply + # if: github.ref == 'refs/heads/master' && github.event_name == 'push' + # run: terraform apply -auto-approve \ No newline at end of file diff --git a/environments/production/vpc.tf b/environments/production/vpc.tf new file mode 100644 index 0000000..5ba3782 --- /dev/null +++ b/environments/production/vpc.tf @@ -0,0 +1,7 @@ +module "vpc" { + source = "../../modules/vpc" + vpc_cidr = var.vpc_cidr + env = var.env + region = var.region + zones = var.zones +} diff --git a/environments/sandbox/vpc.tf b/environments/sandbox/vpc.tf new file mode 100644 index 0000000..5ba3782 --- /dev/null +++ b/environments/sandbox/vpc.tf @@ -0,0 +1,7 @@ +module "vpc" { + source = "../../modules/vpc" + vpc_cidr = var.vpc_cidr + env = var.env + region = var.region + zones = var.zones +} diff --git a/modules/vpc/main.tf b/modules/vpc/main.tf new file mode 100644 index 0000000..341708f --- /dev/null +++ b/modules/vpc/main.tf @@ -0,0 +1,136 @@ +# +# Defines VPC, subnets, security groups, NAT instance, etc. +# + +# VPC +resource "aws_vpc" "default" { + cidr_block = var.vpc_cidr + enable_dns_hostnames = false + + tags = { + Environment = var.env + Name = "spire-vpc-${var.env}" + Provisoning = "terraform" + } +} + +## Public subnets +resource "aws_subnet" "public" { + vpc_id = aws_vpc.default.id + cidr_block = var.public_subnet_cidr_blocks["zone${count.index}"] + availability_zone = "${var.region}${element(var.zones, count.index)}" + count = length(var.zones) + + tags = { + Environment = var.env + Name = "spire-subnet-${var.env}-public-${count.index}" + Type = "spire-subnet-${var.env}-public" + Provisoning = "terraform" + } +} + +### Custom route table for public subnets +resource "aws_route_table" "custom" { + vpc_id = aws_vpc.default.id + + tags = { + Environment = var.env + Name = "spire-${var.env}-public-rt" + Provisoning = "terraform" + } +} + +#### Route for customer route table +resource "aws_route" "custom" { + route_table_id = aws_route_table.custom.id + destination_cidr_block = "0.0.0.0/0" + gateway_id = aws_internet_gateway.default.id + depends_on = [aws_route_table.custom] +} + +### NAT GW eip +resource "aws_eip" "natgw" { + vpc = true + tags = { + Name = "spire-vpc-igw" + Environment = var.env + Provisoning = "terraform" + } +} + +### Internet Gateway +resource "aws_internet_gateway" "default" { + vpc_id = aws_vpc.default.id + tags = { + Name = "spire-nat-sg" + Environment = var.env + Provisoning = "terraform" + } +} + +### NAT Gateway +resource "aws_nat_gateway" "natgw" { + allocation_id = aws_eip.natgw.id + subnet_id = element(aws_subnet.public.*.id, 0) + + tags = { + Environment = var.env + Name = "natgw-${var.env}" + Provisoning = "terraform" + } +} + +#### Associate custom route table with public subnets +resource "aws_route_table_association" "public" { + subnet_id = element(aws_subnet.public.*.id, count.index) + route_table_id = aws_route_table.custom.id + count = length(var.zones) +} + +## Private subnets +resource "aws_subnet" "private" { + vpc_id = aws_vpc.default.id + cidr_block = var.private_subnet_cidr_blocks["zone${count.index}"] + availability_zone = "${var.region}${element(var.zones, count.index)}" + count = length(var.zones) + + tags = { + Environment = var.env + Name = "spire-subnet-${var.env}-private-${count.index}" + Type = "spire-subnet-${var.env}-private" + Provisoning = "terraform" + } +} + +### Main route table +resource "aws_route_table" "main" { + vpc_id = aws_vpc.default.id + + tags = { + Environment = var.env + Name = "spire-${var.env}-private-rt" + Provisoning = "terraform" + } +} + +### Update main route table to use NAT +resource "aws_route" "main" { + route_table_id = aws_route_table.main.id + destination_cidr_block = "0.0.0.0/0" + nat_gateway_id = aws_nat_gateway.natgw.id + depends_on = [aws_nat_gateway.natgw] +} + +### Associate main route table with private subnets +resource "aws_route_table_association" "private" { + subnet_id = element(aws_subnet.private.*.id, count.index) + route_table_id = aws_route_table.main.id + count = length(var.zones) +} + +### Set main route table +resource "aws_main_route_table_association" "main" { + vpc_id = aws_vpc.default.id + route_table_id = aws_route_table.main.id +} + diff --git a/modules/vpc/variables.tf b/modules/vpc/variables.tf new file mode 100644 index 0000000..3bd0fd3 --- /dev/null +++ b/modules/vpc/variables.tf @@ -0,0 +1,31 @@ +variable "env" { + default = "undefined" +} + +variable "region" { + default = "us-east-1" +} + +variable "zones" { + default = ["a", "b", "c"] +} + +variable "vpc_cidr" { + default = "10.0.0.0/16" +} + +variable "public_subnet_cidr_blocks" { + default = { + zone0 = "10.0.10.0/24" + zone1 = "10.0.20.0/24" + zone2 = "10.0.30.0/24" + } +} + +variable "private_subnet_cidr_blocks" { + default = { + zone0 = "10.0.11.0/24" + zone1 = "10.0.21.0/24" + zone2 = "10.0.31.0/24" + } +} diff --git a/provider.tf b/provider.tf new file mode 100644 index 0000000..336dd3a --- /dev/null +++ b/provider.tf @@ -0,0 +1,4 @@ +provider "aws" { + region = var.region + version = "~> 2.70.0" +} \ No newline at end of file From 367d55cdb1e3373b6e0757300faad52cc88f14fc Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:11:44 +0530 Subject: [PATCH 11/84] add files to github --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84239cb..9aac512 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-2' + AWS_REGION: 'us-west-1" steps: - name: Checkout From 439fa9c9c87daa8f3f3912ad4185985817a20b25 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:12:37 +0530 Subject: [PATCH 12/84] add files to githubs --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9aac512..f140f07 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-1" + AWS_REGION: 'us-west-1' steps: - name: Checkout From cffdb7358929dad3008b40c157e7805818ea7be6 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:14:43 +0530 Subject: [PATCH 13/84] add files to github release file --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f140f07..655ad66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,8 @@ jobs: id: plan if: github.event_name == 'push' run: terraform plan -no-color + env: + TF_WORKSPACE: sandbox # - name: Terraform Apply # if: github.ref == 'refs/heads/master' && github.event_name == 'push' # run: terraform apply -auto-approve \ No newline at end of file From 59bcb8b3868d9e40bd63d48750182e9410d51f8e Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:43:42 +0530 Subject: [PATCH 14/84] add files to githubst --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 655ad66..b3bda6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,8 +31,8 @@ jobs: id: plan if: github.event_name == 'push' run: terraform plan -no-color - env: - TF_WORKSPACE: sandbox + # env: + # TF_WORKSPACE: sandbox # - name: Terraform Apply # if: github.ref == 'refs/heads/master' && github.event_name == 'push' # run: terraform apply -auto-approve \ No newline at end of file From a3eb877865326ad45447dec36511e4e8d98c04f8 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:45:17 +0530 Subject: [PATCH 15/84] add files to githubste --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3bda6b..90de6db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,8 +24,8 @@ jobs: - name: Terraform Init id: init run: terraform init - env: - TF_WORKSPACE: sandbox + # env: + # TF_WORKSPACE: sandbox - name: Terraform Plan id: plan From a51d1170c7d0aa3b1be1a316ed96b8c6c6d3ced9 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:49:50 +0530 Subject: [PATCH 16/84] changes to release.yml file --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90de6db..c51cdc1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: - name: Terraform Plan id: plan if: github.event_name == 'push' - run: terraform plan -no-color + run: cd environment && cd sandbox && terraform plan -no-color # env: # TF_WORKSPACE: sandbox # - name: Terraform Apply From 3f6f193c12121ed6b5c13b6529994e82f7b3d920 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:51:58 +0530 Subject: [PATCH 17/84] changes to release.yml files --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c51cdc1..1c09463 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: - name: Terraform Plan id: plan if: github.event_name == 'push' - run: cd environment && cd sandbox && terraform plan -no-color + run: cd environments && cd sandbox && terraform plan -no-color # env: # TF_WORKSPACE: sandbox # - name: Terraform Apply From 605cf3772d58f0374e4171500338fda2b706b55d Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:53:58 +0530 Subject: [PATCH 18/84] changes to release.yml files so far --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c09463..6b8076f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: - name: Terraform Plan id: plan if: github.event_name == 'push' - run: cd environments && cd sandbox && terraform plan -no-color + run: cd environments && cd sandbox && terraform init && terraform plan -no-color # env: # TF_WORKSPACE: sandbox # - name: Terraform Apply From 05c2ddff0240748d96316477098a467dd9c0f707 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Wed, 15 Sep 2021 23:55:40 +0530 Subject: [PATCH 19/84] changes to release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b8076f..7af517e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: - name: Terraform Plan id: plan if: github.event_name == 'push' - run: cd environments && cd sandbox && terraform init && terraform plan -no-color + run: cd modules && cd vpc && terraform init && terraform plan -no-color # env: # TF_WORKSPACE: sandbox # - name: Terraform Apply From d85d544790bca7a44aa60efcbcc84867bc20cd64 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Thu, 16 Sep 2021 22:50:27 +0530 Subject: [PATCH 20/84] sample code to dev --- .github/workflows/release.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7af517e..f09266e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,8 +31,11 @@ jobs: id: plan if: github.event_name == 'push' run: cd modules && cd vpc && terraform init && terraform plan -no-color - # env: - # TF_WORKSPACE: sandbox - # - name: Terraform Apply - # if: github.ref == 'refs/heads/master' && github.event_name == 'push' - # run: terraform apply -auto-approve \ No newline at end of file + - name: Terraform plan for sandbox + id: plan + if: github.event_name == 'push' + run: cd environments && cd sandbox && terraform init && terraform plan -no-color + - name: Terraform plan for prod + id: plan + if: github.event_name == 'push' + run: cd environments && cd production && terraform init && terraform plan -no-color \ No newline at end of file From 7ca873e818400803119da11522fd685cf6cafcc5 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Thu, 16 Sep 2021 22:52:27 +0530 Subject: [PATCH 21/84] sample code to des --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f09266e..fc1dbd1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,10 +32,10 @@ jobs: if: github.event_name == 'push' run: cd modules && cd vpc && terraform init && terraform plan -no-color - name: Terraform plan for sandbox - id: plan + id: plan for sandbox if: github.event_name == 'push' run: cd environments && cd sandbox && terraform init && terraform plan -no-color - name: Terraform plan for prod - id: plan + id: plan for prod if: github.event_name == 'push' run: cd environments && cd production && terraform init && terraform plan -no-color \ No newline at end of file From aae8474fe27951353ecccb00a12cdaa968282e6b Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Thu, 16 Sep 2021 22:53:45 +0530 Subject: [PATCH 22/84] sample code to dest --- .github/workflows/release.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc1dbd1..be1ba11 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,11 +31,11 @@ jobs: id: plan if: github.event_name == 'push' run: cd modules && cd vpc && terraform init && terraform plan -no-color - - name: Terraform plan for sandbox - id: plan for sandbox - if: github.event_name == 'push' - run: cd environments && cd sandbox && terraform init && terraform plan -no-color - - name: Terraform plan for prod - id: plan for prod - if: github.event_name == 'push' - run: cd environments && cd production && terraform init && terraform plan -no-color \ No newline at end of file + # - name: Terraform plan for sandbox + # id: plan for sandbox + # if: github.event_name == 'push' + # run: cd environments && cd sandbox && terraform init && terraform plan -no-color + # - name: Terraform plan for prod + # id: plan for prod + # if: github.event_name == 'push' + # run: cd environments && cd production && terraform init && terraform plan -no-color \ No newline at end of file From 214169038827098928056a95d5f923753f40825a Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Thu, 16 Sep 2021 22:55:45 +0530 Subject: [PATCH 23/84] sample code to desti --- .github/workflows/release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be1ba11..efd859b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,10 +31,11 @@ jobs: id: plan if: github.event_name == 'push' run: cd modules && cd vpc && terraform init && terraform plan -no-color - # - name: Terraform plan for sandbox - # id: plan for sandbox - # if: github.event_name == 'push' - # run: cd environments && cd sandbox && terraform init && terraform plan -no-color + steps: + - name: Terraform plan for sandbox + id: plan for sandbox + if: github.event_name == 'push' + run: cd environments && cd sandbox && terraform init && terraform plan -no-color # - name: Terraform plan for prod # id: plan for prod # if: github.event_name == 'push' From 366ce0da40a06ab850d4863052f1fbe9a665fdd0 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Thu, 16 Sep 2021 22:56:56 +0530 Subject: [PATCH 24/84] sample code to destin --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efd859b..0aee829 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,9 @@ jobs: id: plan if: github.event_name == 'push' run: cd modules && cd vpc && terraform init && terraform plan -no-color - steps: + steps: + - name: Checkout + uses: actions/checkout@v2 - name: Terraform plan for sandbox id: plan for sandbox if: github.event_name == 'push' From 0ad58d15b7648cc3dddca23bb2c36f81f0b53399 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Sun, 19 Sep 2021 23:01:56 +0530 Subject: [PATCH 25/84] adding git files to workflow --- .github/workflows/release.yml | 47 +++++++++++++++-------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0aee829..17b8240 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,30 +15,23 @@ jobs: AWS_REGION: 'us-west-1' steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Terraform - uses: hashicorp/setup-terraform@v1 - - - name: Terraform Init - id: init - run: terraform init - # env: - # TF_WORKSPACE: sandbox - - - name: Terraform Plan - id: plan - if: github.event_name == 'push' - run: cd modules && cd vpc && terraform init && terraform plan -no-color - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Terraform plan for sandbox - id: plan for sandbox - if: github.event_name == 'push' - run: cd environments && cd sandbox && terraform init && terraform plan -no-color - # - name: Terraform plan for prod - # id: plan for prod - # if: github.event_name == 'push' - # run: cd environments && cd production && terraform init && terraform plan -no-color \ No newline at end of file + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Terraform Init' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'init' + tf_actions_working_dir: './environments/production' + tf_actions_comment: true + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + # - name: Terraform plan for sandbox + # id: plan for sandbox + # if: github.event_name == 'push' + # run: cd environments && cd sandbox && terraform init && terraform plan -no-color + # # - name: Terraform plan for prod + # # id: plan for prod + # # if: github.event_name == 'push' + # # run: cd environments && cd production && terraform init && terraform plan -no-color \ No newline at end of file From 6a3804d85883d4bc769a25c5b8b4226d8a429153 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Sun, 19 Sep 2021 23:07:23 +0530 Subject: [PATCH 26/84] adding git files to workflow plan --- .github/workflows/release.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 17b8240..dbd4b22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,20 +18,16 @@ jobs: - name: 'Checkout' uses: actions/checkout@master - name: 'Terraform Init' - uses: hashicorp/terraform-github-actions@master + uses: maddytestaccount/sample-site@master with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' tf_actions_working_dir: './environments/production' tf_actions_comment: true - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - # - name: Terraform plan for sandbox - # id: plan for sandbox - # if: github.event_name == 'push' - # run: cd environments && cd sandbox && terraform init && terraform plan -no-color - # # - name: Terraform plan for prod - # # id: plan for prod - # # if: github.event_name == 'push' - # # run: cd environments && cd production && terraform init && terraform plan -no-color \ No newline at end of file + - name: 'Terraform plan' + uses: maddytestaccount/sample-site@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'plan' + tf_actions_working_dir: './environments/production' + tf_actions_comment: true \ No newline at end of file From 669315d86b41e15ada474ebc815d300bbd5310b5 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Sun, 19 Sep 2021 23:12:28 +0530 Subject: [PATCH 27/84] adding git files to workflow plan to hashicorp --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbd4b22..7f9b9d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,14 +18,14 @@ jobs: - name: 'Checkout' uses: actions/checkout@master - name: 'Terraform Init' - uses: maddytestaccount/sample-site@master + uses: hashicorp/terraform-github-actions@master with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' tf_actions_working_dir: './environments/production' tf_actions_comment: true - name: 'Terraform plan' - uses: maddytestaccount/sample-site@master + uses: hashicorp/terraform-github-actions@master with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' From 1fbf669d5a121d0d46333e976741eb2d8f526626 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Sun, 19 Sep 2021 23:18:38 +0530 Subject: [PATCH 28/84] adding git files to workflow plan to hashicorp sandbox --- .github/workflows/release.yml | 27 +++++++++++++++++++++++- environments/production/variables.tf | 31 ++++++++++++++++++++++++++++ environments/sandbox/variables.tf | 15 ++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 environments/production/variables.tf create mode 100644 environments/sandbox/variables.tf diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f9b9d9..f495695 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,4 +30,29 @@ jobs: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/production' - tf_actions_comment: true \ No newline at end of file + tf_actions_comment: true + terraform: + name: "sandbox Terraform" + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + AWS_REGION: 'us-west-1' + + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Terraform Init' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'init' + tf_actions_working_dir: './environments/sandbox' + tf_actions_comment: true + - name: 'Terraform plan' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'plan' + tf_actions_working_dir: './environments/sandbox' + tf_actions_comment: true \ No newline at end of file diff --git a/environments/production/variables.tf b/environments/production/variables.tf new file mode 100644 index 0000000..38d38fd --- /dev/null +++ b/environments/production/variables.tf @@ -0,0 +1,31 @@ +variable "env" { + default = "undefined" +} + +variable "region" { + default = "us-east-1" +} + +variable "zones" { + default = ["a", "b", "c"] +} + +variable "vpc_cidr" { + default = "10.0.0.0/16" +} + +# variable "public_subnet_cidr_blocks" { +# default = { +# zone0 = "10.0.10.0/24" +# zone1 = "10.0.20.0/24" +# zone2 = "10.0.30.0/24" +# } +# } + +# variable "private_subnet_cidr_blocks" { +# default = { +# zone0 = "10.0.11.0/24" +# zone1 = "10.0.21.0/24" +# zone2 = "10.0.31.0/24" +# } +# } diff --git a/environments/sandbox/variables.tf b/environments/sandbox/variables.tf new file mode 100644 index 0000000..c1af275 --- /dev/null +++ b/environments/sandbox/variables.tf @@ -0,0 +1,15 @@ +variable "env" { + default = "undefined" +} + +variable "region" { + default = "us-east-1" +} + +variable "zones" { + default = ["a", "b", "c"] +} + +variable "vpc_cidr" { + default = "10.0.0.0/16" +} \ No newline at end of file From a464e714ac1c68513f72dee3dcc3a73935377f1b Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Sun, 19 Sep 2021 23:19:58 +0530 Subject: [PATCH 29/84] adding git files to workflow plan to hashicorp sandbox workflow --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f495695..a43cb1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,8 +31,8 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/production' tf_actions_comment: true - terraform: - name: "sandbox Terraform" + terraform-sandbox: + name: "sandbox-Terraform" runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} From 6ab8d61a29e00f834759920fd67baa1d34642c89 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Sun, 19 Sep 2021 23:26:09 +0530 Subject: [PATCH 30/84] adding git files to workflow plan to hashicorp sandbox workflo --- environments/production/variables.tf | 53 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/environments/production/variables.tf b/environments/production/variables.tf index 38d38fd..2af3fab 100644 --- a/environments/production/variables.tf +++ b/environments/production/variables.tf @@ -1,31 +1,32 @@ -variable "env" { - default = "undefined" -} - -variable "region" { - default = "us-east-1" -} - -variable "zones" { - default = ["a", "b", "c"] -} +# variable "env" { +# default = "undefined" +# } -variable "vpc_cidr" { - default = "10.0.0.0/16" -} +# variable "region" { +# default = "us-east-1" +# } -# variable "public_subnet_cidr_blocks" { -# default = { -# zone0 = "10.0.10.0/24" -# zone1 = "10.0.20.0/24" -# zone2 = "10.0.30.0/24" -# } +# variable "zones" { +# default = ["a", "b", "c"] # } -# variable "private_subnet_cidr_blocks" { -# default = { -# zone0 = "10.0.11.0/24" -# zone1 = "10.0.21.0/24" -# zone2 = "10.0.31.0/24" -# } +# variable "vpc_cidr" { +# default = "10.0.0.0/16" # } + +# # variable "public_subnet_cidr_blocks" { +# # default = { +# # zone0 = "10.0.10.0/24" +# # zone1 = "10.0.20.0/24" +# # zone2 = "10.0.30.0/24" +# # } +# # } + +# # variable "private_subnet_cidr_blocks" { +# # default = { +# # zone0 = "10.0.11.0/24" +# # zone1 = "10.0.21.0/24" +# # zone2 = "10.0.31.0/24" +# # } +# # } +./environments/modules/variables.tf From da3ff553f295727d86a4eb7aff0269f0deeb9604 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Sun, 19 Sep 2021 23:27:25 +0530 Subject: [PATCH 31/84] adding git files to workflow plan to hashicorp sandbox workfl --- environments/production/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environments/production/variables.tf b/environments/production/variables.tf index 2af3fab..7fe7e56 100644 --- a/environments/production/variables.tf +++ b/environments/production/variables.tf @@ -29,4 +29,4 @@ # # zone2 = "10.0.31.0/24" # # } # # } -./environments/modules/variables.tf +./production/environments/modules/variables.tf From 01ffd3ff6edb21c36bd03010fa598959ac61d087 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 14:57:35 +0530 Subject: [PATCH 32/84] adding git files to workflow plan to hashicorp sandbox work --- .github/workflows/release.yml | 2 +- environments/production/variables.tf | 32 ---------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 environments/production/variables.tf diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a43cb1e..92428d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: "Terraform-Plan-Infra-Plan" on: push: branches: - - dev + - pull_request jobs: terraform: diff --git a/environments/production/variables.tf b/environments/production/variables.tf deleted file mode 100644 index 7fe7e56..0000000 --- a/environments/production/variables.tf +++ /dev/null @@ -1,32 +0,0 @@ -# variable "env" { -# default = "undefined" -# } - -# variable "region" { -# default = "us-east-1" -# } - -# variable "zones" { -# default = ["a", "b", "c"] -# } - -# variable "vpc_cidr" { -# default = "10.0.0.0/16" -# } - -# # variable "public_subnet_cidr_blocks" { -# # default = { -# # zone0 = "10.0.10.0/24" -# # zone1 = "10.0.20.0/24" -# # zone2 = "10.0.30.0/24" -# # } -# # } - -# # variable "private_subnet_cidr_blocks" { -# # default = { -# # zone0 = "10.0.11.0/24" -# # zone1 = "10.0.21.0/24" -# # zone2 = "10.0.31.0/24" -# # } -# # } -./production/environments/modules/variables.tf From bdc024a97fdd3777c10148d9b9df2494653e7524 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:02:58 +0530 Subject: [PATCH 33/84] adding git files to workflow plan to hashicorp sandbox test --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92428d2..d2a39d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,9 @@ name: "Terraform-Plan-Infra-Plan" on: - push: + pull_request: branches: - - pull_request + - dev jobs: terraform: From 3af9b2ca49fe04bdaae0a9086ddd22b8427fe5f1 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:11:53 +0530 Subject: [PATCH 34/84] adding git files to actions --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2a39d2..6edaf86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ name: "Terraform-Plan-Infra-Plan" on: + push: pull_request: branches: - dev From 83ff03f5c73dda3679241cbd5c86eaf6ae365d02 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:13:43 +0530 Subject: [PATCH 35/84] adding git files to actions for test --- environments/production/variables.tf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 environments/production/variables.tf diff --git a/environments/production/variables.tf b/environments/production/variables.tf new file mode 100644 index 0000000..c1af275 --- /dev/null +++ b/environments/production/variables.tf @@ -0,0 +1,15 @@ +variable "env" { + default = "undefined" +} + +variable "region" { + default = "us-east-1" +} + +variable "zones" { + default = ["a", "b", "c"] +} + +variable "vpc_cidr" { + default = "10.0.0.0/16" +} \ No newline at end of file From 1485bf1d29fade3f00b46cf8de1a9e6122e4b96c Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:18:22 +0530 Subject: [PATCH 36/84] adding git files to actions for test to master --- .github/workflows/apply.yml | 72 +++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/apply.yml diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml new file mode 100644 index 0000000..5b9b4bf --- /dev/null +++ b/.github/workflows/apply.yml @@ -0,0 +1,72 @@ +name: "Terraform-Plan-Infra-Plan" + +on: + push: + branches: + - master + +jobs: + terraform: + name: "Terraform" + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + AWS_REGION: 'us-west-1' + + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Terraform Init' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'init' + tf_actions_working_dir: './environments/production' + tf_actions_comment: true + - name: 'Terraform plan' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'plan' + tf_actions_working_dir: './environments/production' + tf_actions_comment: true + - name: 'Terraform apply' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'apply' + tf_actions_working_dir: './environments/production' + tf_actions_comment: true + terraform-sandbox: + name: "sandbox-Terraform" + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + AWS_REGION: 'us-west-1' + + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Terraform Init' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'init' + tf_actions_working_dir: './environments/sandbox' + tf_actions_comment: true + - name: 'Terraform plan' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'plan' + tf_actions_working_dir: './environments/sandbox' + tf_actions_comment: true + - name: 'Terraform apply' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'apply' + tf_actions_working_dir: './environments/production' + tf_actions_comment: true \ No newline at end of file From b1e30cce29b33b679cb0bb3100b80d73cb475d7f Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:26:48 +0530 Subject: [PATCH 37/84] adding git files to actions for test to pull request --- .github/workflows/apply.yml | 7 +++---- .github/workflows/release.yml | 2 +- environments/production/variables.tf | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 5b9b4bf..4beee12 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -1,9 +1,8 @@ name: "Terraform-Plan-Infra-Plan" on: - push: - branches: - - master + pull_request: + types: [ closed ] jobs: terraform: @@ -44,7 +43,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-1' + AWS_REGION: 'us-east-1' steps: - name: 'Checkout' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6edaf86..ae08d3b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-1' + AWS_REGION: 'us-east-1' steps: - name: 'Checkout' diff --git a/environments/production/variables.tf b/environments/production/variables.tf index c1af275..f4bf3e9 100644 --- a/environments/production/variables.tf +++ b/environments/production/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-1" + default = "us-west-1" } variable "zones" { From 5f314cc829c2dca744f1e6211bb190cbf9a5c9df Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:31:02 +0530 Subject: [PATCH 38/84] adding git files to actions for test to pull --- modules/vpc/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/vpc/variables.tf b/modules/vpc/variables.tf index 3bd0fd3..3b47578 100644 --- a/modules/vpc/variables.tf +++ b/modules/vpc/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-1" + default = "us-west-1" } variable "zones" { From 75caacdee007f45f061b3859e3c4b20e14a482e2 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:39:25 +0530 Subject: [PATCH 39/84] adding git files to modules --- .github/workflows/apply.yml | 34 +++++++++++++++++++++++++++++++++- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 4beee12..10ef0d3 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -1,10 +1,42 @@ -name: "Terraform-Plan-Infra-Plan" +name: "Terraform-apply" on: pull_request: types: [ closed ] jobs: + terraform: + name: "Terraform-modules" + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + AWS_REGION: 'us-west-1' + + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Terraform Init' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'init' + tf_actions_working_dir: './modules/vpc' + tf_actions_comment: true + - name: 'Terraform plan' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'plan' + tf_actions_working_dir: './modules/vpc' + tf_actions_comment: true + - name: 'Terraform plan' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'apply' + tf_actions_working_dir: './modules/vpc' + tf_actions_comment: true terraform: name: "Terraform" runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae08d3b..0c44faa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: "Terraform-Plan-Infra-Plan" +name: "Terraform-Plan" on: push: @@ -8,7 +8,32 @@ on: jobs: terraform: - name: "Terraform" + name: "Terraform-modules" + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + AWS_REGION: 'us-west-1' + + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Terraform Init' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'init' + tf_actions_working_dir: './modules/vpc' + tf_actions_comment: true + - name: 'Terraform plan' + uses: hashicorp/terraform-github-actions@master + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: 'plan' + tf_actions_working_dir: './modules/vpc' + tf_actions_comment: true + terraform: + name: "Terraform-prod" runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} From a97bdce346ac6483f5d5b30632ba08601de5d009 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:40:37 +0530 Subject: [PATCH 40/84] adding git files to modules latest --- .github/workflows/apply.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 10ef0d3..5cc1ff2 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -30,7 +30,7 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './modules/vpc' tf_actions_comment: true - - name: 'Terraform plan' + - name: 'Terraform apply' uses: hashicorp/terraform-github-actions@master with: tf_actions_version: 0.12.13 From 793346a422ff5bbaac7bf7e5e2aed8ab1d77cc27 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:44:07 +0530 Subject: [PATCH 41/84] adding git files to modules latest --- .github/workflows/apply.yml | 2 +- .github/workflows/release.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 5cc1ff2..7780cd0 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -5,7 +5,7 @@ on: types: [ closed ] jobs: - terraform: + terraform-module: name: "Terraform-modules" runs-on: ubuntu-latest env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c44faa..b914fb0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: - dev jobs: - terraform: + terraform-module: name: "Terraform-modules" runs-on: ubuntu-latest env: @@ -32,7 +32,7 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './modules/vpc' tf_actions_comment: true - terraform: + terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest env: From 687b9f46ed021e762bb1a994562a04bad7de54d1 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:48:19 +0530 Subject: [PATCH 42/84] adding git file --- .github/workflows/apply.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 7780cd0..591b9d8 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -11,7 +11,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-1' + AWS_REGION: 'us-west-2' steps: - name: 'Checkout' @@ -43,7 +43,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-1' + AWS_REGION: 'us-west-2' steps: - name: 'Checkout' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b914fb0..6e7b9a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-1' + AWS_REGION: 'us-west-2' steps: - name: 'Checkout' @@ -38,7 +38,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-1' + AWS_REGION: 'us-west-2' steps: - name: 'Checkout' From 7b37d4feb6452553ad934a037724d89765807731 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:51:38 +0530 Subject: [PATCH 43/84] adding git file to qa --- modules/vpc/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/vpc/variables.tf b/modules/vpc/variables.tf index 3b47578..1d63aed 100644 --- a/modules/vpc/variables.tf +++ b/modules/vpc/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-west-1" + default = "us-west-2" } variable "zones" { From 151ee3d4c50e0e0786ddec0fcb4ab0bd34fdacda Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 15:52:34 +0530 Subject: [PATCH 44/84] adding git file to qa pr --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e7b9a0..2a50e7a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,6 @@ name: "Terraform-Plan" on: - push: pull_request: branches: - dev From 616f03587a6d379225a46e9ddf18a87c95e8d27a Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 16:43:02 +0530 Subject: [PATCH 45/84] create workflow based on pull_request --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a50e7a..210f901 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,7 @@ name: "Terraform-Plan" on: pull_request: - branches: - - dev + branches: [ master ] jobs: terraform-module: From 485fe1827b08a6855db8000a37168fd432a24e6f Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 17:08:00 +0530 Subject: [PATCH 46/84] create workflow based --- environments/production/variables.tf | 20 ++++++++++++++++++-- environments/sandbox/variables.tf | 20 ++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/environments/production/variables.tf b/environments/production/variables.tf index f4bf3e9..1d63aed 100644 --- a/environments/production/variables.tf +++ b/environments/production/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-west-1" + default = "us-west-2" } variable "zones" { @@ -12,4 +12,20 @@ variable "zones" { variable "vpc_cidr" { default = "10.0.0.0/16" -} \ No newline at end of file +} + +variable "public_subnet_cidr_blocks" { + default = { + zone0 = "10.0.10.0/24" + zone1 = "10.0.20.0/24" + zone2 = "10.0.30.0/24" + } +} + +variable "private_subnet_cidr_blocks" { + default = { + zone0 = "10.0.11.0/24" + zone1 = "10.0.21.0/24" + zone2 = "10.0.31.0/24" + } +} diff --git a/environments/sandbox/variables.tf b/environments/sandbox/variables.tf index c1af275..1d63aed 100644 --- a/environments/sandbox/variables.tf +++ b/environments/sandbox/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-1" + default = "us-west-2" } variable "zones" { @@ -12,4 +12,20 @@ variable "zones" { variable "vpc_cidr" { default = "10.0.0.0/16" -} \ No newline at end of file +} + +variable "public_subnet_cidr_blocks" { + default = { + zone0 = "10.0.10.0/24" + zone1 = "10.0.20.0/24" + zone2 = "10.0.30.0/24" + } +} + +variable "private_subnet_cidr_blocks" { + default = { + zone0 = "10.0.11.0/24" + zone1 = "10.0.21.0/24" + zone2 = "10.0.31.0/24" + } +} From b114fd8b54ac5c3ce0fe5ead64bcc25e9205db6d Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 17:33:24 +0530 Subject: [PATCH 47/84] create workflow based on tags --- .github/workflows/apply.yml | 6 +++--- .github/workflows/release.yml | 4 ++-- environments/production/variables.tf | 2 +- environments/sandbox/variables.tf | 2 +- modules/vpc/variables.tf | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 591b9d8..43ff156 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -11,7 +11,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-2' + AWS_REGION: 'us-east-2' steps: - name: 'Checkout' @@ -43,7 +43,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-2' + AWS_REGION: 'us-east-2' steps: - name: 'Checkout' @@ -75,7 +75,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-1' + AWS_REGION: 'us-east-2' steps: - name: 'Checkout' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 210f901..b5ebf1c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-2' + AWS_REGION: 'us-east-2' steps: - name: 'Checkout' @@ -61,7 +61,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-1' + AWS_REGION: 'us-east-2' steps: - name: 'Checkout' diff --git a/environments/production/variables.tf b/environments/production/variables.tf index 1d63aed..1d77dfa 100644 --- a/environments/production/variables.tf +++ b/environments/production/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-west-2" + default = "us-east-2" } variable "zones" { diff --git a/environments/sandbox/variables.tf b/environments/sandbox/variables.tf index 1d63aed..1d77dfa 100644 --- a/environments/sandbox/variables.tf +++ b/environments/sandbox/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-west-2" + default = "us-east-2" } variable "zones" { diff --git a/modules/vpc/variables.tf b/modules/vpc/variables.tf index 1d63aed..1d77dfa 100644 --- a/modules/vpc/variables.tf +++ b/modules/vpc/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-west-2" + default = "us-east-2" } variable "zones" { From 5cac3fc94c6cef33ec9f127af61a53392c096b3d Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 17:42:22 +0530 Subject: [PATCH 48/84] edited tf files --- .github/workflows/apply.yml | 2 +- environments/sandbox/variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 43ff156..afd3b8a 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -99,5 +99,5 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'apply' - tf_actions_working_dir: './environments/production' + tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true \ No newline at end of file diff --git a/environments/sandbox/variables.tf b/environments/sandbox/variables.tf index 1d77dfa..3bd0fd3 100644 --- a/environments/sandbox/variables.tf +++ b/environments/sandbox/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-2" + default = "us-east-1" } variable "zones" { From 9d030de90f4dd26704516f793ab056a1bd99b929 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 20 Sep 2021 17:49:10 +0530 Subject: [PATCH 49/84] edited tf files in sandbox --- .github/workflows/release.yml | 2 +- environments/sandbox/variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5ebf1c..aab3e64 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-west-2' + AWS_REGION: 'us-east-2' steps: - name: 'Checkout' diff --git a/environments/sandbox/variables.tf b/environments/sandbox/variables.tf index 3bd0fd3..1d77dfa 100644 --- a/environments/sandbox/variables.tf +++ b/environments/sandbox/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-1" + default = "us-east-2" } variable "zones" { From d748ff8b7cdf69bab0718f8a2acf16c810807f06 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:32:14 +0530 Subject: [PATCH 50/84] Create deploy.sh --- deploy.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..541ddaa --- /dev/null +++ b/deploy.sh @@ -0,0 +1 @@ +this is madhu From 76b4062ebad568c2883f485fb91fde875dd44581 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:37:23 +0530 Subject: [PATCH 51/84] Update apply.yml --- .github/workflows/apply.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index afd3b8a..03224ed 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -14,6 +14,12 @@ jobs: AWS_REGION: 'us-east-2' steps: + - shell: bash + run: | + source $BASH_ENV + ./bin/deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan + + - name: 'Checkout' uses: actions/checkout@master - name: 'Terraform Init' @@ -24,7 +30,8 @@ jobs: tf_actions_working_dir: './modules/vpc' tf_actions_comment: true - name: 'Terraform plan' - uses: hashicorp/terraform-github-actions@master + uses: hashicorp/terraform-github-actions@master + with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' @@ -100,4 +107,4 @@ jobs: tf_actions_version: 0.12.13 tf_actions_subcommand: 'apply' tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true \ No newline at end of file + tf_actions_comment: true From d2b7d5b5fdc3f5e6b9143b8be2b8040eb39cbe79 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:53:22 +0530 Subject: [PATCH 52/84] Update apply.yml --- .github/workflows/apply.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 03224ed..aea8671 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -17,7 +17,7 @@ jobs: - shell: bash run: | source $BASH_ENV - ./bin/deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan + deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan - name: 'Checkout' From b50b13a2d8e9a6506fe3bcdf0c873b8964ebfd6b Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:59:09 +0530 Subject: [PATCH 53/84] Update apply.yml --- .github/workflows/apply.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index aea8671..ac25e0c 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -17,7 +17,7 @@ jobs: - shell: bash run: | source $BASH_ENV - deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan + ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan - name: 'Checkout' From 900793f20cf426878b4c19a99c24856426b574a4 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Nov 2021 17:06:07 +0530 Subject: [PATCH 54/84] Update apply.yml --- .github/workflows/apply.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index ac25e0c..13880fe 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -13,15 +13,14 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} AWS_REGION: 'us-east-2' - steps: - - shell: bash - run: | - source $BASH_ENV - ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan + steps: - name: 'Checkout' uses: actions/checkout@master + - shell: bash + run: ./deploy.sh + - name: 'Terraform Init' uses: hashicorp/terraform-github-actions@master with: From 137293fe6185e365416e5f179560dea995ca04f6 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Mon, 8 Nov 2021 17:09:48 +0530 Subject: [PATCH 55/84] Update apply.yml --- .github/workflows/apply.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 13880fe..c05e9d1 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -5,7 +5,7 @@ on: types: [ closed ] jobs: - terraform-module: + terraform-management: name: "Terraform-modules" runs-on: ubuntu-latest env: From 1b9cfe2c64906c5a1cf663df6d6fb8015a8a5039 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 09:06:37 +0530 Subject: [PATCH 56/84] Update apply.yml --- .github/workflows/apply.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index c05e9d1..2416919 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -14,13 +14,8 @@ jobs: AWS_REGION: 'us-east-2' steps: - - - name: 'Checkout' - uses: actions/checkout@master - - shell: bash - run: ./deploy.sh - + uses: actions/checkout@master - name: 'Terraform Init' uses: hashicorp/terraform-github-actions@master with: @@ -43,6 +38,10 @@ jobs: tf_actions_subcommand: 'apply' tf_actions_working_dir: './modules/vpc' tf_actions_comment: true + - name: run shell script + run: | + chmod +x ./deploy.sh + ./deploy.sh terraform: name: "Terraform" runs-on: ubuntu-latest From 5afda38726cde920b17cb6c95b8410393d6860b0 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 09:44:29 +0530 Subject: [PATCH 57/84] Update variables.tf --- modules/vpc/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/vpc/variables.tf b/modules/vpc/variables.tf index 1d77dfa..1d63aed 100644 --- a/modules/vpc/variables.tf +++ b/modules/vpc/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-2" + default = "us-west-2" } variable "zones" { From f7095bc9b6d53bd0ceb3acd7cccfd84feb92cf95 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 10:59:43 +0530 Subject: [PATCH 58/84] Update release.yml --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aab3e64..16ed138 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,10 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './modules/vpc' tf_actions_comment: true + - name: run shell script + run: | + chmod +x ./deploy.sh + ./deploy.sh terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest @@ -79,4 +83,4 @@ jobs: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true \ No newline at end of file + tf_actions_comment: true From 08e20e4fab893d576be83a5b2e7907cb146b930c Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:02:29 +0530 Subject: [PATCH 59/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 16ed138..51ed3af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh + ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest From 55328bb1d5b5d68e208ecbc293a344c6c137be45 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:04:30 +0530 Subject: [PATCH 60/84] Update deploy.sh --- deploy.sh | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 145 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 541ddaa..4e2baa5 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1 +1,145 @@ -this is madhu +#!/usr/bin/env bash + +# set -x # Un-comment to debug this script + +#TF_LOG=DEBUG; TF_LOG_PATH=~tf.log # Un-comment to debug terraform + +if [ -z "${BASH_VERSINFO[*]}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ]; then + echo "This script requires Bash version >= 4" + exit 1 +fi + +programname=$0 +SCRIPT_REL_DIR=$(dirname "${0}") +ROOT=$(realpath "$SCRIPT_REL_DIR/../") +cd "$ROOT" || exit + +TERRAFORM_OPTS=() + +# echo 'pull latest code ...' +# git pull origin master + +usage() { + echo "usage: $programname [-e environment] [-o operation]" + echo "MANDATORY:" + echo " -e, --environment VAL specify environment [global sandbox staging production management ops new_sandbox]" + echo " -o, --operation VAL specify operation [plan print_output apply]" + echo "OPTIONAL:" + echo " -a, --auto-approve TERRAFORM_OPTS: auto-approve on apply" + exit 1 +} + +parse_params() { + while [ ! $# -eq 0 ]; do + case "$1" in + --help | -h) + usage + exit + ;; + --environment | -e) + ENV=$2 + if [[ $ENV != "global" && $ENV != "sandbox" && $ENV != "staging" && $ENV != "production" && $ENV != "management" && $ENV != "ops" && $ENV != "new_sandbox" ]]; then + echo "Wrong environment: $ENV. Valid options: global sandbox staging production management ops" + exit 1 + fi + ;; + --operation | -o) + OPER=$2 + if [[ $OPER != "plan" && $OPER != "print_output" && $OPER != "apply" ]]; then + echo "Wrong operation: $OPER. Valid options: plan print_output apply" + exit 1 + fi + ;; + --auto-approve | -a) + if [[ $OPER == "apply" ]]; then + TERRAFORM_OPTS+=('-auto-approve') + fi + ;; + esac + shift + done +} + +print_params() { + echo "-------------------------------" + echo "ENV : $ENV" + echo "OPER : $OPER" + echo "-------------------------------" +} + +select_environment() { + ENVS=("global" "sandbox" "staging" "production" "management" "ops") + echo "Select environment:" + select var in "${ENVS[@]}"; do + ENV=$var + break + done +} + +select_oper() { + OPERS=("apply" "plan" "print_output") + echo "Select operation:" + select oper in "${OPERS[@]}"; do + OPER=$oper + break + done +} + +release_notes() { + RELEASE="RELEASES.md" + if ! grep -q "$PROJECT" $RELEASE; then + echo "#$PROJECT" >>$RELEASE + fi + DATE=$(date +%Y-%m-%d) + sed -i "/$PROJECT/a * **$DATE** - $DESCRIPTION" $RELEASE +} + +get_output_var() { + terraform output -json | jq -r ".$1.value" +} + +# Display output +display_output() { + terraform output +} + +do_project() { + # cd to env folder + cd "environments/$ENV" || exit + + # Deploy architecture + if [[ $OPER == "print_output" ]]; then + display_output + else + echo "Performing $OPER" + terraform "$OPER" "${TERRAFORM_OPTS[@]}" || exit 1 + fi +} + +update_shared_json() { + if [[ $ENV == "global" ]]; then + echo "[Skipping] Uploading shared.json to S3 - global env does not expose shared.json" + elif [[ $OPER != "apply" ]]; then + echo "[Skipping] Uploading shared.json to S3 - terraform outputs are updated only on apply" + else + echo 'Uploading shared.json to S3 ...' + + output=$(terraform output -json) + echo "$output" >shared.json + + aws s3 cp shared.json "s3://lambda-$ENV.spire.io/shared.json" + fi +} + +# execution sequence: +[[ $# -eq 0 ]] && usage +parse_params "$@" +print_params +# select_project +# select_environment +# select_oper +do_project +update_shared_json + +echo '' +echo 'done.' From 69eb5b5d36f7d1b1b2f324c5e1bc570aba892401 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:08:05 +0530 Subject: [PATCH 61/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51ed3af..4d8e58e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a + ./deploy.sh -e -o plan -a terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest From 21a3e11879b5d53885a5818dc7c287ee9aa82914 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:10:05 +0530 Subject: [PATCH 62/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d8e58e..b6c0beb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e -o plan -a + ./deploy.sh -e sandbox -o plan -a terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest From 457a65ac10a1b8e55da8649afa0944a464a30062 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:14:43 +0530 Subject: [PATCH 63/84] Update release.yml --- .github/workflows/release.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6c0beb..94ee3f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,10 +30,7 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './modules/vpc' tf_actions_comment: true - - name: run shell script - run: | - chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + terraform-prod: name: "Terraform-prod" runs-on: ubuntu-latest @@ -59,6 +56,12 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/production' tf_actions_comment: true + - name: run shell script + run: | + source $BASH_ENV + chmod +x ./deploy.sh + ./deploy.sh -e production -o plan -a + terraform-sandbox: name: "sandbox-Terraform" runs-on: ubuntu-latest From 261bd62898edb738d769901b14c323639be4934c Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:16:45 +0530 Subject: [PATCH 64/84] Update release.yml --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94ee3f1..fa15e32 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,7 +58,6 @@ jobs: tf_actions_comment: true - name: run shell script run: | - source $BASH_ENV chmod +x ./deploy.sh ./deploy.sh -e production -o plan -a From 9189ac38f4d9897c17a3b45a495af3be339e06b3 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:48:11 +0530 Subject: [PATCH 65/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa15e32..7bea169 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,7 +59,7 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e production -o plan -a + ./deploy.sh -e sandbox -o plan -a terraform-sandbox: name: "sandbox-Terraform" From 5d6c2c57352da3801f1ebbc42c1cb94accddb16c Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:56:43 +0530 Subject: [PATCH 66/84] Update release.yml --- .github/workflows/release.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7bea169..69481df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,10 +56,7 @@ jobs: tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/production' tf_actions_comment: true - - name: run shell script - run: | - chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + terraform-sandbox: name: "sandbox-Terraform" @@ -85,4 +82,8 @@ jobs: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true + tf_actions_comment: true + - name: run shell script + run: | + chmod +x ./deploy.sh + ./deploy.sh -e sandbox -o plan -a From 6706a6999dafd7d2e41743cb0e34abb224f031cc Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:37:38 +0530 Subject: [PATCH 67/84] Update release.yml --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69481df..91df5bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,6 +47,7 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' + TERRAFORM_ENVIRONMENT: production tf_actions_working_dir: './environments/production' tf_actions_comment: true - name: 'Terraform plan' @@ -81,6 +82,7 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' + TERRAFORM_ENVIRONMENT: sandbox tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true - name: run shell script From 99032ed70cbbeda4c43cafcd9a9a57a71ec891b7 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:38:48 +0530 Subject: [PATCH 68/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91df5bb..8cc0fe6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,4 +88,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a From e973639d15f1404e15ac936a5e490a4500e09ac3 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:55:33 +0530 Subject: [PATCH 69/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8cc0fe6..7cbb6af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,4 +88,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a + ./deploy.sh -a plan From c439db57ddc6872d5fe538aaa5b2945e82c3e83e Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:38:20 +0530 Subject: [PATCH 70/84] Update release.yml --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7cbb6af..435aa09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,8 +84,11 @@ jobs: tf_actions_subcommand: 'plan' TERRAFORM_ENVIRONMENT: sandbox tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true + tf_actions_comment: true + env: + TF_CLI_ARGS_init: '-var="TERRAFORM_ENVIRONMENT=sandbox"' + - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -a plan + ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a From 24ba7bafd767dd7f6e86772aabf499f1878aa540 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:44:08 +0530 Subject: [PATCH 71/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 435aa09..eb52ea8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,4 +91,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a + ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a From 39842d3c051b774736e7dc18df41b4672c1d8a42 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:46:22 +0530 Subject: [PATCH 72/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb52ea8..3348a95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,4 +91,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e << parameters.TERRAFORM_ENVIRONMENT >> -o plan -a + ./deploy.sh -e 'parameters.TERRAFORM_ENVIRONMENT' -o plan -a From b6250961efcb649352cc29145192f1123438faa5 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:48:14 +0530 Subject: [PATCH 73/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3348a95..dd6a2a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,4 +91,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e 'parameters.TERRAFORM_ENVIRONMENT' -o plan -a + ./deploy.sh -e sandbox -o plan -a From 4bd9a39d208b4068cd596f843f60b171bee8f34c Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:52:32 +0530 Subject: [PATCH 74/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd6a2a0..e798e68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,4 +91,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + ./deploy.sh -e env.TERRAFORM_ENVIRONMENT -o plan -a From ab2717e6cf63fd8fa4d9983f5c93e5c67d26cc54 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:55:14 +0530 Subject: [PATCH 75/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e798e68..daac4fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,7 +86,7 @@ jobs: tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true env: - TF_CLI_ARGS_init: '-var="TERRAFORM_ENVIRONMENT=sandbox"' + ENV: '-var="TERRAFORM_ENVIRONMENT=sandbox"' - name: run shell script run: | From 8df971a3920c112fe2b0b8ec6448f765009b8378 Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:11:06 +0530 Subject: [PATCH 76/84] Create deploy.sh --- .github/deploy.sh | 145 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 .github/deploy.sh diff --git a/.github/deploy.sh b/.github/deploy.sh new file mode 100644 index 0000000..4e2baa5 --- /dev/null +++ b/.github/deploy.sh @@ -0,0 +1,145 @@ +#!/usr/bin/env bash + +# set -x # Un-comment to debug this script + +#TF_LOG=DEBUG; TF_LOG_PATH=~tf.log # Un-comment to debug terraform + +if [ -z "${BASH_VERSINFO[*]}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ]; then + echo "This script requires Bash version >= 4" + exit 1 +fi + +programname=$0 +SCRIPT_REL_DIR=$(dirname "${0}") +ROOT=$(realpath "$SCRIPT_REL_DIR/../") +cd "$ROOT" || exit + +TERRAFORM_OPTS=() + +# echo 'pull latest code ...' +# git pull origin master + +usage() { + echo "usage: $programname [-e environment] [-o operation]" + echo "MANDATORY:" + echo " -e, --environment VAL specify environment [global sandbox staging production management ops new_sandbox]" + echo " -o, --operation VAL specify operation [plan print_output apply]" + echo "OPTIONAL:" + echo " -a, --auto-approve TERRAFORM_OPTS: auto-approve on apply" + exit 1 +} + +parse_params() { + while [ ! $# -eq 0 ]; do + case "$1" in + --help | -h) + usage + exit + ;; + --environment | -e) + ENV=$2 + if [[ $ENV != "global" && $ENV != "sandbox" && $ENV != "staging" && $ENV != "production" && $ENV != "management" && $ENV != "ops" && $ENV != "new_sandbox" ]]; then + echo "Wrong environment: $ENV. Valid options: global sandbox staging production management ops" + exit 1 + fi + ;; + --operation | -o) + OPER=$2 + if [[ $OPER != "plan" && $OPER != "print_output" && $OPER != "apply" ]]; then + echo "Wrong operation: $OPER. Valid options: plan print_output apply" + exit 1 + fi + ;; + --auto-approve | -a) + if [[ $OPER == "apply" ]]; then + TERRAFORM_OPTS+=('-auto-approve') + fi + ;; + esac + shift + done +} + +print_params() { + echo "-------------------------------" + echo "ENV : $ENV" + echo "OPER : $OPER" + echo "-------------------------------" +} + +select_environment() { + ENVS=("global" "sandbox" "staging" "production" "management" "ops") + echo "Select environment:" + select var in "${ENVS[@]}"; do + ENV=$var + break + done +} + +select_oper() { + OPERS=("apply" "plan" "print_output") + echo "Select operation:" + select oper in "${OPERS[@]}"; do + OPER=$oper + break + done +} + +release_notes() { + RELEASE="RELEASES.md" + if ! grep -q "$PROJECT" $RELEASE; then + echo "#$PROJECT" >>$RELEASE + fi + DATE=$(date +%Y-%m-%d) + sed -i "/$PROJECT/a * **$DATE** - $DESCRIPTION" $RELEASE +} + +get_output_var() { + terraform output -json | jq -r ".$1.value" +} + +# Display output +display_output() { + terraform output +} + +do_project() { + # cd to env folder + cd "environments/$ENV" || exit + + # Deploy architecture + if [[ $OPER == "print_output" ]]; then + display_output + else + echo "Performing $OPER" + terraform "$OPER" "${TERRAFORM_OPTS[@]}" || exit 1 + fi +} + +update_shared_json() { + if [[ $ENV == "global" ]]; then + echo "[Skipping] Uploading shared.json to S3 - global env does not expose shared.json" + elif [[ $OPER != "apply" ]]; then + echo "[Skipping] Uploading shared.json to S3 - terraform outputs are updated only on apply" + else + echo 'Uploading shared.json to S3 ...' + + output=$(terraform output -json) + echo "$output" >shared.json + + aws s3 cp shared.json "s3://lambda-$ENV.spire.io/shared.json" + fi +} + +# execution sequence: +[[ $# -eq 0 ]] && usage +parse_params "$@" +print_params +# select_project +# select_environment +# select_oper +do_project +update_shared_json + +echo '' +echo 'done.' From 8a9c46c7cbd9655e3c68b04dfb1ccb4ebdb6fa7f Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:16:23 +0530 Subject: [PATCH 77/84] Update release.yml --- .github/workflows/release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index daac4fc..eda5058 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,10 +62,7 @@ jobs: terraform-sandbox: name: "sandbox-Terraform" runs-on: ubuntu-latest - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + environment: sandbox steps: - name: 'Checkout' From 3eaf5a41448897b908f3ed417debd91aee985bbf Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:22:34 +0530 Subject: [PATCH 78/84] Update release.yml --- .github/workflows/release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eda5058..be1d4bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,6 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' - TERRAFORM_ENVIRONMENT: production tf_actions_working_dir: './environments/production' tf_actions_comment: true - name: 'Terraform plan' @@ -79,7 +78,6 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' - TERRAFORM_ENVIRONMENT: sandbox tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true env: @@ -88,4 +86,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e env.TERRAFORM_ENVIRONMENT -o plan -a + ./deploy.sh -e sandbox -o plan -a From d1d6c092576ced91e36df28510765a3efcd68e1f Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:27:19 +0530 Subject: [PATCH 79/84] Update release.yml --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be1d4bf..590ddad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,10 @@ jobs: terraform-sandbox: name: "sandbox-Terraform" runs-on: ubuntu-latest - environment: sandbox + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + AWS_REGION: 'us-east-2' steps: - name: 'Checkout' @@ -81,7 +84,7 @@ jobs: tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true env: - ENV: '-var="TERRAFORM_ENVIRONMENT=sandbox"' + ENV: '-var="ENV=sandbox"' - name: run shell script run: | From 00393ed8d7547b674843aade6bd997a57be59e0b Mon Sep 17 00:00:00 2001 From: maddytestaccount <78583881+maddytestaccount@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:36:21 +0530 Subject: [PATCH 80/84] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 590ddad..0379efd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,4 +89,4 @@ jobs: - name: run shell script run: | chmod +x ./deploy.sh - ./deploy.sh -e sandbox -o plan -a + ./deploy.sh -e echo $sandbox -o plan -a From 5260ba1ba936613a70a19e1afc1e1b012f63aedf Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 29 Nov 2021 12:56:51 +0530 Subject: [PATCH 81/84] adding deploy.sh --- .github/workflows/apply.yml | 80 ++++++++++++++-------------- .github/workflows/release.yml | 52 ++++++++---------- {.github => bin}/deploy.sh | 0 environments/production/variables.tf | 16 +++--- environments/production/vpc.tf | 3 ++ environments/sandbox/variables.tf | 2 +- environments/sandbox/vpc.tf | 1 + modules/core/variables.tf | 0 modules/vpc/main.tf | 2 +- modules/vpc/output.tf | 23 ++++++++ modules/vpc/variables.tf | 2 +- provider.tf | 5 +- 12 files changed, 104 insertions(+), 82 deletions(-) rename {.github => bin}/deploy.sh (100%) create mode 100644 modules/core/variables.tf create mode 100644 modules/vpc/output.tf diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 2416919..d06a5db 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -5,54 +5,52 @@ on: types: [ closed ] jobs: - terraform-management: - name: "Terraform-modules" - runs-on: ubuntu-latest - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + # terraform-module: + # name: "Terraform-modules" + # runs-on: ubuntu-latest + # env: + # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} + # AWS_REGION: 'ap-east-1' - steps: - - name: 'Checkout' - uses: actions/checkout@master - - name: 'Terraform Init' - uses: hashicorp/terraform-github-actions@master - with: - tf_actions_version: 0.12.13 - tf_actions_subcommand: 'init' - tf_actions_working_dir: './modules/vpc' - tf_actions_comment: true - - name: 'Terraform plan' - uses: hashicorp/terraform-github-actions@master - - with: - tf_actions_version: 0.12.13 - tf_actions_subcommand: 'plan' - tf_actions_working_dir: './modules/vpc' - tf_actions_comment: true - - name: 'Terraform apply' - uses: hashicorp/terraform-github-actions@master - with: - tf_actions_version: 0.12.13 - tf_actions_subcommand: 'apply' - tf_actions_working_dir: './modules/vpc' - tf_actions_comment: true - - name: run shell script - run: | - chmod +x ./deploy.sh - ./deploy.sh + # steps: + # - name: 'Checkout' + # uses: actions/checkout@master + # - name: 'Terraform Init' + # uses: hashicorp/terraform-github-actions@master + # with: + # tf_actions_version: 0.12.13 + # tf_actions_subcommand: 'init' + # tf_actions_working_dir: './modules/vpc' + # tf_actions_comment: true + # - name: 'Terraform plan' + # uses: hashicorp/terraform-github-actions@master + # with: + # tf_actions_version: 0.12.13 + # tf_actions_subcommand: 'plan' + # tf_actions_working_dir: './modules/vpc' + # tf_actions_comment: true + # - name: 'Terraform apply' + # uses: hashicorp/terraform-github-actions@master + # with: + # tf_actions_version: 0.12.13 + # tf_actions_subcommand: 'apply' + # tf_actions_working_dir: './modules/vpc' + # tf_actions_comment: true terraform: name: "Terraform" + needs: terraform-sandbox runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'eu-central-1' steps: - name: 'Checkout' uses: actions/checkout@master + - name: set-env + run: echo "tf_actions_working_dir=$(echo $tf_actions_working_dir | cut -c 1-6)" >> $GITHUB_ENV - name: 'Terraform Init' uses: hashicorp/terraform-github-actions@master with: @@ -60,8 +58,11 @@ jobs: tf_actions_subcommand: 'init' tf_actions_working_dir: './environments/production' tf_actions_comment: true + - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master + - name: set env + run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' @@ -76,11 +77,12 @@ jobs: tf_actions_comment: true terraform-sandbox: name: "sandbox-Terraform" + runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'ap-south-1' steps: - name: 'Checkout' @@ -105,4 +107,4 @@ jobs: tf_actions_version: 0.12.13 tf_actions_subcommand: 'apply' tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true + tf_actions_comment: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0379efd..bfce7b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'ap-east-1' steps: - name: 'Checkout' @@ -23,21 +23,21 @@ jobs: tf_actions_subcommand: 'init' tf_actions_working_dir: './modules/vpc' tf_actions_comment: true - - name: 'Terraform plan' - uses: hashicorp/terraform-github-actions@master - with: - tf_actions_version: 0.12.13 - tf_actions_subcommand: 'plan' - tf_actions_working_dir: './modules/vpc' - tf_actions_comment: true - - terraform-prod: - name: "Terraform-prod" + # - name: 'Terraform plan' + # uses: hashicorp/terraform-github-actions@master + # with: + # tf_actions_version: 0.12.13 + # tf_actions_subcommand: 'plan' + # tf_actions_working_dir: './modules/vpc' + # tf_actions_comment: true + terraform-sandbox: + name: "sandbox-Terraform" + needs: terraform-module runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'ap-south-1' steps: - name: 'Checkout' @@ -47,24 +47,23 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' - tf_actions_working_dir: './environments/production' + tf_actions_working_dir: './environments/sandbox' tf_actions_comment: true - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' - tf_actions_working_dir: './environments/production' - tf_actions_comment: true - - - terraform-sandbox: - name: "sandbox-Terraform" + tf_actions_working_dir: './environments/sandbox' + tf_actions_comment: true + terraform-prod: + name: "Terraform-prod" + needs: terraform-sandbox runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }} - AWS_REGION: 'us-east-2' + AWS_REGION: 'eu-central-1' steps: - name: 'Checkout' @@ -74,19 +73,12 @@ jobs: with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'init' - tf_actions_working_dir: './environments/sandbox' + tf_actions_working_dir: './environments/production' tf_actions_comment: true - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' - tf_actions_working_dir: './environments/sandbox' - tf_actions_comment: true - env: - ENV: '-var="ENV=sandbox"' - - - name: run shell script - run: | - chmod +x ./deploy.sh - ./deploy.sh -e echo $sandbox -o plan -a + tf_actions_working_dir: './environments/production' + tf_actions_comment: true \ No newline at end of file diff --git a/.github/deploy.sh b/bin/deploy.sh similarity index 100% rename from .github/deploy.sh rename to bin/deploy.sh diff --git a/environments/production/variables.tf b/environments/production/variables.tf index 1d77dfa..45cdb67 100644 --- a/environments/production/variables.tf +++ b/environments/production/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-2" + default = "eu-central-1" } variable "zones" { @@ -11,21 +11,21 @@ variable "zones" { } variable "vpc_cidr" { - default = "10.0.0.0/16" + default = "10.100.0.0/16" } variable "public_subnet_cidr_blocks" { default = { - zone0 = "10.0.10.0/24" - zone1 = "10.0.20.0/24" - zone2 = "10.0.30.0/24" + zone0 = "10.100.10.0/24" + zone1 = "10.100.20.0/24" + zone2 = "10.100.30.0/24" } } variable "private_subnet_cidr_blocks" { default = { - zone0 = "10.0.11.0/24" - zone1 = "10.0.21.0/24" - zone2 = "10.0.31.0/24" + zone0 = "10.100.11.0/24" + zone1 = "10.100.21.0/24" + zone2 = "10.100.31.0/24" } } diff --git a/environments/production/vpc.tf b/environments/production/vpc.tf index 5ba3782..f58b0cd 100644 --- a/environments/production/vpc.tf +++ b/environments/production/vpc.tf @@ -1,3 +1,4 @@ +# VPC module "vpc" { source = "../../modules/vpc" vpc_cidr = var.vpc_cidr @@ -5,3 +6,5 @@ module "vpc" { region = var.region zones = var.zones } + +## Security groups diff --git a/environments/sandbox/variables.tf b/environments/sandbox/variables.tf index 1d77dfa..d9784ea 100644 --- a/environments/sandbox/variables.tf +++ b/environments/sandbox/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-east-2" + default = "ap-south-1" } variable "zones" { diff --git a/environments/sandbox/vpc.tf b/environments/sandbox/vpc.tf index 5ba3782..c3108d1 100644 --- a/environments/sandbox/vpc.tf +++ b/environments/sandbox/vpc.tf @@ -1,3 +1,4 @@ +# VPC module "vpc" { source = "../../modules/vpc" vpc_cidr = var.vpc_cidr diff --git a/modules/core/variables.tf b/modules/core/variables.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/vpc/main.tf b/modules/vpc/main.tf index 341708f..ce1d93a 100644 --- a/modules/vpc/main.tf +++ b/modules/vpc/main.tf @@ -5,7 +5,7 @@ # VPC resource "aws_vpc" "default" { cidr_block = var.vpc_cidr - enable_dns_hostnames = false + enable_dns_hostnames = true tags = { Environment = var.env diff --git a/modules/vpc/output.tf b/modules/vpc/output.tf new file mode 100644 index 0000000..846c56e --- /dev/null +++ b/modules/vpc/output.tf @@ -0,0 +1,23 @@ +output "vpc_id" { + value = aws_vpc.default.id +} + +output "vpc_public_subnets" { + value = aws_subnet.public.*.id +} + +output "vpc_private_subnets" { + value = aws_subnet.private.*.id +} + +output "lambda_subnets" { + value = aws_subnet.private.*.id +} + +output "vpc_private_rt" { + value = aws_route_table.main.id +} + +output "vpc_public_rt" { + value = aws_route_table.custom.id +} diff --git a/modules/vpc/variables.tf b/modules/vpc/variables.tf index 1d63aed..83df322 100644 --- a/modules/vpc/variables.tf +++ b/modules/vpc/variables.tf @@ -3,7 +3,7 @@ variable "env" { } variable "region" { - default = "us-west-2" + default = "ap-east-1" } variable "zones" { diff --git a/provider.tf b/provider.tf index 336dd3a..cf0b0db 100644 --- a/provider.tf +++ b/provider.tf @@ -1,4 +1,5 @@ provider "aws" { - region = var.region - version = "~> 2.70.0" + region = "us-east-2" + access_key = "AKIAXDSL7DJCRCBXV7E2" + secret_key = "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" } \ No newline at end of file From 14fe14bbc006724ad085d1fb4fa21a39efcf52fd Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 29 Nov 2021 13:37:02 +0530 Subject: [PATCH 82/84] update apply.yml file --- deploy.sh | 145 ------------------------------------------------------ 1 file changed, 145 deletions(-) delete mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index 4e2baa5..0000000 --- a/deploy.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env bash - -# set -x # Un-comment to debug this script - -#TF_LOG=DEBUG; TF_LOG_PATH=~tf.log # Un-comment to debug terraform - -if [ -z "${BASH_VERSINFO[*]}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ]; then - echo "This script requires Bash version >= 4" - exit 1 -fi - -programname=$0 -SCRIPT_REL_DIR=$(dirname "${0}") -ROOT=$(realpath "$SCRIPT_REL_DIR/../") -cd "$ROOT" || exit - -TERRAFORM_OPTS=() - -# echo 'pull latest code ...' -# git pull origin master - -usage() { - echo "usage: $programname [-e environment] [-o operation]" - echo "MANDATORY:" - echo " -e, --environment VAL specify environment [global sandbox staging production management ops new_sandbox]" - echo " -o, --operation VAL specify operation [plan print_output apply]" - echo "OPTIONAL:" - echo " -a, --auto-approve TERRAFORM_OPTS: auto-approve on apply" - exit 1 -} - -parse_params() { - while [ ! $# -eq 0 ]; do - case "$1" in - --help | -h) - usage - exit - ;; - --environment | -e) - ENV=$2 - if [[ $ENV != "global" && $ENV != "sandbox" && $ENV != "staging" && $ENV != "production" && $ENV != "management" && $ENV != "ops" && $ENV != "new_sandbox" ]]; then - echo "Wrong environment: $ENV. Valid options: global sandbox staging production management ops" - exit 1 - fi - ;; - --operation | -o) - OPER=$2 - if [[ $OPER != "plan" && $OPER != "print_output" && $OPER != "apply" ]]; then - echo "Wrong operation: $OPER. Valid options: plan print_output apply" - exit 1 - fi - ;; - --auto-approve | -a) - if [[ $OPER == "apply" ]]; then - TERRAFORM_OPTS+=('-auto-approve') - fi - ;; - esac - shift - done -} - -print_params() { - echo "-------------------------------" - echo "ENV : $ENV" - echo "OPER : $OPER" - echo "-------------------------------" -} - -select_environment() { - ENVS=("global" "sandbox" "staging" "production" "management" "ops") - echo "Select environment:" - select var in "${ENVS[@]}"; do - ENV=$var - break - done -} - -select_oper() { - OPERS=("apply" "plan" "print_output") - echo "Select operation:" - select oper in "${OPERS[@]}"; do - OPER=$oper - break - done -} - -release_notes() { - RELEASE="RELEASES.md" - if ! grep -q "$PROJECT" $RELEASE; then - echo "#$PROJECT" >>$RELEASE - fi - DATE=$(date +%Y-%m-%d) - sed -i "/$PROJECT/a * **$DATE** - $DESCRIPTION" $RELEASE -} - -get_output_var() { - terraform output -json | jq -r ".$1.value" -} - -# Display output -display_output() { - terraform output -} - -do_project() { - # cd to env folder - cd "environments/$ENV" || exit - - # Deploy architecture - if [[ $OPER == "print_output" ]]; then - display_output - else - echo "Performing $OPER" - terraform "$OPER" "${TERRAFORM_OPTS[@]}" || exit 1 - fi -} - -update_shared_json() { - if [[ $ENV == "global" ]]; then - echo "[Skipping] Uploading shared.json to S3 - global env does not expose shared.json" - elif [[ $OPER != "apply" ]]; then - echo "[Skipping] Uploading shared.json to S3 - terraform outputs are updated only on apply" - else - echo 'Uploading shared.json to S3 ...' - - output=$(terraform output -json) - echo "$output" >shared.json - - aws s3 cp shared.json "s3://lambda-$ENV.spire.io/shared.json" - fi -} - -# execution sequence: -[[ $# -eq 0 ]] && usage -parse_params "$@" -print_params -# select_project -# select_environment -# select_oper -do_project -update_shared_json - -echo '' -echo 'done.' From da05d57131a9a2ebb72e44a63420baa6692f30f4 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 29 Nov 2021 13:40:10 +0530 Subject: [PATCH 83/84] update apply.yml file --- .github/workflows/apply.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index d06a5db..9f142a3 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -62,7 +62,7 @@ jobs: - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master - name: set env - run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan + run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan >> $GITHUB_ENV with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' From ee428716f66b2fbfd2546e64cf7f15f20640ba28 Mon Sep 17 00:00:00 2001 From: madhusudhanarava Date: Mon, 29 Nov 2021 13:42:33 +0530 Subject: [PATCH 84/84] updated tf files --- .github/workflows/apply.yml | 2 +- provider.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 9f142a3..f09c4f4 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -62,7 +62,7 @@ jobs: - name: 'Terraform plan' uses: hashicorp/terraform-github-actions@master - name: set env - run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan >> $GITHUB_ENV + run: ./bin/deploy.sh -e $tf_actions_working_dir -o plan >> $GITHUB_ENV with: tf_actions_version: 0.12.13 tf_actions_subcommand: 'plan' diff --git a/provider.tf b/provider.tf index cf0b0db..4c75b5a 100644 --- a/provider.tf +++ b/provider.tf @@ -1,5 +1,5 @@ provider "aws" { region = "us-east-2" - access_key = "AKIAXDSL7DJCRCBXV7E2" - secret_key = "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" + access_key = "AKIAXDSL7DJCYKZR6MFU" + secret_key = "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" } \ No newline at end of file