Skip to main content

The CDK Construct Library for AWS::ElasticLoadBalancing

Project description

Amazon Elastic Load Balancing Construct Library

---

End-of-Support

AWS CDK v1 has reached End-of-Support on 2023-06-01. This package is no longer being updated, and users should migrate to AWS CDK v2.

For more information on how to migrate, see the Migrating to AWS CDK v2 guide.


The @aws-cdk/aws-elasticloadbalancing package provides constructs for configuring classic load balancers.

Configuring a Load Balancer

Load balancers send traffic to one or more AutoScalingGroups. Create a load balancer, set up listeners and a health check, and supply the fleet(s) you want to load balance to in the targets property.

# vpc: ec2.IVpc

# my_auto_scaling_group: autoscaling.AutoScalingGroup

lb = elb.LoadBalancer(self, "LB",
    vpc=vpc,
    internet_facing=True,
    health_check=elb.HealthCheck(
        port=80
    )
)
lb.add_target(my_auto_scaling_group)
lb.add_listener(
    external_port=80
)

The load balancer allows all connections by default. If you want to change that, pass the allowConnectionsFrom property while setting up the listener:

# my_security_group: ec2.SecurityGroup
# lb: elb.LoadBalancer

lb.add_listener(
    external_port=80,
    allow_connections_from=[my_security_group]
)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-cdk.aws-elasticloadbalancing-1.204.0.tar.gz (109.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file aws-cdk.aws-elasticloadbalancing-1.204.0.tar.gz.

File metadata

File hashes

Hashes for aws-cdk.aws-elasticloadbalancing-1.204.0.tar.gz
Algorithm Hash digest
SHA256 0933180a702b9e28e3a2e4e3233113925571f2deb9c8f52c846ec4a6b4005303
MD5 c7affe343b9c154d231133b87f81f175
BLAKE2b-256 359ea50ae1752bda2f559b0e78972ab57284b849356e8196addfae3257d1a39e

See more details on using hashes here.

File details

Details for the file aws_cdk.aws_elasticloadbalancing-1.204.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_cdk.aws_elasticloadbalancing-1.204.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f82f10d65ee97344628cb99092ab1aa47b2c148a1b259fdd9a0e2b227c095bd7
MD5 f789da28188e839153c0273a3ce53061
BLAKE2b-256 473df4dbd23d2bb9c781b2ce96304d765a30d12fba94dd2aa48d5eb1020304a2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page