Skip to content
v2.274.0

ApplicationLoadBalancerProps Struct ​

Properties to define an application load balancer.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_certificatemanager as certificatemanager } from 'aws-cdk-lib';
import { aws_ecs_patterns as ecs_patterns } from 'aws-cdk-lib';
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';
import { aws_route53 as route53 } from 'aws-cdk-lib';

declare const certificate: certificatemanager.Certificate;
declare const hostedZone: route53.HostedZone;
const applicationLoadBalancerProps: ecs_patterns.ApplicationLoadBalancerProps = {
  listeners: [{
    name: 'name',

    // the properties below are optional
    certificate: certificate,
    port: 123,
    protocol: elbv2.ApplicationProtocol.HTTP,
    sslPolicy: elbv2.SslPolicy.RECOMMENDED_TLS,
  }],
  name: 'name',

  // the properties below are optional
  domainName: 'domainName',
  domainZone: hostedZone,
  idleTimeout: cdk.Duration.minutes(30),
  publicLoadBalancer: false,
};

Properties ​

domainNamestringdomain_namestrdomainNameStringDomainNamestringDomainName*string#
The domain name for the service, e.g. "api.example.com.".

Default: No domain name.

domainZoneIHostedZonedomain_zoneIHostedZonedomainZoneIHostedZoneDomainZoneIHostedZoneDomainZoneIHostedZone#
The Route53 hosted zone for the domain, e.g. "example.com.".

Default: No Route53 hosted domain zone.

idleTimeoutDurationidle_timeoutDurationidleTimeoutDurationIdleTimeoutDurationIdleTimeoutDuration#
The load balancer idle timeout, in seconds.

Default: CloudFormation sets idle timeout to 60 seconds

Can be between 1 and 4000 seconds.

Listeners (at least one listener) attached to this load balancer.
namestringnamestrnameStringNamestringName*stringrequired#
Name of the load balancer.
publicLoadBalancerbooleanpublic_load_balancerboolpublicLoadBalancerBooleanPublicLoadBalancerboolPublicLoadBalancer*bool= true#
Determines whether the Load Balancer will be internet-facing.