【发布时间】:2020-10-06 19:44:56
【问题描述】:
我想通过定义 Access Policies 来限制对我在 aws 上的 elasticsearch 集群的访问,这将限制对 iam 用户的访问、特定的 lambda 函数和 appsync api。
我在 cloudformation 上的 elasticsearch 资源中定义了以下 access policies,但这失败并出现错误:Service: AWSElasticsearch; Status Code: 409; Error Code: InvalidTypeException;
如何修正我的政策以使其发挥作用?
"Type": "AWS::Elasticsearch::Domain",
"Properties": {
"AccessPolicies": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": [
{
"Fn::Join": [
"",
[
"arn:aws:lambda:",
{"Ref": "AWS::Region"},
":",
{"Ref": "AWS::AccountId"},
":function:",
{"Ref": "DdEsLambdaFunctionName"},
"-",
{"Ref": "env"}
]
]
},
{
"Fn::Join": [
"",
[
{"Ref": "GraphQLAPI"},
"/*"
]
]
}
]
},
"Action": [
"es:ESHttp*"
]
},
{
"Effect": "Allow",
"Principal": [
{
"AWS": {
"Fn::Join": [
"",
[
"arn:aws:iam::",
{"Ref": "AWS::AccountId"},
":user/*"
]
]
}
}
],
"Action": "*"
}
]
},...}
【问题讨论】:
标签: amazon-web-services amazon-cloudformation