paws-r / paws

Paws, a package for Amazon Web Services in R
https://www.paws-r-sdk.com
Other
315 stars 37 forks source link

AWS config file doesn't support `endpoint_url` #764

Closed James-G-Hill closed 6 months ago

James-G-Hill commented 6 months ago

A wider question here; does paws support localstack?

The setup for localstack required an endpoint_url to be added to the AWS config file under a profile, but endpoint_url is not listed as a supported parameter in the config file here:

https://github.com/paws-r/paws/blob/main/docs/credentials.md#config-file

DyfanJones commented 6 months ago

Hi @James-G-Hill I believe we already support endpoint_url in config file https://github.com/paws-r/paws/issues/667. It* looks like the documentation needs updating to reflect this

DyfanJones commented 6 months ago

I believe we had a similar question around local stack: https://github.com/paws-r/paws/issues/747.

James-G-Hill commented 6 months ago

Thanks, yes. Seems like this should work.

James-G-Hill commented 6 months ago

Actually @DyfanJones I have a question. I have been able to get this work if I set the endpoint_url per AWS service as below:

[profile localstack]
region = us-east-1
output = json
services = localstack

[services localstack]
ssm =
  endpoint_url = http://localhost:4566

But should I be able to do this?

[profile localstack]
region = us-east-1
output = json
endpoint_url = http://localhost:4566

It doesn't work for me. I'd prefer not to have to set every service I use individually but maybe I have to?

DyfanJones commented 6 months ago

I don't think we have added the global endpoint. I don't believe it has been requested before.

DyfanJones commented 6 months ago

I will add this as a feature request :)

DyfanJones commented 6 months ago

@James-G-Hill I believe I have a solution

remotes::install_github("dyfanjones/paws/paws.common", ref = "global_endpoint")

config file example

[profile localstack]
region=us-east-1
output=json
endpoint = http://localstack:1234/
services = localstack

[services localstack]
s3 = 
 endpoint_url = http://localstack:4566/

This latest version will allow you to set specific endpoint per service and also set a global default endpoint in either config file or in the environmental variables.

James-G-Hill commented 6 months ago

Thanks, will give this a try in the near future.