Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

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
上一篇 Jenkins用户权限配置
下一篇 aws ssm send-command 执行无效果解决