@@ -220,6 +220,17 @@ Format: 'projects/{{projectId}}/locations/{{location}}/backupVaults/{{backupVaul
220
220
Please refer to the field 'effective_labels' for all of the labels present on the resource.` ,
221
221
Elem : & schema.Schema {Type : schema .TypeString },
222
222
},
223
+ "large_capacity" : {
224
+ Type : schema .TypeBool ,
225
+ Optional : true ,
226
+ Description : `Optional. Flag indicating if the volume will be a large capacity volume or a regular volume.` ,
227
+ },
228
+ "multiple_endpoints" : {
229
+ Type : schema .TypeBool ,
230
+ Optional : true ,
231
+ Description : `Optional. Flag indicating if the volume will have an IP address per node for volumes supporting multiple IP endpoints.
232
+ Only the volume with largeCapacity will be allowed to have multiple endpoints.` ,
233
+ },
223
234
"restore_parameters" : {
224
235
Type : schema .TypeList ,
225
236
Optional : true ,
@@ -654,6 +665,18 @@ func resourceNetappVolumeCreate(d *schema.ResourceData, meta interface{}) error
654
665
} else if v , ok := d .GetOkExists ("backup_config" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (backupConfigProp )) && (ok || ! reflect .DeepEqual (v , backupConfigProp )) {
655
666
obj ["backupConfig" ] = backupConfigProp
656
667
}
668
+ largeCapacityProp , err := expandNetappVolumeLargeCapacity (d .Get ("large_capacity" ), d , config )
669
+ if err != nil {
670
+ return err
671
+ } else if v , ok := d .GetOkExists ("large_capacity" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (largeCapacityProp )) && (ok || ! reflect .DeepEqual (v , largeCapacityProp )) {
672
+ obj ["largeCapacity" ] = largeCapacityProp
673
+ }
674
+ multipleEndpointsProp , err := expandNetappVolumeMultipleEndpoints (d .Get ("multiple_endpoints" ), d , config )
675
+ if err != nil {
676
+ return err
677
+ } else if v , ok := d .GetOkExists ("multiple_endpoints" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (multipleEndpointsProp )) && (ok || ! reflect .DeepEqual (v , multipleEndpointsProp )) {
678
+ obj ["multipleEndpoints" ] = multipleEndpointsProp
679
+ }
657
680
labelsProp , err := expandNetappVolumeEffectiveLabels (d .Get ("effective_labels" ), d , config )
658
681
if err != nil {
659
682
return err
@@ -855,6 +878,12 @@ func resourceNetappVolumeRead(d *schema.ResourceData, meta interface{}) error {
855
878
if err := d .Set ("replica_zone" , flattenNetappVolumeReplicaZone (res ["replicaZone" ], d , config )); err != nil {
856
879
return fmt .Errorf ("Error reading Volume: %s" , err )
857
880
}
881
+ if err := d .Set ("large_capacity" , flattenNetappVolumeLargeCapacity (res ["largeCapacity" ], d , config )); err != nil {
882
+ return fmt .Errorf ("Error reading Volume: %s" , err )
883
+ }
884
+ if err := d .Set ("multiple_endpoints" , flattenNetappVolumeMultipleEndpoints (res ["multipleEndpoints" ], d , config )); err != nil {
885
+ return fmt .Errorf ("Error reading Volume: %s" , err )
886
+ }
858
887
if err := d .Set ("terraform_labels" , flattenNetappVolumeTerraformLabels (res ["labels" ], d , config )); err != nil {
859
888
return fmt .Errorf ("Error reading Volume: %s" , err )
860
889
}
@@ -941,6 +970,18 @@ func resourceNetappVolumeUpdate(d *schema.ResourceData, meta interface{}) error
941
970
} else if v , ok := d .GetOkExists ("backup_config" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , backupConfigProp )) {
942
971
obj ["backupConfig" ] = backupConfigProp
943
972
}
973
+ largeCapacityProp , err := expandNetappVolumeLargeCapacity (d .Get ("large_capacity" ), d , config )
974
+ if err != nil {
975
+ return err
976
+ } else if v , ok := d .GetOkExists ("large_capacity" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , largeCapacityProp )) {
977
+ obj ["largeCapacity" ] = largeCapacityProp
978
+ }
979
+ multipleEndpointsProp , err := expandNetappVolumeMultipleEndpoints (d .Get ("multiple_endpoints" ), d , config )
980
+ if err != nil {
981
+ return err
982
+ } else if v , ok := d .GetOkExists ("multiple_endpoints" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , multipleEndpointsProp )) {
983
+ obj ["multipleEndpoints" ] = multipleEndpointsProp
984
+ }
944
985
labelsProp , err := expandNetappVolumeEffectiveLabels (d .Get ("effective_labels" ), d , config )
945
986
if err != nil {
946
987
return err
@@ -999,6 +1040,14 @@ func resourceNetappVolumeUpdate(d *schema.ResourceData, meta interface{}) error
999
1040
"backup_config.scheduled_backup_enabled" )
1000
1041
}
1001
1042
1043
+ if d .HasChange ("large_capacity" ) {
1044
+ updateMask = append (updateMask , "largeCapacity" )
1045
+ }
1046
+
1047
+ if d .HasChange ("multiple_endpoints" ) {
1048
+ updateMask = append (updateMask , "multipleEndpoints" )
1049
+ }
1050
+
1002
1051
if d .HasChange ("effective_labels" ) {
1003
1052
updateMask = append (updateMask , "labels" )
1004
1053
}
@@ -1686,6 +1735,14 @@ func flattenNetappVolumeReplicaZone(v interface{}, d *schema.ResourceData, confi
1686
1735
return v
1687
1736
}
1688
1737
1738
+ func flattenNetappVolumeLargeCapacity (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1739
+ return v
1740
+ }
1741
+
1742
+ func flattenNetappVolumeMultipleEndpoints (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1743
+ return v
1744
+ }
1745
+
1689
1746
func flattenNetappVolumeTerraformLabels (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1690
1747
if v == nil {
1691
1748
return v
@@ -2225,6 +2282,14 @@ func expandNetappVolumeBackupConfigScheduledBackupEnabled(v interface{}, d tpgre
2225
2282
return v , nil
2226
2283
}
2227
2284
2285
+ func expandNetappVolumeLargeCapacity (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2286
+ return v , nil
2287
+ }
2288
+
2289
+ func expandNetappVolumeMultipleEndpoints (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2290
+ return v , nil
2291
+ }
2292
+
2228
2293
func expandNetappVolumeEffectiveLabels (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
2229
2294
if v == nil {
2230
2295
return map [string ]string {}, nil
0 commit comments