AWS – DBパラメーターグループの情報取得だけでは、設定されているパラメーターの内容は取得できませんでした。
パラメーターグループ情報で取得した「DBParameterGroupName」を用いて、パラメーターグループに設定されている値を取得する方法について記載しています。
aws rds describe-db-parameters --db-parameter-group-name %DBPARAMETERGROUPNAME%
実行結果 TEXT
pending-reboot static string The MySQL installation base directory. False basedir /rdsdbbin/mysql system
4096-18446744073709547520 pending-reboot dynamic integer The size of the cache to hold the SQL statements for the binary log during a transaction. True binlog_cache_size 32768 system
ROW,MIXED pending-reboot dynamic string Row or Mixed replication True binlog_format MIXED system
TABLE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| |
+-----------------------------+-----------------+------------+-----------+---------------------------------------------------------------------------------------------+---------------+-----------------------+---------------------+-------------------+-----------+
| AllowedValues | ApplyMethod | ApplyType | DataType | Description | IsModifiable | MinimumEngineVersion | ParameterName | ParameterValue | Source |
+-----------------------------+-----------------+------------+-----------+---------------------------------------------------------------------------------------------+---------------+-----------------------+---------------------+-------------------+-----------+
| | pending-reboot | static | string | The MySQL installation base directory. | False | | basedir | /rdsdbbin/mysql | system |
| 4096-18446744073709547520 | pending-reboot | dynamic | integer | The size of the cache to hold the SQL statements for the binary log during a transaction. | True | | binlog_cache_size | 32768 | system |
| ROW,MIXED | pending-reboot | dynamic | string | Row or Mixed replication | True | | binlog_format | MIXED | system |
+-----------------------------+-----------------+------------+-----------+---------------------------------------------------------------------------------------------+---------------+-----------------------+---------------------+-------------------+-----------+
JSON
[
{
"ApplyMethod": "pending-reboot",
"Description": "The MySQL installation base directory.",
"DataType": "string",
"IsModifiable": false,
"Source": "system",
"ParameterValue": "/rdsdbbin/mysql",
"ParameterName": "basedir",
"ApplyType": "static"
},
{
"ApplyMethod": "pending-reboot",
"Description": "The size of the cache to hold the SQL statements for the binary log during a transaction.",
"DataType": "integer",
"IsModifiable": true,
"AllowedValues": "4096-18446744073709547520",
"Source": "system",
"ParameterValue": "32768",
"ParameterName": "binlog_cache_size",
"ApplyType": "dynamic"
},
{
"ApplyMethod": "pending-reboot",
"Description": "Row or Mixed replication",
"DataType": "string",
"IsModifiable": true,
"AllowedValues": "ROW,MIXED",
"Source": "system",
"ParameterValue": "MIXED",
"ParameterName": "binlog_format",
"ApplyType": "dynamic"
}
]
出力結果から以下の項目が取得できます。
項目 | 形式 | 説明 | 対応箇所 |
---|---|---|---|
Parameters | list | パラメータ値のリスト。 | – |
ParameterName | string | パラメーターの名前を指定します。 | 名前 |
ParameterValue | string | パラメータの値を指定します。 | 値 |
Description | string | パラメータの説明を提供します。 | 説明 |
Source | string | パラメータ値のソースを示します。 | – |
ApplyType | string | エンジン固有のパラメータタイプを指定します。 | – |
DataType | string | パラメーターの有効なデータ・タイプを指定します。 | データ型 |
AllowedValues | string | パラメータの有効な値の範囲を指定します。 | 適用タイプ |
IsModifiable | boolean | パラメータを変更することができます。 | 変更可能 |
MinimumEngineVersion | string | パラメータが適用できる最初のエンジンバージョン。 | 送信元 |
ApplyMethod | string | パラメータの更新をいつ適用するかを示します。 | – |
「describe-db-parameters」で取得したパラメータグループの情報は結構な数があります。 以下のようにクエリーを追加することで、値が設定されている項目だけに絞ることが可能になります。
aws rds describe-db-parameters --db-parameter-group-name %DBPARAMETERGROUPNAME% --query Parameters[?ParameterValue!=`null`]