Skip to content

Commit

Permalink
Use default config to use chain credential provider
Browse files Browse the repository at this point in the history
  • Loading branch information
syucream committed Jan 7, 2020
1 parent 857310e commit cf66d3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ shutter

# GoLand
.idea/

# goreleaser
dist/
7 changes: 1 addition & 6 deletions aws_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package shutter
import (
"errors"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/autoscaling"
"github.com/aws/aws-sdk-go/service/ec2"
Expand All @@ -29,11 +28,7 @@ type awsClientImpl struct {
}

func NewAwsClient(config *Config) (AwsClient, error) {
creds := credentials.NewEnvCredentials()
sess, err := session.NewSession(&aws.Config{
Credentials: creds,
Region: &config.AwsRegion,
})
sess, err := session.NewSession(aws.NewConfig().WithRegion(config.AwsRegion))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit cf66d3a

Please sign in to comment.