^ my code trying to create the listener
# general
a
^ my code trying to create the listener
w
Just a note that
elasticloadbalancingv2
is ALB/NLB, not classic load balancer - I assume that's what you want?
a
oh
w
Here's an example of using this:
Copy code
const listener = new aws.elasticloadbalancingv2.Listener(`${name}metabase`, {
            loadBalancerArn: loadbalancer.arn,
            port: 443,
            protocol: "HTTPS",
            certificateArn: certificate.arn,
            defaultAction: {
                type: "forward",
                targetGroupArn: targetgroup.arn,
            },
            // Require the use of SSL/TLS v1.2 or higher to connect.
            sslPolicy: "ELBSecurityPolicy-TLS-1-2-2017-01",
        }, { parent: this, dependsOn: [certificateValidation] });
        const httpRedirectListener = new aws.elasticloadbalancingv2.Listener(`${name}metabase-redirecthttp`, {
            loadBalancerArn: loadbalancer.arn,
            port: 80,
            protocol: "HTTP",
            defaultAction: {
                type: "redirect",
                redirect: {
                    protocol: "HTTPS",
                    port: "443",
                    statusCode: "HTTP_301",
                },
            },
        }, { parent: this });
a
I think I need a classic load balancer (just basing off what we already have). Is it the "applicationloadbalancing" module or "elasticloadbalancing" (not v2)?
Thank you for that example!
nevermind, if anyone sees this it is "elasticloadbalancing"
Thanks for the help
w
Yep -
elasticloadbalancing
. Naming here is unfortunate overall, but aligned with what AWS APIs chose to do when ALB/NLB were introduced.