# CfnLoadBalancerProps

Properties for defining a `CfnLoadBalancer`.

Extends: CfnLoadBalancerProps
Used as props by: CfnLoadBalancer

- Source: Generated code
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticloadbalancing as elb } from 'aws-cdk-lib';

declare const attributes: any;
const cfnLoadBalancerProps: elb.CfnLoadBalancerProps = {
  listeners: [{
    instancePort: 'instancePort',
    loadBalancerPort: 'loadBalancerPort',
    protocol: 'protocol',

    // the properties below are optional
    instanceProtocol: 'instanceProtocol',
    policyNames: ['policyNames'],
    sslCertificateId: 'sslCertificateId',
  }],

  // the properties below are optional
  accessLoggingPolicy: {
    enabled: false,
    s3BucketName: 's3BucketName',

    // the properties below are optional
    emitInterval: 123,
    s3BucketPrefix: 's3BucketPrefix',
  },
  appCookieStickinessPolicy: [{
    cookieName: 'cookieName',
    policyName: 'policyName',
  }],
  availabilityZones: ['availabilityZones'],
  connectionDrainingPolicy: {
    enabled: false,

    // the properties below are optional
    timeout: 123,
  },
  connectionSettings: {
    idleTimeout: 123,
  },
  crossZone: false,
  healthCheck: {
    healthyThreshold: 'healthyThreshold',
    interval: 'interval',
    target: 'target',
    timeout: 'timeout',
    unhealthyThreshold: 'unhealthyThreshold',
  },
  instances: ['instances'],
  lbCookieStickinessPolicy: [{
    cookieExpirationPeriod: 'cookieExpirationPeriod',
    policyName: 'policyName',
  }],
  loadBalancerName: 'loadBalancerName',
  policies: [{
    attributes: [attributes],
    policyName: 'policyName',
    policyType: 'policyType',

    // the properties below are optional
    instancePorts: ['instancePorts'],
    loadBalancerPorts: ['loadBalancerPorts'],
  }],
  scheme: 'scheme',
  securityGroups: ['securityGroups'],
  subnets: ['subnets'],
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

## Properties

- `accessLoggingPolicy`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLoadBalancer.AccessLoggingPolicyProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancing.CfnLoadBalancer.AccessLoggingPolicyProperty.html) — Information about where and how access logs are stored for the load balancer.

- `appCookieStickinessPolicy`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLoadBalancer.AppCookieStickinessPolicyProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancing.CfnLoadBalancer.AppCookieStickinessPolicyProperty.html)[] — Information about a policy for application-controlled session stickiness.

- `availabilityZones`: string[] — The Availability Zones for a load balancer in a default VPC.

  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`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLoadBalancer.ConnectionDrainingPolicyProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancing.CfnLoadBalancer.ConnectionDrainingPolicyProperty.html) — If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.

  For more information, see [Configure connection draining](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) in the *User Guide for Classic Load Balancers* .

- `connectionSettings`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLoadBalancer.ConnectionSettingsProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancing.CfnLoadBalancer.ConnectionSettingsProperty.html) — If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.

  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](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) in the *User Guide for Classic Load Balancers* .

- `crossZone`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.

  For more information, see [Configure cross-zone load balancing](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) in the *User Guide for Classic Load Balancers* .

- `healthCheck`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLoadBalancer.HealthCheckProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancing.CfnLoadBalancer.HealthCheckProperty.html) — The health check settings to use when evaluating the health of your EC2 instances.

  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`: string | [IInstanceRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.IInstanceRef.html)[] — The IDs of the instances for the load balancer.

- `lbCookieStickinessPolicy`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLoadBalancer.LBCookieStickinessPolicyProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancing.CfnLoadBalancer.LBCookieStickinessPolicyProperty.html)[] — Information about a policy for duration-based session stickiness.

- `listeners`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLoadBalancer.ListenersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancing.CfnLoadBalancer.ListenersProperty.html)[] (required) — The listeners for the load balancer. You can specify at most one listener per port.

  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`: string — The name of the load balancer.

  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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) . 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`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLoadBalancer.PoliciesProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancing.CfnLoadBalancer.PoliciesProperty.html)[] — The policies defined for your Classic Load Balancer.

  Specify only back-end server policies.

- `scheme`: string — The type of load balancer. Valid only for load balancers in a VPC.

  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`: string | [ISecurityGroupRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ISecurityGroupRef.html)[] — The security groups for the load balancer.

  Valid only for load balancers in a VPC.

- `subnets`: string | [ISubnetRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ISubnetRef.html)[] — The IDs of the subnets for the load balancer. You can specify at most one subnet per Availability Zone.

  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`: [CfnTag](/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags associated with a load balancer.
