我设置了 AWS_CONTAINER_CREDENTIALS_RELATIVE_URI 环境变量并尝试在 AWS S3 私有存储桶上上传图像,但我收到 403 Access Denied Error。
Excon::Error::Forbidden Expected(200) <=> Actual(403 Forbidden)
excon.error.response
:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>82YFG8EV8S20TWCS</RequestId><HostId>+uW4/W6lOn9h3Hu/Jri6EILuW47RU5Suv7tBQT9mhoh8/JLp3hyFXlo=</HostId></Error>"
:cookies => [
]
:headers => {
"Connection" => "close"
"Content-Type" => "application/xml"
"Date" => "Tue, 29 Oct 2021 14:32:43 GMT"
"Server" => "AmazonS3"
"x-amz-id-2" => "+uW4/W6lOn9h3Hu/Jri6EILuW47RU5Suv7tBQHEVPd5FXMtT9mhoh8/JLp3hyFXlo="
"x-amz-request-id" => "82YFG8EV8S20TWCS"
}
:host => "foo.s3.amazonaws.com"
:local_address => "11.11.11.11"
:local_port => 53586
:path => "/2021/10/12/14/32/44/9af613b2-2f37-43ae-bf20-555ab3cc1b38/testing.jpg"
:port => 443
:reason_phrase => "Forbidden"
:remote_ip => "52.216.140.132"
:status => 403
:status_line => "HTTP/1.1 403 Forbidden\r\n"
in /usr/local/rvm/gems/ruby-2.5.1/gems/excon-0.82.0/lib/excon/middlewares/expects.rb:13:in `response_call'