Skip to content

Commit a82f375

Browse files
committed
Using a module to create Cloudwatch logs resources
1 parent 75be46a commit a82f375

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

logs.tf

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
# ---------------------------------------------------------------------------------------------------------------------
22
# AWS Cloudwatch Logs
33
# ---------------------------------------------------------------------------------------------------------------------
4-
resource "aws_cloudwatch_log_group" "log_group" {
5-
name = local.log_options["awslogs-group"]
6-
retention_in_days = "7"
7-
tags = {
8-
Name = local.log_options["awslogs-group"]
9-
}
10-
}
11-
12-
resource "aws_cloudwatch_log_stream" "log_stream" {
13-
name = local.log_options["awslogs-group"]
14-
log_group_name = aws_cloudwatch_log_group.log_group.name
4+
module "aws_cw_logs" {
5+
source = "jnonino/cloudwatch-logs/aws"
6+
version = "1.0.2"
7+
logs_path = local.log_options["awslogs-group"]
8+
profile = var.profile
9+
region = var.region
1510
}
1611

server.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ resource "aws_ecs_task_definition" "td" {
4343
dynamic "placement_constraints" {
4444
for_each = var.placement_constraints
4545
content {
46-
# TF-UPGRADE-TODO: The automatic upgrade tool can't predict
47-
# which keys might be set in maps assigned here, so it has
48-
# produced a comprehensive set here. Consider simplifying
49-
# this after confirming which keys can be set in practice.
50-
5146
expression = lookup(placement_constraints.value, "expression", null)
5247
type = placement_constraints.value.type
5348
}
@@ -58,11 +53,6 @@ resource "aws_ecs_task_definition" "td" {
5853
dynamic "proxy_configuration" {
5954
for_each = var.proxy_configuration
6055
content {
61-
# TF-UPGRADE-TODO: The automatic upgrade tool can't predict
62-
# which keys might be set in maps assigned here, so it has
63-
# produced a comprehensive set here. Consider simplifying
64-
# this after confirming which keys can be set in practice.
65-
6656
container_name = proxy_configuration.value.container_name
6757
properties = lookup(proxy_configuration.value, "properties", null)
6858
type = lookup(proxy_configuration.value, "type", null)

0 commit comments

Comments
 (0)