Last active
November 21, 2024 03:34
-
-
Save hanafiah/419de0fb18f827b40676 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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