@@ -72,6 +72,15 @@ projects/{projectId}/locations/{locationId}/clusters/{clusterId}`,
7272 Required : true ,
7373 Description : `Required. Number of shards for the Redis cluster.` ,
7474 },
75+ "allow_fewer_zones_deployment" : {
76+ Type : schema .TypeBool ,
77+ Optional : true ,
78+ ForceNew : true ,
79+ Description : `Allows customers to specify if they are okay with deploying a multi-zone
80+ cluster in less than 3 zones. Once set, if there is a zonal outage during
81+ the cluster creation, the cluster will only be deployed in 2 zones, and
82+ stay within the 2 zones for its lifecycle.` ,
83+ },
7584 "authorization_mode" : {
7685 Type : schema .TypeString ,
7786 Optional : true ,
@@ -814,6 +823,12 @@ func resourceRedisClusterCreate(d *schema.ResourceData, meta interface{}) error
814823 } else if v , ok := d .GetOkExists ("zone_distribution_config" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (zoneDistributionConfigProp )) && (ok || ! reflect .DeepEqual (v , zoneDistributionConfigProp )) {
815824 obj ["zoneDistributionConfig" ] = zoneDistributionConfigProp
816825 }
826+ allowFewerZonesDeploymentProp , err := expandRedisClusterAllowFewerZonesDeployment (d .Get ("allow_fewer_zones_deployment" ), d , config )
827+ if err != nil {
828+ return err
829+ } else if v , ok := d .GetOkExists ("allow_fewer_zones_deployment" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (allowFewerZonesDeploymentProp )) && (ok || ! reflect .DeepEqual (v , allowFewerZonesDeploymentProp )) {
830+ obj ["allowFewerZonesDeployment" ] = allowFewerZonesDeploymentProp
831+ }
817832 pscConfigsProp , err := expandRedisClusterPscConfigs (d .Get ("psc_configs" ), d , config )
818833 if err != nil {
819834 return err
@@ -1019,6 +1034,9 @@ func resourceRedisClusterRead(d *schema.ResourceData, meta interface{}) error {
10191034 if err := d .Set ("zone_distribution_config" , flattenRedisClusterZoneDistributionConfig (res ["zoneDistributionConfig" ], d , config )); err != nil {
10201035 return fmt .Errorf ("Error reading Cluster: %s" , err )
10211036 }
1037+ if err := d .Set ("allow_fewer_zones_deployment" , flattenRedisClusterAllowFewerZonesDeployment (res ["allowFewerZonesDeployment" ], d , config )); err != nil {
1038+ return fmt .Errorf ("Error reading Cluster: %s" , err )
1039+ }
10221040 if err := d .Set ("discovery_endpoints" , flattenRedisClusterDiscoveryEndpoints (res ["discoveryEndpoints" ], d , config )); err != nil {
10231041 return fmt .Errorf ("Error reading Cluster: %s" , err )
10241042 }
@@ -1448,6 +1466,10 @@ func flattenRedisClusterZoneDistributionConfigZone(v interface{}, d *schema.Reso
14481466 return v
14491467}
14501468
1469+ func flattenRedisClusterAllowFewerZonesDeployment (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1470+ return v
1471+ }
1472+
14511473func flattenRedisClusterDiscoveryEndpoints (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
14521474 if v == nil {
14531475 return v
@@ -2282,6 +2304,10 @@ func expandRedisClusterZoneDistributionConfigZone(v interface{}, d tpgresource.T
22822304 return v , nil
22832305}
22842306
2307+ func expandRedisClusterAllowFewerZonesDeployment (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2308+ return v , nil
2309+ }
2310+
22852311func expandRedisClusterPscConfigs (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
22862312 l := v .([]interface {})
22872313 req := make ([]interface {}, 0 , len (l ))
0 commit comments