Interface ILoadBalancerListener
- Namespace
- Amazon.CDK.AWS.ElasticLoadBalancing
- Assembly
- Amazon.CDK.AWS.ElasticLoadBalancing.dll
Add a backend to the load balancer.
public interface ILoadBalancerListener
Examples
IVpc vpc;
AutoScalingGroup myAutoScalingGroup;
var lb = new LoadBalancer(this, "LB", new LoadBalancerProps {
Vpc = vpc,
InternetFacing = true,
HealthCheck = new HealthCheck {
Port = 80
}
});
lb.AddTarget(myAutoScalingGroup);
lb.AddListener(new LoadBalancerListener {
ExternalPort = 80
});
Remarks
ExampleMetadata: infused
Properties
AllowConnectionsFrom
Allow connections to the load balancer from the given set of connection peers.
IConnectable[]? AllowConnectionsFrom { get; }
Property Value
- IConnectable[]
Remarks
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).
Default: Anywhere
ExternalPort
External listening port.
double ExternalPort { get; }
Property Value
ExternalProtocol
What public protocol to use for load balancing.
LoadBalancingProtocol? ExternalProtocol { get; }
Property Value
Remarks
Either 'tcp', 'ssl', 'http' or 'https'.
May be omitted if the external port is either 80 or 443.
InternalPort
Instance listening port.
double? InternalPort { get; }
Property Value
Remarks
Same as the externalPort if not specified.
Default: externalPort
InternalProtocol
What public protocol to use for load balancing.
LoadBalancingProtocol? InternalProtocol { get; }
Property Value
Remarks
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
SSL policy names.
string[]? PolicyNames { get; }
Property Value
- string[]
SslCertificateArn
the ARN of the SSL certificate.
string? SslCertificateArn { get; }
Property Value
Remarks
Default: - none
SslCertificateId
(deprecated) the ARN of the SSL certificate.
[Obsolete("- use sslCertificateArn instead")]
string? SslCertificateId { get; }
Property Value
Remarks
Stability: Deprecated