Skip to content

Commit 340ed5a

Browse files
Patch/test ephemeral sandbox deploys (#22)
* test ephemeral sandbox * test ephemeral sandbox * fix prod hcls * fix strategy setting * fix strategy setting * fix input name
1 parent 3718314 commit 340ed5a

File tree

15 files changed

+122
-72
lines changed

15 files changed

+122
-72
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy Sandbox Environment
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
branches: [ "**" ]
7+
8+
jobs:
9+
get-tg-versions:
10+
permissions:
11+
contents: read
12+
uses: launchbynttdata/launch-workflows/.github/workflows/reusable-terragrunt-versions.yml@0.1.7
13+
14+
build-matrix:
15+
permissions:
16+
contents: read
17+
uses: launchbynttdata/launch-workflows/.github/workflows/reusable-github-matrix-tg.yml@0.1.7
18+
with:
19+
platform_environment: sandbox
20+
21+
call-terragrunt-deploy:
22+
needs: [get-tg-versions, build-matrix]
23+
permissions:
24+
contents: read
25+
id-token: write
26+
strategy:
27+
fail-fast: false
28+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
29+
30+
uses: launchbynttdata/launch-workflows/.github/workflows/reusable-terragrunt-deploy-ephemeral.yml@feature/tg-deploy-without-gh-environment
31+
with:
32+
git_branch: ${{ github.head_ref }}
33+
assume_role_arn: "arn:aws:iam::020127659860:role/github-actions-deploy-role"
34+
tf_version: ${{ needs.get-tg-versions.outputs.tf_version }}
35+
tg_version: ${{ needs.get-tg-versions.outputs.tg_version }}
36+
region: ${{ matrix.terragrunt_environment.region }}
37+
env_id: ${{ matrix.terragrunt_environment.instance }}
38+
secrets: inherit

.github/workflows/deploy-sandbox.yml renamed to .github/workflows/pull-request-ephemeral-destroy.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Deploy Sandbox Environment
22

33
on:
44
pull_request:
5+
types: [closed]
56
branches: [ "**" ]
67

78
jobs:
@@ -26,11 +27,12 @@ jobs:
2627
fail-fast: false
2728
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
2829

29-
uses: launchbynttdata/launch-workflows/.github/workflows/reusable-terragrunt-deploy.yml@0.1.7
30+
uses: launchbynttdata/launch-workflows/.github/workflows/reusable-terragrunt-destroy-ephemeral.yml@feature/tg-deploy-without-gh-environment
3031
with:
32+
git_branch: ${{ github.head_ref }}
33+
assume_role_arn: "arn:aws:iam::020127659860:role/github-actions-deploy-role"
3134
tf_version: ${{ needs.get-tg-versions.outputs.tf_version }}
3235
tg_version: ${{ needs.get-tg-versions.outputs.tg_version }}
33-
environment: ${{ matrix.terragrunt_environment.environment }}
3436
region: ${{ matrix.terragrunt_environment.region }}
3537
env_id: ${{ matrix.terragrunt_environment.instance }}
3638
secrets: inherit
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
create_package = true
2-
create = true
3-
handler = "app.lambda_handler"
4-
cors = { allow_origins = ["*"] }
5-
source_path = "../../../../../../../src/function/"
6-
name = "platform_sample-useast1-production-000-fn-000"
7-
environment_variables = {
1+
create_package = true
2+
create = true
3+
handler = "app.lambda_handler"
4+
cors = { allow_origins = ["*"] }
5+
source_path = "../../../../../../../src/function/"
6+
environment_variables = {
87
PAYLOAD = "Primary"
98
}
10-

platform/production/us-east-1/000/terragrunt.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ include "root" {
33
}
44

55
locals {
6-
git_tag = "1.0.3"
6+
git_tag = "1.0.0"
77
}
88

99
terraform {
10-
source = "tfr://terraform.registry.launch.nttdata.com/module_primitive/lambda_function/aws?version=${local.git_tag}"
10+
source = "tfr://terraform.registry.launch.nttdata.com/module_reference/lambda_function/aws?version=${local.git_tag}"
1111
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
create_package = true
2-
create = true
3-
handler = "app.lambda_handler"
4-
cors = { allow_origins = ["*"] }
5-
source_path = "../../../../../../../src/function/"
6-
name = "platform_sample-useast2-production-000-fn-000"
7-
environment_variables = {
1+
create_package = true
2+
create = true
3+
handler = "app.lambda_handler"
4+
cors = { allow_origins = ["*"] }
5+
source_path = "../../../../../../../src/function/"
6+
environment_variables = {
87
PAYLOAD = "Failover"
98
}

platform/production/us-east-2/000/terragrunt.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ include "root" {
33
}
44

55
locals {
6-
git_tag = "1.0.3"
6+
git_tag = "1.0.0"
77
}
88

99
terraform {
10-
source = "tfr://terraform.registry.launch.nttdata.com/module_primitive/lambda_function/aws?version=${local.git_tag}"
10+
source = "tfr://terraform.registry.launch.nttdata.com/module_reference/lambda_function/aws?version=${local.git_tag}"
1111
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
create_package = true
2-
create = true
3-
handler = "app.lambda_handler"
4-
cors = { allow_origins = ["*"] }
5-
source_path = "../../../../../../../src/function/"
6-
name = "platform_sample-useast2-sandbox-000-fn-000"
7-
environment_variables = {
1+
create_package = true
2+
create = true
3+
handler = "app.lambda_handler"
4+
cors = { allow_origins = ["*"] }
5+
source_path = "../../../../../../../src/function/"
6+
environment_variables = {
87
PAYLOAD = "Primary-East"
98
}

platform/sandbox/us-east-2/000/terragrunt.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ include "root" {
33
}
44

55
locals {
6-
git_tag = "1.0.3"
6+
git_tag = "1.0.0"
77
}
88

99
terraform {
10-
source = "tfr://terraform.registry.launch.nttdata.com/module_primitive/lambda_function/aws?version=${local.git_tag}"
10+
source = "tfr://terraform.registry.launch.nttdata.com/module_reference/lambda_function/aws?version=${local.git_tag}"
1111
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
create_package = true
2-
create = true
3-
handler = "app.lambda_handler"
4-
cors = { allow_origins = ["*"] }
5-
source_path = "../../../../../../../src/function/"
6-
name = "platform_sample-useast2-sandbox-001-fn-000"
7-
environment_variables = {
1+
create_package = true
2+
create = true
3+
handler = "app.lambda_handler"
4+
cors = { allow_origins = ["*"] }
5+
source_path = "../../../../../../../src/function/"
6+
environment_variables = {
87
PAYLOAD = "Failover-East"
98
}

platform/sandbox/us-east-2/001/terragrunt.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ include "root" {
33
}
44

55
locals {
6-
git_tag = "1.0.3"
6+
git_tag = "1.0.0"
77
}
88

99
terraform {
10-
source = "tfr://terraform.registry.launch.nttdata.com/module_primitive/lambda_function/aws?version=${local.git_tag}"
10+
source = "tfr://terraform.registry.launch.nttdata.com/module_reference/lambda_function/aws?version=${local.git_tag}"
1111
}

0 commit comments

Comments
 (0)