-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.42 KB
/
api-waf-sync-plan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: api-waf-sync plan terraform
on:
pull_request:
paths:
- .github/workflows/api-waf-sync-plan.yml
- terraform/modules/bucket/**
- terraform/modules/key/**
- terraform/modules/function/**
- terraform/modules/queue/**
- terraform/modules/subnets/**
- terraform/modules/vpc/**
- terraform/services/api-waf-sync/**
workflow_dispatch: # Allow manual trigger
jobs:
check-terraform-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./actions/setup-tfenv-terraform
- run: terraform fmt -check -diff -recursive terraform/services/api-waf-sync
terraform-plan:
needs: check-terraform-fmt
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./terraform/services/api-waf-sync
strategy:
fail-fast: false
matrix:
env: [dev]
env:
TF_VAR_env: ${{ matrix.env }}
steps:
- uses: actions/checkout@v4
- uses: ./actions/setup-tfenv-terraform
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.BCDA_ACCOUNT }}:role/delegatedadmin/developer/dpc-${{ matrix.env }}-github-actions
aws-region: ${{ vars.AWS_REGION }}
- run: terraform init -reconfigure -backend-config=../../backends/dpc-$TF_VAR_env.s3.tfbackend
- run: terraform plan