Class ApplicationTargetGroupProps
Properties for defining an Application Target Group.
Inheritance
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ApplicationTargetGroupProps : Object, IApplicationTargetGroupProps, IBaseTargetGroupProps
Syntax (vb)
Public Class ApplicationTargetGroupProps
Inherits Object
Implements IApplicationTargetGroupProps, IBaseTargetGroupProps
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
var tg = new ApplicationTargetGroup(this, "TG", new ApplicationTargetGroupProps {
TargetType = TargetType.IP,
Port = 50051,
Protocol = ApplicationProtocol.HTTP,
ProtocolVersion = ApplicationProtocolVersion.GRPC,
HealthCheck = new HealthCheck {
Enabled = true,
HealthyGrpcCodes = "0-99"
},
Vpc = vpc
});
Synopsis
Constructors
ApplicationTargetGroupProps() |
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 target receives traffic. |
Protocol | The protocol used for communication with the target. |
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. |
TargetType | The type of targets registered to this TargetGroup, either IP or Instance. |
Vpc | The virtual private cloud (VPC). |
Constructors
ApplicationTargetGroupProps()
public ApplicationTargetGroupProps()
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: 300
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.
LoadBalancingAlgorithmType
The load balancing algorithm to select targets for routing requests.
public Nullable<TargetGroupLoadBalancingAlgorithmType> LoadBalancingAlgorithmType { get; set; }
Property Value
System.Nullable<TargetGroupLoadBalancingAlgorithmType>
Remarks
Default: TargetGroupLoadBalancingAlgorithmType.ROUND_ROBIN
Port
The port on which the target receives traffic.
public Nullable<double> Port { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
This is not applicable for Lambda targets.
Default: - Determined from protocol if known
Protocol
The protocol used for communication with the target.
public Nullable<ApplicationProtocol> Protocol { get; set; }
Property Value
System.Nullable<ApplicationProtocol>
Remarks
This is not applicable for Lambda targets.
Default: - Determined from port if known
ProtocolVersion
The protocol version to use.
public Nullable<ApplicationProtocolVersion> ProtocolVersion { get; set; }
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.
public Duration SlowStart { get; set; }
Property Value
Remarks
The range is 30-900 seconds (15 minutes).
Default: 0
StickinessCookieDuration
The stickiness cookie expiration period.
public Duration StickinessCookieDuration { get; set; }
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 is disabled
StickinessCookieName
The name of an application-based stickiness cookie.
public string StickinessCookieName { get; set; }
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.
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 IApplicationLoadBalancerTarget[] Targets { get; set; }
Property Value
IApplicationLoadBalancerTarget[]
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.
Default: - No targets.
TargetType
The type of targets registered to this TargetGroup, either IP or Instance.
public Nullable<TargetType> TargetType { get; set; }
Property Value
System.Nullable<TargetType>
Remarks
All targets registered into the group must be of this type. If you register targets to the TargetGroup in the CDK app, the TargetType is determined automatically.
Default: - Determined automatically.
Vpc
The virtual private cloud (VPC).
public IVpc Vpc { get; set; }
Property Value
Remarks
only if TargetType
is Ip
or InstanceId
Default: - undefined