diff --git a/terraform/README.md b/terraform/README.md index 0f65a8cc..d5d49004 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -167,6 +167,7 @@ No resources. | [container\_apps\_allow\_ips\_inbound](#input\_container\_apps\_allow\_ips\_inbound) | Restricts access to the Container Apps by creating a network security group rule that only allow inbound traffic from the provided list of IPs | `list(string)` | `[]` | no | | [container\_command](#input\_container\_command) | Container command | `list(any)` | n/a | yes | | [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\_min\_replicas](#input\_container\_min\_replicas) | Container min replicas | `number` | `1` | 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({
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
}))
| `{}` | no | diff --git a/terraform/container-apps-hosting.tf b/terraform/container-apps-hosting.tf index e44ad7f5..be57fd86 100644 --- a/terraform/container-apps-hosting.tf +++ b/terraform/container-apps-hosting.tf @@ -25,6 +25,7 @@ module "azure_container_apps_hosting" { container_secret_environment_variables = local.container_secret_environment_variables container_scale_http_concurrency = local.container_scale_http_concurrency container_apps_allow_ips_inbound = local.container_apps_allow_ips_inbound + container_min_replicas = local.container_min_replicas enable_cdn_frontdoor = local.enable_cdn_frontdoor cdn_frontdoor_forwarding_protocol = local.cdn_frontdoor_forwarding_protocol diff --git a/terraform/locals.tf b/terraform/locals.tf index 7169e04d..cf91efe5 100644 --- a/terraform/locals.tf +++ b/terraform/locals.tf @@ -13,6 +13,7 @@ locals { container_command = var.container_command container_secret_environment_variables = var.container_secret_environment_variables container_scale_http_concurrency = var.container_scale_http_concurrency + container_min_replicas = var.container_min_replicas enable_cdn_frontdoor = var.enable_cdn_frontdoor enable_event_hub = var.enable_event_hub enable_logstash_consumer = var.enable_logstash_consumer diff --git a/terraform/variables.tf b/terraform/variables.tf index 6c9c1df4..db9b8fbd 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -382,3 +382,9 @@ variable "custom_container_apps" { })) default = {} } + +variable "container_min_replicas" { + description = "Container min replicas" + type = number + default = 1 +}