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

Connecting to localstack #434

Open
rabalasubramani3 opened this issue Feb 11, 2024 · 1 comment
Open

Connecting to localstack #434

rabalasubramani3 opened this issue Feb 11, 2024 · 1 comment

Comments

@rabalasubramani3
Copy link

Has anyone successfully connect to localstack with this package. I tried setting endpoint_url

Sys.setenv(
"AWS_ACCESS_KEY_ID"="foo",
"AWS_SECRET_ACCESS_KEY"="bar",
"AWS_DEFAULT_REGION"="us-east-1",
"AWS_S3_ENDPOINT"="http://localhost:4566"
)

and calling bucketlist()

will return an error like this.

500 Could not resolve host: us-east-1.http

Tried various combinations for AWS_S3_ENDPOINT like

localhost:4566
localstack:4566
host.docker.internal:4566
localhost.localstack.cloud:4566

None of them seem to work.

Any help appreicated.

@throrin19
Copy link

throrin19 commented Nov 5, 2024

Hello, I have same problem and I found how to do that :

In environment variables you have to modify your AWS_S3_ENDPOINT to localhost:4566.

After that you have to modify default region in aws.s3 config to set it empty (it does not works with env variable at first test). You have normally that and it will be works :

Sys.setenv(
"AWS_ACCESS_KEY_ID"="foo",
"AWS_SECRET_ACCESS_KEY"="bar",
"AWS_S3_ENDPOINT"="localhost:4566"
)
options("cloudyr.aws.default_region" = "")

And, important part, on all libary call, you have to pass option use_https = FALSE :

useHttps <- FALSE
get_object(fileKey, bucket = bucket, use_https = useHttps)

I hope it will help you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants