Class AddNetworkTargetsProps
Properties for adding new network targets to a listener.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AddNetworkTargetsProps : Object, IAddNetworkTargetsProps
Syntax (vb)
Public Class AddNetworkTargetsProps
Inherits Object
Implements IAddNetworkTargetsProps
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
AutoScalingGroup asg;
ISecurityGroup sg1;
ISecurityGroup sg2;
// Create the load balancer in a VPC. 'internetFacing' is 'false'
// by default, which creates an internal load balancer.
var lb = new NetworkLoadBalancer(this, "LB", new NetworkLoadBalancerProps {
Vpc = vpc,
InternetFacing = true,
SecurityGroups = new [] { sg1 }
});
lb.AddSecurityGroup(sg2);
// Add a listener on a particular port.
var listener = lb.AddListener("Listener", new BaseNetworkListenerProps {
Port = 443
});
// Add targets on a particular port.
listener.AddTargets("AppFleet", new AddNetworkTargetsProps {
Port = 443,
Targets = new [] { asg }
});
Synopsis
Constructors
AddNetworkTargetsProps() |
Properties
DeregistrationDelay | The amount of time for Elastic Load Balancing to wait before deregistering a target. |
HealthCheck | Health check configuration. |
Port | The port on which the listener listens for requests. |
PreserveClientIp | Indicates whether client IP preservation is enabled. |
Protocol | Protocol for target group, expects TCP, TLS, UDP, or TCP_UDP. |
ProxyProtocolV2 | Indicates whether Proxy Protocol version 2 is enabled. |
TargetGroupName | The name of the target group. |
Targets | The targets to add to this target group. |
Constructors
AddNetworkTargetsProps()
public AddNetworkTargetsProps()
Properties
DeregistrationDelay
The amount of time for Elastic Load Balancing to wait before deregistering a target.
public Duration DeregistrationDelay { get; set; }
Property Value
Remarks
The range is 0-3600 seconds.
Default: Duration.minutes(5)
HealthCheck
Health check configuration.
public IHealthCheck HealthCheck { get; set; }
Property Value
Remarks
Default: - The default value for each property in this configuration varies depending on the target.
Port
The port on which the listener listens for requests.
public double Port { get; set; }
Property Value
System.Double
Remarks
Default: Determined from protocol if known
PreserveClientIp
Indicates whether client IP preservation is enabled.
public Nullable<bool> PreserveClientIp { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false if the target group type is IP address and the target group protocol is TCP or TLS. Otherwise, true.
Protocol
Protocol for target group, expects TCP, TLS, UDP, or TCP_UDP.
public Nullable<Protocol> Protocol { get; set; }
Property Value
System.Nullable<Protocol>
Remarks
Default: - inherits the protocol of the listener
ProxyProtocolV2
Indicates whether Proxy Protocol version 2 is enabled.
public Nullable<bool> ProxyProtocolV2 { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
TargetGroupName
The name of the target group.
public string TargetGroupName { get; set; }
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.
public INetworkLoadBalancerTarget[] Targets { get; set; }
Property Value
Remarks
Can be Instance
, IPAddress
, or any self-registering load balancing
target. If you use either Instance
or IPAddress
as targets, all
target must be of the same type.