@@ -19,9 +19,9 @@ data "aws_subnet_ids" "private_subnet_ids" {
1919
2020# TODO: setup at least 3 LB: NLB, ALB w/o logs, ALB w/ logs
2121# update outputs for all 3
22- module "lb" {
22+ module "lb-tcp " {
2323 source = " ../"
24- name = " lb-svc "
24+ name = " lb-tcp "
2525 environment = " one"
2626 organization = " wiser"
2727 # attributes = ["role", "policy", "use", ""]
@@ -30,7 +30,7 @@ module "lb" {
3030 # health_check_path = ""
3131 security_groups = [" sg-a5bf1cd8" ] # Need at least 1
3232 lb_protocols = [" HTTP" ," HTTPS" ]
33- # type = "network"
33+ type = " network"
3434 subnets = " ${ data . aws_subnet_ids . private_subnet_ids . ids } "
3535 vpc_id = " ${ data . aws_vpc . vpc . id } "
3636 ports = " 3000,4000"
@@ -40,20 +40,51 @@ module "lb" {
4040 lb_http_ports = " 80,8080"
4141 lb_https_ports = " 443"
4242 lb_tcp_ports = " "
43-
4443}
45-
46- /* Example for replacing existing module
47- module "lb-http-service" {
48- source = "../"
49- name = "${var.stack}"
50- subnets = "${module.aws_env.private_subnet_ids}"
51- vpc_id = "${module.aws_env.vpc_id}"
52- security_groups = "${compact(split(",", "${join(",", var.additional_sg_ids)},${module.sg.sg_id}" ))}"
53- ports = "${join(",", list(var.port), var.additional_ports)}"
54- type = "${var.lb_type}"
55- lb_protocols = ["${var.lb_type == "application" ? "HTTP" : "TCP"}"]
56- health_check_path = "${var.healthcheck_path}"
57- health_check_protocol = "${var.healthcheck_protocol}"
44+ module "lb-http" {
45+ source = " ../"
46+ name = " lb-http"
47+ environment = " one"
48+ organization = " wiser"
49+ # attributes = ["role", "policy", "use", ""]
50+ # tags = "${map("Key", "Value")}"
51+ # enabled = false
52+ # health_check_path = ""
53+ security_groups = [" sg-a5bf1cd8" ] # Need at least 1
54+ lb_protocols = [" HTTP" ]
55+ # type = "network"
56+ subnets = " ${ data . aws_subnet_ids . private_subnet_ids . ids } "
57+ vpc_id = " ${ data . aws_vpc . vpc . id } "
58+ ports = " 3000,4000"
59+ instance_http_ports = " 80,8080"
60+ instance_https_ports = " "
61+ instance_tcp_ports = " "
62+ lb_http_ports = " 80,8080"
63+ lb_https_ports = " "
64+ lb_tcp_ports = " "
65+ }
66+ module "lb-https" {
67+ source = " ../"
68+ name = " lb-https"
69+ environment = " one"
70+ organization = " wiser"
71+ # attributes = ["role", "policy", "use", ""]
72+ # tags = "${map("Key", "Value")}"
73+ # enabled = false
74+ # health_check_path = ""
75+ internal = false # PUBLIC
76+ # security_groups = ["sg-a5bf1cd8"] # Need at least 1
77+ security_groups = [" sg-422c923e" ] # PUBLIC -> use whitelist SG
78+ lb_protocols = [" HTTPS" ]
79+ # type = "network"
80+ # subnets = "${data.aws_subnet_ids.private_subnet_ids.ids}"
81+ subnets = " ${ data . aws_subnet_ids . public_subnet_ids . ids } " # PUBLIC -> use public subnets
82+ vpc_id = " ${ data . aws_vpc . vpc . id } "
83+ ports = " 3000,4000"
84+ instance_http_ports = " "
85+ instance_https_ports = " 443,8443"
86+ instance_tcp_ports = " "
87+ lb_http_ports = " "
88+ lb_https_ports = " 443,8443"
89+ lb_tcp_ports = " "
5890}
59- */
0 commit comments