aws / aws/aws-cdk

(cli): shared credentials: if case of aws_access_key_id or aws_secret_access_key is not all lowercase, it will be ignored

Open
#13,792 4 comments 0 reactions 0 assignees View on GitHub
bug effort/small p2 package/tools
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

I feel this is a bug, but maybe it's just a documentation issue.
in the shared `~/.aws/credentials` file if the case of `aws_access_key_id` or `aws_secret_access_key` is not all lowercase, then CDK will not read it.

I feel this is a bug, because the behavior is inconsistent with SDK and aws-cli, both of which have no issue if your entry in the file looks like

```
[my_profile_name]
AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

I lost many hours and some hair trying to figure this out.

### Reproduction Steps

take any working cdk app, change the relevant entries in `~/.aws/credentials` to uppercase.
do a `cdk deploy`

### What did you expect to happen?

i expect it to work because other AWS SDK and aws-cli have no issue

### What actually happened?

get an error message saying
> Need to perform AWS calls for account 1111111111111, but no credentials have been configured

### Environment

- **CDK CLI Version : ** 1.91.0 (build 0f728ce)
- **Framework Version:** 1.91.0 (build 0f728ce)
- **Node.js Version:** v12.21.0
- **OS :** ubuntu 20.04.1
- **Language (Version):** typescript 4.2.3

### Other

maybe at the very least this deserves an entry on https://docs.aws.amazon.com/cdk/latest/guide/troubleshooting.html, despite the fact that maybe i'm the only one who has ever come across this. =(

---

This is :bug: Bug Report

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with uppercase entries in ~/.aws/credentials and a cdk deploy on the reported CLI version. Compare the credential handling with the AWS SDK and aws-cli behavior described in the report. Done means uppercase credential keys work consistently, or the limitation is documented in the referenced CDK troubleshooting guide.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
authentication, cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.