Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status of iam_credentials_provider #750

Closed
tyner opened this issue Feb 20, 2024 · 9 comments · Fixed by #752
Closed

status of iam_credentials_provider #750

tyner opened this issue Feb 20, 2024 · 9 comments · Fixed by #752
Labels
enhancement 💡 New feature or request

Comments

@tyner
Copy link

tyner commented Feb 20, 2024

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 the aws.ec2metadata package is available. On the other hand, the non-exported function paws.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 exporting iam_credentials_provider so that it is part of the official API? Regards, Ben

@DyfanJones
Copy link
Member

I am not opposed to exporting iam_credentials_provider.

@DyfanJones DyfanJones added the enhancement 💡 New feature or request label Feb 20, 2024
@DyfanJones
Copy link
Member

🤔 should all providers be exported or maybe something similar to aws.signature locate_credentials

@DyfanJones
Copy link
Member

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()

@tyner
Copy link
Author

tyner commented Feb 21, 2024

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()

Thanks, is there a .tar.gz I can use to test? (access to github is blocked from our environment)

@DyfanJones
Copy link
Member

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

@tyner
Copy link
Author

tyner commented Feb 21, 2024

That paws.common_0.7.0.9000.tar.gz looks like a binary package? We are required to use a source package.

@DyfanJones
Copy link
Member

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"])
}

@tyner
Copy link
Author

tyner commented Feb 22, 2024

Works like a charm, thank you @DyfanJones !

@DyfanJones
Copy link
Member

Closing as paws.common 0.7.1 is now on the cran

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants