File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ module "container_definition_noalb" { // Without ALB
11
11
container_memory_reservation = var. memory
12
12
container_memory = var. memory_limit
13
13
14
- port_mappings = [
14
+ port_mappings = var . port ? [
15
15
{
16
16
containerPort = var.port
17
- hostPort = 0
17
+ hostPort = contains (var . requires_compatibilities , " FARGATE " ) ? var.port : 0
18
18
protocol = " tcp"
19
19
},
20
- ]
21
-
20
+ ] : []
21
+
22
22
log_configuration = {
23
23
logDriver = " awslogs"
24
24
options = {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ variable "private_subnet_ids" {
35
35
36
36
variable "port" {
37
37
description = " port on which the service listens"
38
- default = 80
38
+ default = null
39
39
type = number
40
40
}
41
41
You can’t perform that action at this time.
0 commit comments