PLT-724 Apply api-rds service to ab2d dev (#140) #3
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
name: api-rds apply terraform | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/api-rds-apply.yml | |
- terraform/services/api-rds/** | |
workflow_dispatch: # Allow manual trigger | |
jobs: | |
terraform-apply: | |
permissions: | |
contents: read | |
id-token: write | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./terraform/services/api-rds | |
strategy: | |
fail-fast: false | |
matrix: | |
app: [ab2d] | |
env: [dev, test] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./actions/setup-tfenv-terraform | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{ matrix.app == 'ab2d' && secrets[format('{0}_{1}_ACCOUNT', matrix.app, matrix.env)] || secrets.BCDA_ACCOUNT }}:role/delegatedadmin/developer/${{ matrix.app }}-${{ matrix.env }}-github-actions | |
aws-region: ${{ vars.AWS_REGION }} | |
- run: terraform init -backend-config=../../backends/${{ matrix.app }}-${{ matrix.env }}.s3.tfbackend | |
- uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main | |
env: | |
AWS_REGION: ${{ vars.AWS_REGION }} | |
with: | |
params: | | |
TF_VAR_jenkins_security_group_id=/jenkins/security-group | |
- run: terraform apply -auto-approve | |
env: | |
TF_VAR_app: ${{ matrix.app }} | |
TF_VAR_env: ${{ matrix.env }} |