using R & paws how switch/assume different IAM Role?

504 views Asked by At

I'm logging in successfully to AWS via paws however am in the parent account.

library(paws)

Sys.setenv(
  AWS_ACCESS_KEY_ID = "*****************************************",
  AWS_SECRET_ACCESS_KEY = "************************************",
  AWS_SESSION_TOKEN = "******************************************************************",
  AWS_REGION = "us-west-2"
)

mys3<- paws::s3()
temp_s3 <- mys3$list_buckets()

I'm want to change to a child account and list the buckets under it. Any ideas?

1

There are 1 answers

0
Andre.IDK On BEST ANSWER

What you're looking for is Switching Role via API.

Provided that you have all the necessary rights and parameters, you should use the methods of the STS service, Paws seems to cover all the basic ones and you can find their documentation here.