Skip to content

Commit 46b3a9d

Browse files
liyun-huangamanMahendroo
authored andcommitted
Added controlled-vault feature to backupdr-backupvault (GoogleCloudPlatform#12239)
1 parent d9257de commit 46b3a9d

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

mmv1/products/backupdr/BackupVault.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,16 @@ properties:
198198
description: "Optional. User annotations. See https://google.aip.dev/128#annotations\nStores
199199
small amounts of arbitrary data. "
200200
min_version: 'beta'
201+
- name: 'accessRestriction'
202+
type: Enum
203+
description: |
204+
Access restriction for the backup vault. Default value is `WITHIN_ORGANIZATION` if not provided during creation.
205+
min_version: 'beta'
206+
immutable: true
207+
default_value: "WITHIN_ORGANIZATION"
208+
enum_values:
209+
- 'ACCESS_RESTRICTION_UNSPECIFIED'
210+
- 'WITHIN_PROJECT'
211+
- 'WITHIN_ORGANIZATION'
212+
- 'UNRESTRICTED'
213+
- 'WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA'

mmv1/templates/terraform/examples/backup_dr_backup_vault_full.tf.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ resource "google_backup_dr_backup_vault" "{{$.PrimaryResourceId}}" {
1313
annotations2 = "baz1"
1414
}
1515
force_update = "true"
16+
access_restriction = "WITHIN_ORGANIZATION"
1617
ignore_inactive_datasources = "true"
1718
ignore_backup_plan_references = "true"
1819
allow_missing = "true"

mmv1/third_party/terraform/services/backupdr/resource_backup_dr_backup_vault_test.go.tmpl

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestAccBackupDRBackupVault_fullUpdate(t *testing.T) {
3232
ResourceName: "google_backup_dr_backup_vault.backup-vault-test",
3333
ImportState: true,
3434
ImportStateVerify: true,
35-
ImportStateVerifyIgnore: []string{"allow_missing", "annotations", "backup_vault_id", "force_delete", "force_update", "ignore_backup_plan_references", "ignore_inactive_datasources", "labels", "location", "terraform_labels"},
35+
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"},
3636
},
3737
{
3838
Config: testAccBackupDRBackupVault_fullUpdate(context),
@@ -41,7 +41,7 @@ func TestAccBackupDRBackupVault_fullUpdate(t *testing.T) {
4141
ResourceName: "google_backup_dr_backup_vault.backup-vault-test",
4242
ImportState: true,
4343
ImportStateVerify: true,
44-
ImportStateVerifyIgnore: []string{"allow_missing", "annotations", "backup_vault_id", "force_delete", "force_update", "ignore_backup_plan_references", "ignore_inactive_datasources", "labels", "location", "terraform_labels"},
44+
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"},
4545
},
4646
},
4747
})
@@ -66,6 +66,7 @@ resource "google_backup_dr_backup_vault" "backup-vault-test" {
6666
}
6767
force_update = "true"
6868
ignore_inactive_datasources = "true"
69+
access_restriction = "WITHIN_ORGANIZATION"
6970
ignore_backup_plan_references = "true"
7071
allow_missing = "true"
7172
}
@@ -90,6 +91,7 @@ resource "google_backup_dr_backup_vault" "backup-vault-test" {
9091
annotations2 = "baz1"
9192
}
9293
force_update = "true"
94+
access_restriction = "WITHIN_ORGANIZATION"
9395
ignore_inactive_datasources = "true"
9496
ignore_backup_plan_references = "true"
9597
allow_missing = "true"

0 commit comments

Comments
 (0)