Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Provisions an Azure Container App with a given configuration

Notifications You must be signed in to change notification settings

pagopa-archive/terraform-azurerm-dx-azure-container-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DX - Azure Container APP

Overview

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.

Resources Created

  • 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.

Features

  • 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.

Requirements

Name Version
azurerm ~> 4

Modules

Name Source Version
naming_convention pagopa/dx-azure-naming-convention/azurerm ~> 0.0

Resources

Name Type
azurerm_container_app.this resource

Inputs

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({
image = string
name = optional(string, "")
app_settings = optional(map(string), {})

liveness_probe = optional(object({
failure_count_threshold = optional(number, 5)
header = optional(object({
name = string
value = string
}))
host = optional(string)
initial_delay = optional(number, 1)
interval_seconds = optional(number, 10)
path = optional(string)
port = optional(number, 8080)
timeout = optional(number, 5)
transport = optional(string, "HTTP")
}), {})

readiness_probe = optional(object({
failure_count_threshold = optional(number, 10)
header = optional(object({
name = string
value = string
}))
host = optional(string)
interval_seconds = optional(number, 10)
path = optional(string)
port = optional(number, 8080)
success_count_threshold = optional(number, 3)
timeout = optional(number, 5)
transport = optional(string, "HTTP")
}), {})

startup_probe = optional(object({
failure_count_threshold = optional(number, 30)
header = optional(object({
name = string
value = string
}))
host = optional(string)
interval_seconds = optional(number, 10)
path = optional(string)
port = optional(number, 8080)
timeout = optional(number, 5)
transport = optional(string, "HTTP")
}), {})
}))
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({
prefix = string
env_short = string
location = string
domain = optional(string)
app_name = string
instance_number = string
})
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

Outputs

Name Description
id n/a
name n/a
resource_group_name n/a
url n/a

About

Provisions an Azure Container App with a given configuration

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages