From 9dd0a2243af86a78672d4e17d7fc23ee6891ba2d Mon Sep 17 00:00:00 2001 From: Terra Field Date: Fri, 20 Oct 2023 11:07:08 -0700 Subject: [PATCH] add test that should fail (hopefully) --- .github/workflows/test-terraform-module.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-terraform-module.yml b/.github/workflows/test-terraform-module.yml index a084a9a..b4011a8 100644 --- a/.github/workflows/test-terraform-module.yml +++ b/.github/workflows/test-terraform-module.yml @@ -40,9 +40,21 @@ jobs: - name: Terraform Validate run: terraform validate -no-color - - name: Terraform Apply + - name: Terraform Apply (1st run) run: terraform apply -auto-approve -no-color -input=false + # This should fail if the kinesis thing flaps + - name: Terraform Plan + run: terraform plan -out=tfplan + + - name: Check if plan has changes + run: | + if [ $(terraform show -json tfplan | jq '.resource_changes | length') -ne 0 ]; then + echo "Terraform plan has detected changes after apply. This means the configuration is flapping." + exit 1 + fi + - name: Terraform Destroy run: terraform destroy -auto-approve -no-color -input=false if: 'always()' +