https://pulumi.com logo
#general
Title
# general
a

adventurous-kilobyte-12973

01/09/2019, 11:29 PM
^ my code trying to create the listener
w

white-balloon-205

01/09/2019, 11:29 PM
Just a note that
elasticloadbalancingv2
is ALB/NLB, not classic load balancer - I assume that's what you want?
a

adventurous-kilobyte-12973

01/09/2019, 11:30 PM
oh
w

white-balloon-205

01/09/2019, 11:30 PM
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

adventurous-kilobyte-12973

01/09/2019, 11:31 PM
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

white-balloon-205

01/10/2019, 12:15 AM
Yep -
elasticloadbalancing
. Naming here is unfortunate overall, but aligned with what AWS APIs chose to do when ALB/NLB were introduced.