1

How to specify plan type = Consumption and Dedicated workload profiles for Azure Container Apps Environment using terraform 3.49.0. I am using below snippet:


# main.tf
resource "azurerm_container_app_environment" "aca_env" {
    for_each = { for aca_env in var.aca_envs : aca_env.name => aca_env}
  name = each.value.name
  ...
}

# .tfvars
aca_envs = [
  {
    name                 = "myacaenv"
    resource_group_name  = "myrg"
    location             = "West Europe"
    subnet_id            = "mysubnet"
    internal_load_balancer_enabled = true
    tags                 = {}
    roles = []
  }
]

enter image description here

Rajesh Swarnkar
  • 601
  • 1
  • 6
  • 18

1 Answers1

0

Terraform does not support it yet (see related issue on github).

You could use the azapi provider to deploy a container app with a preview plan:

terraform {
  required_providers {
    azapi = {
      source  = "Azure/azapi"
    }
  }
}

resource "azapi_resource" "aca_env" {
  type      = "Microsoft.App/managedEnvironments@2022-11-01-preview"
  parent_id = azurerm_resource_group.rg.id
  location  = azurerm_resource_group.rg.location
  name      = "my-aca-env-name"
  body   = jsonencode({
    properties = {
      appLogsConfiguration = {
        ...
      }
      workloadProfiles = [
        {
          name = "workload-profile-name"
          workloadProfileType = "workload-profile-type"
        }
      ]
      ...
    }
 })
}

Bicep/ARM documentation for container app environment can be found here .

Thomas
  • 24,234
  • 6
  • 81
  • 125