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

Add ability to assume a role #65

Closed
bacoboy opened this issue Feb 22, 2017 · 1 comment
Closed

Add ability to assume a role #65

bacoboy opened this issue Feb 22, 2017 · 1 comment
Assignees

Comments

@bacoboy
Copy link
Contributor

bacoboy commented Feb 22, 2017

While unicreds support specifying an alternate profile, it does not have the ability to assume a role using that (or the default) profile as shown in the AWS docs here.

Ideally, there'd be another optional parameter to specify the role to assume.

Even better would be the ability to use pre-defined profiles specified in ~/.aws/config as in this example:

[profile prod-admin]
role_arn = arn:aws:iam::XXXXXX:role/Admin
source_profile = default
region = us-east-1

which works with the aws cli as in this example (documented here):

$ aws --profile prod-admin ec2 describe-vpcs
[output snip]

Not really sure why ~/.aws/config seems to be ignored with the SDK but not in the CLI.

I've seen an additional role_arn parameter in the config as in this terraform example which only just came out in 0.8.7 so you can look how they did it here:

provider "aws" {
  region = "${var.aws_region}"
  profile = "default"
  assume_role {
    role_arn = "arn:aws:iam::${var.aws_account_number}:role/Admin"
  }
}

Looking over the credstash usage, this would be functionally equivalent to the --arn parameter

@bacoboy
Copy link
Contributor Author

bacoboy commented Mar 11, 2020

Looks like this is supported now so closing issue.

@bacoboy bacoboy closed this as completed Mar 11, 2020
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

2 participants