Skip to content

claranet/terraform-azurerm-container-apps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Container Apps

Changelog Notice Apache V2 License OpenTofu Registry

Azure module to deploy a Azure Container Apps.

Global versioning rule for Claranet Azure modules

Module version Terraform version OpenTofu version AzureRM version
>= 8.x.x Unverified 1.8.x >= 4.0
>= 7.x.x 1.3.x >= 3.0
>= 6.x.x 1.x >= 3.0
>= 5.x.x 0.15.x >= 2.0
>= 4.x.x 0.13.x / 0.14.x >= 2.0
>= 3.x.x 0.12.x >= 2.0
>= 2.x.x 0.12.x < 2.0
< 2.x.x 0.11.x < 2.0

Contributing

If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.

More details are available in the CONTRIBUTING.md file.

Usage

This module is optimized to work with the Claranet terraform-wrapper tool which set some terraform variables in the environment needed by this module. More details about variables set by the terraform-wrapper available in the documentation.

⚠️ Since modules version v8.0.0, we do not maintain/check anymore the compatibility with Hashicorp Terraform. Instead, we recommend to use OpenTofu.

module "container_app" {
  source  = "claranet/container-apps/azurerm"
  version = "x.x.x"

  location            = module.azure_region.location
  location_short      = module.azure_region.location_short
  resource_group_name = module.rg.name

  client_name = var.client_name
  environment = var.environment
  stack       = var.stack

  containers = [
    {
      name   = "helloworld"
      image  = "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest"
      cpu    = 0.25
      memory = "0.5Gi"
    },
  ]

  extra_tags = {
    foo = "bar"
  }
}

Providers

No providers.

Modules

Name Source Version
container_app ./modules/container-app n/a
container_app_environment ./modules/container-app-environment n/a

Resources

No resources.

Inputs

Name Description Type Default Required
azure_queue_scale_rules Parameters used to define one or moreazure_queue_scale_rule object.
list(object({
name = string
queue_name = string
queue_length = string
authentications = list(object({
secret_name = string
trigger_parameter = string
}))
}))
[] no
certificate Container App Environment Certificate parameters.
list(object({
name = string
certificate_blob_base64 = string
certificate_password = string
}))
[] no
client_name Client name/account used in naming. string n/a yes
container_app_custom_name Name of the Container App, generated if not set. string "" no
container_app_environment_custom_name Name of the Container App Environment, generated if not set. string "" no
containers Configuration of one or more containers.
list(object({
name = string
image = string
cpu = number
memory = string
args = optional(list(string), null)
command = optional(list(string), null)
envs = optional(list(object({
name = string
secret_name = optional(string, null)
value = optional(string, null)
})), [])
liveness_probes = optional(list(object({
failure_count_threshold = optional(number, 3)
headers = optional(list(object({
name = string
value = string
})), [])
host = optional(string, null)
initial_delay = optional(number, 1)
interval_seconds = optional(number, 10)
path = optional(string, "/")
port = number
timeout = optional(number, 1)
transport = optional(string, null)
})), [])
readiness_probes = optional(list(object({
failure_count_threshold = optional(number, 3)
headers = optional(list(object({
name = string
value = string
})), [])
host = optional(string, null)
initial_delay = optional(number, 0)
interval_seconds = optional(number, 10)
path = optional(string, "/")
port = number
success_count_threshold = optional(number, 3)
timeout = optional(number, 1)
transport = optional(string, null)
})), [])
startup_probes = optional(list(object({
failure_count_threshold = optional(number, 3)
headers = optional(list(object({
name = string
value = string
})), [])
host = optional(string, null)
initial_delay = optional(number, 0)
interval_seconds = optional(number, 10)
path = optional(string, "/")
port = number
timeout = optional(number, 1)
transport = optional(string, null)
})), [])
volume_mnt = optional(list(object({
name = string
path = string
})), [])
}))
[] no
custom_domain_certificate_blob_base64 The bundle of Private Key and Certificate for the Custom DNS Suffix as a base64 encoded PFX or PEM. string "" no
custom_domain_certificate_password The password for the Certificate bundle. string "" no
custom_domain_dns_suffix Custom DNS Suffix for the Container App Environment. string "" no
custom_domain_enabled Should the Container App Environment be configured with a Custom Domain? Defaults to false. bool false no
custom_scale_rules Parameters used to define one or more custom_scale_rule object.
list(object({
name = string
custom_rule_type = string
metadata = map(string)
authentications = optional(list(object({
secret_name = string
trigger_parameter = string
})), [])
}))
[] no
dapr_application_insights_connection_string Application Insights connection string used by Dapr to export Service to Service communication telemetry. Changing this forces a new resource to be created. string null no
dapr_components Dapr Components to be added to the Container App Environment.
list(object({
name = string
component_type = string
version = string
ignore_errors = optional(bool, false)
init_timeout = optional(string, "5s")
metadata = list(object({
name = string
value = optional(string)
secret_name = optional(string)
}))
scopes = list(string)
secrets = list(object({
name = string
value = string
}))
}))
[] no
daprs Parameters used to define one or more dapr object.
list(object({
app_id = string
app_port = optional(number)
app_protocol = optional(string, "http")
}))
[] no
default_tags_enabled Option to enable or disable default tags. bool true no
environment Project environment. string n/a yes
extra_tags Additional tags to add on resources. map(string) {} no
http_scale_rules Parameters used to define one or more http_scale_rule object.
list(object({
name = string
concurrent_requests = number
authentications = optional(list(object({
secret_name = string
trigger_parameter = string
})), [])
}))
[] no
identity Map with identity block information.
object({
type = string
identity_ids = list(string)
})
{
"identity_ids": [],
"type": "SystemAssigned"
}
no
infrastructure_resource_group_name Name of the platform-managed resource group created for the Managed Environment to host infrastructure resources. Changing this forces a new resource to be created. string null no
ingresses Parameters used to define one or more ingress object.
list(object({
allow_insecure_connections = optional(bool, false)
external_enabled = optional(bool, false)
ip_security_restrictions = optional(list(object({
action = string
description = optional(string)
ip_address_range = string
name = string
})), [])
target_port = number
exposed_port = optional(number)
traffic_weights = list(object({
label = optional(string)
latest_revision = optional(string)
revision_suffix = optional(string)
percentage = number
}))
transport = optional(string, "auto")
}))
[] no
init_containers Configuration of one or more init containers.
list(object({
name = string
args = optional(list(string), null)
command = optional(list(string), null)
cpu = optional(number, null)
image = string
memory = optional(string, null)
envs = optional(list(object({
name = string
secret_name = optional(string, null)
value = optional(string, null)
})), [])
ephemeral_storage = optional(string, null)
volume_mnt = optional(list(object({
name = string
path = string
})), [])
}))
[] no
location Azure region to use. string n/a yes
location_short Short string for Azure location. string n/a yes
log_analytics_workspace_id The ID for the Log Analytics Workspace to link this Container Apps Managed Environment to. Changing this forces a new resource to be created. string null no
max_inactive_revisions The maximum of inactive revisions allowed for this Container App. number null no
mutual_tls_enabled Should mutual transport layer security (mTLS) be enabled? Defaults to false. bool false no
name_prefix Optional prefix for the generated name. string "" no
name_suffix Optional suffix for the generated name. string "" no
registries Parameters used to define one or more registry object.
list(object({
server = string
identity = optional(string)
password_secret_name = optional(string)
username = optional(string)
}))
[] no
resource_group_name Name of the resource group. string n/a yes
revision_mode The revisions operational mode for the Container App. Possible values include Single and Multiple. In Single mode, a single revision is in operation at any given time. In Multiple mode, more than one revision can be active at a time and can be configured with load distribution via the traffic_weight block in the ingress configuration. string "Single" no
revision_suffix The suffix for the revision. This value must be unique for the lifetime of the Resource. If omitted the service will use a hash function to create one. string "" no
secrets Parameters used to define one or more secret object.
list(object({
name = string
identity = optional(string)
key_vault_secret_id = optional(string)
value = optional(string)
}))
[] no
stack Project stack name. string n/a yes
storage Storage parameters for the Container App Environment.
list(object({
name = string
account_name = string
access_key = string
share_name = string
access_mode = optional(string, "ReadWrite")
}))
[] no
tcp_scale_rules Parameters used to define one or more tcp_scale_rule object.
list(object({
name = string
concurrent_requests = number
authentications = optional(list(object({
secret_name = string
trigger_parameter = string
})), [])
}))
[] no
template_max_replicas The maximum number of replicas for this container. number null no
template_min_replicas The minimum number of replicas for this container. number null no
termination_grace_period_seconds The time in seconds after the container is sent the termination signal before the process if forcibly killed. number null no
volumes Parameters used to define one or more volume object.
list(object({
name = string
storage_name = optional(string)
storage_type = optional(string, "EmptyDir")
}))
[] no
workload_profile The profile of the workload to scope the container app execution.
map(object({
name = optional(string, null)
workload_profile_type = optional(string, "Consumption")
maximum_count = number
minimum_count = number
}))
{} no
workload_profile_name The name of the Workload Profile in the Container App Environment to place this Container App. string null no

Outputs

Name Description
module_container_app Container App output object. Please refer to ./modules/container-app/README.md.
module_container_app_environment Container App Environment output object. Please refer to ./modules/container-app-environment/README.md.

Related documentation

Microsoft Azure documentation: xxxx

About

Terraform module for Azure Container Apps

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages