我正在使用AWS執行我的第一步並嘗試使用AWS CLI將文件從EC2服務器複製到S3服務器。AWS CLI'cp'失敗並顯示「指定的存儲桶不存在」
我收到錯誤:
A client error (NoSuchBucket) occurred when calling the PutObject operation: The specified bucket does not exist
我的命令如下:
- 我去我S3儀表盤,所選擇的桶 - >特性和copeied的「端點」值,它是
[bucket name].s3-website-us-west-2.amazonaws.com
- 然後執行
aws s3 cp ./file.ext s3://[bucket name].s3-website-us-west-2.amazonaws.com/file.ext
但是由於之前描述的錯誤 - 桶不存在而失敗。
p.s.運行
aws s3api list-buckets --query 'Buckets[].Name'
顯示存儲桶確實存在,因此這不是我理解的問題。
編輯 如果我不使用的端點,但只能用水桶命名錯誤消息鼓勵使用全名,其在所有網上的例子看起來酷似端點
upload failed: ./file.ext to s3://[bucket name]/file.ext A client error (PermanentRedirect) occurred when calling the PutObject operation: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint: [bucket name].s3.amazonaws.com You can fix this issue by explicitly providing the correct region location using the --region argument, the AWS_DEFAULT_REGION environment variable, or the region variable in the AWS CLI configuration file. You can get the bucket's location by running "aws s3api get-bucket-location --bucket BUCKET".
桶的名稱是什麼? – error2007s
可以稱之爲bucket_name - 如果這就是你要求的全部小寫,請以x.com形式 – AYBABTU
注意尾部斜線 – grepe