aws / aws/aws-cli

AWS_ROLE_ARN env variable doesnt work without setting up config file

Open
#5,639 8 comments 28 reactions 1 assignee Claimed by @kdaily View on GitHub
configuration documentation feature-request p2
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

Confirm by changing [ ] to [x] below:
- [x] I've gone though the [User Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) and the [API reference](https://docs.aws.amazon.com/cli/latest/reference/)
- [x] I've searched for [previous similar issues](https://github.com/aws/aws-cli/issues) and didn't find any solution

Issue is about usage on:
- [x] CLI : passing arguments or cli configurations.

**Platform/OS/Hardware/Device**
What are you running the cli on?
Windows10Pro V1903

**Describe the question**
AWS_ROLE_ARN is an environment variable supported by the cli [as shown in this doc](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html), but I can't seem to use it purely as an environment variable without having to set up a profile in `.aws/config` file.

Desired usage:
```
export AWS_ACCESS_KEY_ID=AKxxxx
export AWS_SECRET_ACCESS_KEY=yyyyy
export AWS_ROLE_ARN= arn:aws:iam:::role/
```

What I have to do instead to make it work (with additional settings for ~/.aws/config):
```
export AWS_ACCESS_KEY_ID=AKxxxx
export AWS_SECRET_ACCESS_KEY=yyyyy
aws configure set role_arn arn:aws:iam:::role/
aws configure set credential_source Environment
```

I'm not sure if this is a bug, or that it's just not part of the feature support for AWS_ROLE_ARN. But it will be very useful to be able to set everything in the environment variable without having to touch the file directory. Similar issue has been opened in [aws-sdk-go issue aws/aws-sdk-go-v2#2867 ](https://github.com/aws/aws-sdk-go-v2/issues/2867)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.