![](http://aws-guide.work/wp-content/themes/cocoon-master/images/b-woman.png)
AWS CLIで
・RDSを停止
できます!
![](http://aws-guide.work/wp-content/themes/cocoon-master/images/b-woman.png)
「aws rds stop-db-instance」コマンドで
停止できます!
サンプルコマンド
ここでは例として
・DB 識別子「sample-rds-postgres」を停止
します。
![DB 識別子「sample-rds-postgres」](https://aws-guide.work/wp-content/uploads/2024/03/aws_rds_stop_cli_001.png)
構文は以下です。
aws rds stop-db-instance --db-instance-identifier DB 識別子 --profile プロファイル名
実行例は以下です。
aws rds stop-db-instance --db-instance-identifier sample-rds-postgres --profile develop
実行結果
RDSを停止できました。
![実行結果①](https://aws-guide.work/wp-content/uploads/2024/03/aws_rds_stop_cli_003.png)
![実行結果②(停止中)](https://aws-guide.work/wp-content/uploads/2024/03/aws_rds_stop_cli_004.png)
![実行結果③(一時的に停止済み)](https://aws-guide.work/wp-content/uploads/2024/03/aws_rds_stop_cli_005.png)
参考①
停止しているRDSへ上記コマンド(停止コマンド)を実行すると、以下のエラーとなります。
エラーメッセージ
An error occurred (InvalidDBInstanceState) when calling the StopDBInstance operation: Instance DB 識別子 is not in available state.
![](https://aws-guide.work/wp-content/uploads/2024/03/aws_rds_stop_cli_006.png)
参考②
RDSを開始することもできます。
詳細は以下の記事をご確認ください。
参考③
「aws rds stop-db-instance」コマンドの詳細は、公式サイトをご確認ください。