LoginSignup
0
1

More than 3 years have passed since last update.

RDSのDBパラメーターグループ関連のコマンドめも

Posted at

はじめに

  • RDSのDBパラメーターグループ関連のコマンドメモとしての備忘録
  • 本手順では、AWS-CLIでの操作となります。

実施手順

DBパラメーターグループ名の一覧を出力

[root@localhost ~]# aws rds describe-db-parameter-groups --query 'DBParameterGroups[].DBParameterGroupName'
[
    "aurora-postgresql11",
    "postgresql11"
]

※現在、登録してあるDBパラメーターグループは「aurora-postgresql11」「postgresql11」の2つです。

DBパラメーターグループの設定値をファイルに出力

▼DBパラメーターグループの設定値をJSON形式(デフォルト)で出力

・aurora-postgresql11 の場合
# aws rds describe-db-parameters --db-parameter-group-name aurora-postgresql11 > /tmp/aurora-postgresql1_parameters.json

▼DBパラメーターグループの設定値をCSV形式(出力結果を成形した状態)で出力

# aws rds describe-db-parameters --db-parameter-group-name aurora-postgresql11 \
    | jq -r '["名前","値","許可された値","変更可能","送信元","適用タイプ","データ型","説明","ApplyMethod","MinimumEngineVersion"], (.Parameters[] | [.ParameterName,.ParameterValue,.AllowedValues,.IsModifiable,.Source,.ApplyType,.DataType,.Description,.ApplyMethod,.MinimumEngineVersion]) | @csv' \
    | iconv -t sjis > /tmp/aurora-postgresql11_parameters.csv

※上記のコマンドは、以下のブログが参照したものである。
https://dev.classmethod.jp/articles/rds-parameter-group-export-to-csv/

DBパラメーターグループの削除

・aurora-postgresql11 の場合
# aws rds delete-db-parameter-group  --db-parameter-group-name  aurora-postgresql11 

参考URL

https://dev.classmethod.jp/articles/rds-parameter-group-export-to-csv/
https://blog.manabusakai.com/2017/02/rds-parameter-group-diff/

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1