Skip to content

Commit a7cf8c2

Browse files
committed
Adding missing settings
1 parent ca153d9 commit a7cf8c2

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

main.tf

+1-22
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,6 @@ provider "aws" {
66
region = var.region
77
}
88

9-
# ---------------------------------------------------------------------------------------------------------------------
10-
# AWS Cloudwatch Logs
11-
# ---------------------------------------------------------------------------------------------------------------------
12-
module aws_cw_logs {
13-
source = "cn-terraform/cloudwatch-logs/aws"
14-
version = "1.0.5"
15-
# source = "../terraform-aws-cloudwatch-logs"
16-
17-
logs_path = "/ecs/service/${var.name_preffix}"
18-
profile = var.profile
19-
region = var.region
20-
}
21-
229
# ---------------------------------------------------------------------------------------------------------------------
2310
# ECS Cluster
2411
# ---------------------------------------------------------------------------------------------------------------------
@@ -59,15 +46,7 @@ module "td" {
5946
healthcheck = var.healthcheck
6047
links = var.links
6148
linux_parameters = var.linux_parameters
62-
log_configuration = {
63-
logDriver = "awslogs"
64-
options = {
65-
"awslogs-region" = var.region
66-
"awslogs-group" = module.aws_cw_logs.logs_path
67-
"awslogs-stream-prefix" = "ecs"
68-
}
69-
secretOptions = null
70-
}
49+
log_configuration = var.log_configuration
7150
mount_points = var.mount_points
7251
port_mappings = var.port_mappings
7352
readonly_root_filesystem = var.readonly_root_filesystem

variables.tf

+14
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ variable "linux_parameters" {
156156
default = null
157157
}
158158

159+
# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html
160+
variable "log_configuration" {
161+
description = "(Optional) Log configuration options to send to a custom log driver for the container. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html"
162+
type = object({
163+
logDriver = string
164+
options = map(string)
165+
secretOptions = list(object({
166+
name = string
167+
valueFrom = string
168+
}))
169+
})
170+
default = null
171+
}
172+
159173
variable "mount_points" {
160174
description = "(Optional) Container mount points. This is a list of maps, where each map should contain a `containerPath` and `sourceVolume`"
161175
type = list(object({

0 commit comments

Comments
 (0)