Skip to content

terraform.resources() returns empty config body #148

Closed Answered by bendrucker
f-marschall asked this question in Q&A
Discussion options

You must be logged in to vote

The "empty" resources don't have a name attribute. The "populated" ones do. You need to provide a valid schema to decode a resource's attributes:

https://github.com/terraform-linters/tflint-ruleset-opa/blob/main/docs/functions.md#terraformresources

All schema attributes are optional and so you'll just get an empty object if none of your schema attributes can be decoded from what's declared in your TF config.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@f-marschall
Comment options

Answer selected by f-marschall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #147 on April 01, 2025 23:29.