-
Notifications
You must be signed in to change notification settings - Fork 373
/
cloudwatch.tf
34 lines (29 loc) · 1.33 KB
/
cloudwatch.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
# Because alarms cost money we want to share them per log group. Therefore we want all environments in one log group.
# For example: we have a CloudWatch LogGroup named 'docker' where you can find streams 'ENV/IP', like 'test/10.0.0.1'.
# Consequence: When you have multiple ECS environments in one account you can only create the LogGroups once.
# This means that the other enviourments have to import the log groups.
# If you don't want that just specify the cloudwatch_prefix per enviourment.
resource "aws_cloudwatch_log_group" "dmesg" {
name = "${var.cloudwatch_prefix}/var/log/dmesg"
retention_in_days = 30
}
resource "aws_cloudwatch_log_group" "docker" {
name = "${var.cloudwatch_prefix}/var/log/docker"
retention_in_days = 30
}
resource "aws_cloudwatch_log_group" "ecs-agent" {
name = "${var.cloudwatch_prefix}/var/log/ecs/ecs-agent.log"
retention_in_days = 30
}
resource "aws_cloudwatch_log_group" "ecs-init" {
name = "${var.cloudwatch_prefix}/var/log/ecs/ecs-init.log"
retention_in_days = 30
}
resource "aws_cloudwatch_log_group" "audit" {
name = "${var.cloudwatch_prefix}/var/log/ecs/audit.log"
retention_in_days = 30
}
resource "aws_cloudwatch_log_group" "messages" {
name = "${var.cloudwatch_prefix}/var/log/messages"
retention_in_days = 30
}