ramazon-web-servicesr-paws

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


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?


Solution

  • 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.