AWR.Athena icon indicating copy to clipboard operation
AWR.Athena copied to clipboard

Notes from a newbie regarding credentials configuration

Open maelle opened this issue 5 years ago • 6 comments

Heya here, thanks for the package.

I'm just writing down notes regarding configuration in case it can be added somewhere in the docs / can help another newbie (I read issues to understand that environment variables didn't mean R environment variables :slightly_smiling_face: )

First note for newbies: to get the key and key ID go into your "My security credentials" settings from the drop-down menu at the top right of the console where your username is.

I was hoping to be able to use keyring and Sys.setenv() but since environment variables are not read by R and I seem to be too unaware of Java/Ubuntu I ended up installing AWS CLI and running aws configure which was fairly straightforward and now I can open a connection. :-)

I suppose that because R doesn't handle the credentials there's no way to check the configuration worked from R without trying to establish a connection?

maelle avatar Mar 17 '20 12:03 maelle

What do you mean by "environment variables are not read by R"? It should work.

But to set persistent config, you just need to create ~/.aws/credentials as per https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-configure-files-where (that is done by aws configure, but you can manually create as well)

daroczig avatar Mar 17 '20 13:03 daroczig

I mean I can't use something like Sys.setenv(varname=keyring::get_value(varnane)) (nor .Renviron)

maelle avatar Mar 17 '20 13:03 maelle

I don't understand this issue. Here you find a description:

https://docs.rstudio.com/rspm/admin/s3-config.html

With Sys.setenv('AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE')and so on you can specify credentials with your RStudio environment.

Within AWS EC2 you can use the cloudyr package to retrieve credentials from 'http://169.254.169.254...'.

Within Fargate (Shiny) you need to call:


# Write values to .Renviron
env | grep AWS_ >> /home/shiny/.Renviron
chown shiny.shiny /home/shiny/.Renviron

So several ops ...

Zirkonium88 avatar Mar 17 '20 13:03 Zirkonium88

Ah then I must have made another mistake, feel free to close, sorry.

maelle avatar Mar 17 '20 13:03 maelle

Issue comment I misunderstood https://github.com/nfultz/AWR.Athena/issues/20#issuecomment-516586181

maelle avatar Mar 17 '20 13:03 maelle

Environment variables are used, but when the rJava process is started (one of the librarys AWR.Athena uses), it keeps it's own copy of the environment, so changing R's copy will not have an effect.

nfultz avatar Mar 17 '20 14:03 nfultz