Skip to content

Commit

Permalink
feat: variable extra_port_mappings for container definition (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
harryherbig authored Mar 3, 2025
1 parent cd18df2 commit f91bdb2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions container_definition.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ locals {
}
} : null)

portMappings = [
# concat with var.extra_port_mappings
portMappings = concat([
{
hostPort = var.container_port,
containerPort = var.container_port,
protocol = "tcp"
}
]
], var.extra_port_mappings)

ulimits = startswith(upper(var.operating_system_family), "WINDOWS") ? [] : [
{
Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,16 @@ variable "efs_volumes" {
type = any
}

variable "extra_port_mappings" {
default = []
description = "Additional ports to be exposed from the container."
type = list(object({
hostPort = number
containerPort = number
protocol = optional(string, "tcp")
}))
}

variable "firelens" {
description = "Configuration for optional custom log routing using FireLens over fluentbit sidecar. Enable `attach_init_config_s3_policy` to attach an IAM policy granting access to the init config files on S3."
default = {}
Expand Down

0 comments on commit f91bdb2

Please sign in to comment.