2016-10-19 1 views
1

S3 서비스와 연결하기 위해 우편 발송자 AWS 서명을 사용했으며 모든 버킷, 폴더를 해당 버킷으로 가져올 수 있으며 버킷을 삭제할 수도 있습니다.우편 발송자를 통해 AWS S3에서 버킷을 만드는 방법

다음은 우편 배달부를 통해 제가 할 수있는 요청 목록입니다.

List of all bucket inside the specific region: GET https://s3-us-west-2.amazonaws.com/ 
List of all objects/folders inside the bucket: GET https://s3-us-west-2.amazonaws.com/<bucket name> 
Delete the bucket/file (when it's empty):  DELETE https://s3-us-west-2.amazonaws.com/<bucket name>/[<file name>] 
Create the file into the bucket:    PUT https://s3-us-west-2.amazonaws.com/<bucket name>/[<file name>][<folder name>/] 

내가 버킷 (PUT 메소드)을 만들고 싶을 때 오류 메시지가 표시됩니다.

The unspecified location constraint is incompatible for the region specific endpoint this request was sent to 

그래서 질문입니다. 우편 배달부를 통해 버킷을 만들려면 어떻게해야합니까? 미리 감사드립니다.

답변

0

API 호출을 통해 버킷을 만들기위한 AWS에 의한 문서는 요청의 본문에 위치 제약 조건을 제공 할 수 있습니다 언급 :

<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> 
    <LocationConstraint>YourBucketRegion</LocationConstraint> 
</CreateBucketConfiguration> 

에 한번 당신의 선택의 영역으로 추가 :

PUT/HTTP/1.1 
Host: BucketName.s3.amazonaws.com 
Content-Length: length 
Date: date 
Authorization: authorization string (see Authenticating Requests (AWS Signature Version 
    4)) 

<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> 
<LocationConstraint>BucketRegion</LocationConstraint> 
</CreateBucketConfiguration> 

출처 :여기

Valid Values: [ us-west-1 | us-west-2 | EU or eu-west-1 | 
eu-central-1 | ap-south-1 | ap-southeast-1 | ap-southeast-2 | 
ap-northeast-1 | ap-northeast-2 | sa-east-1 | us-east-2] 
전체 구문입니다

+0

고맙습니다. 저에게 도움이되었습니다. –

+0

대답이 효과가 있다면, 비슷한 문제가있는 사람들도 해결책을 찾을 수 있도록 허용으로 표시하십시오. –