Skip to content

Commit d791199

Browse files
test ephemeral sandbox
1 parent 3718314 commit d791199

File tree

15 files changed

+166
-70
lines changed

15 files changed

+166
-70
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
assume_role_arn: "arn:aws:iam::020127659860:role/github-actions-deploy-role"
33+
tf_version: ${{ needs.get-tg-versions.outputs.tf_version }}
34+
tg_version: ${{ needs.get-tg-versions.outputs.tg_version }}
35+
region: ${{ matrix.terragrunt_environment.region }}
36+
env_id: ${{ matrix.terragrunt_environment.instance }}
37+
secrets: inherit
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy Sandbox Environment
2+
3+
on:
4+
pull_request:
5+
types: [closed]
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-destroy-ephemeral.yml@feature/tg-deploy-without-gh-environment
31+
with:
32+
assume_role_arn: "arn:aws:iam::020127659860:role/github-actions-deploy-role"
33+
tf_version: ${{ needs.get-tg-versions.outputs.tf_version }}
34+
tg_version: ${{ needs.get-tg-versions.outputs.tg_version }}
35+
region: ${{ matrix.terragrunt_environment.region }}
36+
env_id: ${{ matrix.terragrunt_environment.instance }}
37+
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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ include "root" {
22
path = find_in_parent_folders()
33
}
44

5+
include "state" {
6+
path = find_in_parent_folders("state-persistent.hcl")
7+
}
8+
59
locals {
6-
git_tag = "1.0.3"
10+
git_tag = "1.0.0"
711
}
812

913
terraform {
10-
source = "tfr://terraform.registry.launch.nttdata.com/module_primitive/lambda_function/aws?version=${local.git_tag}"
14+
source = "tfr://terraform.registry.launch.nttdata.com/module_reference/lambda_function/aws?version=${local.git_tag}"
1115
}
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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ include "root" {
22
path = find_in_parent_folders()
33
}
44

5+
include "state" {
6+
path = find_in_parent_folders("state-persistent.hcl")
7+
}
8+
59
locals {
6-
git_tag = "1.0.3"
10+
git_tag = "1.0.0"
711
}
812

913
terraform {
10-
source = "tfr://terraform.registry.launch.nttdata.com/module_primitive/lambda_function/aws?version=${local.git_tag}"
14+
source = "tfr://terraform.registry.launch.nttdata.com/module_reference/lambda_function/aws?version=${local.git_tag}"
1115
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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+
resource_names_strategy = "minimal_random_suffix"
7+
environment_variables = {
88
PAYLOAD = "Primary-East"
99
}

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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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+
resource_names_strategy = "minimal_random_suffix"
7+
environment_variables = {
88
PAYLOAD = "Failover-East"
99
}

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)