Specify a region for your bucket

Telnyx Storage provides you with the ability to specify the region of a bucket. To do so, pass the following text in the body of the CreateBucket request:

Copy
Copied
<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <LocationConstraint>{{region}}</LocationConstraint>
</CreateBucketConfiguration>

Note: After pasting the above content, Kindly check and remove any new line added

Where {{region}} is substituted for the region that you would like your objects stored in. Currently, you can pass one of the following regions:

  • dallas
  • denver
  • atlanta
  • phoenix
  • minneapolis
  • las vegas

We plan on also supporting seattle and fort lauderdale in the near future.

When you define a region, Telnyx will guarantee that for any object uploaded in the bucket, one copy of the object will be stored in the specified region. In addition, Telnyx will create and store additional copies in two other randomly selected regions for redundancy.

If you do not define a region, Telnyx will store one copy of your object in Dallas, and two other copies in randomly selected regions.

Example

An example of an API request may look like this:

Copy
Copied
curl --location --request PUT 'https://storage.telnyx.com/testdenverbucket' \
--header 'Accept: text/xml' \
--header 'X-Amz-Content-Sha256: beaead3198f7da1e70d03ab969765e0821b24fc913697e929e726aeaebf0eba3' \
--header 'X-Amz-Date: 20221128T195628Z' \
--header 'Authorization: AWS4-HMAC-SHA256 Credential={{your_telnyx_api_key}}/20221128/us-east-1/execute-api/aws4_request, SignedHeaders=accept;host;x-amz-content-sha256;x-amz-date, Signature=ac7a055379576fd010e12b65ff261f227b1b514f853b99982822e064524e44d9' \
--header 'Content-Type: application/xml' \
--data-raw '--data-raw '\''<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <LocationConstraint>atlanta</LocationConstraint>
</CreateBucketConfiguration>'\'''

Note: After pasting the above content, Kindly check and remove any new line added

To view the region for a bucket you already created, pass the location filter in the path of a GetBucket request. An example of this is shown below:

Request

Copy
Copied
Request:
curl --location --request GET 'https://storage.telnyx.com/testdenverbucket2?location' \
--header 'X-Amz-Date: 20230110T200255Z' \
--header 'Authorization: AWS4-HMAC-SHA256 Credential={{your_telnyx_api_key}}/test/execute-api/aws4_request, SignedHeaders=host;x-amz-date, Signature=90f200908fa18a0f2e40353f1a5b05c40a626de5974417d7d29a1cd31e500a13'

Note: After pasting the above content, Kindly check and remove any new line added

Response

Copy
Copied
Response:
<LocationConstraint>
    <LocationConstraint>denver</LocationConstraint>
</LocationConstraint>

Note: After pasting the above content, Kindly check and remove any new line added