Skip to content

Commit 9429ab1

Browse files
authored
cmd/devp2p: add flag for AWS region (ethereum#22537)
1 parent d3040a8 commit 9429ab1

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

cmd/devp2p/dns_route53.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ var (
5959
Name: "zone-id",
6060
Usage: "Route53 Zone ID",
6161
}
62+
route53RegionFlag = cli.StringFlag{
63+
Name: "aws-region",
64+
Usage: "AWS Region",
65+
Value: "eu-central-1",
66+
}
6267
)
6368

6469
type route53Client struct {
@@ -76,13 +81,14 @@ func newRoute53Client(ctx *cli.Context) *route53Client {
7681
akey := ctx.String(route53AccessKeyFlag.Name)
7782
asec := ctx.String(route53AccessSecretFlag.Name)
7883
if akey == "" || asec == "" {
79-
exit(fmt.Errorf("need Route53 Access Key ID and secret proceed"))
84+
exit(fmt.Errorf("need Route53 Access Key ID and secret to proceed"))
8085
}
8186
creds := aws.NewCredentialsCache(credentials.NewStaticCredentialsProvider(akey, asec, ""))
8287
cfg, err := config.LoadDefaultConfig(context.Background(), config.WithCredentialsProvider(creds))
8388
if err != nil {
8489
exit(fmt.Errorf("can't initialize AWS configuration: %v", err))
8590
}
91+
cfg.Region = ctx.String(route53RegionFlag.Name)
8692
return &route53Client{
8793
api: route53.NewFromConfig(cfg),
8894
zoneID: ctx.String(route53ZoneIDFlag.Name),

cmd/devp2p/dnscmd.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ var (
7777
Usage: "Deploy DNS TXT records to Amazon Route53",
7878
ArgsUsage: "<tree-directory>",
7979
Action: dnsToRoute53,
80-
Flags: []cli.Flag{route53AccessKeyFlag, route53AccessSecretFlag, route53ZoneIDFlag},
80+
Flags: []cli.Flag{
81+
route53AccessKeyFlag,
82+
route53AccessSecretFlag,
83+
route53ZoneIDFlag,
84+
route53RegionFlag,
85+
},
8186
}
8287
)
8388

0 commit comments

Comments
 (0)