Skip to content
name: "CI Terraform"
on:
pull_request:
paths:
- "aws/**"
- "terragrunt/**"
- ".github/workflows/pull_requests_terraform.yml"
defaults:
run:
shell: bash
permissions:
id-token: write
pull-requests: write
contents: read
env:
AWS_REGION: ca-central-1
CONFTEST_VERSION: 0.27.0
TERRAFORM_VERSION: 0.13.5
TERRAGRUNT_VERSION: 0.26.0
TF_VAR_git_sha: abcdefgh
jobs:
terraform-plan:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Setup Terraform tools
uses: cds-snc/terraform-tools-setup@v1
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
role-to-assume: arn:aws:iam::637287734259:role/secret-plan
role-session-name: TFPlan
aws-region: ${{ env.AWS_REGION }}
- name: Plan aws/acm
uses: cds-snc/terraform-plan@28d2efe5155573489fa5b5816fad20d44d1f274b # v3.0.7
with:
comment-delete: true
comment-title: Plan for aws/acm
directory: ./terragrunt/acm
github-token: ${{ secrets.GITHUB_TOKEN }}
terragrunt: true