Skip to main content

The CDK Construct Library for AWS::ElasticLoadBalancing

Project description

Amazon Elastic Load Balancing Construct Library

---

cfn-resources: Stable

cdk-constructs: Stable


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.171.0.tar.gz (105.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

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

File metadata

File hashes

Hashes for aws-cdk.aws-elasticloadbalancing-1.171.0.tar.gz
Algorithm Hash digest
SHA256 0602a50d45921fb2252eed887d09273764fbd0293bb368ff32260d6135c29d61
MD5 4cdd44e4ac9692f322a1e08f59d8963b
BLAKE2b-256 102263d2c8d86c3e5eab3326eaf4fd145ac67dc280f467f65ad1f86a425449e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aws_cdk.aws_elasticloadbalancing-1.171.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9b75a765835c60e0c0aca259fe5701341179bced71a01e27619b1a589ac7dc3
MD5 d327618978940075576fc285456cd92f
BLAKE2b-256 3aec7cdaa45474ca91cef5b79d17647761ba714eee055804f746c471463ec133

See more details on using hashes here.

Supported by

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