From 23b228ed7ad3f54e6886396a5ce4acb95db38133 Mon Sep 17 00:00:00 2001 From: ofir machlof Date: Tue, 5 Nov 2024 09:14:39 +0200 Subject: [PATCH] add the ability to configure policy for cross cluster OpenSearch --- main.tf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index e5499c7..64b4091 100644 --- a/main.tf +++ b/main.tf @@ -288,7 +288,10 @@ data "aws_iam_policy_document" "this" { not_actions = try(statement.value.not_actions, null) effect = try(statement.value.effect, null) resources = try(statement.value.resources, - [for path in try(statement.value.resource_paths, ["*"]) : "${aws_opensearch_domain.this[0].arn}/${path}"] + [ + for path in try(statement.value.resource_paths, ["*"]) : + "${aws_opensearch_domain.this[0].arn}${path == "/*" ? "/*" : path}" + ] ) not_resources = try(statement.value.not_resources, null)