Skip to content

modify github actions to push to aws #98

modify github actions to push to aws

modify github actions to push to aws #98

name: "Terraform Validation"
on:
push:
paths:
- "dlp-terraform/**"
pull_request:
paths:
- "dlp-terraform/**"
permissions:
contents: read
jobs:
terraform:
name: "Terraform Validation"
runs-on: ubuntu-latest
strategy:
matrix:
{
dir:
[
"./dlp-terraform/dynamodb",
"./dlp-terraform/ecs",
"./dlp-terraform/lambda",
"./dlp-terraform/s3",
"./dlp-terraform/sqs",
],
}
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v4
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN__GITHUB_ACTION }}
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init
working-directory: ${{ matrix.dir }}
# Checks that all Terraform configuration files adhere to a canonical format
- name: Terraform Format
run: terraform fmt -recursive
working-directory: ${{ matrix.dir }}
# Validates that all Terraform configuration files are syntactically correct
- name: Terraform Validate
run: terraform validate .
working-directory: ${{ matrix.dir }}