Connecting to localstack
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.
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 ;)
This is actually discussed explicitly in the documentation - see the comments for the base_url argument.