This Terraform module deploys an Azure Container App in a provided Azure Container App Environment. It supports System Assigned Managed Identity and configurable scaling options.
azurerm_container_app: Deploys a containerized application in the specified environment.azurerm_private_dns_a_record: Creates a private DNS A record for the container app.
- Supports different templates configuration via a map (
container_app_templates). - With tier specification (xs, s, m, or l) creates container app with different replicas, CPU, and memory settings:
"xs" = {
cpu = 0.25
memory = "0.5Gi"
replicas = {
min = 0
max = 1
}
}
"s" = {
cpu = 0.5
memory = "1Gi"
replicas = {
min = 1
max = 1
}
}
"m" = {
cpu = 1.25
memory = "2.5Gi"
replicas = {
min = 1
max = 2
}
}
"l" = {
cpu = 2
memory = "4Gi"
replicas = {
min = 2
max = 4
}
}- Managed Identity (System Assigned) for secure authentication.
- Probes for liveness, readiness, and startup to ensure container health.
| Name | Version |
|---|---|
| azurerm | ~> 4 |
| Name | Source | Version |
|---|---|---|
| naming_convention | pagopa/dx-azure-naming-convention/azurerm | ~> 0.0 |
| Name | Type |
|---|---|
| azurerm_container_app.this | resource |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| container_app_environment_id | The container app environemnt id. | string |
n/a | yes |
| container_app_templates | List of container app templates | list(object({ |
n/a | yes |
| environment | Values which are used to generate resource names and location short names. They are all mandatory except for domain, which should not be used only in the case of a resource used by multiple domains. | object({ |
n/a | yes |
| resource_group_name | Resource group to deploy resources to | string |
n/a | yes |
| revision_mode | The revision mode for the container app. Valid values are 'Single' and 'Multiple'. | string |
"Multiple" |
no |
| tags | Resources tags | map(any) |
n/a | yes |
| target_port | The target port for the container app. | number |
8080 |
no |
| tier | The offer type for the Container. Valid values are 'xs', 's', 'm' and 'l'. | string |
"s" |
no |
| Name | Description |
|---|---|
| id | n/a |
| name | n/a |
| resource_group_name | n/a |
| url | n/a |