From b1f83d92ed2af0b39c91435c1700b79b5c0e0b9e Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 28 Nov 2024 14:16:33 -0500 Subject: [PATCH] QoL: do not show AWS locations in fly replication Also, warn early if primaryRegion is on AWS --- internal/cmd/db_replicate.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/cmd/db_replicate.go b/internal/cmd/db_replicate.go index 23c6b56b..4582fce1 100644 --- a/internal/cmd/db_replicate.go +++ b/internal/cmd/db_replicate.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "sort" + "strings" "time" "github.com/manifoldco/promptui" @@ -40,6 +41,9 @@ var replicateCmd = &cobra.Command{ if err != nil { return err } + if strings.HasPrefix(database.PrimaryRegion, "aws-") { + return fmt.Errorf("replication is not available on AWS at the moment") + } location, err := getReplicateLocation(client, args, database) if err != nil { @@ -194,7 +198,7 @@ func pickLocation(dbName string, locations map[string]string, exclude []string) tbl := table.New(columns...) for _, id := range ids { - if excluded[id] { + if excluded[id] || strings.HasPrefix(id, "aws-") { continue } tbl.AddRow(id, locations[id])