2016-01-09 40 views
0

我使用this tutorial創建一個AWS EC2實例,我無法找到我的故障排除問題,或者任何證據表明任何人,甚至經歷過這方面的消息!AWS EC2 GET-控制檯輸出打印無關的屏幕

我用了一個IAM用戶有管理員權限設立一個EC2實例,當我運行

$> aws ec2 get-console-output --instance-id <my-ec2-id> 

一個空行輸出,其次是

'Output' 

,沒有別的!

根據本教程中,這個命令讓我看到了遠程RSA指紋來驗證我做出了正確的連接。

我可以登錄到我的EC2實例就好了(雖然我認爲沒有前面的步驟有沒有辦法有絕對的把握)。

此外,我的工作的IAM用戶是不是我的CLI的默認用戶,我設置一個配置文件來處理它。但如果我嘗試

$> aws ec2 get-console-output --profile <user-profile> --instance-id <my-ec2-id> 

我仍然得到和以前一樣的結果。令人生氣的是我之前已經解決了這個問題,但我不記得如何。

+0

它是Windows實例還是Linux實例? – helloV

+0

亞馬遜Linux AMI 2015.09.1 x86_64 HVM GP2 – Joel

+0

你甚至沒有獲得實例ID和時間戳? – helloV

回答

1

某些AWS CLI操作可能無法明確說明如果證書無效,或者如果用戶缺少的角色/權限訪問定義的資源。在這種情況下,很可能是因爲訪問憑證無效 - 您可以使用describe-instances或類似命令來驗證。

在以舊版本的CLI(〜1.7),以更容易調試這一點,你可以使用--debug參數,如:

> aws ec2 get-console-output --instance-id i-<id> --debug 

<Errors><Error><Code>InvalidInstanceID.NotFound</Code><Message>The instance ID 'i-e7bffa43' does not exist</Message></Error></Errors> 

在CLI的新版本(1.9)這個特定的論點給出了一些更詳細的錯誤:

> aws ec2 get-console-output --instance-id i-<id> 

A client error (InvalidInstanceID.NotFound) occurred when calling the GetConsoleOutput operation: The instance ID 'i-<id>' does not exist