-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Import of azurerm_static_web_app_custom_domain forces repacement #25289
Comments
Same issue here with 2 existing azurerm_static_site and azurerm_static_site_custom_domain |
Thanks @sharebear for raising this issue, let me try transferring the id from static site domain to static web app domain. Just one detail that I'd like to confirm with you is: despite of the id transferring itself, were you trying to link the custom domain to a new static web app? How did you deal with the static site and the static web app? |
No this is an existing static web app, that I migrated with the steps below.
Migrating the static site to static web app worked fine by just changing the resource type and adding a pair of removed + import blocks removed {
from = azurerm_static_site.example
lifecycle {
destroy = false
}
}
import {
id = "/subscriptions/[redacted]/resourceGroups/prod-norwayeast-rg/providers/Microsoft.Web/staticSites/example"
to = azurerm_static_web_app.example
} |
Thanks for the update, let me try the import of the custom domain. |
@sharebear in this case the field Would you be able to take a look and see if using |
I faced this issue last week and can confirm that ignoring validation_type works as a workaround. removed {
from = azurerm_static_site_custom_domain.domain
lifecycle { destroy = false }
}
import {
to = azurerm_static_web_app_custom_domain.domain
id = "/subscriptions/....."
}
resource "azurerm_static_web_app_custom_domain" "domain" {
static_web_app_id = "yyyyy"
domain_name = "xxxx"
validation_type = "cname-delegation"
lifecycle {
ignore_changes = [validation_type]
}
}
|
Thank you for taking the time to raise this! I am going to close this with tombuildsstuff response as an answer. If you have future questions, I suggest using the Community Resources, such as the Azure Provider forum. |
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. |
Is there an existing issue for this?
Community Note
Terraform Version
1.7.4
AzureRM Provider Version
3.95.0
Affected Resource(s)/Data Source(s)
azurerm_static_web_app_custom_domain
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Resource should be imported without recreation
Actual Behaviour
Terraform plan reveals that terraform wants to recreate the custom domain (which will then change the token that needs to be present in DNS for validation).
Steps to Reproduce
Important Factoids
No response
References
Trying to resolve the deprecation warning triggered by the following PR #25117
The text was updated successfully, but these errors were encountered: