2018-12-09 12:50:40 -08:00
< ? php
2019-01-02 22:53:19 -08:00
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2018-12-09 12:50:40 -08:00
// SPDX-License-Identifier: Apache-2.0
2024-02-05 10:49:20 -07:00
2024-02-06 09:28:06 -07:00
// snippet-start:[php.example_code.rds.startDBInstance.complete]
// snippet-start:[php.example_code.rds.startDBInstance.import]
2024-02-05 10:49:20 -07:00
2024-02-06 09:28:06 -07:00
require __DIR__ . '/vendor/autoload.php' ;
2024-02-05 10:49:20 -07:00
2018-12-09 12:50:40 -08:00
use Aws\Exception\AwsException ;
2024-02-05 10:49:20 -07:00
2024-02-06 09:28:06 -07:00
// snippet-end:[php.example_code.rds.startDBInstance.import]
2024-02-05 10:49:20 -07:00
2024-02-06 09:28:06 -07:00
// snippet-start:[php.example_code.rds.startDBInstance.main]
//Create an RDSClient
2018-12-09 12:50:40 -08:00
$rdsClient = new Aws\Rds\RdsClient ([
'profile' => 'default' ,
'version' => '2014-10-31' ,
2018-12-09 13:53:34 -08:00
'region' => 'us-east-2'
2018-12-09 12:50:40 -08:00
]);
2024-02-05 10:49:20 -07:00
2018-12-09 12:50:40 -08:00
$dbIdentifier = '<<{{db-identifier}}>>' ;
2024-02-05 10:49:20 -07:00
2018-12-09 12:50:40 -08:00
try {
$result = $rdsClient -> startDBInstance ([
2018-12-09 13:53:34 -08:00
'DBInstanceIdentifier' => $dbIdentifier ,
2018-12-09 12:50:40 -08:00
]);
var_dump ( $result );
2018-12-09 13:53:34 -08:00
} catch ( AwsException $e ) {
2018-12-09 12:50:40 -08:00
echo $e -> getMessage ();
echo " \n " ;
2019-01-02 22:53:19 -08:00
}
2024-02-05 10:49:20 -07:00
2024-02-06 09:28:06 -07:00
// snippet-end:[php.example_code.rds.startDBInstance.main]
// snippet-end:[php.example_code.rds.startDBInstance.complete]