Skip to content

add iac plan trigger #13

add iac plan trigger

add iac plan trigger #13

Workflow file for this run

name: validate-iac
on:
push:
workflow_call:
env:
tf_version: '1.6.2'
tg_version: '0.55.15'
environment: 'stage'
AWS_REGION: us-east-1
permissions:
id-token: write
contents: read
jobs:
validate-iac:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.IAM_ROLE}}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}
- name: install opentofu
uses: opentofu/setup-opentofu@v1
with:
tofu_version: ${{ env.tf_version }}
tofu_wrapper: false
- name: install terragrunt
run: |
sudo wget -q -O /bin/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v${{ env.tg_version }}/terragrunt_linux_amd64"
sudo chmod +x /bin/terragrunt
terragrunt -v
- name: validate vpc
working-directory: ./tofu/environments/${{ env.environment}}/network/vpc
run: |
terragrunt init
terragrunt validate
- name: validate backend
working-directory: ./tofu/environments/${{ env.environment}}/services/backend-infra
run: |
terragrunt init
terragrunt validate
- name: validate cache
working-directory: ./tofu/environments/${{ env.environment}}/data-store/cache
run: |
terragrunt init
terragrunt validate
- name: validate database
working-directory: ./tofu/environments/${{ env.environment}}/data-store/database
run: |
terragrunt init
terragrunt validate
- name: validate frontend
working-directory: ./tofu/environments/${{ env.environment}}/services/frontend
run: |
terragrunt init
terragrunt validate