provider/aws: pull iamconn setup earlier (#7734)

Fixes problem introduced in re-arrangement of config
This commit is contained in:
Paul Hinze 2016-07-20 18:38:14 -05:00 committed by Paul Stack
parent 7ba439dbf6
commit df5d2c9a63
1 changed files with 3 additions and 1 deletions

View File

@ -193,7 +193,10 @@ func (c *Config) Client() (interface{}, error) {
dynamoSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.DynamoDBEndpoint)}) dynamoSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.DynamoDBEndpoint)})
kinesisSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.KinesisEndpoint)}) kinesisSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.KinesisEndpoint)})
// These two services need to be set up early so we can check on AccountID
client.iamconn = iam.New(awsIamSess)
client.stsconn = sts.New(sess) client.stsconn = sts.New(sess)
err = c.ValidateCredentials(client.stsconn) err = c.ValidateCredentials(client.stsconn)
if err != nil { if err != nil {
errs = append(errs, err) errs = append(errs, err)
@ -233,7 +236,6 @@ func (c *Config) Client() (interface{}, error) {
client.esconn = elasticsearch.New(sess) client.esconn = elasticsearch.New(sess)
client.firehoseconn = firehose.New(sess) client.firehoseconn = firehose.New(sess)
client.glacierconn = glacier.New(sess) client.glacierconn = glacier.New(sess)
client.iamconn = iam.New(awsIamSess)
client.kinesisconn = kinesis.New(kinesisSess) client.kinesisconn = kinesis.New(kinesisSess)
client.kmsconn = kms.New(sess) client.kmsconn = kms.New(sess)
client.lambdaconn = lambda.New(sess) client.lambdaconn = lambda.New(sess)