Skip to content

Commit

Permalink
rename tikweb-frontend to tikweb-web for GHA deployment prep
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm committed Jan 20, 2024
1 parent 2351e55 commit ea6e53d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion modules/ilmo/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ resource "azurerm_linux_web_app" "ilmo_backend" {

ALLOW_ORIGIN = "*"

# Paths from tikweb-frontend
# Paths from tikweb-web
BASE_URL = var.website_events_url
EVENT_DETAILS_URL = "${var.website_events_url}/{slug}"
EDIT_SIGNUP_URL = "${var.website_events_url}/ilmo/{id}/{editToken}"
Expand Down
4 changes: 2 additions & 2 deletions modules/web/app/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ resource "azurerm_dns_txt_record" "tikweb_asuid" {
ttl = 300

record {
value = azurerm_linux_web_app.frontend.custom_domain_verification_id
value = azurerm_linux_web_app.web.custom_domain_verification_id
}
}

Expand All @@ -49,7 +49,7 @@ resource "azurerm_dns_txt_record" "tikweb_dmarc" {
# https://github.com/hashicorp/terraform-provider-azurerm/issues/14642#issuecomment-1084728235
# Currently, the azurerm provider doesn't give us the IP address, so we need to fetch it ourselves.
data "dns_a_record_set" "tikweb_dns_fetch" {
host = azurerm_linux_web_app.frontend.default_hostname
host = azurerm_linux_web_app.web.default_hostname
}

resource "azurerm_dns_cname_record" "tikweb_cdn_cname_record" {
Expand Down
23 changes: 18 additions & 5 deletions modules/web/app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ resource "random_password" "revalidation_key" {
length = 32
special = true
}
resource "azurerm_linux_web_app" "frontend" {
name = "tikweb-frontend-${terraform.workspace}"
resource "azurerm_linux_web_app" "web" {
name = "tikweb-web-${terraform.workspace}"
location = var.resource_group_location
resource_group_name = var.resource_group_name
service_plan_id = var.app_service_plan_id
Expand All @@ -17,6 +17,12 @@ resource "azurerm_linux_web_app" "frontend" {
}

}
lifecycle {
// image is deployed by web-repos GHA workflow
ignore_changes = [
site_config.0.application_stack.0.docker_image_name,
]
}
logs {
http_logs {
file_system {
Expand Down Expand Up @@ -58,13 +64,20 @@ resource "azurerm_linux_web_app" "cms" {
docker_registry_url = "https://ghcr.io"
docker_image_name = "tietokilta/cms:latest"
}

ip_restriction {
action = "Allow"
headers = []
priority = 100
service_tag = "AzureCloud"
}
}
lifecycle {
// image is deployed by web-repos GHA workflow
ignore_changes = [
site_config.0.application_stack.0.docker_image_name,
]
}
logs {
http_logs {
file_system {
Expand Down Expand Up @@ -111,8 +124,8 @@ resource "azurerm_cdn_endpoint" "next-cdn-endpoint" {
is_https_allowed = true
# TODO: Add custom domain support
origin {
name = "tikweb-frontend-${terraform.workspace}"
host_name = azurerm_linux_web_app.frontend.default_hostname
name = "tikweb-web-${terraform.workspace}"
host_name = azurerm_linux_web_app.web.default_hostname
}

global_delivery_rule {
Expand Down Expand Up @@ -159,7 +172,7 @@ resource "azurerm_cdn_endpoint_custom_domain" "tikweb_cdn_domain" {

resource "azurerm_app_service_custom_hostname_binding" "tikweb_hostname_binding" {
hostname = local.fqdn
app_service_name = azurerm_linux_web_app.frontend.name
app_service_name = azurerm_linux_web_app.web.name
resource_group_name = var.resource_group_name

# Deletion may need manual work.
Expand Down

0 comments on commit ea6e53d

Please sign in to comment.