File tree Expand file tree Collapse file tree 4 files changed +13
-1
lines changed
Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ module "load_balancer" {
6262 vpc_id = local. vpc_id
6363 vpc_cidr = local. vpc_cidr
6464 vpc_subnets = var. lb_internal ? local. vpc_private_subnets : local. vpc_public_subnets
65+ lb_nlb_subnets = var. lb_nlb_internal ? local. vpc_private_subnets : local. vpc_public_subnets
6566 security_group_id = local. lb_security_group_id
6667 create_ssl_cert = var. create_ssl_cert
6768 alb_certificate_domain = var. alb_certificate_domain
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ resource "aws_lb" "vpces_nlb" {
150150 name = " ${ var . deployment_name } -nlb"
151151 internal = true
152152 load_balancer_type = " network"
153- subnets = var. vpc_subnets
153+ subnets = var. lb_nlb_subnets
154154 security_groups = [var . vpces_security_group_id ]
155155
156156 enable_cross_zone_load_balancing = true
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ variable "lb_deploy_nlb" {
8989 description = " Flag if the network load balancer should be deployed (usually for incoming private link)."
9090}
9191
92+ variable "lb_nlb_subnets" {
93+ type = list (any )
94+ description = " List of subnets to deploy the load balancer in"
95+ }
96+
9297variable "vpces_security_group_id" {
9398 type = string
9499 default = " "
Original file line number Diff line number Diff line change @@ -375,6 +375,12 @@ variable "lb_deploy_nlb" {
375375 description = " Flag if the network load balancer should be deployed (usually for incoming private link)."
376376}
377377
378+ variable "lb_nlb_internal" {
379+ type = bool
380+ default = true
381+ description = " Set to true to make the load balancer internal and not exposed to the internet."
382+ }
383+
378384variable "lb_vpces_details" {
379385 default = null
380386 type = object ({
You can’t perform that action at this time.
0 commit comments