feat: authorize OCI lifecycle service principal

This commit is contained in:
juvenal.diaz 2026-10-28 08:40:43 -06:00
parent 3c39b4cee6
commit 5980e4c6a0
1 changed files with 11 additions and 0 deletions

View File

@ -48,6 +48,17 @@ resource "oci_objectstorage_bucket" "homelab_backups" {
}
}
resource "oci_identity_policy" "object_storage_lifecycle" {
count = var.enabled && var.backup_bucket_enabled ? 1 : 0
compartment_id = var.tenancy_id
name = "jeannie-object-storage-lifecycle"
description = "Allow OCI Object Storage to execute Jeannie backup lifecycle rules"
statements = [
"Allow service objectstorage-${var.region} to manage object-family in compartment ${var.compartment_name}",
]
freeform_tags = local.base_tags
}
resource "oci_identity_compartment" "homelab" {
count = var.enabled && var.create_compartment ? 1 : 0
compartment_id = var.tenancy_id