From c63c21f25f37b71f58e98583e774408df448efbe Mon Sep 17 00:00:00 2001 From: Ash Davies <3853061+DrizzlyOwl@users.noreply.github.com> Date: Wed, 19 Apr 2023 11:56:02 +0100 Subject: [PATCH] Override option for changing CDN Origin --- terraform/README.md | 1 + terraform/container-apps-hosting.tf | 1 + terraform/locals.tf | 1 + terraform/variables.tf | 6 ++++++ 4 files changed, 9 insertions(+) diff --git a/terraform/README.md b/terraform/README.md index b2f62ab68..acbfa61ca 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -152,6 +152,7 @@ No resources. | [cdn\_frontdoor\_enable\_rate\_limiting](#input\_cdn\_frontdoor\_enable\_rate\_limiting) | Enable CDN Front Door Rate Limiting. This will create a WAF policy, and CDN security policy. For pricing reasons, there will only be one WAF policy created. | `bool` | n/a | yes | | [cdn\_frontdoor\_health\_probe\_path](#input\_cdn\_frontdoor\_health\_probe\_path) | Specifies the path relative to the origin that is used to determine the health of the origin. | `string` | n/a | yes | | [cdn\_frontdoor\_host\_add\_response\_headers](#input\_cdn\_frontdoor\_host\_add\_response\_headers) | List of response headers to add at the CDN Front Door `[{ "name" = "Strict-Transport-Security", "value" = "max-age=31536000" }]` | `list(map(string))` | n/a | yes | +| [cdn\_frontdoor\_origin\_fqdn\_override](#input\_cdn\_frontdoor\_origin\_fqdn\_override) | Manually specify the hostname that the CDN Front Door should target. Defaults to the Container App FQDN | `string` | `""` | no | | [cdn\_frontdoor\_rate\_limiting\_duration\_in\_minutes](#input\_cdn\_frontdoor\_rate\_limiting\_duration\_in\_minutes) | CDN Front Door rate limiting duration in minutes | `number` | n/a | yes | | [cdn\_frontdoor\_rate\_limiting\_threshold](#input\_cdn\_frontdoor\_rate\_limiting\_threshold) | CDN Front Door rate limiting duration in minutes | `number` | n/a | yes | | [container\_command](#input\_container\_command) | Container command | `list(any)` | n/a | yes | diff --git a/terraform/container-apps-hosting.tf b/terraform/container-apps-hosting.tf index a5a6804bc..39d75468c 100644 --- a/terraform/container-apps-hosting.tf +++ b/terraform/container-apps-hosting.tf @@ -29,6 +29,7 @@ module "azure_container_apps_hosting" { cdn_frontdoor_rate_limiting_threshold = local.cdn_frontdoor_rate_limiting_threshold cdn_frontdoor_host_add_response_headers = local.cdn_frontdoor_host_add_response_headers cdn_frontdoor_custom_domains = local.cdn_frontdoor_custom_domains + cdn_frontdoor_origin_fqdn_override = local.cdn_frontdoor_origin_fqdn_override enable_monitoring = local.enable_monitoring monitor_email_receivers = local.monitor_email_receivers diff --git a/terraform/locals.tf b/terraform/locals.tf index 37faaf694..3068906d1 100644 --- a/terraform/locals.tf +++ b/terraform/locals.tf @@ -20,6 +20,7 @@ locals { cdn_frontdoor_rate_limiting_threshold = var.cdn_frontdoor_rate_limiting_threshold cdn_frontdoor_host_add_response_headers = var.cdn_frontdoor_host_add_response_headers cdn_frontdoor_custom_domains = var.cdn_frontdoor_custom_domains + cdn_frontdoor_origin_fqdn_override = var.cdn_frontdoor_origin_fqdn_override key_vault_access_users = toset(var.key_vault_access_users) key_vault_access_ipv4 = var.key_vault_access_ipv4 tfvars_filename = var.tfvars_filename diff --git a/terraform/variables.tf b/terraform/variables.tf index 9e524feb9..03499f423 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -69,6 +69,12 @@ variable "enable_cdn_frontdoor" { type = bool } +variable "cdn_frontdoor_origin_fqdn_override" { + description = "Manually specify the hostname that the CDN Front Door should target. Defaults to the Container App FQDN" + type = string + default = "" +} + variable "cdn_frontdoor_enable_rate_limiting" { description = "Enable CDN Front Door Rate Limiting. This will create a WAF policy, and CDN security policy. For pricing reasons, there will only be one WAF policy created." type = bool