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

Adding private acr creds #7102

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
10 changes: 10 additions & 0 deletions infra/azure/terraform/capz/identities/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ variable "location" {
type = string
}

variable "container_registry_private_scope" {
type = string
}

resource "azurerm_user_assigned_identity" "cloud_provider_user_identity" {
name = "cloud-provider-user-identity"
location = var.location
Expand All @@ -40,6 +44,12 @@ resource "azurerm_user_assigned_identity" "gmsa_user_identity" {
resource_group_name = var.resource_group_name
}

resource "azurerm_role_assignment" "acr_pull_private" {
principal_id = azurerm_user_assigned_identity.cloud_provider_user_identity.principal_id
role_definition_name = "AcrPull"
scope = var.container_registry_private_scope
}

output "cloud_provider_user_identity_id" {
value = azurerm_user_assigned_identity.cloud_provider_user_identity.principal_id
}
Expand Down
1 change: 1 addition & 0 deletions infra/azure/terraform/capz/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module "identities" {
source = "./identities"
resource_group_name = var.resource_group_name
location = var.location
container_registry_private_scope = module.container_registry.e2eprivate_registry_id
depends_on = [azurerm_resource_group.capz_ci]
}

Expand Down