diff --git a/builtin/providers/aws/auth_helpers.go b/builtin/providers/aws/auth_helpers.go index e808d4d39..19b89369e 100644 --- a/builtin/providers/aws/auth_helpers.go +++ b/builtin/providers/aws/auth_helpers.go @@ -23,6 +23,8 @@ import ( func GetAccountInfo(iamconn *iam.IAM, stsconn *sts.STS, authProviderName string) (string, string, error) { // If we have creds from instance profile, we can use metadata API + log.Println("[DEBUG] GetAccountInfo called") + if authProviderName == ec2rolecreds.ProviderName { log.Println("[DEBUG] Trying to get account ID via AWS Metadata API") @@ -118,6 +120,23 @@ func GetCredentials(c *Config) (*awsCredentials.Credentials, error) { HTTPClient: client, } usedEndpoint := setOptionalEndpoint(cfg) + log.Printf("[INFO] AssumeRoleARN: %s", c.AssumeRoleARN) + log.Printf("[INFO] Endpoint Config: %+v", cfg) + log.Printf("[INFO] Our Config: %+v", c) + log.Printf("[INFO] Providers: %+v", providers) + for ind, p := range providers { + log.Printf("[INFO] %d %+v", ind, p) + } + xcreds := awsCredentials.NewChainCredentials(providers) + log.Printf("[INFO] Credential chain: %+v", xcreds) + // log.Printf("[INFO] Credential chain provider: %+v", xcreds.provider) + // for ind, p := range xcreds.provider.Providers { + // log.Printf("[INFO] %d %+v", ind, p) + // } + xcp, xerr := xcreds.Get() + if xerr == nil { + log.Printf("[INFO] Attempt to get credentials: %+v", xcp) + } if !c.SkipMetadataApiCheck { // Real AWS should reply to a simple metadata request. @@ -144,7 +163,7 @@ func GetCredentials(c *Config) (*awsCredentials.Credentials, error) { return awsCredentials.NewChainCredentials(providers), nil } - // Otherwise we need to construct and STS client with the main credentials, and verify + // Otherwise we need to construct an STS client with the main credentials, and verify // that we can assume the defined role. log.Printf("[INFO] Attempting to AssumeRole %s (SessionName: %q, ExternalId: %q, Policy: %q)", c.AssumeRoleARN, c.AssumeRoleSessionName, c.AssumeRoleExternalID, c.AssumeRolePolicy) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go index 09c8e5bc7..e37bcb578 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go @@ -152,7 +152,7 @@ func (cfg *sharedConfig) setFromIniFiles(profile string, files []sharedConfigFil for _, f := range files { if err := cfg.setFromIniFile(profile, f); err != nil { if _, ok := err.(SharedConfigProfileNotExistsError); ok { - // Ignore proviles missings + // Ignore missing profiles continue } return err