Skip to content

Commit

Permalink
Use region in ~/.aws/config rather than hardcode
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerBrock committed Jun 18, 2018
1 parent 4746cdc commit 966a483
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions blade/blade.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/TylerBrock/colorjson"
"github.com/TylerBrock/saw/config"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
"github.com/fatih/color"
Expand All @@ -23,9 +22,9 @@ type Blade struct {

func NewBlade(config *config.Configuration, outputConfig *config.OutputConfiguration) *Blade {
blade := Blade{}
region := endpoints.UsEast1RegionID
awsConfig := aws.Config{Region: &region}
sess := session.Must(session.NewSession(&awsConfig))
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))

blade.cwl = cloudwatchlogs.New(sess)
blade.config = config
Expand Down

0 comments on commit 966a483

Please sign in to comment.