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.154.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd696e2f44ad71da49ce1acfd81c0c9c2c955b141131cfcc9829d0cde4564551 |
|
MD5 | ce3169437f6a6775f2ac34b81aab5547 |
|
BLAKE2b-256 | 6176af98b238df0582d3df1baaeb86a42e3f76504da782db9abf20d08cf445fe |
Close
Hashes for aws_cdk.aws_elasticloadbalancing-1.154.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b55f5818bb619b7ce5691ecf621a8794c30b9b72ac34c5ee113525006a652c5 |
|
MD5 | d59fa85904627d6a955a4a2fac07950f |
|
BLAKE2b-256 | c29088c4f9c8a2ab117907446c756f1ba6794a246ef2088c865a510d0ad541c4 |