Skip to content

Commit 2a159b8

Browse files
authored
fix: Improve AWS credentials error message and local profile docs (#4708)
#### Summary Fixes #4656 <!--
1 parent ad47c3e commit 2a159b8

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

plugins/source/aws/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func configureAwsClient(ctx context.Context, logger zerolog.Logger, awsConfig *S
321321
// Test out retrieving credentials
322322
if _, err := awsCfg.Credentials.Retrieve(ctx); err != nil {
323323
logger.Error().Err(err).Msg("error retrieving credentials")
324-
return awsCfg, fmt.Errorf("error retrieving credentials: %w", err)
324+
return awsCfg, fmt.Errorf("error retrieving AWS credentials (see logs for details). Please verify your credentials and try again")
325325
}
326326

327327
return awsCfg, err

plugins/source/aws/docs/configuration.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,20 @@ This is used to specify one or more accounts to extract information from. Note t
5353

5454
- `local_profile` (string) (default: will use current credentials)
5555

56-
[Local profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) to use to authenticate this account with
56+
[Local profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) to use to authenticate this account with.
57+
Please note this should be set to the name of the profile. For example, with the following credentials file:
58+
59+
```ini
60+
[default]
61+
aws_access_key_id=xxxx
62+
aws_secret_access_key=xxxx
63+
64+
[user1]
65+
aws_access_key_id=xxxx
66+
aws_secret_access_key=xxxx
67+
```
68+
69+
`local_profile` should be set to either `default` or `user1`.
5770

5871
- `role_arn` (string)
5972

0 commit comments

Comments
 (0)