Class CfnLoadBalancerProps
Properties for defining a CfnLoadBalancer
.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.ElasticLoadBalancing
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnLoadBalancerProps : ICfnLoadBalancerProps
Syntax (vb)
Public Class CfnLoadBalancerProps Implements ICfnLoadBalancerProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElasticLoadBalancing;
var attributes;
var cfnLoadBalancerProps = new CfnLoadBalancerProps {
Listeners = new [] { new ListenersProperty {
InstancePort = "instancePort",
LoadBalancerPort = "loadBalancerPort",
Protocol = "protocol",
// the properties below are optional
InstanceProtocol = "instanceProtocol",
PolicyNames = new [] { "policyNames" },
SslCertificateId = "sslCertificateId"
} },
// the properties below are optional
AccessLoggingPolicy = new AccessLoggingPolicyProperty {
Enabled = false,
S3BucketName = "s3BucketName",
// the properties below are optional
EmitInterval = 123,
S3BucketPrefix = "s3BucketPrefix"
},
AppCookieStickinessPolicy = new [] { new AppCookieStickinessPolicyProperty {
CookieName = "cookieName",
PolicyName = "policyName"
} },
AvailabilityZones = new [] { "availabilityZones" },
ConnectionDrainingPolicy = new ConnectionDrainingPolicyProperty {
Enabled = false,
// the properties below are optional
Timeout = 123
},
ConnectionSettings = new ConnectionSettingsProperty {
IdleTimeout = 123
},
CrossZone = false,
HealthCheck = new HealthCheckProperty {
HealthyThreshold = "healthyThreshold",
Interval = "interval",
Target = "target",
Timeout = "timeout",
UnhealthyThreshold = "unhealthyThreshold"
},
Instances = new [] { "instances" },
LbCookieStickinessPolicy = new [] { new LBCookieStickinessPolicyProperty {
CookieExpirationPeriod = "cookieExpirationPeriod",
PolicyName = "policyName"
} },
LoadBalancerName = "loadBalancerName",
Policies = new [] { new PoliciesProperty {
Attributes = new [] { attributes },
PolicyName = "policyName",
PolicyType = "policyType",
// the properties below are optional
InstancePorts = new [] { "instancePorts" },
LoadBalancerPorts = new [] { "loadBalancerPorts" }
} },
Scheme = "scheme",
SecurityGroups = new [] { "securityGroups" },
Subnets = new [] { "subnets" },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
Synopsis
Constructors
CfnLoadBalancerProps() | Properties for defining a |
Properties
AccessLoggingPolicy | Information about where and how access logs are stored for the load balancer. |
AppCookieStickinessPolicy | Information about a policy for application-controlled session stickiness. |
AvailabilityZones | The Availability Zones for a load balancer in a default VPC. |
ConnectionDrainingPolicy | If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance. |
ConnectionSettings | If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration. |
CrossZone | If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones. |
HealthCheck | The health check settings to use when evaluating the health of your EC2 instances. |
Instances | The IDs of the instances for the load balancer. |
LbCookieStickinessPolicy | Information about a policy for duration-based session stickiness. |
Listeners | The listeners for the load balancer. You can specify at most one listener per port. |
LoadBalancerName | The name of the load balancer. |
Policies | The policies defined for your Classic Load Balancer. |
Scheme | The type of load balancer. Valid only for load balancers in a VPC. |
SecurityGroups | The security groups for the load balancer. |
Subnets | The IDs of the subnets for the load balancer. You can specify at most one subnet per Availability Zone. |
Tags | The tags associated with a load balancer. |
Constructors
CfnLoadBalancerProps()
Properties for defining a CfnLoadBalancer
.
public CfnLoadBalancerProps()
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElasticLoadBalancing;
var attributes;
var cfnLoadBalancerProps = new CfnLoadBalancerProps {
Listeners = new [] { new ListenersProperty {
InstancePort = "instancePort",
LoadBalancerPort = "loadBalancerPort",
Protocol = "protocol",
// the properties below are optional
InstanceProtocol = "instanceProtocol",
PolicyNames = new [] { "policyNames" },
SslCertificateId = "sslCertificateId"
} },
// the properties below are optional
AccessLoggingPolicy = new AccessLoggingPolicyProperty {
Enabled = false,
S3BucketName = "s3BucketName",
// the properties below are optional
EmitInterval = 123,
S3BucketPrefix = "s3BucketPrefix"
},
AppCookieStickinessPolicy = new [] { new AppCookieStickinessPolicyProperty {
CookieName = "cookieName",
PolicyName = "policyName"
} },
AvailabilityZones = new [] { "availabilityZones" },
ConnectionDrainingPolicy = new ConnectionDrainingPolicyProperty {
Enabled = false,
// the properties below are optional
Timeout = 123
},
ConnectionSettings = new ConnectionSettingsProperty {
IdleTimeout = 123
},
CrossZone = false,
HealthCheck = new HealthCheckProperty {
HealthyThreshold = "healthyThreshold",
Interval = "interval",
Target = "target",
Timeout = "timeout",
UnhealthyThreshold = "unhealthyThreshold"
},
Instances = new [] { "instances" },
LbCookieStickinessPolicy = new [] { new LBCookieStickinessPolicyProperty {
CookieExpirationPeriod = "cookieExpirationPeriod",
PolicyName = "policyName"
} },
LoadBalancerName = "loadBalancerName",
Policies = new [] { new PoliciesProperty {
Attributes = new [] { attributes },
PolicyName = "policyName",
PolicyType = "policyType",
// the properties below are optional
InstancePorts = new [] { "instancePorts" },
LoadBalancerPorts = new [] { "loadBalancerPorts" }
} },
Scheme = "scheme",
SecurityGroups = new [] { "securityGroups" },
Subnets = new [] { "subnets" },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
Properties
AccessLoggingPolicy
Information about where and how access logs are stored for the load balancer.
public object? AccessLoggingPolicy { get; set; }
Property Value
Remarks
AppCookieStickinessPolicy
Information about a policy for application-controlled session stickiness.
public object? AppCookieStickinessPolicy { get; set; }
Property Value
Remarks
AvailabilityZones
The Availability Zones for a load balancer in a default VPC.
public string[]? AvailabilityZones { get; set; }
Property Value
string[]
Remarks
For a load balancer in a nondefault VPC, specify Subnets
instead.
Update requires replacement if you did not previously specify an Availability Zone or if you are removing all Availability Zones. Otherwise, update requires no interruption.
ConnectionDrainingPolicy
If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.
public object? ConnectionDrainingPolicy { get; set; }
Property Value
Remarks
For more information, see Configure connection draining in the User Guide for Classic Load Balancers .
ConnectionSettings
If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.
public object? ConnectionSettings { get; set; }
Property Value
Remarks
By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. For more information, see Configure idle connection timeout in the User Guide for Classic Load Balancers .
CrossZone
If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.
public object? CrossZone { get; set; }
Property Value
Remarks
For more information, see Configure cross-zone load balancing in the User Guide for Classic Load Balancers .
HealthCheck
The health check settings to use when evaluating the health of your EC2 instances.
public object? HealthCheck { get; set; }
Property Value
Remarks
Update requires replacement if you did not previously specify health check settings or if you are removing the health check settings. Otherwise, update requires no interruption.
Instances
The IDs of the instances for the load balancer.
public string[]? Instances { get; set; }
Property Value
string[]
Remarks
LbCookieStickinessPolicy
Information about a policy for duration-based session stickiness.
public object? LbCookieStickinessPolicy { get; set; }
Property Value
Remarks
Listeners
The listeners for the load balancer. You can specify at most one listener per port.
public object Listeners { get; set; }
Property Value
Remarks
If you update the properties for a listener, AWS CloudFormation deletes the existing listener and creates a new one with the specified properties. While the new listener is being created, clients cannot connect to the load balancer.
LoadBalancerName
The name of the load balancer.
public string? LoadBalancerName { get; set; }
Property Value
Remarks
This name must be unique within your set of load balancers for the region.
If you don't specify a name, AWS CloudFormation generates a unique physical ID for the load balancer. For more information, see Name Type . If you specify a name, you cannot perform updates that require replacement of this resource, but you can perform other updates. To replace the resource, specify a new name.
Policies
The policies defined for your Classic Load Balancer.
public object? Policies { get; set; }
Property Value
Remarks
Specify only back-end server policies.
Scheme
The type of load balancer. Valid only for load balancers in a VPC.
public string? Scheme { get; set; }
Property Value
Remarks
If Scheme
is internet-facing
, the load balancer has a public DNS name that resolves to a public IP address.
If Scheme
is internal
, the load balancer has a public DNS name that resolves to a private IP address.
SecurityGroups
The security groups for the load balancer.
public string[]? SecurityGroups { get; set; }
Property Value
string[]
Remarks
Valid only for load balancers in a VPC.
Subnets
The IDs of the subnets for the load balancer. You can specify at most one subnet per Availability Zone.
public string[]? Subnets { get; set; }
Property Value
string[]
Remarks
Update requires replacement if you did not previously specify a subnet or if you are removing all subnets. Otherwise, update requires no interruption. To update to a different subnet in the current Availability Zone, you must first update to a subnet in a different Availability Zone, then update to the new subnet in the original Availability Zone.
Tags
The tags associated with a load balancer.
public ICfnTag[]? Tags { get; set; }
Property Value
ICfnTag[]