Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider running terraform validate against supplied configuration #270

Open
bendbennett opened this issue Jan 9, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@bendbennett
Copy link
Contributor

terraform-plugin-testing version

v1.6.0

Use cases

TestStep.Config uses strings to represent terraform configuration. There is no guarantee that the configuration that is supplied is valid. TestStep.ConfigDirectory, and TestStep.ConfigFile provide for supplying terraform configuration in either a directory, or a file, respectively, but do not validate the configuration before it is executed.

Proposal

The terraform configuration supplied through Config, ConfigDirectory, or ConfigFile could be validate using terraform validate prior to execution, and errors raised if the configuration is invalid.

References

@bflad
Copy link
Contributor

bflad commented Jan 9, 2024

Does terraform plan output configuration validation issues differently than terraform validate? My understanding is that validation has to occur during plan/apply anyways, since it needs to fully read the configuration. Running a separate provider-required command also means that provider plugins will need to an additional start-stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants