2017-10-28 53 views
1

我刚开始探索aws系统管理器功能。aws ssm send命令在Ubuntu服务器中不起作用

我使用python 3.6和boto3来测试ssm。

我已经创建了Ubuntu服务器EC2(t2 micro),并为策略“AmazonEC2RoleforSSM”分配了IAM角色,根据我的知识应该允许在该EC2上运行ssm send命令。但是,相反,我得到以下错误:

botocore.errorfactory.InvalidInstanceId: An error occurred (InvalidInstanceId) when calling the SendCommand operation: 

我甚至试过检查的输出:

ssm.describe_instance_information()['InstanceInformationList']) 

它没有实例ID我创建,它几乎讲述的故事,为什么我我正在得到那个错误。但是,就我所知,如果我将IAM角色分配给上述政策,它应显示在列表中。

奇怪的是,当我尝试使用Amazon Linux AMI服务器进行以上设置并运行ssm时,一切都看起来不错。

任何想法为什么ssm不能在ubuntu服务器上工作?我错过了什么?

+0

[InvalidInstanceId:调用SendCommand操作时发生错误(InvalidInstanceId)]的可能重复](https://stackoverflow.com/questions/47034797/invalidinstanceid-an-error-occurred-invalidinstanceid-when-calling-the- sendco) – kenorb

回答

3

But, to my knowledge if I assign the IAM role with above mentioned policy it should show up in the list.

不,比这还多得多。您需要在每台要管理的服务器上安装install the AWS SSM agent。使用Amazon Linux为您工作的原因是,最新版本的Amazon Linux已预先安装了SSM代理。

+0

默认情况下,SSM代理安装在日期为2017.09及更高版本的Amazon Linux AMI上。 –

+0

@JohnHanley是不是我说的?他遇到的问题是运行Ubuntu,他说运行的是Amazon Linux。他需要在Ubuntu服务器上安装代理。 –

+0

绝对。我只是用实际的日期来帮助答案,亚马逊Linux将SSM包括在六个月或两年后看到你答案的人。我并没有试图批评,因为你的答案总是非常出色。 –

相关问题