Skip to content

Commit 6a7d453

Browse files
Google APIscopybara-github
authored andcommitted
feat: Adding new fields for CMEK and Retention Inheritance features
PiperOrigin-RevId: 833678865
1 parent 15fa97d commit 6a7d453

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

google/cloud/backupdr/v1/backupvault.proto

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ option java_outer_classname = "BackupVaultProto";
3535
option java_package = "com.google.cloud.backupdr.v1";
3636
option php_namespace = "Google\\Cloud\\BackupDR\\V1";
3737
option ruby_package = "Google::Cloud::BackupDR::V1";
38+
option (google.api.resource_definition) = {
39+
type: "cloudkms.googleapis.com/CryptoKey"
40+
pattern: "projects/{project}/locations/{location}/keyRings/{ring}/cryptoKeys/{key}"
41+
};
42+
option (google.api.resource_definition) = {
43+
type: "cloudkms.googleapis.com/CryptoKeyVersion"
44+
pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
45+
};
3846

3947
// Message describing a BackupVault object.
4048
message BackupVault {
@@ -45,6 +53,28 @@ message BackupVault {
4553
singular: "backupVault"
4654
};
4755

56+
// How a backup's enforced retention end time is inherited.
57+
enum BackupRetentionInheritance {
58+
// Inheritance behavior not set. This will default to
59+
// `INHERIT_VAULT_RETENTION`.
60+
BACKUP_RETENTION_INHERITANCE_UNSPECIFIED = 0;
61+
62+
// The enforced retention end time of a backup will be inherited from the
63+
// backup vault's `backup_minimum_enforced_retention_duration` field.
64+
//
65+
// This is the default behavior.
66+
INHERIT_VAULT_RETENTION = 1;
67+
68+
// The enforced retention end time of a backup will always match the expire
69+
// time of the backup.
70+
//
71+
// If this is set, the backup's enforced retention end time will be set to
72+
// match the expire time during creation of the backup. When updating, the
73+
// ERET and expire time must be updated together and have the same value.
74+
// Invalid update requests will be rejected by the server.
75+
MATCH_BACKUP_EXPIRE_TIME = 2;
76+
}
77+
4878
// Holds the state of the backup vault resource.
4979
enum State {
5080
// State not set.
@@ -87,6 +117,21 @@ message BackupVault {
87117
WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA = 4;
88118
}
89119

120+
// Message describing the EncryptionConfig of backup vault.
121+
// This determines how data within the vault is encrypted at rest.
122+
message EncryptionConfig {
123+
// Optional. The Cloud KMS key name to encrypt backups in this backup vault.
124+
// Must be in the same region as the vault. Some workload backups like
125+
// compute disk backups may use their inherited source key instead. Format:
126+
// projects/{project}/locations/{location}/keyRings/{ring}/cryptoKeys/{key}
127+
optional string kms_key_name = 1 [
128+
(google.api.field_behavior) = OPTIONAL,
129+
(google.api.resource_reference) = {
130+
type: "cloudkms.googleapis.com/CryptoKey"
131+
}
132+
];
133+
}
134+
90135
// Output only. Identifier. Name of the backup vault to create. It must have
91136
// the
92137
// format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`.
@@ -118,6 +163,11 @@ message BackupVault {
118163
optional google.protobuf.Duration backup_minimum_enforced_retention_duration =
119164
20 [(google.api.field_behavior) = REQUIRED];
120165

166+
// Optional. Setting for how a backup's enforced retention end time is
167+
// inherited.
168+
optional BackupRetentionInheritance backup_retention_inheritance = 27
169+
[(google.api.field_behavior) = OPTIONAL];
170+
121171
// Output only. Set to true when there are no backups nested under this
122172
// resource.
123173
optional bool deletable = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -161,6 +211,10 @@ message BackupVault {
161211
// Default value is WITHIN_ORGANIZATION if not provided during creation.
162212
AccessRestriction access_restriction = 24
163213
[(google.api.field_behavior) = OPTIONAL];
214+
215+
// Optional. The encryption config of the backup vault.
216+
optional EncryptionConfig encryption_config = 29
217+
[(google.api.field_behavior) = OPTIONAL];
164218
}
165219

166220
// Message describing a DataSource object.
@@ -569,6 +623,11 @@ message Backup {
569623
optional google.protobuf.Timestamp enforced_retention_end_time = 6
570624
[(google.api.field_behavior) = OPTIONAL];
571625

626+
// Output only. Setting for how the enforced retention end time is inherited.
627+
// This value is copied from this backup's BackupVault.
628+
optional BackupVault.BackupRetentionInheritance backup_retention_inheritance =
629+
30 [(google.api.field_behavior) = OUTPUT_ONLY];
630+
572631
// Optional. When this backup is automatically expired.
573632
optional google.protobuf.Timestamp expire_time = 7
574633
[(google.api.field_behavior) = OPTIONAL];
@@ -645,6 +704,15 @@ message Backup {
645704
BackupGcpResource gcp_resource = 31
646705
[(google.api.field_behavior) = OUTPUT_ONLY];
647706
}
707+
708+
// Optional. Output only. The list of KMS key versions used to encrypt the
709+
// backup.
710+
repeated string kms_key_versions = 33 [
711+
(google.api.field_behavior) = OUTPUT_ONLY,
712+
(google.api.resource_reference) = {
713+
type: "cloudkms.googleapis.com/CryptoKeyVersion"
714+
}
715+
];
648716
}
649717

650718
// Message for creating a BackupVault.
@@ -1223,6 +1291,21 @@ message RestoreBackupRequest {
12231291
// Disk properties to be overridden during restore.
12241292
DiskRestoreProperties disk_restore_properties = 7;
12251293
}
1294+
1295+
// Optional. A field mask used to clear server-side default values
1296+
// for fields within the `instance_properties` oneof.
1297+
//
1298+
// When a field in this mask is cleared, the server will not apply its
1299+
// default logic (like inheriting a value from the source) for that field.
1300+
//
1301+
// The most common current use case is clearing default encryption keys.
1302+
//
1303+
// Examples of field mask paths:
1304+
// - Compute Instance Disks:
1305+
// `compute_instance_restore_properties.disks.*.disk_encryption_key`
1306+
// - Single Disk: `disk_restore_properties.disk_encryption_key`
1307+
optional google.protobuf.FieldMask clear_overrides_field_mask = 8
1308+
[(google.api.field_behavior) = OPTIONAL];
12261309
}
12271310

12281311
// Response message for restoring from a Backup.

0 commit comments

Comments
 (0)