Skip to content

Commit e8fb5e5

Browse files
feat(rdb): cross AZ Read Replica (#3140)
Co-authored-by: Jules Castéran <[email protected]>
1 parent 69821b1 commit e8fb5e5

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

cmd/scw/testdata/test-all-usage-rdb-read-replica-create-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ARGS:
99
instance-id UUID of the Database Instance you want to create a Read Replica from
1010
[endpoint-spec.{index}.private-network.private-network-id] UUID of the Private Network to be connected to the Read Replica
1111
[endpoint-spec.{index}.private-network.service-ip] Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations.
12+
[same-zone] Defines whether to create the replica in the same availability zone as the main instance nodes or not.
1213
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1314

1415
FLAGS:

docs/commands/rdb.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,7 @@ scw rdb read-replica create <instance-id ...> [arg=value ...]
11921192
| instance-id | Required | UUID of the Database Instance you want to create a Read Replica from |
11931193
| endpoint-spec.{index}.private-network.private-network-id | | UUID of the Private Network to be connected to the Read Replica |
11941194
| endpoint-spec.{index}.private-network.service-ip | | Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations. |
1195+
| same-zone | | Defines whether to create the replica in the same availability zone as the main instance nodes or not. |
11951196
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
11961197

11971198

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/moby/buildkit v0.11.6
2727
github.com/opencontainers/go-digest v1.0.0
2828
github.com/pkg/errors v0.9.1
29-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.16.0.20230524124738-b9ba35117a52
29+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17
3030
github.com/spf13/cobra v1.7.0
3131
github.com/spf13/pflag v1.0.5
3232
github.com/stretchr/testify v1.8.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
483483
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
484484
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
485485
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
486-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.16.0.20230524124738-b9ba35117a52 h1:ib3iE5wJl//BpzUIuyZ3Fp2Caf8Zu5G6cA3sHHbuPx8=
487-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.16.0.20230524124738-b9ba35117a52/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
486+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17 h1:1WuWJu7/e8SqK+uQl7lfk/N/oMZTL2NE/TJsNKRNMc4=
487+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
488488
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
489489
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
490490
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/rdb/v1/rdb_cli.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,13 @@ func rdbReadReplicaCreate() *core.Command {
13111311
Deprecated: false,
13121312
Positional: false,
13131313
},
1314+
{
1315+
Name: "same-zone",
1316+
Short: `Defines whether to create the replica in the same availability zone as the main instance nodes or not.`,
1317+
Required: false,
1318+
Deprecated: false,
1319+
Positional: false,
1320+
},
13141321
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
13151322
},
13161323
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)