GoogleCloudPlatform / terraform-python-testing-helper

Simple Python test helper for Terraform.
https://pypi.org/project/tftest/
Apache License 2.0
214 stars 31 forks source link

Parse state flag #70

Closed andrewesweet closed 1 year ago

andrewesweet commented 1 year ago

Adds support for specifying the state file (https://developer.hashicorp.com/terraform/language/settings/backends/local#command-line-arguments) during plan. This is very useful for setting up test cases for, "what if I modified this attribute on an already provisioned resource?". It is possible to achieve the same thing today using init_vars during setup, but that introduces modifies the init cache key and hence requires an init per test case using a state file. Using the plan feature affects only the plan cache key, so saves some time overall.