-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added github actions to create API Gateway and Cognito user poo…
…l with App clients Refer to task unity-sds/unity-cs#124
- Loading branch information
1 parent
645b5da
commit 7c49d7b
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: deployment-api-gateway-and-cognito | ||
on: | ||
workflow_dispatch: | ||
branches: [ main ] | ||
|
||
permissions: | ||
id-token: write # required to use OIDC authentication | ||
contents: read # required to checkout the code from the repo | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
## Check Terraform formatting | ||
- name: Terraform Format | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: fmt | ||
run: terraform fmt -check | ||
|
||
## Init Terraform | ||
- name: Terraform Init | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: init | ||
run: terraform init | ||
|
||
## Validate Terraform | ||
- name: Terraform Validate | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: validate | ||
run: terraform validate -no-color | ||
|
||
## Plan Terraform | ||
- name: Terraform Plan | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: plan | ||
run: terraform plan -no-color | ||
continue-on-error: true | ||
|
||
## Fail the job if terraform plan doesn't succeed | ||
- name: Terraform Plan Status | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: plan_status | ||
if: steps.plan.outcome == 'failure' | ||
run: exit 1 | ||
|
||
## Apply Terraform | ||
- name: Terraform Apply | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: apply | ||
run: terraform apply -auto-approve |
50 changes: 50 additions & 0 deletions
50
.github/workflows/deployment_destroy_api_gateway_and_cognito.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: deployment-destroy-api-gateway-and-cognito | ||
on: | ||
workflow_dispatch: | ||
branches: [ main ] | ||
|
||
permissions: | ||
id-token: write # required to use OIDC authentication | ||
contents: read # required to checkout the code from the repo | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
## Check Terraform formatting | ||
- name: Terraform Format | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: fmt | ||
run: terraform fmt -check | ||
|
||
## Init Terraform | ||
- name: Terraform Init | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: init | ||
run: terraform init | ||
|
||
## Validate Terraform | ||
- name: Terraform Validate | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: validate | ||
run: terraform validate -no-color | ||
|
||
## Plan Terraform | ||
- name: Terraform Plan | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: plan | ||
run: terraform plan -no-color | ||
continue-on-error: true | ||
|
||
## Fail the job if terraform plan doesn't succeed | ||
- name: Terraform Plan Status | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: plan_status | ||
if: steps.plan.outcome == 'failure' | ||
run: exit 1 | ||
|
||
## Destroy Terraform | ||
- name: Terraform Destroy | ||
working-directory: ./terraform-api-gateway-cognito | ||
id: destroy | ||
run: terraform destroy -auto-approve |