Skip to content

Commit

Permalink
Allow overriding of AWS endpoint
Browse files Browse the repository at this point in the history
The AWS service endpoint can be overridden to enable emulation. For
example by using localstack.
  • Loading branch information
Suraj Barkale authored and Suraj Barkale committed Oct 16, 2018
1 parent 66323c4 commit c11976b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type (
RoleARN string `envconfig:"AWS_ROLE_ARN"`
SecretKey string `envconfig:"AWS_SECRET_KEY"`
SessionToken string `envconfig:"AWS_SESSION_TOKEN"`
Endpoint *string // Must be overridden separately for each service
}

// S3 holds the info required to work with Amazon S3.
Expand Down
1 change: 1 addition & 0 deletions pubsub/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func NewPublisher(cfg SNSConfig) (pubsub.Publisher, error) {
p.sns = sns.New(sess, &aws.Config{
Credentials: creds,
Region: &cfg.Region,
Endpoint: cfg.Endpoint,
})
return p, nil
}
Expand Down

0 comments on commit c11976b

Please sign in to comment.