由于InvalidTypeException而无法通过AWS CLI创建ElasticSearch域

问题描述 投票:0回答:1

我正在按照以下说明将Kibana与AWS Elastic Search结合使用:

https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-walkthrough.html

特别是,教程要求我执行此行(在重新输入用户信息之后,以创建新的ElasticSearch域:

aws es create-elasticsearch-domain-域名my-transcribe-test --elasticsearch-version 6.2 --elasticsearch-cluster-config InstanceType = t2.medium.elasticsearch,InstanceCount = 1 --ebs-options EBSEnabled = true,VolumeType = standard,VolumeSize = 10 --access-policies'{“ Version”:“ 2012-10-17”,“ Statement”:[{“ Effect”:“ Allow”,“ Principal”:{“ AWS” :“ arn:aws:iam :: 123456789012:root”},“ Action”:“ es:”,“资源”:“ arn:aws:es:us-west-2:123456789012:domain / my-transcribe -test /“}]}'--region us-west-2

我用自己的信息替换了它:

aws es create-elasticsearch-domain --domain-name my-transcribe-test2 --elasticsearch-version 6.2 --elasticsearch-cluster-config InstanceType = t2.medium.elasticsearch,InstanceCount = 1 --ebs-options EBSEnabled = true,VolumeType = standard,VolumeSize = 10 --access-policies'{“ Version”:“ 2012-10-17”,“ Statement”:[{“ Effect”:“ Allow”,“ Principal”:{“ AWS” :“” arn:aws:iam :: 31865135xxxx:user:xxxx“},” Action“:” es:*“,”资源“:” arn:aws:es:us-east-1:31865135xxxx:domain / my- transcribe-test2“}}}'--region us-east-1

但是,我得到了错误:

调用CreateElasticsearchDomain操作时发生错误(InvalidTypeException):错误设置策略:[{Version:2012-10-17,Statement:[{Effect:Allow,Principal:{AWS:arn:aws:iam :: 318651355992: user / xxxx},操作:es:*,资源:arn:aws:es:us-east-1:31865135xxxx:domain / my-transcribe-test2}]}]

起初我以为是因为我在访问策略中犯了一个错误,但是,我使用AWS控制台创建了完全相同的域/策略,没有错误:

{“ Version”:“ 2012-10-17”,“声明”:[{“效果”:“允许”,“校长”:{“ AWS”:“ arn:aws:iam :: 31865135xxxx:user / xxxx”},“ Action”:“ es:*”,“资源”:“ arn:aws:es:us-east-1:318651355992:domain / my-transcribe-test2”}]}

因此,不可能是我创建的策略的结构错误。创建此域/策略时,我必须在CLI中做一些错误。有人可以帮助我确定错误吗?谢谢。

amazon-web-services elasticsearch command-line-interface
1个回答
0
投票

仅能看到不同的是您说的有效的政策斜杠,而您的政策却没有斜杠:

my-transcribe-test2/ 
      VS 
my-transcribe-test2 

我实际上以为您最后需要"/*"(斜杠和'*',但是您可以尝试两种方式-值得一试。

© www.soinside.com 2019 - 2024. All rights reserved.