Skip to content

Commit

Permalink
attach cluster uami to node subnet
Browse files Browse the repository at this point in the history
  • Loading branch information
nhudson committed Nov 18, 2024
1 parent ecde535 commit f779903
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ resource "azurerm_role_assignment" "network_contributor_on_resource_group" {
role_definition_name = "Network Contributor"
}

resource "azurerm_role_assignment" "virtual_machine_contributor_on_resource_group" {
principal_id = data.azurerm_user_assigned_identity.cluster_identity.principal_id
scope = data.azurerm_resource_group.this.id
role_definition_name = "Virtual Machine Contributor"
}

resource "azurerm_role_assignment" "network_contributor_on_node_subnet" {
principal_id = data.azurerm_user_assigned_identity.cluster_identity.principal_id
scope = var.network.node_subnet_id
role_definition_name = "Network Contributor"
}

resource "azurerm_kubernetes_cluster" "this" {
location = var.location
name = "aks-${var.name}"
Expand Down

0 comments on commit f779903

Please sign in to comment.