Skip to content

Instantly share code, notes, and snippets.

@hanafiah
Last active November 21, 2024 03:34
Show Gist options
  • Save hanafiah/419de0fb18f827b40676 to your computer and use it in GitHub Desktop.
Save hanafiah/419de0fb18f827b40676 to your computer and use it in GitHub Desktop.
<?php
/**
* 1st. make sure you've created your access key in IAM. then configure credential file in the following path
*
* ~/.aws/credentials
* enter credentials info as below..
[default]
aws_access_key_id = YOUR_ACCESS_KEY_ID
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
[others_profile_if_want_to]
aws_access_key_id = YOUR_ACCESS_KEY_ID
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
*
*
*/
include('aws-autoloader.php');
use Aws\ElasticLoadBalancing\ElasticLoadBalancingClient;
$client = ElasticLoadBalancingClient::factory(array(
'profile' => 'default', //as per your credentials file.
'region' => 'us-west-2' //your aws region
));
$result = $client->describeLoadBalancers(
array(
'LoadBalancerNames' => array('YOUR_ELB_NAME')
));
print_r($result);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment