@@ -170,13 +170,23 @@ the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{v
170170 Optional : true ,
171171 Description : `User-provided description for this private cloud.` ,
172172 },
173+ "preferred_zone" : {
174+ Type : schema .TypeString ,
175+ Optional : true ,
176+ Description : `The preferred single failure domain within a region.` ,
177+ },
178+ "secondary_zone" : {
179+ Type : schema .TypeString ,
180+ Optional : true ,
181+ Description : `The secondary single failure domain within a region.` ,
182+ },
173183 "type" : {
174184 Type : schema .TypeString ,
175185 Optional : true ,
176186 ForceNew : true ,
177- ValidateFunc : verify .ValidateEnum ([]string {"STANDARD" , "TIME_LIMITED" , "" }),
187+ ValidateFunc : verify .ValidateEnum ([]string {"STANDARD" , "TIME_LIMITED" , "STRETCHED" , " " }),
178188 DiffSuppressFunc : vmwareenginePrivateCloudStandardTypeDiffSuppressFunc ,
179- Description : `Initial type of the private cloud. Possible values: ["STANDARD", "TIME_LIMITED"]` ,
189+ Description : `Initial type of the private cloud. Possible values: ["STANDARD", "TIME_LIMITED", "STRETCHED" ]` ,
180190 },
181191 "hcx" : {
182192 Type : schema .TypeList ,
@@ -321,6 +331,18 @@ func resourceVmwareenginePrivateCloudCreate(d *schema.ResourceData, meta interfa
321331 } else if v , ok := d .GetOkExists ("type" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (typeProp )) && (ok || ! reflect .DeepEqual (v , typeProp )) {
322332 obj ["type" ] = typeProp
323333 }
334+ preferredZoneProp , err := expandVmwareenginePrivateCloudPreferredZone (d .Get ("preferred_zone" ), d , config )
335+ if err != nil {
336+ return err
337+ } else if v , ok := d .GetOkExists ("preferred_zone" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (preferredZoneProp )) && (ok || ! reflect .DeepEqual (v , preferredZoneProp )) {
338+ obj ["preferredZone" ] = preferredZoneProp
339+ }
340+ secondaryZoneProp , err := expandVmwareenginePrivateCloudSecondaryZone (d .Get ("secondary_zone" ), d , config )
341+ if err != nil {
342+ return err
343+ } else if v , ok := d .GetOkExists ("secondary_zone" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (secondaryZoneProp )) && (ok || ! reflect .DeepEqual (v , secondaryZoneProp )) {
344+ obj ["secondaryZone" ] = secondaryZoneProp
345+ }
324346
325347 url , err := tpgresource .ReplaceVars (d , config , "{{VmwareengineBasePath}}projects/{{project}}/locations/{{location}}/privateClouds?privateCloudId={{name}}" )
326348 if err != nil {
@@ -454,6 +476,12 @@ func resourceVmwareenginePrivateCloudRead(d *schema.ResourceData, meta interface
454476 if err := d .Set ("vcenter" , flattenVmwareenginePrivateCloudVcenter (res ["vcenter" ], d , config )); err != nil {
455477 return fmt .Errorf ("Error reading PrivateCloud: %s" , err )
456478 }
479+ if err := d .Set ("preferred_zone" , flattenVmwareenginePrivateCloudPreferredZone (res ["preferredZone" ], d , config )); err != nil {
480+ return fmt .Errorf ("Error reading PrivateCloud: %s" , err )
481+ }
482+ if err := d .Set ("secondary_zone" , flattenVmwareenginePrivateCloudSecondaryZone (res ["secondaryZone" ], d , config )); err != nil {
483+ return fmt .Errorf ("Error reading PrivateCloud: %s" , err )
484+ }
457485
458486 return nil
459487}
@@ -486,6 +514,18 @@ func resourceVmwareenginePrivateCloudUpdate(d *schema.ResourceData, meta interfa
486514 } else if v , ok := d .GetOkExists ("management_cluster" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , managementClusterProp )) {
487515 obj ["managementCluster" ] = managementClusterProp
488516 }
517+ preferredZoneProp , err := expandVmwareenginePrivateCloudPreferredZone (d .Get ("preferred_zone" ), d , config )
518+ if err != nil {
519+ return err
520+ } else if v , ok := d .GetOkExists ("preferred_zone" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , preferredZoneProp )) {
521+ obj ["preferredZone" ] = preferredZoneProp
522+ }
523+ secondaryZoneProp , err := expandVmwareenginePrivateCloudSecondaryZone (d .Get ("secondary_zone" ), d , config )
524+ if err != nil {
525+ return err
526+ } else if v , ok := d .GetOkExists ("secondary_zone" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , secondaryZoneProp )) {
527+ obj ["secondaryZone" ] = secondaryZoneProp
528+ }
489529
490530 obj , err = resourceVmwareenginePrivateCloudUpdateEncoder (d , meta , obj )
491531 if err != nil {
@@ -939,6 +979,14 @@ func flattenVmwareenginePrivateCloudVcenterFqdn(v interface{}, d *schema.Resourc
939979 return v
940980}
941981
982+ func flattenVmwareenginePrivateCloudPreferredZone (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
983+ return v
984+ }
985+
986+ func flattenVmwareenginePrivateCloudSecondaryZone (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
987+ return v
988+ }
989+
942990func expandVmwareenginePrivateCloudDescription (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
943991 return v , nil
944992}
@@ -1084,6 +1132,14 @@ func expandVmwareenginePrivateCloudType(v interface{}, d tpgresource.TerraformRe
10841132 return v , nil
10851133}
10861134
1135+ func expandVmwareenginePrivateCloudPreferredZone (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1136+ return v , nil
1137+ }
1138+
1139+ func expandVmwareenginePrivateCloudSecondaryZone (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1140+ return v , nil
1141+ }
1142+
10871143func resourceVmwareenginePrivateCloudUpdateEncoder (d * schema.ResourceData , meta interface {}, obj map [string ]interface {}) (map [string ]interface {}, error ) {
10881144 delete (obj , "managementCluster" )
10891145 return obj , nil
0 commit comments