-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcloudwatch.tf
More file actions
34 lines (29 loc) · 1.46 KB
/
cloudwatch.tf
File metadata and controls
34 lines (29 loc) · 1.46 KB
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
# These log groups are used by cloudwatch and fluentbit,
# by creating it here we do not have to specify the retention
# inside the helm chart. Added benefit is that we can destroy
# it using terraform which we wouldn't be able to when using helm
resource "aws_cloudwatch_log_group" "cloudwatch-application" {
count = var.enable_cloudwatch_agent ? 1 : 0
name = "/aws/containerinsights/${var.eks_cluster_name}/application"
retention_in_days = var.log_retention_in_days
}
resource "aws_cloudwatch_log_group" "cloudwatch-dataplane" {
count = var.enable_cloudwatch_agent ? 1 : 0
name = "/aws/containerinsights/${var.eks_cluster_name}/dataplane"
retention_in_days = var.log_retention_in_days
}
resource "aws_cloudwatch_log_group" "cloudwatch-host" {
count = var.enable_cloudwatch_agent ? 1 : 0
name = "/aws/containerinsights/${var.eks_cluster_name}/host"
retention_in_days = var.log_retention_in_days
}
resource "aws_cloudwatch_log_group" "cloudwatch-performance" {
count = var.enable_cloudwatch_agent ? 1 : 0
name = "/aws/containerinsights/${var.eks_cluster_name}/performance"
retention_in_days = var.log_retention_in_days
}
resource "aws_cloudwatch_log_group" "fluentbit" {
count = var.enable_fluentbit && var.log_preserve_legacy_log_group ? 1 : 0
name = "/aws/eks/fluentbit-cloudwatch/logs"
retention_in_days = var.log_retention_in_days
}