terraform-example-foundation icon indicating copy to clipboard operation
terraform-example-foundation copied to clipboard

Enforce expected output keys of each stage in the test

Open bharathkkb opened this issue 3 years ago • 0 comments

TL;DR

With https://github.com/terraform-google-modules/terraform-example-foundation/pull/782 we now use remote state. Stages maybe dependent on the previous states output and if any output key is changed unknowingly we won't will waste build time until a remote data call tries to pull the old key and fails. T

To prevent these kind of failures and enforce stronger guarantees, I propose we add validation at the end of each stage to enforce all expected output keys are present. We could likely use https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/tree/master/infra/blueprint-test/pkg/golden to create a golden json file with all expected keys and assert at the end of each stage.

Terraform Resources

No response

Detailed design

No response

Additional information

No response

bharathkkb avatar Sep 09 '22 02:09 bharathkkb