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.151.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce4f2745095dfd453207f749c2b7704fd664d49489b6105eae234e64e1278acc |
|
MD5 | 74d39fe502c220e6169b1468be815944 |
|
BLAKE2b-256 | e111ff019484f9e9ad838366e2cb0e86e439a240fc8616e921074a49c504a166 |
Close
Hashes for aws_cdk.aws_elasticloadbalancing-1.151.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01dedc1ef41cdcfb5be6331c1f3f56277ecf77ca6aa9f0db71789c506b74a9e1 |
|
MD5 | 29ae6cf489d1513d79627e935c58cd09 |
|
BLAKE2b-256 | bbf8f17d83476c26b83385f818a329a8a12ba9e124f7ddaa27e2db4072605cc3 |