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

terrafmt upgrade012 could skip running if already formatted in 0.12 syntax #23

Closed
gdavison opened this issue Jul 24, 2020 · 1 comment
Closed

Comments

@gdavison
Copy link
Contributor

Currently, terrafmt upgrade012 outputs errors if a block has already been updated to Terraform 0.12 syntax. This is because of limitations in terraform 0.12upgrade, as explained in hashicorp/terraform#23512.

Calling terraform validate -json and looking for a non-zero value in the warning_count field will indicate validation warnings, which can be assumed to be (mostly) pre-0.12 syntax.

@gdavison gdavison changed the title terrafmt upgrade012 could be terrafmt upgrade012 could skip running if already formatted in 0.12 syntax Jul 24, 2020
@gdavison
Copy link
Contributor Author

terraform validate won't work, because it needs a full configuration. E.g. the AWS provider needs a region configuration

katbyte added a commit that referenced this issue Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant