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
{{ message }}
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.
At the moment, the auth0_email_template resource enforces the from property as required, which is the expected behaviour, but this field should allow an empty string, as this is the only configuration value possible when not using custom email providers.
# Copy-paste your Terraform configurations here - for large Terraform configs,# please use a [Github Gist](https://gist.github.com/) instead.
Expected Behavior
For an email template using Auth0 email provider to be created when the from property is an empty string.
Actual Behavior
Failure to create resource because when the from property is not set, the API validates it is missing. But when it is set, and the Auth0 email provider is used (instead of a custom one), the API doesn't allow for this field to have a custom value.
The text was updated successfully, but these errors were encountered:
leonfs
changed the title
From property from the EmailTemplate resource is required, but it should allow empty string.
From property in EmailTemplate resource is required, but it should allow empty string.
Jun 14, 2021
leonfs
changed the title
From property in EmailTemplate resource is required, but it should allow empty string.
From property in auth0_email_template resource is required, but it should allow empty string.
Jun 14, 2021
This actually isn't a problem with the Terraform Provider; the problem actually stems from one of it's dependencies.
Under the hood, this Provider uses the Auth0 Go SDK to make calls to the Auth0 Management API.
It turns out that the EmailTemplate Struct makes use of the omitempty tag. This means that any fields that are empty will be omitted from the request that is sent to the Management API.
I noticed the Management API returns this error only for POST and PUT requests, but not for PATCH requests.
The Auth0 Go SDK uses PATCH requests to update the templates; this means that until a PR is released to fix this problem, you can work around this problem by either creating the email templates outside of Terraform and them importing them into Terraform, or you can create them with a non-empty string using Terraform, them modify the configuration and immediately run Terraform again.
The second run should update the templates using a PATCH request, and thus not throw an error.
I'll eventually make a PR to fix this problem if I can find the time and someone else doesn't beat me to it.
This relates to several other issues that are present within the provider and I have captured this along with the others within auth0/terraform-provider-auth0#14.
Description
At the moment, the
auth0_email_template
resource enforces thefrom
property as required, which is the expected behaviour, but this field should allow an empty string, as this is the only configuration value possible when not using custom email providers.See: https://github.com/alexkappa/terraform-provider-auth0/blob/master/auth0/resource_auth0_email_template.go#L48
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
For an email template using Auth0 email provider to be created when the
from
property is an empty string.Actual Behavior
Failure to create resource because when the
from
property is not set, the API validates it is missing. But when it is set, and the Auth0 email provider is used (instead of a custom one), the API doesn't allow for this field to have a custom value.The text was updated successfully, but these errors were encountered: