moj-analytical-services / s3tools

Interact with files in s3 on the Analytical Platform
8 stars 2 forks source link

Add AWS credentials resolver code to s3tools #8

Closed andyhd closed 7 years ago

andyhd commented 7 years ago

What

How to review

You can run the following in your analytics platform Rstudio instance

library(devtools)
install_github("moj-analytical-services/s3tools", ref = "no-fork-aws-sig", force = TRUE)
creds <- s3tools::get_credentials()
Sys.getenv("AWS_SESSION_TOKEN")

This should return a valid AWS token. The creds object can be refreshed (a new token retrieved) using creds$refresh() - this should update the token only if it is is about to expire (or has already).