Skip to content

Commit

Permalink
Added controlled-vault feature to backupdr-backupvault (#12239)
Browse files Browse the repository at this point in the history
  • Loading branch information
liyun-huang authored Nov 8, 2024
1 parent 3db026c commit 069cde8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
13 changes: 13 additions & 0 deletions mmv1/products/backupdr/BackupVault.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,16 @@ properties:
description: "Optional. User annotations. See https://google.aip.dev/128#annotations\nStores
small amounts of arbitrary data. "
min_version: 'beta'
- name: 'accessRestriction'
type: Enum
description: |
Access restriction for the backup vault. Default value is `WITHIN_ORGANIZATION` if not provided during creation.
min_version: 'beta'
immutable: true
default_value: "WITHIN_ORGANIZATION"
enum_values:
- 'ACCESS_RESTRICTION_UNSPECIFIED'
- 'WITHIN_PROJECT'
- 'WITHIN_ORGANIZATION'
- 'UNRESTRICTED'
- 'WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA'
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ resource "google_backup_dr_backup_vault" "{{$.PrimaryResourceId}}" {
annotations2 = "baz1"
}
force_update = "true"
access_restriction = "WITHIN_ORGANIZATION"
ignore_inactive_datasources = "true"
ignore_backup_plan_references = "true"
allow_missing = "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestAccBackupDRBackupVault_fullUpdate(t *testing.T) {
ResourceName: "google_backup_dr_backup_vault.backup-vault-test",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"allow_missing", "annotations", "backup_vault_id", "force_delete", "force_update", "ignore_backup_plan_references", "ignore_inactive_datasources", "labels", "location", "terraform_labels"},
ImportStateVerifyIgnore: []string{"allow_missing", "annotations", "backup_vault_id", "force_delete", "force_update", "ignore_backup_plan_references", "ignore_inactive_datasources", "access_restriction", "labels", "location", "terraform_labels"},
},
{
Config: testAccBackupDRBackupVault_fullUpdate(context),
Expand All @@ -41,7 +41,7 @@ func TestAccBackupDRBackupVault_fullUpdate(t *testing.T) {
ResourceName: "google_backup_dr_backup_vault.backup-vault-test",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"allow_missing", "annotations", "backup_vault_id", "force_delete", "force_update", "ignore_backup_plan_references", "ignore_inactive_datasources", "labels", "location", "terraform_labels"},
ImportStateVerifyIgnore: []string{"allow_missing", "annotations", "backup_vault_id", "force_delete", "force_update", "ignore_backup_plan_references", "ignore_inactive_datasources", "access_restriction", "labels", "location", "terraform_labels"},
},
},
})
Expand All @@ -66,6 +66,7 @@ resource "google_backup_dr_backup_vault" "backup-vault-test" {
}
force_update = "true"
ignore_inactive_datasources = "true"
access_restriction = "WITHIN_ORGANIZATION"
ignore_backup_plan_references = "true"
allow_missing = "true"
}
Expand All @@ -90,6 +91,7 @@ resource "google_backup_dr_backup_vault" "backup-vault-test" {
annotations2 = "baz1"
}
force_update = "true"
access_restriction = "WITHIN_ORGANIZATION"
ignore_inactive_datasources = "true"
ignore_backup_plan_references = "true"
allow_missing = "true"
Expand Down

0 comments on commit 069cde8

Please sign in to comment.