Skip to content

Commit

Permalink
QoL: do not show AWS locations in fly replication
Browse files Browse the repository at this point in the history
Also, warn early if primaryRegion is on AWS
  • Loading branch information
glommer committed Nov 28, 2024
1 parent 6264cfc commit b1f83d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/cmd/db_replicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"sort"
"strings"
"time"

"github.com/manifoldco/promptui"
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit b1f83d9

Please sign in to comment.