Closed tyner closed 7 months ago
I am not opposed to exporting iam_credentials_provider
.
🤔 should all providers be exported or maybe something similar to aws.signature locate_credentials
Hi @tyner I believe I have an initial method. Currently named the same as aws.signature
(not tied to the name so any better suggestions are welcome). Please have a go and let me know
remotes::install_github("dyfanjones/paws/paws.common", ref = "locate_credentials")
paws.common::locate_credentials()
Hi @tyner I believe I have an initial method. Currently named the same as
aws.signature
(not tied to the name so any better suggestions are welcome). Please have a go and let me knowremotes::install_github("dyfanjones/paws/paws.common", ref = "locate_credentials") paws.common::locate_credentials()
Thanks, is there a .tar.gz
I can use to test? (access to github is blocked from our environment)
If you have access to r-universe https://paws-r.r-universe.dev/paws.common you could use:
install.packages('paws.common', repos = c('https://paws-r.r-universe.dev', 'https://cloud.r-project.org'))
Alternatively can you get the .tar.gz
from this link :)
https://paws-r.r-universe.dev/bin/linux/jammy/4.3/src/contrib/paws.common_0.7.0.9000.tar.gz
That paws.common_0.7.0.9000.tar.gz
looks like a binary package? We are required to use a source package.
You could try out the function directly is you wish:
locate_credentials <- function(profile = "", anonymous = FALSE) {
credentials <- paws.common:::Credentials(profile = profile, anonymous = anonymous)
result <- as.list(paws.common:::get_credentials(credentials)$creds)
result$region <- paws.common:::get_region(profile)
return(result[names(result) != "provider_name"])
}
Works like a charm, thank you @DyfanJones !
Closing as paws.common 0.7.1 is now on the cran
On our EMR cluster, we are using IMDSv2, and as a result,
aws.signature::locate_credentials()
is not able to find the credentials, even when theaws.ec2metadata
package is available. On the other hand, the non-exported functionpaws.common:::iam_credentials_provider()
still works just fine. Since it is a non-exported function, we are wondering if there is an exported wrapper we should be using instead, perhaps from a different package? If not, would it make sense to start exportingiam_credentials_provider
so that it is part of the official API? Regards, Ben