Skip to content

Commit ff936d8

Browse files
authored
fix(redis): prevent cluster recreation on private network changes (#2037)
* fix(redis): prevent cluster recreation on private network changes * fix * lint
1 parent 560e2dd commit ff936d8

5 files changed

+1095
-2388
lines changed

docs/resources/redis_cluster.md

+4
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ the form `{zone}/{id}`, e.g. `fr-par-1/11111111-1111-1111-1111-111111111111`
176176
- `ips` - Lis of IPv4 address of the endpoint (IP address).
177177
- `port` - TCP port of the endpoint.
178178

179+
- `private_network` - List of private networks endpoints of the Redis Cluster.
180+
- `endpoint_id` - The ID of the endpoint.
181+
- `zone` - The zone of the private network.
182+
179183
- `created_at` - The date and time of creation of the Redis Cluster.
180184
- `updated_at` - The date and time of the last update of the Redis Cluster.
181185
- `certificate` - The PEM of the certificate used by redis, only when `tls_enabled` is true

scaleway/helpers.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,16 @@ func regionSchema() *schema.Schema {
378378
}
379379
}
380380

381-
// regionComputedSchema returns a standard schema for a zone
381+
// zoneComputedSchema returns a standard schema for a zone
382+
func zoneComputedSchema() *schema.Schema {
383+
return &schema.Schema{
384+
Type: schema.TypeString,
385+
Description: "The zone of the resource",
386+
Computed: true,
387+
}
388+
}
389+
390+
// regionComputedSchema returns a standard schema for a region
382391
func regionComputedSchema() *schema.Schema {
383392
return &schema.Schema{
384393
Type: schema.TypeString,

scaleway/resource_redis_cluster.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func resourceScalewayRedisCluster() *schema.Resource {
151151
Computed: true,
152152
Description: "UUID of the endpoint to be connected to the cluster",
153153
},
154-
"zone": zoneSchema(),
154+
"zone": zoneComputedSchema(),
155155
},
156156
},
157157
},

0 commit comments

Comments
 (0)