Skip to content

Commit efc7771

Browse files
authored
Merge pull request #5 from druids/feat/fargate-compatibility
feat/fargate
2 parents c784221 + 0f5b238 commit efc7771

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

container.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ module "container_definition_noalb" { // Without ALB
1111
container_memory_reservation = var.memory
1212
container_memory = var.memory_limit
1313

14-
port_mappings = [
14+
port_mappings = var.port ? [
1515
{
1616
containerPort = var.port
17-
hostPort = 0
17+
hostPort = contains(var.requires_compatibilities, "FARGATE") ? var.port : 0
1818
protocol = "tcp"
1919
},
20-
]
21-
20+
] : []
21+
2222
log_configuration = {
2323
logDriver = "awslogs"
2424
options = {

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ variable "private_subnet_ids" {
3535

3636
variable "port" {
3737
description = "port on which the service listens"
38-
default = 80
38+
default = null
3939
type = number
4040
}
4141

0 commit comments

Comments
 (0)