-
Notifications
You must be signed in to change notification settings - Fork 57
/
data.tf
38 lines (30 loc) · 920 Bytes
/
data.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
36
37
38
data "aws_region" "current" {}
data "aws_caller_identity" "current" {}
data "aws_route53_zone" "opensearch" {
name = var.cluster_domain
private_zone = var.cluster_domain_private
}
data "aws_iam_policy_document" "access_policy" {
statement {
actions = ["es:*"]
resources = ["arn:aws:es:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:domain/${var.cluster_name}/*"]
principals {
type = "AWS"
identifiers = ["*"]
}
}
}
data "aws_iam_policy_document" "allow_logging" {
statement {
actions = [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
]
resources = ["arn:aws:logs:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:log-group:${local.log_prefix}/*:*"]
principals {
identifiers = ["es.amazonaws.com"]
type = "Service"
}
}
}