Skip to content

Workflow file for this run

name: Terraform Workflow
on:
push:
branches: [ main ]
env:
global:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

Check failure on line 9 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / Terraform Workflow

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 9, Col: 5): A mapping was not expected .github/workflows/main.yml: (Line: 58, Col: 21, Idx: 1195) - (Line: 58, Col: 22, Idx: 1196): While parsing a tag, did not find expected tag URI.
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
jobs:
setup-terraform:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use HashiCorp Terraform action
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.3.x
- name: Initialize Terraform
run: terraform init
validate:
runs-on: ubuntu-latest
needs: setup-terraform
steps:
- uses: actions/checkout@v3
- name: Validate Terraform configuration
run: terraform validate
plan:
runs-on: ubuntu-latest
needs: validate
steps:
- uses: actions/checkout@v3
- name: Create Terraform plan
run: terraform plan -out=planfile
apply:
runs-on: ubuntu-latest
needs: plan
steps:
- uses: actions/checkout@v3
- name: Apply Terraform plan
run: terraform apply -input=false planfile
env:
TF_IN_AUTOMATION: true
destroy:
runs-on: ubuntu-latest
needs: [ apply, ! main ]
steps:
- uses: actions/checkout@v3
- name: Destroy Terraform resources
run: terraform destroy --auto-approve