generated from blackbird-cloud/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.tf
39 lines (34 loc) · 908 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
39
data "aws_eks_cluster" "cluster" {
name = var.cluster_name
}
data "aws_eks_cluster_auth" "cluster" {
name = var.cluster_name
}
locals {
cluster_oidc_issuer = data.aws_eks_cluster.cluster.identity[0].oidc[0].issuer
}
module "cloudwatch_log_policy" {
source = "terraform-aws-modules/iam/aws//modules/iam-policy"
version = "~> 4"
name = var.name
path = "/cloudwatch_log/"
description = "Cloudwatch log Policy ${var.name}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"logs:CreateLogGroup",
"logs:DescribeLogStreams",
"logs:PutLogEvents",
"logs:PutRetentionPolicy"
],
"Resource": "${module.cluster_log_group.cloudwatch_log_group_arn}:*"
}
]
}
EOF
}