Set the region for AWS SDK for PHP

If you are using the PHP SDK for AWS, by default, all operations are done on their Virginia data center.

If you want to use a different data center, you must define it with the set_hostname command

$sdb = new AmazonSDB();<br>
$sdb -> set_hostname('');

There are two parts to this,

  • The Service (eg SDB, EC2, etc..)
  • The Data Center (eg Tokyo)

Valid Data Centers are

Location region Position Code
Tokyo Asia Pacific North East
Singapore Asia Pacific South East
Ireland Europe West
Virginia North America East
Northern California North America West
Oregan North America West
Sao Paulo South America East

Be careful with the URLs as they are not always consistent. S3 is done slightly differently for example.

Leave a Reply