Skip to content

Commit

Permalink
Create log group
Browse files Browse the repository at this point in the history
  • Loading branch information
vertism committed Dec 11, 2023
1 parent 41ac576 commit dace9c1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions terraform/environments/cdpt-chaps/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ resource "aws_ecs_cluster" "ecs_cluster" {
}
}

resource "aws_cloudwatch_log_group" "deployment_logs" {
name = "/aws/events/deploymentLogs"
retention_in_days = "7"
}

resource "aws_ecs_task_definition" "chaps_task_definition" {
family = "chapsFamily"
requires_compatibilities = ["FARGATE"]
Expand Down Expand Up @@ -250,3 +245,14 @@ resource "aws_cloudwatch_log_resource_policy" "ecs_logging_policy" {
})
policy_name = "TrustEventsToStoreLogEvents"
}

# Set up CloudWatch group and log stream and retain logs for 30 days
resource "aws_cloudwatch_log_group" "cloudwatch_group" {
name = "${local.application_name}-ecs"
retention_in_days = 30
}

resource "aws_cloudwatch_log_stream" "cloudwatch_stream" {
name = "${local.application_name}-log-stream"
log_group_name = aws_cloudwatch_log_group.cloudwatch_group.name
}

0 comments on commit dace9c1

Please sign in to comment.