aws ssm send-command 报错 An error occurred (InvalidInstanceId) when calling the SendCommand operation

aws ssm

参考:https://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/walkthrough-cli.html

  • 显示实例是否处于联机状态
1
aws ssm describe-instance-information --output text --query "InstanceInformationList[*]"
  • 获取实例的 IP 信息
1
2
3
# aws ssm send-command --instance-ids "xxx" --document-name "AWS-RunShellScript" --comment "IP config" --parameters commands=ifconfig --output text

An error occurred (InvalidInstanceId) when calling the SendCommand operation
1
# systemctl status amazon-ssm-agent

正常日志:[HealthCheck] HealthCheck reporting agent health.
异常日志:ERROR Health ping failed with error - NoCredentialProviders: no valid providers in chain. Deprecated.

解决

选中实例 -> 操作 -> 实例设置 -> 附加/替换 IAM 角色

IAM 角色要求的权限策略

  • AmazonEC2RoleforSSM
  • AmazonS3FullAccess
  • AmazonSSMAutomationRole

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :