-
Notifications
You must be signed in to change notification settings - Fork 71
Error when resource schema element has a default value with double curly braces #247
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
Comments
Hi @gramsa49 👋🏻 , thanks for submitting the issue and sorry you're running into trouble here.
Full example w/ your use-case: return &schema.Resource{
Description: "Automation Rules define associations between actions and findings.",
Schema: map[string]*schema.Schema{
"servicenow_summary": {
Type: schema.TypeString,
Required: true,
Default: "Wiz Issue: {{`{{issue.control.name}}`}}",
Description: "Ticket summary",
}, Let me know if that doesn't solve the issue! |
That has the downside that it alters the default value for the schema in the provider. I was able to work around the issue in the call to tfplugindocs as follows:
This takes a similar approach to the one proposed, but changes the handling by terraform-plugin-docs versus changing the default value in the Terraform providr. |
Ah! I overlooked your example was with Re-opening the issue as we'd need to tweak |
running into the same problem for https://github.com/ibm-hyper-protect/terraform-provider-hpcr
|
Take the following code snippet from a Terraform provider:
An error is returned:
There looks to be an issue when a default value for a resource element contains double curly braces, which is what the tfplugindocs template format uses.
It's worth noting that the provider is configured to render the defaults in the docs:
The text was updated successfully, but these errors were encountered: