LoginSignup
0
0

More than 5 years have passed since last update.

AWS Sytems Manager Sericesからコマンド実行のトラブルシューティング(原因不明)

Posted at

AWS Sytems Manager Sericesからコマンド実行のトラブルシューティング

Amazon Web Services パターン別構築・運用ガイドの「5-2 システムを監視する」を参考に、AWSでログ監視をなるべくansibleから設定するという課題(そのうち公開予定)を実施しつつ、つまづいたことを書きます。

ansibleから作ったIAMでコマンドが実行できなかった。

Amazon Web Services パターン別構築・運用ガイドの手順にてP.409のCloudWatch Agentを利用するための準備としてロールを作成した。

過去に手動で作ったインスタンスは表示される。

Systems Manager Run Command のトラブルシューティング
Linux インスタンスのステータス情報の取得を参考に次を実行。

以下はansibleで構成しようとしているec2インスタンスとは別のインスタンスが表示されている。

$ aws ssm describe-instance-information --instance-information-filter-list key=PingStatus,valueSet=Online                                                                                                                    
{
    "InstanceInformationList": [
        {
            "IsLatestVersion": false, 
            "ComputerName": "ip-x-x-x-x.us-west-2.compute.internal", 
            "PingStatus": "Online", 
            "InstanceId": "i-xxxx7cb53516b635e", 
            "IPAddress": "x.x.x.x", 
            "ResourceType": "EC2Instance", 
            "AgentVersion": "2.3.372.0", 
            "PlatformVersion": "2", 
            "PlatformName": "Amazon Linux", 
            "PlatformType": "Linux", 
            "LastPingDateTime": 1554108523.909
        }
    ]
}

新しく作ったIAMロールと何が違うのかわからずしばらく経って、接続確認できているIAMロールに入れ替えて実行。
出てきたのでIAMロールが悪いのかと思って、接続できなかったIAMロールにして実行しても同じ結果に。

satokaoru:cloudwatch/ (topic_#11CloudWatch✗) $ aws ssm describe-instance-information --instance-information-filter-list key=PingStatus,valueSet=Online                                                                                                                    
{
    "InstanceInformationList": [
        {
            "IsLatestVersion": false, 
            "ComputerName": "ip-x-x-x-x.us-west-2.compute.internal", 
            "PingStatus": "Online", 
            "InstanceId": "i-xxxx7cb53516b635e", 
            "IPAddress": "x.x.x.x", 
            "ResourceType": "EC2Instance", 
            "AgentVersion": "2.3.372.0", 
            "PlatformVersion": "2", 
            "PlatformName": "Amazon Linux", 
            "PlatformType": "Linux", 
            "LastPingDateTime": 1554168223.963
        }, 
        {
            "IsLatestVersion": true, 
            "ComputerName": "ip-x-x-x-x.us-west-2.compute.internal", 
            "PingStatus": "Online", 
            "InstanceId": "i-xxxx9b7d2a4671971", 
            "IPAddress": "x.x.x.x", 
            "ResourceType": "EC2Instance", 
            "AgentVersion": "2.3.479.0", 
            "PlatformVersion": "2", 
            "PlatformName": "Amazon Linux", 
            "PlatformType": "Linux", 
            "LastPingDateTime": 1554168177.525
        }
    ]
}

IAMロールが悪かったのではないのか。
振り出しに戻った感じ。

理由がわかったら本記事更新していきます。

0
0
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
0