diff --git a/terraform/README.md b/terraform/README.md index f775cc1e1..45d2258a1 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -170,6 +170,7 @@ No resources. | [container\_port](#input\_container\_port) | Container port | `number` | `3000` | no | | [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 | +| [custom\_container\_apps](#input\_custom\_container\_apps) | Custom container apps, by default deployed within the container app environment managed by this module. |
map(object({| `{}` | no | | [dns\_mx\_records](#input\_dns\_mx\_records) | DNS MX records to add to the DNS Zone |
container_app_environment_id = optional(string, "")
resource_group_name = optional(string, "")
revision_mode = optional(string, "Single")
container_port = optional(number, 0)
ingress = optional(object({
external_enabled = optional(bool, true)
target_port = optional(number, null)
traffic_weight = object({
percentage = optional(number, 100)
})
cdn_frontdoor_custom_domain = optional(string, "")
cdn_frontdoor_origin_fqdn_override = optional(string, "")
cdn_frontdoor_origin_host_header_override = optional(string, "")
enable_cdn_frontdoor_health_probe = optional(bool, false)
cdn_frontdoor_health_probe_protocol = optional(string, "")
cdn_frontdoor_health_probe_interval = optional(number, 120)
cdn_frontdoor_health_probe_request_type = optional(string, "")
cdn_frontdoor_health_probe_path = optional(string, "")
cdn_frontdoor_forwarding_protocol_override = optional(string, "")
}), null)
identity = optional(list(object({
type = string
identity_ids = list(string)
})), [])
secrets = optional(list(object({
name = string
value = string
})), [])
registry = optional(object({
server = optional(string, "")
username = optional(string, "")
password_secret_name = optional(string, "")
identity = optional(string, "")
}), null),
image = string
cpu = number
memory = number
command = list(string)
liveness_probes = optional(list(object({
interval_seconds = number
transport = string
port = number
path = optional(string, null)
})), [])
env = optional(list(object({
name = string
value = optional(string, null)
secretRef = optional(string, null)
})), [])
min_replicas = number
max_replicas = number
}))
map(| `{}` | no | | [dns\_ns\_records](#input\_dns\_ns\_records) | DNS NS records to add to the DNS zone |
object({
ttl : optional(number, 300),
records : list(
object({
preference : number,
exchange : string
})
)
})
)
map(| `{}` | no | | [dns\_txt\_records](#input\_dns\_txt\_records) | DNS TXT records to add to the DNS zone |
object({
ttl : optional(number),
records : list(string)
})
)
map(| `{}` | no | diff --git a/terraform/container-apps-hosting.tf b/terraform/container-apps-hosting.tf index d724b3af1..5dcb6697e 100644 --- a/terraform/container-apps-hosting.tf +++ b/terraform/container-apps-hosting.tf @@ -25,6 +25,8 @@ module "azure_container_apps_hosting" { health_insights_api_cors_origins = local.health_insights_api_cors_origins health_insights_api_ipv4_allow_list = local.health_insights_api_ipv4_allow_list + custom_container_apps = local.custom_container_apps + enable_worker_container = local.enable_worker_container worker_container_command = local.worker_container_command worker_container_max_replicas = local.worker_container_max_replicas diff --git a/terraform/locals.tf b/terraform/locals.tf index ee1951806..1f48e42d6 100644 --- a/terraform/locals.tf +++ b/terraform/locals.tf @@ -71,4 +71,5 @@ locals { health_insights_api_ipv4_allow_list = var.health_insights_api_ipv4_allow_list enable_cdn_frontdoor_vdp_redirects = var.enable_cdn_frontdoor_vdp_redirects cdn_frontdoor_vdp_destination_hostname = var.cdn_frontdoor_vdp_destination_hostname + custom_container_apps = var.custom_container_apps } diff --git a/terraform/variables.tf b/terraform/variables.tf index cc15bb18b..beeb24cb4 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -464,3 +464,61 @@ variable "cdn_frontdoor_vdp_destination_hostname" { type = string default = "vdp.security.education.gov.uk" } + +variable "custom_container_apps" { + description = "Custom container apps, by default deployed within the container app environment managed by this module." + type = map(object({ + container_app_environment_id = optional(string, "") + resource_group_name = optional(string, "") + revision_mode = optional(string, "Single") + container_port = optional(number, 0) + ingress = optional(object({ + external_enabled = optional(bool, true) + target_port = optional(number, null) + traffic_weight = object({ + percentage = optional(number, 100) + }) + cdn_frontdoor_custom_domain = optional(string, "") + cdn_frontdoor_origin_fqdn_override = optional(string, "") + cdn_frontdoor_origin_host_header_override = optional(string, "") + enable_cdn_frontdoor_health_probe = optional(bool, false) + cdn_frontdoor_health_probe_protocol = optional(string, "") + cdn_frontdoor_health_probe_interval = optional(number, 120) + cdn_frontdoor_health_probe_request_type = optional(string, "") + cdn_frontdoor_health_probe_path = optional(string, "") + cdn_frontdoor_forwarding_protocol_override = optional(string, "") + }), null) + identity = optional(list(object({ + type = string + identity_ids = list(string) + })), []) + secrets = optional(list(object({ + name = string + value = string + })), []) + registry = optional(object({ + server = optional(string, "") + username = optional(string, "") + password_secret_name = optional(string, "") + identity = optional(string, "") + }), null), + image = string + cpu = number + memory = number + command = list(string) + liveness_probes = optional(list(object({ + interval_seconds = number + transport = string + port = number + path = optional(string, null) + })), []) + env = optional(list(object({ + name = string + value = optional(string, null) + secretRef = optional(string, null) + })), []) + min_replicas = number + max_replicas = number + })) + default = {} +}
object({
ttl : optional(number),
records : list(string)
})
)