Last active
August 29, 2015 14:05
-
-
Save jdunmore/29e9f842bd4c38968b98 to your computer and use it in GitHub Desktop.
Check an AWS alarm from the PHP SDK
This file contains 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 | |
include("vendor/autoload.php"); | |
use Aws\Common\Aws; | |
// Create a service builder using a configuration file | |
$aws = Aws::factory('config.php'); | |
// Get the client from the builder by namespace | |
$client = $aws->get('CloudWatch'); | |
$result = $client->describeAlarms( array( | |
'AlarmNames' => array('ALARM NAME')) | |
); | |
$alarm = $result['MetricAlarms'][0]; | |
echo $alarm['StateValue'] . PHP_EOL; | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment