Fork me on GitHub
#aws
<
2019-01-23
>
lilactown00:01:20

I’m trying to use the S3 API:

(aws/invoke s3 {:op :CreateBucket :request {:Bucket bucket-name}})
but I’m getting:
{:Code "IllegalLocationConstraintException",
 :Message
 "The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.",
 :RequestId "8542E011B3C15E87",
 :HostId
 "25VZAk6+s/7WJBfr2vHu4TOL36kJo0EXR9eMz1maK4OCanDnGQjU1cZeNPbtbGTxwUAwOPg1Xrc="}

lilactown00:01:36

I’m pretty sure my env defaults to us-west-2

lilactown00:01:00

it sounds like I need to specify the LocationConstraint but I can’t figure out how to do that with aws/invoke

lilactown00:01:26

(aws/invoke s3 {:op :CreateBucket :request {:Bucket bucket-name
                                            :LocationConstraint "us-west-2"}})

lilactown00:01:30

doesn’t seem to work 😕

lilactown00:01:39

ah:

(aws/invoke s3-client {:op :CreateBucket :request {:Bucket "my-unique-bucket-name"
                                                   :CreateBucketConfiguration {:LocationConstraint "us-west-2"}}})
found in https://github.com/cognitect-labs/aws-api/pull/28/files >_<

lilactown00:01:15

is there a place where I should have seen that in the docs?