Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container Groups - network_profile_id is deprecated. Managed Identity Support for Container Registry #1954

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions compute_container_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module "container_groups" {
keyvaults = local.combined_objects_keyvaults
managed_identities = local.combined_objects_managed_identities
network_profiles = local.combined_objects_network_profiles
networking = local.combined_objects_networking
}
}

Expand Down
10 changes: 6 additions & 4 deletions modules/compute/container_group/container_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ resource "azurerm_container_group" "acg" {
tags = merge(local.tags, try(var.settings.tags, null))
ip_address_type = try(var.settings.ip_address_type, "Public")
restart_policy = try(var.settings.restart_policy, "Always")
network_profile_id = try(var.combined_resources.network_profiles[try(var.settings.network_profile.lz_key, var.client_config.landingzone_key)][var.settings.network_profile.key].id, null)
subnet_ids = try(var.settings.network.subnets, null) == null ? null : [for key, value in var.settings.network.subnets : can(value.subnet_id) ? value.subnet_id : var.combined_resources.networking[try(value.lz_key, var.client_config.landingzone_key)][value.vnet_key].subnets[value.subnet_key].id]


dynamic "exposed_port" {
for_each = try(var.settings.exposed_port, [])
Expand Down Expand Up @@ -178,9 +179,10 @@ resource "azurerm_container_group" "acg" {
dynamic "image_registry_credential" {
for_each = try(var.settings.image_registry_credentials, {})
content {
server = image_registry_credential.value.server
username = try(data.azurerm_key_vault_secret.image_registry_credential_username[image_registry_credential.key].value, image_registry_credential.value.username)
password = try(data.azurerm_key_vault_secret.image_registry_credential_password[image_registry_credential.key].value, image_registry_credential.value.password)
server = image_registry_credential.value.server
username = try(data.azurerm_key_vault_secret.image_registry_credential_username[image_registry_credential.key].value, image_registry_credential.value.username, null)
password = try(data.azurerm_key_vault_secret.image_registry_credential_password[image_registry_credential.key].value, image_registry_credential.value.password, null)
user_assigned_identity_id = try(var.settings.identity, false) == false ? null : try(local.managed_identities[0], null)
}
}

Expand Down