forked from lgallard/terraform-aws-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiam.tf
35 lines (32 loc) · 927 Bytes
/
iam.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
resource "aws_cloudwatch_log_group" "es_cloudwatch_log_group" {
name = "${var.domain_name}-log_group"
tags = var.tags
}
resource "aws_cloudwatch_log_resource_policy" "es_aws_cloudwatch_log_resource_policy" {
policy_name = "${var.domain_name}-policy"
policy_document = <<CONFIG
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "es.amazonaws.com"
},
"Action": [
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
"logs:CreateLogStream"
],
"Resource": "arn:aws:logs:*"
}
]
}
CONFIG
}
# Service-linked role to give Amazon ES permissions to access your VPC
resource "aws_iam_service_linked_role" "es" {
count = var.create_service_link_role == true ? 1 : 0
aws_service_name = "es.amazonaws.com"
description = "Service-linked role to give Amazon ES permissions to access your VPC"
}