Here's an example of using this:
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 });