Set the hostname to connect to. This is useful for alternate services that are API-compatible with AWS, but run from a different hostname.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
|
Required |
The alternate hostname to use in place of the default one. Useful for mock or test applications living on different hostnames. |
|
|
|
Optional |
The alternate port number to use in place of the default one. Useful for mock or test applications living on different port numbers. |
Returns
Type |
Description |
|---|---|
|
A reference to the current instance. |
Examples
Configure hostname and resource prefix.
// Instantiate the class
$ec2 = new AmazonEC2();
// Point to the new endpoint
$ec2->set_hostname('localhost', '3000');
$ec2->set_resource_prefix('/services/mock');
$ec2->allow_hostname_override(false);
// Describe images
$response = $ec2->describe_images();
// Success?
var_dump($response->isOK());
Result:
bool(true)
Source
Method defined in sdk.class.php | Toggle source view (15 lines) | View on GitHub

