seratch/AWScala

Question: How to switch role after login?

PhilAndrew opened this issue · 1 comments

How to switch role after I logged in with

    val cred = BasicCredentialsProvider("key1", "key2");
    implicit val ec2 = new EC2Client(cred).at(Region.Sydney)

At this point I need to change role to access my organisations resources, or otherwise login with that role, otherwise I cannot access my company AWS resources.

https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html

Is it related to STS? https://github.com/seratch/AWScala/blob/9467f52a3802ddb8998cabf73b63de9dd4d935d3/sts/src/main/scala/awscala/sts/STS.scala

How can I then get from STS to EC2Client?

Sorry for my slow response here but I recommend asking this question in the AWS community.