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
- 显示实例是否处于联机状态
aws ssm describe-instance-information --output text --query "InstanceInformationList[*]"
- 获取实例的 IP 信息
# 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
# 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
版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/25/aws-ssm-send-command-error-an-error-occurred-invalidinstanceid-when-calling-the-sendcommand-operation/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论