Skip to content

Commit

Permalink
feat: include locks permission (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
varnastadeus authored Dec 1, 2022
1 parent 6a16dc5 commit 7478d8c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ resource "azurerm_role_definition" "castai" {
name = local.role_name
description = "Role used by CAST AI"

scope = "/subscriptions/${var.subscription_id}/resourceGroups/${var.resource_group}"
scope = "/subscriptions/${var.subscription_id}/resourceGroups/${var.resource_group}"

permissions {
actions = [
actions = [
"Microsoft.Compute/*/read",
"Microsoft.Compute/virtualMachines/*",
"Microsoft.Compute/virtualMachineScaleSets/*",
Expand Down Expand Up @@ -39,6 +39,7 @@ resource "azurerm_role_definition" "castai" {
"Microsoft.ContainerService/managedClusters/agentPools/*",
"Microsoft.Resources/*/read",
"Microsoft.Resources/tags/write",
"Microsoft.Authorization/locks/read",
"Microsoft.Authorization/roleAssignments/read",
"Microsoft.Authorization/roleDefinitions/read",
"Microsoft.ManagedIdentity/userAssignedIdentities/assign/action"
Expand All @@ -54,15 +55,15 @@ resource "azurerm_role_definition" "castai" {


resource "azurerm_role_assignment" "castai_resource_group" {
principal_id = azuread_service_principal.castai.id
role_definition_id = azurerm_role_definition.castai.role_definition_resource_id
principal_id = azuread_service_principal.castai.id
role_definition_id = azurerm_role_definition.castai.role_definition_resource_id

scope = "/subscriptions/${var.subscription_id}/resourceGroups/${var.resource_group}"
}

resource "azurerm_role_assignment" "castai_node_resource_group" {
principal_id = azuread_service_principal.castai.id
role_definition_id = azurerm_role_definition.castai.role_definition_resource_id
principal_id = azuread_service_principal.castai.id
role_definition_id = azurerm_role_definition.castai.role_definition_resource_id

scope = "/subscriptions/${var.subscription_id}/resourceGroups/${var.node_resource_group}"
}
Expand Down

0 comments on commit 7478d8c

Please sign in to comment.