Skip to content

Merge branch 'main' of https://github.com/pagopa/private-data-vault-i… #195

Merge branch 'main' of https://github.com/pagopa/private-data-vault-i…

Merge branch 'main' of https://github.com/pagopa/private-data-vault-i… #195

name: "Terraform-Plan"
on:
push:
branches:
- '**' # matches every branch
- '!main' # excludes main
- '!master' # excludes master
paths:
- 'src/main/**'
- '.github/workflows/*.yml'
defaults:
run:
shell: bash
working-directory: src/main
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
terraform:
strategy:
matrix:
environment: [dev, uat, prod]
name: "terraform-plan"
runs-on: ubuntu-22.04
environment: ${{ matrix.environment }}
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- name: Configure AWS Credentials
env:
AWS_REGION: eu-south-1
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838
with:
role-to-assume: ${{ secrets.IAM_ROLE }}
aws-region: ${{ env.AWS_REGION }}
- name: Read terraform version
id: read-version
run: |
echo "TERRAFORM_VERSION=`cat ../.terraform-version`" >> $GITHUB_ENV
- name: Setup Terraform
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Terraform Format
id: fmt
run: terraform fmt -check
- name: Terraform Init
id: init
run: |
./terraform.sh init ${{ matrix.environment }}
- name: Terraform Plan
id: plan
run: |
./terraform.sh plan ${{ matrix.environment }}