interface LoadBalancerListener
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ElasticLoadBalancing.LoadBalancerListener |
Java | software.amazon.awscdk.services.elasticloadbalancing.LoadBalancerListener |
Python | aws_cdk.aws_elasticloadbalancing.LoadBalancerListener |
TypeScript (source) | @aws-cdk/aws-elasticloadbalancing » LoadBalancerListener |
Add a backend to the load balancer.
Example
declare const vpc: ec2.IVpc;
const lb = new elb.LoadBalancer(this, 'LB', {
vpc,
internetFacing: true,
healthCheck: {
port: 80,
},
});
declare const myAutoScalingGroup: autoscaling.AutoScalingGroup;
lb.addTarget(myAutoScalingGroup);
lb.addListener({
externalPort: 80,
});
Properties
Name | Type | Description |
---|---|---|
external | number | External listening port. |
allow | IConnectable [] | Allow connections to the load balancer from the given set of connection peers. |
external | Load | What public protocol to use for load balancing. |
internal | number | Instance listening port. |
internal | Load | What public protocol to use for load balancing. |
policy | string[] | SSL policy names. |
ssl | string | the ARN of the SSL certificate. |
ssl | string | the ARN of the SSL certificate. |
externalPort
Type:
number
External listening port.
allowConnectionsFrom?
Type:
IConnectable
[]
(optional, default: Anywhere)
Allow connections to the load balancer from the given set of connection peers.
By default, connections will be allowed from anywhere. Set this to an empty list to deny connections, or supply a custom list of peers to allow connections from (IP ranges or security groups).
externalProtocol?
Type:
Load
(optional)
What public protocol to use for load balancing.
Either 'tcp', 'ssl', 'http' or 'https'.
May be omitted if the external port is either 80 or 443.
internalPort?
Type:
number
(optional, default: externalPort)
Instance listening port.
Same as the externalPort if not specified.
internalProtocol?
Type:
Load
(optional)
What public protocol to use for load balancing.
Either 'tcp', 'ssl', 'http' or 'https'.
May be omitted if the internal port is either 80 or 443.
The instance protocol is 'tcp' if the front-end protocol is 'tcp' or 'ssl', the instance protocol is 'http' if the front-end protocol is 'https'.
policyNames?
Type:
string[]
(optional)
SSL policy names.
sslCertificateArn?
Type:
string
(optional, default: none)
the ARN of the SSL certificate.
sslCertificateId?
⚠️ Deprecated: - use sslCertificateArn instead
Type:
string
(optional)
the ARN of the SSL certificate.