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.173.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f81b466f5e8585f7392c1d91dc79a19d528aa2fa727eb0cc56a08f089bc02bfd |
|
MD5 | e8d81b8fc84bfef5d0e8da2607c1392a |
|
BLAKE2b-256 | 3166285522a6ed436352317844df16325c224e35095df194aa0b4464bacbe249 |
Close
Hashes for aws_cdk.aws_elasticloadbalancing-1.173.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 188f02d2e348722086dc1ac1483fdf58e8edd0345af4e84b1b645d7e44585471 |
|
MD5 | d60b93349f80c36b82a78626d5c6a22d |
|
BLAKE2b-256 | 833966706a2b23f1ab842f087a40aad2fbb423183655abc2fb4f30aaa886a1d8 |