Skip to content

Commit

Permalink
Merge pull request #53 from segmentio/allow-overriding-region
Browse files Browse the repository at this point in the history
Allow overriding region
  • Loading branch information
dfuentes authored Dec 4, 2017
2 parents 500da44 + 0b57c20 commit df3773f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ Chamber does not currently read the value of "AWS_DEFAULT_REGION". See
[https://github.com/aws/aws-sdk-go#configuring-aws-region](https://github.com/aws/aws-sdk-go#configuring-aws-region)
for more details.

If you'd like to use a different region for chamber without changing `AWS_REGION`, you can use `CHAMBER_AWS_REGION` to override just for chamber.

### Using Path Based Keys

If you'd prefer to use path based keys (`/service/key`) instead of the default period separated keys (`service.key`), you
Expand Down
4 changes: 4 additions & 0 deletions store/ssmstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func NewSSMStore(numRetries int) *SSMStore {
region, _ = ec2metadataSvc.Region()
}

if regionOverride, ok := os.LookupEnv("CHAMBER_AWS_REGION"); ok {
region = regionOverride
}

ssmSession := session.Must(session.NewSession(&aws.Config{
Region: aws.String(region),
}))
Expand Down

0 comments on commit df3773f

Please sign in to comment.