From e86f3c1dd6fb48abe085c89eebb6f74a064e7cf3 Mon Sep 17 00:00:00 2001 From: Ash Davies <3853061+DrizzlyOwl@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:09:22 +0100 Subject: [PATCH] Deploy MX Records for Prod environment (#479) --- terraform/README.md | 1 + terraform/container-apps-hosting.tf | 1 + terraform/locals.tf | 1 + terraform/variables.tf | 16 ++++++++++++++++ 4 files changed, 19 insertions(+) diff --git a/terraform/README.md b/terraform/README.md index 2da22573b..a2d0d0a43 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -162,6 +162,7 @@ No resources. | [container\_health\_probe\_path](#input\_container\_health\_probe\_path) | Specifies the path that is used to determine the liveness of the Container | `string` | n/a | yes | | [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 | | [container\_secret\_environment\_variables](#input\_container\_secret\_environment\_variables) | Container secret environment variables | `map(string)` | n/a | yes | +| [dns\_mx\_records](#input\_dns\_mx\_records) | DNS MX records to add to the DNS Zone |
map(
object({
ttl : optional(number, 300),
records : list(
object({
preference : number,
exchange : string
})
)
})
)
| `{}` | no | | [dns\_ns\_records](#input\_dns\_ns\_records) | DNS NS records to add to the DNS Zone |
map(
object({
ttl : optional(number, 300),
records : list(string)
})
)
| n/a | yes | | [dns\_txt\_records](#input\_dns\_txt\_records) | DNS TXT records to add to the DNS Zone |
map(
object({
ttl : optional(number, 300),
records : list(string)
})
)
| n/a | yes | | [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 | diff --git a/terraform/container-apps-hosting.tf b/terraform/container-apps-hosting.tf index 812cab253..d6f3a2b98 100644 --- a/terraform/container-apps-hosting.tf +++ b/terraform/container-apps-hosting.tf @@ -17,6 +17,7 @@ module "azure_container_apps_hosting" { dns_zone_domain_name = local.dns_zone_domain_name dns_ns_records = local.dns_ns_records dns_txt_records = local.dns_txt_records + dns_mx_records = local.dns_mx_records image_name = local.image_name container_command = local.container_command diff --git a/terraform/locals.tf b/terraform/locals.tf index 75719a322..2aac68db7 100644 --- a/terraform/locals.tf +++ b/terraform/locals.tf @@ -20,6 +20,7 @@ locals { dns_zone_domain_name = var.dns_zone_domain_name dns_ns_records = var.dns_ns_records dns_txt_records = var.dns_txt_records + dns_mx_records = var.dns_mx_records key_vault_access_ipv4 = var.key_vault_access_ipv4 tfvars_filename = var.tfvars_filename enable_monitoring = var.enable_monitoring diff --git a/terraform/variables.tf b/terraform/variables.tf index 41fafcd5c..e49e75be9 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -108,6 +108,22 @@ variable "dns_txt_records" { ) } +variable "dns_mx_records" { + description = "DNS MX records to add to the DNS Zone" + type = map( + object({ + ttl : optional(number, 300), + records : list( + object({ + preference : number, + exchange : string + }) + ) + }) + ) + default = {} +} + variable "enable_cdn_frontdoor" { description = "Enable Azure CDN FrontDoor. This will use the Container Apps endpoint as the origin." type = bool