Skip to content

Commit

Permalink
Add support for named ports
Browse files Browse the repository at this point in the history
  • Loading branch information
dmattia authored Jan 25, 2025
1 parent 95e357f commit 386cb93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ module "definition" {
containerPort = port
hostPort = port
protocol = "tcp"
name = lookup(var.portNames, port, null)
}
]

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ variable containerPorts {
EOF
}

variable portNames {
type = map(string)
default = {}
description = "A map of port numbers to their respective names for service discovery"
}

variable environment {
type = map(string)
default = {}
Expand Down

0 comments on commit 386cb93

Please sign in to comment.