1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-15 00:15:15 +02:00

Init aws session with region when using role

This commit is contained in:
Lee Brown
2019-07-14 00:54:51 -08:00
parent db07498192
commit 8f5ff1ec1e
7 changed files with 38 additions and 2 deletions

View File

@ -247,6 +247,9 @@ func main() {
// configuration is provided. This is useful for taking advantage of
// EC2/ECS instance roles.
awsSession = session.Must(session.NewSession())
if cfg.Aws.Region != "" {
awsSession.Config.WithRegion(cfg.Aws.Region)
}
log.Printf("main : AWS : Using role.\n")