@@ -100,6 +100,12 @@ Stores small amounts of arbitrary data.
100100Please refer to the field 'effective_annotations' for all of the annotations present on the resource.` ,
101101 Elem : & schema.Schema {Type : schema .TypeString },
102102 },
103+ "backup_retention_inheritance" : {
104+ Type : schema .TypeString ,
105+ Optional : true ,
106+ ValidateFunc : verify .ValidateEnum ([]string {"BACKUP_RETENTION_INHERITANCE_UNSPECIFIED" , "INHERIT_VAULT_RETENTION" , "MATCH_BACKUP_EXPIRE_TIME" , "" }),
107+ Description : `How a backup's enforced retention end time is inherited. Default value is 'INHERIT_VAULT_RETENTION' if not provided during creation. Possible values: ["BACKUP_RETENTION_INHERITANCE_UNSPECIFIED", "INHERIT_VAULT_RETENTION", "MATCH_BACKUP_EXPIRE_TIME"]` ,
108+ },
103109 "description" : {
104110 Type : schema .TypeString ,
105111 Optional : true ,
@@ -271,6 +277,12 @@ func resourceBackupDRBackupVaultCreate(d *schema.ResourceData, meta interface{})
271277 } else if v , ok := d .GetOkExists ("access_restriction" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (accessRestrictionProp )) && (ok || ! reflect .DeepEqual (v , accessRestrictionProp )) {
272278 obj ["accessRestriction" ] = accessRestrictionProp
273279 }
280+ backupRetentionInheritanceProp , err := expandBackupDRBackupVaultBackupRetentionInheritance (d .Get ("backup_retention_inheritance" ), d , config )
281+ if err != nil {
282+ return err
283+ } else if v , ok := d .GetOkExists ("backup_retention_inheritance" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (backupRetentionInheritanceProp )) && (ok || ! reflect .DeepEqual (v , backupRetentionInheritanceProp )) {
284+ obj ["backupRetentionInheritance" ] = backupRetentionInheritanceProp
285+ }
274286 labelsProp , err := expandBackupDRBackupVaultEffectiveLabels (d .Get ("effective_labels" ), d , config )
275287 if err != nil {
276288 return err
@@ -477,6 +489,12 @@ func resourceBackupDRBackupVaultUpdate(d *schema.ResourceData, meta interface{})
477489 } else if v , ok := d .GetOkExists ("effective_time" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , effectiveTimeProp )) {
478490 obj ["effectiveTime" ] = effectiveTimeProp
479491 }
492+ backupRetentionInheritanceProp , err := expandBackupDRBackupVaultBackupRetentionInheritance (d .Get ("backup_retention_inheritance" ), d , config )
493+ if err != nil {
494+ return err
495+ } else if v , ok := d .GetOkExists ("backup_retention_inheritance" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , backupRetentionInheritanceProp )) {
496+ obj ["backupRetentionInheritance" ] = backupRetentionInheritanceProp
497+ }
480498 labelsProp , err := expandBackupDRBackupVaultEffectiveLabels (d .Get ("effective_labels" ), d , config )
481499 if err != nil {
482500 return err
@@ -511,6 +529,10 @@ func resourceBackupDRBackupVaultUpdate(d *schema.ResourceData, meta interface{})
511529 updateMask = append (updateMask , "effectiveTime" )
512530 }
513531
532+ if d .HasChange ("backup_retention_inheritance" ) {
533+ updateMask = append (updateMask , "backupRetentionInheritance" )
534+ }
535+
514536 if d .HasChange ("effective_labels" ) {
515537 updateMask = append (updateMask , "labels" )
516538 }
@@ -786,6 +808,10 @@ func expandBackupDRBackupVaultAccessRestriction(v interface{}, d tpgresource.Ter
786808 return v , nil
787809}
788810
811+ func expandBackupDRBackupVaultBackupRetentionInheritance (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
812+ return v , nil
813+ }
814+
789815func expandBackupDRBackupVaultEffectiveLabels (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
790816 if v == nil {
791817 return map [string ]string {}, nil
0 commit comments