File tree Expand file tree Collapse file tree 2 files changed +100
-0
lines changed
Expand file tree Collapse file tree 2 files changed +100
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments