diff --git a/builtin/providers/aws/auth_helpers.go b/builtin/providers/aws/auth_helpers.go index 91671a801..33db566fd 100644 --- a/builtin/providers/aws/auth_helpers.go +++ b/builtin/providers/aws/auth_helpers.go @@ -111,10 +111,10 @@ func GetCredentials(c *Config) *awsCredentials.Credentials { } usedEndpoint := setOptionalEndpoint(cfg) - // Real AWS should reply to a simple metadata request. - // We check it actually does to ensure something else didn't just - // happen to be listening on the same IP:Port - if c.SkipMetadataApiCheck == false { + if !c.SkipMetadataApiCheck { + // Real AWS should reply to a simple metadata request. + // We check it actually does to ensure something else didn't just + // happen to be listening on the same IP:Port metadataClient := ec2metadata.New(session.New(cfg)) if metadataClient.Available() { providers = append(providers, &ec2rolecreds.EC2RoleProvider{ diff --git a/builtin/providers/aws/config.go b/builtin/providers/aws/config.go index 84a7b5d26..1a7a05c94 100644 --- a/builtin/providers/aws/config.go +++ b/builtin/providers/aws/config.go @@ -203,7 +203,7 @@ func (c *Config) Client() (interface{}, error) { client.iamconn = iam.New(awsIamSess) client.stsconn = sts.New(sess) - if c.SkipIamCredsValidation == false { + if !c.SkipIamCredsValidation { err = c.ValidateCredentials(client.stsconn) if err != nil { errs = append(errs, err) @@ -211,7 +211,7 @@ func (c *Config) Client() (interface{}, error) { } } - if c.SkipIamAccountId == false { + if !c.SkipIamAccountId { accountId, err := GetAccountId(client.iamconn, client.stsconn, cp.ProviderName) if err == nil { client.accountid = accountId