Closed fjalcarazp closed 6 months ago
subresource_names for staging slots are for example "sites-staging" . In your case "sites-slot${local.name}01".
You are right. I had two issues in my code:
The fixed code is:
resource "azurerm_linux_web_app_slot" "app_01_slot_01" {
# Application: API
name = "slot${local.name}01"
app_service_id = azurerm_linux_web_app.app_01.id
https_only = true
virtual_network_subnet_id = azurerm_subnet.vnet_01_snet_02.id
public_network_access_enabled = false
tags = data.azurerm_resource_group.rg_01.tags
identity {
type = "SystemAssigned"
}
site_config {
always_on = "true"
health_check_path = "/hc/live"
http2_enabled = true
minimum_tls_version = "1.2"
ftps_state = "Disabled"
vnet_route_all_enabled = true
cors {
allowed_origins = [
"https://app${local.name}02.azurewebsites.net",
"https://app${local.name}03.azurewebsites.net"
]
}
application_stack {
dotnet_version = "6.0"
}
}
app_settings = {
"WEBSITE_ENABLE_SYNC_UPDATE_SITE" = "true"
"WEBSITE_RUN_FROM_PACKAGE" = "1"
}
connection_string {
name = "Default"
type = "SQLAzure"
value = local.connection_string_db
}
connection_string {
name = "Storage"
type = "Custom"
value = azurerm_storage_account.st_03.primary_connection_string
}
connection_string {
name = "APPLICATIONINSIGHTS_CONNECTION_STRING"
type = "Custom"
value = data.azurerm_application_insights.appi_01.connection_string
}
connection_string {
name = "Hashids__salt"
type = "Custom"
value = random_password.hashids_salt.result
}
lifecycle {
ignore_changes = [
tags["Creation Date"],
tags["Request Ticket"],
tags["Support time window"]
]
}
}
resource "azurerm_private_endpoint" "pe_03" {
name = "pep${local.name}03"
location = data.azurerm_resource_group.rg_01.location
resource_group_name = data.azurerm_resource_group.rg_01.name
subnet_id = data.azurerm_subnet.vnet_01_snet_01.id
custom_network_interface_name = "nic${local.name}03"
tags = data.azurerm_resource_group.rg_01.tags
private_service_connection {
name = "default"
private_connection_resource_id = azurerm_linux_web_app.app_01.id
is_manual_connection = false
subresource_names = ["sites-slot${local.name}01"]
}
lifecycle {
ignore_changes = [
tags["Creation Date"],
tags["Request Ticket"],
tags["Support time window"],
private_dns_zone_group
]
}
}
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Is there an existing issue for this?
Community Note
Terraform Version
1.8.2
AzureRM Provider Version
3.102.0
Affected Resource(s)/Data Source(s)
azurerm_linux_web_app_slot; azurerm_private_endpoint; azurerm_windows_web_app_slot
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The private endpoint is created and linked to the deployment slot.
Actual Behaviour
The private endpoint is not created and is not linked to the deployment slot.
Steps to Reproduce
terraform apply
Important Factoids
No response
References
No response