ex_aws_s3 icon indicating copy to clipboard operation
ex_aws_s3 copied to clipboard

Feature request, support endpoint based buckets (e.g. eu-west-2)

Open JonRowe opened this issue 5 years ago • 0 comments

Environment

  • Elixir & Erlang versions (elixir --version):

Elixir 1.10.0 (compiled with Erlang/OTP 22)

  • ExAws version mix deps |grep ex_aws
ex_aws 2.1.5 (Hex package) (mix)
  locked at 2.1.5 (ex_aws) 0f0357f1
* ex_aws_s3 2.0.2 (Hex package) (mix)
  locked at 2.0.2 (ex_aws_s3) 0569f5b2
  • HTTP client version. IE for hackney do mix deps | grep hackney
* hackney 1.16.0 (Hex package) (rebar3)
  locked at 1.16.0 (hackney) 3bf0bebb

Current behaviour

Specified region is ignored and the us endpoint is used, causing a redirect which ExAws returns as an error and warns about setting region, but setting region has no effect.

# Copying file within the same bucket.
config = ExAws.Config.new(:s3) |> Map.put(:region, "eu-west-2")
ExAws.request(ExAws.S3.put_object_copy(bucket(), destination_path, bucket(), source_path, config))

Produces:

# 22:13:19.849 [warn] ExAws: Received redirect, did you specify the correct region?
# {:error, {:http_error, 301, "redirected"}}

Expected behavior

The operation succeeds without redirecting because ExAws has used the correct endpoint.

e.g. Operations need to use https://my-bucket.s3.amazonaws.com and not https://s3.amazonaws.com/my-bucket

JonRowe avatar Sep 22 '20 22:09 JonRowe