SSMエージェントがインストールされると amazon-ssm-agent コマンドが使用できるようになります。しかし、amazon-ssm-agent コマンドにはバージョンを確認するオプションが見当たりません。
今回は、SSMエージェントのバージョンを確認する手順について記載しています。
aws cliを使用してSSMエージェントのバージョンを確認します。
aws ssm describe-instance-information
実行結果 TABLE形式
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| DescribeInstanceInformation |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|| InstanceInformationList ||
|+--------------+---------------+------------+----------------------+------------------+-------------------+-------------+-------------------+---------------+-------------------+----------------+|
|| AgentVersion | ComputerName | IPAddress | InstanceId | IsLatestVersion | LastPingDateTime | PingStatus | PlatformName | PlatformType | PlatformVersion | ResourceType ||
|+--------------+---------------+------------+----------------------+------------------+-------------------+-------------+-------------------+---------------+-------------------+----------------+|
|| 2.3.68.0 | hoge | 10.0.0.x | i-xxxxxxxxxxxxxxxxx | True | 1537237733.7 | Online | Amazon Linux AMI | Linux | 2018.03 | EC2Instance ||
|+--------------+---------------+------------+----------------------+------------------+-------------------+-------------+-------------------+---------------+-------------------+----------------+|
JSON形式
{
"InstanceInformationList": [
{
"IsLatestVersion": true,
"ComputerName": "hoge",
"PingStatus": "Online",
"InstanceId": "i-xxxxxxxxxxxxxxxxx",
"IPAddress": "10.0.0.x",
"ResourceType": "EC2Instance",
"AgentVersion": "2.3.68.0",
"PlatformVersion": "2018.03",
"PlatformName": "Amazon Linux AMI",
"PlatformType": "Linux",
"LastPingDateTime": 1537237733.703
}
]
}
SSMエージェントのバージョン情報だけを一覧で表示したい場合は、クエリーを使用します。 バージョンの一覧だけではインスタンスとの紐づけが分かりにくいと思います。 インスタンスとバージョンの一覧を表示には以下のコマンドで可能です。
aws ssm describe-instance-information --output text --query InstanceInformationList[].[InstanceId,AgentVersion]
実行結果
i-xxxxxxxxxxxxxxxxx 2.3.68.0