Dear user,
If you find that saving things using the aws.s3 libraty in R is difficult please keep reading. Digging through the code for aws.s3.save_object, we find an interesting comment from the author of the library:
#' @param region A character string containing the AWS region. Ignored if the region can be inferred from \code{bucket}. If missing, an attempt is made to locate it from credentials. Defaults to \dQuote{us-east-1} if all else fails. Should be set to \code{""} when using non-AWS endpoints that don't include regions (and \code{base_url} must be set).
So it looks like specifying the region
argument in the call to save_object
gets overridden if you are using S3. If you do not specify the region
argument then the code tries to infer the region from the bucket. For some reason, the code can't determine the region in this case and defaults to us-east-1
. This explains the confusing presence of us-east-1
in error messages like this:
- attr(*, "request_string_to_sign")= chr "AWS4-HMAC-SHA256\n20210323T165229Z\n20210323/us-east-1/s3/aws4_request\ncc6932c0584c21e77a7dd8f863c151ac796c363"| __truncated__
We are not sure if this is a bug in the library or working as designed; at best it seems un-intuitive - setting an argument in a method call should override lower-level sources of that setting, not the other way around. Either way, update the environment to add the environment variable AWS_DEFAULT_REGION=eu-west-1
which fixes this issue.
Comments
0 comments
Please sign in to leave a comment.