Interface IAddApplicationTargetsProps
Properties for adding new targets to a listener.
Inherited Members
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.AWS.ElasticLoadBalancingV2.dll
Syntax (csharp)
public interface IAddApplicationTargetsProps : IAddRuleProps
Syntax (vb)
Public Interface IAddApplicationTargetsProps
Inherits IAddRuleProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.AutoScaling;
AutoScalingGroup asg;
Vpc vpc;
// Create the load balancer in a VPC. 'internetFacing' is 'false'
// by default, which creates an internal load balancer.
var lb = new ApplicationLoadBalancer(this, "LB", new ApplicationLoadBalancerProps {
Vpc = vpc,
InternetFacing = true
});
// Add a listener and open up the load balancer's security group
// to the world.
var listener = lb.AddListener("Listener", new BaseApplicationListenerProps {
Port = 80,
// 'open: true' is the default, you can leave it out if you want. Set it
// to 'false' and use `listener.connections` if you want to be selective
// about who can access the load balancer.
Open = true
});
// Create an AutoScaling group and add it as a load balancing
// target to the listener.
listener.AddTargets("ApplicationFleet", new AddApplicationTargetsProps {
Port = 8080,
Targets = new [] { asg }
});
Synopsis
Properties
DeregistrationDelay | The amount of time for Elastic Load Balancing to wait before deregistering a target. |
HealthCheck | Health check configuration. |
LoadBalancingAlgorithmType | The load balancing algorithm to select targets for routing requests. |
Port | The port on which the listener listens for requests. |
Protocol | The protocol to use. |
ProtocolVersion | The protocol version to use. |
SlowStart | The time period during which the load balancer sends a newly registered target a linearly increasing share of the traffic to the target group. |
StickinessCookieDuration | The stickiness cookie expiration period. |
StickinessCookieName | The name of an application-based stickiness cookie. |
TargetGroupName | The name of the target group. |
Targets | The targets to add to this target group. |
Properties
DeregistrationDelay
The amount of time for Elastic Load Balancing to wait before deregistering a target.
virtual Duration DeregistrationDelay { get; }
Property Value
Remarks
The range is 0-3600 seconds.
Default: Duration.minutes(5)
HealthCheck
Health check configuration.
virtual IHealthCheck HealthCheck { get; }
Property Value
Remarks
Default: - The default value for each property in this configuration varies depending on the target.
LoadBalancingAlgorithmType
The load balancing algorithm to select targets for routing requests.
virtual Nullable<TargetGroupLoadBalancingAlgorithmType> LoadBalancingAlgorithmType { get; }
Property Value
System.Nullable<TargetGroupLoadBalancingAlgorithmType>
Remarks
Default: round_robin.
Port
The port on which the listener listens for requests.
virtual Nullable<double> Port { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: Determined from protocol if known
Protocol
The protocol to use.
virtual Nullable<ApplicationProtocol> Protocol { get; }
Property Value
System.Nullable<ApplicationProtocol>
Remarks
Default: Determined from port if known
ProtocolVersion
The protocol version to use.
virtual Nullable<ApplicationProtocolVersion> ProtocolVersion { get; }
Property Value
System.Nullable<ApplicationProtocolVersion>
Remarks
Default: ApplicationProtocolVersion.HTTP1
SlowStart
The time period during which the load balancer sends a newly registered target a linearly increasing share of the traffic to the target group.
virtual Duration SlowStart { get; }
Property Value
Remarks
The range is 30-900 seconds (15 minutes).
Default: 0
StickinessCookieDuration
The stickiness cookie expiration period.
virtual Duration StickinessCookieDuration { get; }
Property Value
Remarks
Setting this value enables load balancer stickiness.
After this period, the cookie is considered stale. The minimum value is 1 second and the maximum value is 7 days (604800 seconds).
Default: Stickiness disabled
StickinessCookieName
The name of an application-based stickiness cookie.
virtual string StickinessCookieName { get; }
Property Value
System.String
Remarks
Names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP, and AWSALBTG; they're reserved for use by the load balancer.
Note: stickinessCookieName
parameter depends on the presence of stickinessCookieDuration
parameter.
If stickinessCookieDuration
is not set, stickinessCookieName
will be omitted.
Default: - If stickinessCookieDuration
is set, a load-balancer generated cookie is used. Otherwise, no stickiness is defined.
See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html
TargetGroupName
The name of the target group.
virtual string TargetGroupName { get; }
Property Value
System.String
Remarks
This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.
Default: Automatically generated
Targets
The targets to add to this target group.
virtual IApplicationLoadBalancerTarget[] Targets { get; }
Property Value
IApplicationLoadBalancerTarget[]
Remarks
Can be Instance
, IPAddress
, or any self-registering load balancing
target. All target must be of the same type.