-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
azurerm_api_management_custom_domain: resource gets updated every time #10253
Comments
👍 same issue here. This also reulst in downtime because the service gets restarted when this change gets applied |
This also results in the removal of the custom domain in the first run; and when i run it again it get added again and so on.. |
I would also like to add a couple of things. First, it's not very clear whether or not one should include the default proxy in the custom domains definition. Second, I'll add some additional info from our attempts, might help for debugging. (a) Defining only our custom domainsThis approach performs the same updates on every apply after initial creation. Definition - azurerm_api_management_custom_domain
The initial create-deployment runs successfully and correctly. Running terraform plan/apply (same code - no changes):
(b) Defining default proxy along with our custom domainsThis approach performs almost the same update as above, except split in two steps, in consequent pairs of apply. Definition - azurerm_api_management_custom_domain
Like above, the initial create-deployment runs successfully and correctly. 1st Running terraform plan/apply (same code - no changes):
Result of apply: all custom domains deleted. The default proxy remains, and gets default_ssl_binding auto-toggled to true. 2nd Running terraform plan/apply (same code - no changes):
Result of apply: custom domains added back in, alongside the default proxy, which gets default_ssl_binding toggled correctly back to false 3rd Running terraform plan/apply (same code - no changes) [same as 1st]:
And so it goes, 4th terraform plan / apply is identical to 1st one. |
Getting same problem here. A related Github issue where the need for the For those who can't wait till this bug is fixed: There's also a workaround in the comments there with a custom domain configured via a call to an external script: #3058 (comment) And a blog post by the same guy: https://www.jeanpaulsmit.com/2020/03/terraform-deploy-apim/#custom-domains |
#10636) A possible solution for #10253 . As described in the issue it is unclear if the default hostname for a proxy (<apim-name>.azure-api.net) needs to be included in the azurerm_api_management_custom_domain resource. The test cases include the default hostname, the example in the docs don't. In both cases there are problems using the azurerm_api_management_custom_domain resource at the moment because tf plan will try to apply changes on subsequent runs (see issue). My solution filters out the default hostname (as the azurerm_api_management resource does as well, see https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/internal/services/apimanagement/api_management_resource.go#L986 ). The test cases are succeeding and my local tests are successful with this behaviour:
The latest version of azurerm fixed this issue, thank you @patst! |
closing as it sounds like its fixed! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_api_management_custom_domain
Terraform Configuration Files
Debug Output
Panic Output
Expected Behaviour
Since this resource already exists and no changes were requested, this should not be updated.
Actual Behaviour
resource gets updated every time.
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: