Skip to content

Commit 7e98f00

Browse files
Merge pull request #20 from felixb/region-from-session
allow using region from current session
2 parents b529ac2 + a199821 commit 7e98f00

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

command/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type DescribeCommand struct {
2727

2828
type AwsOptions struct {
2929
Profile string `short:"p" long:"profile" description:"AWS Profile to use. (If you are not using Vaulted)."`
30-
Region string `short:"r" long:"region" description:"Region to target." default:"eu-west-1"`
30+
Region string `short:"r" long:"region" description:"Region to target."`
3131
}
3232

3333
type TargetOptions struct {

manager/manager.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ type Opts struct {
6363

6464
// NewManager creates a new Manager from an AWS session and region.
6565
func NewManager(sess *session.Session, region string, opts Opts) *Manager {
66-
awsCfg := &aws.Config{Region: aws.String(region)}
66+
awsCfg := &aws.Config{}
67+
if region != "" {
68+
awsCfg.Region = aws.String(region)
69+
}
6770
m := &Manager{
6871
ssmClient: ssm.New(sess, awsCfg),
6972
s3Client: s3.New(sess, awsCfg),

0 commit comments

Comments
 (0)