diff --git a/migration-backup-policy.tf b/migration-backup-policy.tf index d34ab46b..c5d41b76 100644 --- a/migration-backup-policy.tf +++ b/migration-backup-policy.tf @@ -4,6 +4,14 @@ resource "azurerm_recovery_services_vault" "darts-migration-backup" { location = azurerm_resource_group.darts_migration_resource_group[0].location resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name sku = "Standard" + tags = var.common_tags +} + +resource "azurerm_role_assignment" "backup-operator" { + for_each = toset(var.backup_operators) + scope = azurerm_recovery_services_vault.darts-migration-backup.id + role_definition_name = "Backup Operator" + principal_id = each.value } resource "azurerm_backup_policy_vm" "darts-migration-backup" { diff --git a/prod.tfvars b/prod.tfvars index 4d33b059..8b16e2e8 100644 --- a/prod.tfvars +++ b/prod.tfvars @@ -91,3 +91,9 @@ palo_networks = { enable_ip_forwarding = true } } + +backup_operators = [ + "e1ba3996-34e9-4ce2-b34f-4d5f28a9310c", // Richard Penswick + "675f1c23-3e46-4cf8-867b-747eb60fe89d", // Scott Robertson + "1d52a6eb-aa62-4dff-a7ac-3d71bccb67fc" // Ben Neill +] diff --git a/variables.tf b/variables.tf index 786f341f..72978a99 100644 --- a/variables.tf +++ b/variables.tf @@ -258,3 +258,9 @@ variable "max-file-upload-megabytes" { default = "350" description = "The file upload size threshold in megabytes " } + +variable "backup_operators" { + description = "List of pricipal IDs to assign the 'Backup Operator' role over the RSV." + type = list(string) + default = [] +}