terraform.resources() returns empty config body #148
-
Issue: Empty Config Body for Some Azure API Management ResourcesHello, I use this project to validate Azure API Management configurations. How can I retrieve the config body for the resources that currently return empty? Versions
ProblemSome resources return an empty config body:
Other resources like:
return a populated config body. All resources with .tf resource without config body: .tf resource with config body: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The "empty" resources don't have a 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. |
Beta Was this translation helpful? Give feedback.
The "empty" resources don't have a
nameattribute. 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.