diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 112905e..e54ca34 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: Terraform Pipeline on: push: - branches: [ main ] + branches: [main] env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -19,7 +19,7 @@ jobs: - name: Install Terraform uses: hashicorp/setup-terraform@v2 with: - terraform_version: 1.9.0 + terraform_version: latest - name: Cache Terraform modules uses: actions/cache@v3 @@ -38,22 +38,22 @@ jobs: - name: Create Terraform plan (optional) id: create-plan run: terraform plan -out=planfile - when: needs.validate.outputs == 'success' + when: needs.validate.outputs == 'success' - name: Upload plan for review (optional) uses: actions/upload-artifact@v3 with: name: terraform-plan path: planfile - when: needs.create-plan.outputs == 'success' + when: needs.create-plan.outputs == 'success' - name: Apply Terraform changes (manual approval required) id: apply-changes run: terraform apply -input=false planfile - needs: [ validate, create-plan ] - when: github.event.inputs.apply == 'true' + needs: [validate, create-plan] + when: github.event.inputs.apply == 'true' - name: Destroy Terraform resources (manual approval required) id: destroy-resources run: terraform destroy --auto-approve - when: github.event.inputs.destroy == 'true' \ No newline at end of file + when: github.event.inputs.destroy == 'true' \ No newline at end of file