【发布时间】:2019-09-16 02:02:23
【问题描述】:
我正在尝试在 AWS 上为我的 elasticsearch 注册一个快照。我的目标是在 s3 存储桶上创建弹性搜索域的快照。以下是我正在使用的命令:
curl -XPUT https://vpc-xxxxxxx.ap-southeast-2.es.amazonaws.com/_snapshot/es-snapshot -d '
{
"type": "s3",
"settings": {
"bucket": "$MY_BUCKET",
"region": "ap-southeast-2",
"role_arn": "arn:aws:iam::xxxx:role/es-snapshot-role"
}
}'
但是我收到了这个错误:
{"Message":"User: anonymous is not authorized to perform: iam:PassRole on resource: arn:aws:iam::xxxx:role/es-snapshot-role"}
这似乎是一个角色权限问题。我已将角色策略配置为:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": [
"es:*",
"s3:*",
"iam:PassRole",
"es:ESHttpPut"
],
"Resource": [
"*"
]
}
]
}
而它的信任关系是:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "es.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
我想知道我还错过了什么。
这篇帖子AccessDenied for EC2 Instance with attached IAM Role 似乎与我的问题无关。
【问题讨论】:
-
通过curl调用api时你的授权在哪里?
-
解决了吗?如果是,那么如何,如果不是,那么还尝试了什么?
标签: amazon-web-services amazon-iam aws-elasticsearch