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

Parsing terraform tfstate files results in "unknown" format #1609

Closed
mikefarah opened this issue Mar 19, 2023 · 2 comments
Closed

Parsing terraform tfstate files results in "unknown" format #1609

mikefarah opened this issue Mar 19, 2023 · 2 comments
Labels

Comments

@mikefarah
Copy link
Owner

Copied from #1608 on behalf of @MrMarkW

I have an additional issue with it not handling the file's extension.

Previous this worked and outputted the content in yaml: yq -v -P '.outputs ' .terraform.tfstate

Now I get this error: Error: unknown format 'tfstate' please use [yaml|json|props|csv|tsv|xml]

13:26:22 FormatFromFilename [DEBU] checking file extension '.terraform.tfstate' for auto format detection
13:26:22 FormatFromFilename [DEBU] detected format 'tfstate'
13:26:22 FormatFromFilename [DEBU] checking file extension '.terraform.tfstate' for auto format detection
13:26:22 FormatFromFilename [DEBU] detected format 'tfstate'

I renamed my input file to .terraform.json

Executed yq -P '.outputs ' .terraform.json, but now the content is JSON.

The work around was to force the output format: yq -o yaml -P '.outputs' .terraform.json or yq -o yaml '.outputs' .terraform.json

@mikefarah
Copy link
Owner Author

Git autocloses when comment matches issue 🙄 will close when released

@mikefarah
Copy link
Owner Author

Fixed in 4.32.2

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

No branches or pull requests

1 participant