diff --git a/Gopkg.lock b/Gopkg.lock index 7a7a3af3b..7e817123f 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -711,8 +711,10 @@ "github.com/VividCortex/mysqlerr", "github.com/WatchBeam/clock", "github.com/aws/aws-sdk-go/aws", + "github.com/aws/aws-sdk-go/aws/awserr", "github.com/aws/aws-sdk-go/aws/credentials", "github.com/aws/aws-sdk-go/aws/session", + "github.com/aws/aws-sdk-go/service/firehose", "github.com/aws/aws-sdk-go/service/firehose/firehoseiface", "github.com/beevik/etree", "github.com/briandowns/spinner", diff --git a/server/logging/firehose.go b/server/logging/firehose.go index 968bf3e04..22e890ec3 100644 --- a/server/logging/firehose.go +++ b/server/logging/firehose.go @@ -34,10 +34,17 @@ type firehoseLogWriter struct { } func NewFirehoseLogWriter(region, id, secret, stream string, logger log.Logger) (*firehoseLogWriter, error) { - sess, err := session.NewSession(&aws.Config{ - Credentials: credentials.NewStaticCredentials(id, secret, ""), - Region: ®ion, - }) + conf := &aws.Config{ + Region: ®ion, + } + + // Only provide static credentials if we have them + // otherwise use the default credentials provider chain + if id != "" && secret != "" { + conf.Credentials = credentials.NewStaticCredentials(id, secret, "") + } + + sess, err := session.NewSession(conf) if err != nil { return nil, errors.Wrap(err, "create Firehose client") }