我正在尝试在我的s3实例上设置elasticsearch ec2快照。如果出现以下错误,它将失败:
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实例中查询?
发布于 2019-10-14 14:53:38
如果您将角色附加到给定的ec2实例,下面的元数据URI将返回一些内容:
http://169.254.169.254/latest/meta-data/iam/security-credentials/
所以看起来你没有附加的IAM角色。请确认一下。
发布于 2021-10-27 14:08:11
我昨天遇到了这个问题。我的自动化创建了一个实例配置文件,但它没有承担角色。
{
"InstanceProfile": {
"Path": "/",
"InstanceProfileName": "example_instance_profile",
"InstanceProfileId": "<id>",
"Arn": "<arn>",
"CreateDate": "«date_time>",
"Roles": []
}
}我删除了这个实例配置文件,然后用自动化再次创建。
{
"InstanceProfile": {
"Path": "/",
"InstanceProfileName": "<profile_name>",
"InstanceProfileId": "<profile_id>",
"Arn": "<arn>",
"CreateDate": "«date_time>",
"Roles": [
{
"Path": "/",
"RoleName": "<role_name>",
"RoleId": "<role_id>",
"Arn": "<arn>",
"CreateDate": "<date>",
"AssumeRolePolicyDocument": {
"Version": "<date>",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
}
]
}
}https://stackoverflow.com/questions/58378329
复制相似问题