azurerm_container_app

Manages a Container App.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_log_analytics_workspace" "example" {
  name                = "acctest-01"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "PerGB2018"
  retention_in_days   = 30
}

resource "azurerm_container_app_environment" "example" {
  name                       = "Example-Environment"
  location                   = azurerm_resource_group.example.location
  resource_group_name        = azurerm_resource_group.example.name
  log_analytics_workspace_id = azurerm_log_analytics_workspace.example.id
}
resource "azurerm_container_app" "example" {
  name                         = "example-app"
  container_app_environment_id = azurerm_container_app_environment.example.id
  resource_group_name          = azurerm_resource_group.example.name
  revision_mode                = "Single"

  template {
    container {
      name   = "examplecontainerapp"
      image  = "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest"
      cpu    = 0.25
      memory = "0.5Gi"
    }
  }
}

Arguments Reference

The following arguments are supported:



A secret block supports the following:


A template block supports the following:


An azure_queue_scale_rule block supports the following:


A custom_scale_rule block supports the following:


A http_scale_rule block supports the following:


A tcp_scale_rule block supports the following:


An authentication block supports the following:


A volume block supports the following:


An init_container block supports:


A container block supports the following:


A liveness_probe block supports the following:


A header block supports the following:


An env block supports the following:


A readiness_probe block supports the following:


A header block supports the following:


A startup_probe block supports the following:


A header block supports the following:


A volume_mounts block supports the following:


An identity block supports the following:


An ingress block supports the following:


A custom_domain block supports the following:


A ip_security_restriction block supports the following:


A traffic_weight block supports the following:


A dapr block supports the following:


A registry block supports the following:

The authentication details must also be supplied, identity and username/password_secret_name are mutually exclusive.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

A Container App can be imported using the resource id, e.g.

terraform import azurerm_container_app.example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.App/containerApps/myContainerApp"