Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/_terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ on:
required: false
type: string
default: 1.9.8
secrets:
AZURE_CLIENT_ID:
required: true
AZURE_TENANT_ID:
required: true
AZURE_SUBSCRIPTION_ID:
required: true

outputs:
resource_group_name:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ jobs:
needs: changes
if: needs.changes.outputs.terraform == 'true'
uses: ./.github/workflows/_terraform.yml
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
with:
apply: true
github-environment: stg
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ jobs:
needs: changes
if: needs.changes.outputs.terraform == 'true'
uses: ./.github/workflows/_terraform.yml
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
with:
github-environment: stg

Expand Down
14 changes: 10 additions & 4 deletions src/terraform/container_app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@ resource "azurerm_container_app_environment" "this" {
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
log_analytics_workspace_id = azurerm_log_analytics_workspace.this.id
tags = local.common_tags
tags = local.common_tags
}

resource "azurerm_container_app" "this" {
name = "${local.name_prefix}-app"
container_app_environment_id = azurerm_container_app_environment.this.id
resource_group_name = azurerm_resource_group.this.name
revision_mode = "Single"
tags = local.common_tags
tags = local.common_tags

// use managed identity for private ACR image pulls
registry {
server = azurerm_container_registry.this.login_server
identity = "System"
}

// bootstrap - pipeline owns image
template {
container {
name = "${local.name_prefix}"
name = local.name_prefix
image = "mcr.microsoft.com/k8se/quickstart:latest"
cpu = 0.25
memory = "0.5Gi"
Expand All @@ -39,4 +45,4 @@ resource "azurerm_role_assignment" "container_app_acr_pull" {
scope = azurerm_container_app.this.id
role_definition_name = "Contributor"
principal_id = data.azurerm_client_config.this.object_id
}
}
Loading