Skip to content

Commit

Permalink
Merge pull request #678 from DFE-Digital/remove-cdn-frontdoor
Browse files Browse the repository at this point in the history
Remove Azure Front Door CDN
  • Loading branch information
DrizzlyOwl authored Jan 24, 2025
2 parents 62b421a + ceafcca commit 0fc298a
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 22 deletions.
26 changes: 13 additions & 13 deletions terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_azure_container_apps_hosting"></a> [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.16.3 |
| <a name="module_azure_container_apps_hosting"></a> [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.16.5 |
| <a name="module_azurerm_key_vault"></a> [azurerm\_key\_vault](#module\_azurerm\_key\_vault) | github.com/DFE-Digital/terraform-azurerm-key-vault-tfvars | v0.5.1 |
| <a name="module_statuscake-tls-monitor"></a> [statuscake-tls-monitor](#module\_statuscake-tls-monitor) | github.com/dfe-digital/terraform-statuscake-tls-monitor | v0.1.5 |

Expand All @@ -154,11 +154,11 @@ No resources.
| <a name="input_azure_location"></a> [azure\_location](#input\_azure\_location) | Azure location in which to launch resources. | `string` | n/a | yes |
| <a name="input_azure_subscription_id"></a> [azure\_subscription\_id](#input\_azure\_subscription\_id) | Service Principal Subscription ID | `string` | n/a | yes |
| <a name="input_azure_tenant_id"></a> [azure\_tenant\_id](#input\_azure\_tenant\_id) | Service Principal Tenant ID | `string` | n/a | yes |
| <a name="input_cdn_frontdoor_custom_domains"></a> [cdn\_frontdoor\_custom\_domains](#input\_cdn\_frontdoor\_custom\_domains) | Azure CDN Front Door custom domains. If they are within the DNS zone (optionally created), the Validation TXT records and ALIAS/CNAME records will be created | `list(string)` | n/a | yes |
| <a name="input_cdn_frontdoor_enable_rate_limiting"></a> [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 |
| <a name="input_cdn_frontdoor_custom_domains"></a> [cdn\_frontdoor\_custom\_domains](#input\_cdn\_frontdoor\_custom\_domains) | Azure CDN Front Door custom domains. If they are within the DNS zone (optionally created), the Validation TXT records and ALIAS/CNAME records will be created | `list(string)` | `[]` | no |
| <a name="input_cdn_frontdoor_enable_rate_limiting"></a> [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` | `false` | no |
| <a name="input_cdn_frontdoor_forwarding_protocol"></a> [cdn\_frontdoor\_forwarding\_protocol](#input\_cdn\_frontdoor\_forwarding\_protocol) | Azure CDN Front Door forwarding protocol | `string` | `"HttpsOnly"` | no |
| <a name="input_cdn_frontdoor_health_probe_path"></a> [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 |
| <a name="input_cdn_frontdoor_host_add_response_headers"></a> [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 |
| <a name="input_cdn_frontdoor_health_probe_path"></a> [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` | `"/"` | no |
| <a name="input_cdn_frontdoor_host_add_response_headers"></a> [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))` | `[]` | no |
| <a name="input_cdn_frontdoor_origin_fqdn_override"></a> [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 |
| <a name="input_cdn_frontdoor_origin_host_header_override"></a> [cdn\_frontdoor\_origin\_host\_header\_override](#input\_cdn\_frontdoor\_origin\_host\_header\_override) | Manually specify the host header that the CDN sends to the target. Defaults to the recieved host header. Set to null to set it to the host\_name (`cdn_frontdoor_origin_fqdn_override`) | `string` | `""` | no |
| <a name="input_cdn_frontdoor_rate_limiting_duration_in_minutes"></a> [cdn\_frontdoor\_rate\_limiting\_duration\_in\_minutes](#input\_cdn\_frontdoor\_rate\_limiting\_duration\_in\_minutes) | CDN Front Door rate limiting duration in minutes | `number` | `5` | no |
Expand All @@ -173,13 +173,14 @@ No resources.
| <a name="input_container_scale_http_concurrency"></a> [container\_scale\_http\_concurrency](#input\_container\_scale\_http\_concurrency) | When the number of concurrent HTTP requests exceeds this value, then another replica is added. Replicas continue to add to the pool up to the max-replicas amount. | `number` | `10` | no |
| <a name="input_container_secret_environment_variables"></a> [container\_secret\_environment\_variables](#input\_container\_secret\_environment\_variables) | Container secret environment variables | `map(string)` | n/a | yes |
| <a name="input_custom_container_apps"></a> [custom\_container\_apps](#input\_custom\_container\_apps) | Custom container apps, by default deployed within the container app environment managed by this module. | <pre>map(object({<br/> container_app_environment_id = optional(string, "")<br/> resource_group_name = optional(string, "")<br/> revision_mode = optional(string, "Single")<br/> container_port = optional(number, 0)<br/> ingress = optional(object({<br/> external_enabled = optional(bool, true)<br/> target_port = optional(number, null)<br/> traffic_weight = object({<br/> percentage = optional(number, 100)<br/> })<br/> cdn_frontdoor_custom_domain = optional(string, "")<br/> cdn_frontdoor_origin_fqdn_override = optional(string, "")<br/> cdn_frontdoor_origin_host_header_override = optional(string, "")<br/> enable_cdn_frontdoor_health_probe = optional(bool, false)<br/> cdn_frontdoor_health_probe_protocol = optional(string, "")<br/> cdn_frontdoor_health_probe_interval = optional(number, 120)<br/> cdn_frontdoor_health_probe_request_type = optional(string, "")<br/> cdn_frontdoor_health_probe_path = optional(string, "")<br/> cdn_frontdoor_forwarding_protocol_override = optional(string, "")<br/> }), null)<br/> identity = optional(list(object({<br/> type = string<br/> identity_ids = list(string)<br/> })), [])<br/> secrets = optional(list(object({<br/> name = string<br/> value = string<br/> })), [])<br/> registry = optional(object({<br/> server = optional(string, "")<br/> username = optional(string, "")<br/> password_secret_name = optional(string, "")<br/> identity = optional(string, "")<br/> }), null),<br/> image = string<br/> cpu = number<br/> memory = number<br/> command = list(string)<br/> liveness_probes = optional(list(object({<br/> interval_seconds = number<br/> transport = string<br/> port = number<br/> path = optional(string, null)<br/> })), [])<br/> env = optional(list(object({<br/> name = string<br/> value = optional(string, null)<br/> secretRef = optional(string, null)<br/> })), [])<br/> min_replicas = number<br/> max_replicas = number<br/> }))</pre> | `{}` | no |
| <a name="input_dns_alias_records"></a> [dns\_alias\_records](#input\_dns\_alias\_records) | DNS ALIAS records to add to the DNS Zone | <pre>map(<br/> object({<br/> ttl : optional(number, 300),<br/> target_resource_id : string<br/> })<br/> )</pre> | `{}` | no |
| <a name="input_dns_mx_records"></a> [dns\_mx\_records](#input\_dns\_mx\_records) | DNS MX records to add to the DNS Zone | <pre>map(<br/> object({<br/> ttl : optional(number, 300),<br/> records : list(<br/> object({<br/> preference : number,<br/> exchange : string<br/> })<br/> )<br/> })<br/> )</pre> | `{}` | no |
| <a name="input_dns_ns_records"></a> [dns\_ns\_records](#input\_dns\_ns\_records) | DNS NS records to add to the DNS Zone | <pre>map(<br/> object({<br/> ttl : optional(number, 300),<br/> records : list(string)<br/> })<br/> )</pre> | n/a | yes |
| <a name="input_dns_txt_records"></a> [dns\_txt\_records](#input\_dns\_txt\_records) | DNS TXT records to add to the DNS Zone | <pre>map(<br/> object({<br/> ttl : optional(number, 300),<br/> records : list(string)<br/> })<br/> )</pre> | n/a | yes |
| <a name="input_dns_zone_domain_name"></a> [dns\_zone\_domain\_name](#input\_dns\_zone\_domain\_name) | DNS zone domain name. If created, records will automatically be created to point to the CDN. | `string` | n/a | yes |
| <a name="input_enable_cdn_frontdoor"></a> [enable\_cdn\_frontdoor](#input\_enable\_cdn\_frontdoor) | Enable Azure CDN FrontDoor. This will use the Container Apps endpoint as the origin. | `bool` | n/a | yes |
| <a name="input_enable_cdn_frontdoor"></a> [enable\_cdn\_frontdoor](#input\_enable\_cdn\_frontdoor) | Enable Azure CDN FrontDoor. This will use the Container Apps endpoint as the origin. | `bool` | `false` | no |
| <a name="input_enable_cdn_frontdoor_health_probe"></a> [enable\_cdn\_frontdoor\_health\_probe](#input\_enable\_cdn\_frontdoor\_health\_probe) | Enable CDN Front Door health probe | `bool` | `false` | no |
| <a name="input_enable_cdn_frontdoor_vdp_redirects"></a> [enable\_cdn\_frontdoor\_vdp\_redirects](#input\_enable\_cdn\_frontdoor\_vdp\_redirects) | Deploy redirects for security.txt and thanks.txt to an external Vulnerability Disclosure Program service | `bool` | `true` | no |
| <a name="input_enable_cdn_frontdoor_vdp_redirects"></a> [enable\_cdn\_frontdoor\_vdp\_redirects](#input\_enable\_cdn\_frontdoor\_vdp\_redirects) | Deploy redirects for security.txt and thanks.txt to an external Vulnerability Disclosure Program service | `bool` | `false` | no |
| <a name="input_enable_container_registry"></a> [enable\_container\_registry](#input\_enable\_container\_registry) | Set to true to create a container registry | `bool` | n/a | yes |
| <a name="input_enable_dns_zone"></a> [enable\_dns\_zone](#input\_enable\_dns\_zone) | Conditionally create a DNS zone | `bool` | n/a | yes |
| <a name="input_enable_event_hub"></a> [enable\_event\_hub](#input\_enable\_event\_hub) | Send Azure Container App logs to an Event Hub sink | `bool` | `false` | no |
Expand All @@ -200,6 +201,7 @@ No resources.
| <a name="input_key_vault_access_ipv4"></a> [key\_vault\_access\_ipv4](#input\_key\_vault\_access\_ipv4) | List of IPv4 Addresses that are permitted to access the Key Vault | `list(string)` | n/a | yes |
| <a name="input_monitor_email_receivers"></a> [monitor\_email\_receivers](#input\_monitor\_email\_receivers) | A list of email addresses that should be notified by monitoring alerts | `list(string)` | n/a | yes |
| <a name="input_monitor_endpoint_healthcheck"></a> [monitor\_endpoint\_healthcheck](#input\_monitor\_endpoint\_healthcheck) | Specify a route that should be monitored for a 200 OK status | `string` | n/a | yes |
| <a name="input_monitor_http_availability_fqdn"></a> [monitor\_http\_availability\_fqdn](#input\_monitor\_http\_availability\_fqdn) | Specify a FQDN to monitor for HTTP Availability. Leave unset to dynamically calculate the correct FQDN | `string` | `""` | no |
| <a name="input_project_name"></a> [project\_name](#input\_project\_name) | Project name. Will be used along with `environment` as a prefix for all resources. | `string` | n/a | yes |
| <a name="input_registry_admin_enabled"></a> [registry\_admin\_enabled](#input\_registry\_admin\_enabled) | Do you want to enable access key based authentication for your Container Registry? | `bool` | `true` | no |
| <a name="input_registry_managed_identity_assign_role"></a> [registry\_managed\_identity\_assign\_role](#input\_registry\_managed\_identity\_assign\_role) | Assign the 'AcrPull' Role to the Container App User-Assigned Managed Identity. Note: If you do not have 'Microsoft.Authorization/roleAssignments/write' permission, you will need to manually assign the 'AcrPull' Role to the identity | `bool` | `false` | no |
Expand Down
5 changes: 4 additions & 1 deletion terraform/container-apps-hosting.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "azure_container_apps_hosting" {
source = "github.com/DFE-Digital/terraform-azurerm-container-apps-hosting?ref=v1.16.3"
source = "github.com/DFE-Digital/terraform-azurerm-container-apps-hosting?ref=v1.16.5"

environment = local.environment
project_name = local.project_name
Expand Down Expand Up @@ -63,4 +63,7 @@ module "azure_container_apps_hosting" {
enable_init_container = local.enable_init_container
init_container_image = local.init_container_image
init_container_command = local.init_container_command

monitor_http_availability_fqdn = local.monitor_http_availability_fqdn
dns_alias_records = local.dns_alias_records
}
2 changes: 2 additions & 0 deletions terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ locals {
enable_init_container = var.enable_init_container
init_container_image = var.init_container_image
init_container_command = var.init_container_command
monitor_http_availability_fqdn = var.monitor_http_availability_fqdn
dns_alias_records = var.dns_alias_records
}
24 changes: 23 additions & 1 deletion terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ variable "dns_mx_records" {
variable "enable_cdn_frontdoor" {
description = "Enable Azure CDN FrontDoor. This will use the Container Apps endpoint as the origin."
type = bool
default = false
}

variable "container_apps_allow_ips_inbound" {
Expand All @@ -165,6 +166,7 @@ variable "container_apps_allow_ips_inbound" {
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
default = false
}

variable "cdn_frontdoor_rate_limiting_duration_in_minutes" {
Expand All @@ -182,6 +184,7 @@ variable "cdn_frontdoor_rate_limiting_threshold" {
variable "cdn_frontdoor_host_add_response_headers" {
description = "List of response headers to add at the CDN Front Door `[{ \"Name\" = \"Strict-Transport-Security\", \"value\" = \"max-age=31536000\" }]`"
type = list(map(string))
default = []
}

variable "cdn_frontdoor_forwarding_protocol" {
Expand Down Expand Up @@ -220,11 +223,13 @@ variable "cdn_frontdoor_origin_host_header_override" {
variable "cdn_frontdoor_health_probe_path" {
description = "Specifies the path relative to the origin that is used to determine the health of the origin."
type = string
default = "/"
}

variable "cdn_frontdoor_custom_domains" {
description = "Azure CDN Front Door custom domains. If they are within the DNS zone (optionally created), the Validation TXT records and ALIAS/CNAME records will be created"
type = list(string)
default = []
}

variable "monitor_endpoint_healthcheck" {
Expand Down Expand Up @@ -410,7 +415,7 @@ variable "health_insights_api_ipv4_allow_list" {
variable "enable_cdn_frontdoor_vdp_redirects" {
description = "Deploy redirects for security.txt and thanks.txt to an external Vulnerability Disclosure Program service"
type = bool
default = true
default = false
}

variable "cdn_frontdoor_vdp_destination_hostname" {
Expand Down Expand Up @@ -442,3 +447,20 @@ variable "init_container_command" {
type = list(any)
default = []
}

variable "monitor_http_availability_fqdn" {
description = "Specify a FQDN to monitor for HTTP Availability. Leave unset to dynamically calculate the correct FQDN"
type = string
default = ""
}

variable "dns_alias_records" {
description = "DNS ALIAS records to add to the DNS Zone"
type = map(
object({
ttl : optional(number, 300),
target_resource_id : string
})
)
default = {}
}

0 comments on commit 0fc298a

Please sign in to comment.