File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,20 @@ data "aws_iam_policy_document" "default" {
221
221
type = " AWS"
222
222
identifiers = distinct (compact (concat (var. iam_role_arns , aws_iam_role. elasticsearch_user . * . arn )))
223
223
}
224
+
225
+ # This condition is for non VPC ES to allow anonymous access from whitelisted IP ranges without requests signing
226
+ # https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-ac.html#es-ac-types-ip
227
+ # https://aws.amazon.com/premiumsupport/knowledge-center/anonymous-not-authorized-elasticsearch/
228
+ dynamic "condition" {
229
+ for_each = ! var. vpc_enabled && length (var. allowed_cidr_blocks ) > 0 ? [true ] : []
230
+
231
+ content {
232
+ test = " IpAddress"
233
+ values = var. allowed_cidr_blocks
234
+ variable = " aws:SourceIp"
235
+ }
236
+ }
237
+
224
238
}
225
239
}
226
240
You can’t perform that action at this time.
0 commit comments