You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: Missing key/value separator
│
│ on generated_resources.tf line 2:
│ (source code not available)
│
│ Expected an equals sign ("=") to mark the beginning of the attribute value. If you intended to given an
│ attribute name containing periods or spaces, write the name in quotes to create a string literal.
╵
Steps to Reproduce
terraform plan -generate-config-out=generated_resources.tf with a provider schema that has a MapNestedAttribute with a key that includes spaces.
It looks like this may be a problem with periods in map keys as well - in the case of periods the HCL can be generated, but there ends up being an error about an undeclared resource:
│ Error: Reference to undeclared resource
│
│ on generated_resources.tf line 34:
│ (source code not available)
│
│ A managed resource "policy" "action" has not been declared in the root module.
With generated HCL that looks like this:
attribute_contract_fulfillment = {
policy.action = {
source = {
id = null
type = "ADAPTER"
}
value = "policy.action"
}
}
It looks like the "policy.action" value ought to be in quotes.
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/henryrecker-pingidentity/ae09eb59b71a2d0c02526018760dd254
Expected Behavior
HCL should be generated with the expected values
Actual Behavior
Error, no HCL is generated:
Steps to Reproduce
terraform plan -generate-config-out=generated_resources.tf
with a provider schema that has a MapNestedAttribute with a key that includes spaces.A simple provider that reproduces this issue can be found here: https://github.com/henryrecker-pingidentity/terraform-provider-example/tree/GenerateConfigBug
Relevant provider code, note the "Use Case" name with the space.
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: