The CDK Construct Library for AWS::ElasticLoadBalancing
Project description
Amazon Elastic Load Balancing Construct Library
---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
Built Distribution
Close
Hashes for aws-cdk.aws-elasticloadbalancing-1.177.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f71d2279d9bee8c80f5a4a03e6d3373ca820ac1b73c959bdfb0a9a3f9591c2b5 |
|
MD5 | 36ae9cbb33d8ac78e68be21196700342 |
|
BLAKE2b-256 | b48ec9b2be1d545adc81d7edd0bce9476578683b8f4aa8031663e371e4cb83a5 |
Close
Hashes for aws_cdk.aws_elasticloadbalancing-1.177.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9373965978e5ea4f4984241a2142259257605ecf652e15ecb4b5090f50d8807f |
|
MD5 | 2486c03eaf3dbed2bedbd581626a663a |
|
BLAKE2b-256 | c84a1d451d3db95ca9c3a05b8be2221c3e7ff3a050e790134363e805b5c4e3ec |