Files
Jonathan Boniface bc84ee4df6
Some checks failed
check agents / check (push) Failing after 13s
Solution architecture outcome pattern: agent and its MCP servers
The cp1-solution-architecture-agent and the sa-aws/azure/gcp-cloud MCP servers, a separate
stream from the individual and sub-agent patterns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:13:25 +00:00

1.3 KiB

Container Apps

An app in a Log Analytics-backed environment, with a user-assigned identity, HTTP ingress and scaling limits.

variable "image" {
  type = string
}

variable "identity_id" {
  type = string
}

resource "azurerm_log_analytics_workspace" "main" {
  name                = "log-workload"
  location            = var.location
  resource_group_name = var.resource_group_name
  retention_in_days   = 30
}

resource "azurerm_container_app_environment" "main" {
  name                       = "cae-workload"
  location                   = var.location
  resource_group_name        = var.resource_group_name
  log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id
}

resource "azurerm_container_app" "api" {
  name                         = "ca-api"
  container_app_environment_id = azurerm_container_app_environment.main.id
  resource_group_name          = var.resource_group_name
  revision_mode                = "Single"

  identity {
    type         = "UserAssigned"
    identity_ids = [var.identity_id]
  }

  ingress {
    external_enabled = true
    target_port      = 8080
    traffic_weight {
      latest_revision = true
      percentage      = 100
    }
  }

  template {
    min_replicas = 2
    max_replicas = 10

    container {
      name   = "api"
      image  = var.image
      cpu    = 0.5
      memory = "1Gi"
    }
  }
}