Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for crossaccount profile access #66

Closed
linuxbsdfreak opened this issue Feb 27, 2017 · 5 comments
Closed

Support for crossaccount profile access #66

linuxbsdfreak opened this issue Feb 27, 2017 · 5 comments

Comments

@linuxbsdfreak
Copy link

Hi,

I have multiple AWS accounts and i am connecting via a single account with a particular user and doing an assume role in another accounts.

For eg:

cat ~/.aws/config
[profile Account1]
source_profile = AccountMain
role_arn = arn:aws:iam:::role/CrossAccountAccessRole
region = eu-west-1

awless config set aws.profile Account1

It says

command hook failed: Your AWS credentials seem undefined!
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY need to be exported in your CLI environment

Is cross accounting supported?

Regards,
Kevin

@padilo
Copy link
Contributor

padilo commented Feb 27, 2017

Not sure about this, but as a workaroud you can set AWS_PROFILE environment variable.

export AWS_PROFILE=Account1
awless list instances

@fxaguessy
Copy link
Contributor

fxaguessy commented Feb 28, 2017

This should be fixed in the last version of awless. Could you please test (with awless config set aws.profile Account1 then normal use of awless) if it is working as expected ?

@fxaguessy
Copy link
Contributor

You can now customize profile using:

  1. aws.profile awless config key
  2. AWS_DEFAULT_PROFILE env variable
  3. --aws-profile global flag.

See README for more details.

@linuxbsdfreak
Copy link
Author

Tested and it works.

@soori1s
Copy link

soori1s commented Jul 31, 2018

Do I need to have IDs on each account to switch ?

When connecting via a single account and doing an assume role in another accounts.Its asking me to provide Access and Security keys.

C:\Users\soori1s>awless list vpcs
Cannot resolve AWS credentials for profile 'Account1' (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY)
Please enter access keys for profile 'Account1' (stored at C:\Users\soori1s.aws\credentials):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants