forked from awsdocs/aws-doc-sdk-examples
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStopInstance.php
More file actions
33 lines (24 loc) · 875 Bytes
/
StopInstance.php
File metadata and controls
33 lines (24 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// snippet-start:[php.example_code.rds.stopDBInstance.complete]
// snippet-start:[php.example_code.rds.stopDBInstance.import]
require __DIR__ . '/vendor/autoload.php';
use Aws\Exception\AwsException;
// snippet-end:[php.example_code.rds.stopDBInstance.import]
// snippet-start:[php.example_code.rds.stopDBInstance.main]
$rdsClient = new Aws\Rds\RdsClient([
'region' => 'us-east-2'
]);
$dbIdentifier = '<<{{db-identifier}}>>';
try {
$result = $rdsClient->stopDBInstance([
'DBInstanceIdentifier' => $dbIdentifier,
]);
var_dump($result);
} catch (AwsException $e) {
echo $e->getMessage();
echo "\n";
}
// snippet-end:[php.example_code.rds.stopDBInstance.main]
// snippet-end:[php.example_code.rds.stopDBInstance.complete]