Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Commit

Permalink
Add app stack and lifecycle to the app slot
Browse files Browse the repository at this point in the history
  • Loading branch information
halprin committed Sep 5, 2024
1 parent 6cb2b62 commit dcd659d
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions operations/template/app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ resource "azurerm_linux_web_app" "sftp" {
location = azurerm_service_plan.plan.location
service_plan_id = azurerm_service_plan.plan.id

lifecycle {
ignore_changes = [
site_config[0].application_stack[0].docker_image_name,
# Ignore changes to tags because the CDC sets these automagically
tags,
]
}

https_only = true

virtual_network_subnet_id = local.cdc_domain_environment ? azurerm_subnet.app.id : null
Expand Down Expand Up @@ -144,13 +136,19 @@ resource "azurerm_linux_web_app" "sftp" {
type = "SystemAssigned"
}

lifecycle {
ignore_changes = [
site_config[0].application_stack[0].docker_image_name,
# Ignore changes to tags because the CDC sets these automagically
tags,
]
}
}

resource "azurerm_linux_web_app_slot" "pre_live" {
name = "pre-live"
app_service_id = azurerm_linux_web_app.sftp.id


https_only = true

virtual_network_subnet_id = local.cdc_domain_environment ? azurerm_subnet.app.id : null
Expand All @@ -161,6 +159,11 @@ resource "azurerm_linux_web_app_slot" "pre_live" {

scm_use_main_ip_restriction = local.cdc_domain_environment ? true : null

application_stack {
docker_registry_url = "https://${azurerm_container_registry.registry.login_server}"
docker_image_name = "ignore_because_specified_later_in_deployment"
}

dynamic "ip_restriction" {
for_each = local.cdc_domain_environment ? [1] : []

Expand Down Expand Up @@ -194,6 +197,14 @@ resource "azurerm_linux_web_app_slot" "pre_live" {
identity {
type = "SystemAssigned"
}

lifecycle {
ignore_changes = [
site_config[0].application_stack[0].docker_image_name,
# Ignore changes to tags because the CDC sets these automagically
tags,
]
}
}

resource "azurerm_monitor_autoscale_setting" "sftp_autoscale" {
Expand Down

0 comments on commit dcd659d

Please sign in to comment.