Skip to content

Commit 7c49d7b

Browse files
feat: Added github actions to create API Gateway and Cognito user pool with App clients
Refer to task unity-sds/unity-cs#124
1 parent 645b5da commit 7c49d7b

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: deployment-api-gateway-and-cognito
2+
on:
3+
workflow_dispatch:
4+
branches: [ main ]
5+
6+
permissions:
7+
id-token: write # required to use OIDC authentication
8+
contents: read # required to checkout the code from the repo
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
## Check Terraform formatting
15+
- name: Terraform Format
16+
working-directory: ./terraform-api-gateway-cognito
17+
id: fmt
18+
run: terraform fmt -check
19+
20+
## Init Terraform
21+
- name: Terraform Init
22+
working-directory: ./terraform-api-gateway-cognito
23+
id: init
24+
run: terraform init
25+
26+
## Validate Terraform
27+
- name: Terraform Validate
28+
working-directory: ./terraform-api-gateway-cognito
29+
id: validate
30+
run: terraform validate -no-color
31+
32+
## Plan Terraform
33+
- name: Terraform Plan
34+
working-directory: ./terraform-api-gateway-cognito
35+
id: plan
36+
run: terraform plan -no-color
37+
continue-on-error: true
38+
39+
## Fail the job if terraform plan doesn't succeed
40+
- name: Terraform Plan Status
41+
working-directory: ./terraform-api-gateway-cognito
42+
id: plan_status
43+
if: steps.plan.outcome == 'failure'
44+
run: exit 1
45+
46+
## Apply Terraform
47+
- name: Terraform Apply
48+
working-directory: ./terraform-api-gateway-cognito
49+
id: apply
50+
run: terraform apply -auto-approve
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: deployment-destroy-api-gateway-and-cognito
2+
on:
3+
workflow_dispatch:
4+
branches: [ main ]
5+
6+
permissions:
7+
id-token: write # required to use OIDC authentication
8+
contents: read # required to checkout the code from the repo
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
## Check Terraform formatting
15+
- name: Terraform Format
16+
working-directory: ./terraform-api-gateway-cognito
17+
id: fmt
18+
run: terraform fmt -check
19+
20+
## Init Terraform
21+
- name: Terraform Init
22+
working-directory: ./terraform-api-gateway-cognito
23+
id: init
24+
run: terraform init
25+
26+
## Validate Terraform
27+
- name: Terraform Validate
28+
working-directory: ./terraform-api-gateway-cognito
29+
id: validate
30+
run: terraform validate -no-color
31+
32+
## Plan Terraform
33+
- name: Terraform Plan
34+
working-directory: ./terraform-api-gateway-cognito
35+
id: plan
36+
run: terraform plan -no-color
37+
continue-on-error: true
38+
39+
## Fail the job if terraform plan doesn't succeed
40+
- name: Terraform Plan Status
41+
working-directory: ./terraform-api-gateway-cognito
42+
id: plan_status
43+
if: steps.plan.outcome == 'failure'
44+
run: exit 1
45+
46+
## Destroy Terraform
47+
- name: Terraform Destroy
48+
working-directory: ./terraform-api-gateway-cognito
49+
id: destroy
50+
run: terraform destroy -auto-approve

0 commit comments

Comments
 (0)