Skip to content

Commit 041b144

Browse files
authored
fix: update type of logConfiguration variable (#27)
Fixes #26
1 parent d83e813 commit 041b144

File tree

6 files changed

+34
-5
lines changed

6 files changed

+34
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ By default, this module creates a task definition with a single container defini
137137
| ipc\_mode | The IPC resource namespace to use for the containers in the task | `string` | `"host"` | no |
138138
| links | The link parameter allows containers to communicate with each other without the need for port mappings | `list(string)` | `[]` | no |
139139
| linuxParameters | Linux-specific modifications that are applied to the container, such as Linux KernelCapabilities | `any` | `{}` | no |
140-
| logConfiguration | The log configuration specification for the container | `map(string)` | `{}` | no |
140+
| logConfiguration | The log configuration specification for the container | `any` | `{}` | no |
141141
| memory | The hard limit (in MiB) of memory to present to the container | `number` | `0` | no |
142142
| memoryReservation | The soft limit (in MiB) of memory to reserve for the container | `number` | `0` | no |
143143
| mountPoints | The mount points for data volumes in your container | `list(any)` | `[]` | no |

examples/terraform-task-definition-multiple-containers/main.tf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ module "redis" {
2222
family = "redis"
2323
image = "redis:alpine"
2424
memory = 512
25-
name = "redis"
25+
26+
logConfiguration = {
27+
logDriver = "awslogs"
28+
options = {
29+
awslogs-group = "awslogs-mongodb"
30+
awslogs-region = "us-east-1"
31+
}
32+
}
33+
34+
name = "redis"
2635

2736
portMappings = [
2837
{

test/fixtures/multiple.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@
5858
"interactive": false,
5959
"links": null,
6060
"linuxParameters": null,
61-
"logConfiguration": null,
61+
"logConfiguration": {
62+
"logDriver": "awslogs",
63+
"options": {
64+
"awslogs-group": "awslogs-mongodb",
65+
"awslogs-region": "us-east-1"
66+
}
67+
},
6268
"memory": 512,
6369
"memoryReservation": null,
6470
"mountPoints": null,

test/fixtures/single.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@
6161
}
6262
]
6363
},
64-
"logConfiguration": null,
64+
"logConfiguration": {
65+
"logDriver": "awslogs",
66+
"options": {
67+
"awslogs-group": "awslogs-mongodb",
68+
"awslogs-region": "us-east-1"
69+
}
70+
},
6571
"memory": null,
6672
"memoryReservation": 512,
6773
"mountPoints": [

varfile.tfvars

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ linuxParameters = {
4343
]
4444
}
4545

46+
logConfiguration = {
47+
logDriver = "awslogs"
48+
options = {
49+
awslogs-group = "awslogs-mongodb"
50+
awslogs-region = "us-east-1"
51+
}
52+
}
53+
4654
memoryReservation = 512
4755

4856
mountPoints = [

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ variable "linuxParameters" {
114114
variable "logConfiguration" {
115115
default = {}
116116
description = "The log configuration specification for the container"
117-
type = map(string)
117+
type = any
118118
}
119119

120120
variable "memory" {

0 commit comments

Comments
 (0)