Skip to content

Commit eef1dbf

Browse files
committed
Addin resource policy
1 parent 55333b6 commit eef1dbf

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

data.tf

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
data "aws_vpc" "this" {
22
id = "${var.vpc_id}"
33
}
4+
5+
data "aws_iam_policy_document" "this" {
6+
statement {
7+
actions = [
8+
"logs:CreateLogStream",
9+
"logs:PutLogEvents",
10+
]
11+
12+
resources = ["${aws_cloudwatch_log_group.this.arn}:*"]
13+
14+
principals {
15+
identifiers = ["es.amazonaws.com"]
16+
type = "Service"
17+
}
18+
}
19+
}

main.tf

+5
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,8 @@ resource "aws_elasticsearch_domain_policy" "this" {
164164
}
165165
POLICIES
166166
}
167+
168+
resource "aws_cloudwatch_log_resource_policy" "this" {
169+
policy_document = "${data.aws_iam_policy_document.this.json}"
170+
policy_name = "${local.id}-ElasticSearch-Index-Logs"
171+
}

0 commit comments

Comments
 (0)