AWS:IAM的实例元数据未找到

时间:2019-10-14 13:55:54

标签: amazon-web-services amazon-s3 amazon-ec2

我正在尝试在ec2实例上设置elasticsearch s3快照。它失败并显示以下错误:

nested: NotSerializableExceptionWrapper[sdk_client_exception: The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/

如果我从该ec2实例查询元数据服务器,它将响应以下内容:

$ curl http://169.254.169.254/latest/meta-data/
ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
events/
hostname
identity-credentials/
instance-action
instance-id
instance-type
local-hostname
local-ipv4
mac
metrics/
network/
placement/
profile
public-keys/
reservation-id
security-groups
services/

因此没有 iam 部分。

如何使iam部分可用于从ec2实例查询?

1 个答案:

答案 0 :(得分:1)

如果您具有给定ec2实例的角色,则遵循元数据URI将返回一些信息:

http://169.254.169.254/latest/meta-data/iam/security-credentials/

所以您似乎没有附加IAM角色。请验证。