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.179.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6a87873af7d1a0d8d176d8c3ef51bf06aef40192867ee61f4b82b1d382ff448 |
|
MD5 | a37122f4cd29e8add7c0916c76abcc12 |
|
BLAKE2b-256 | c9eb5668fcfefb3018512d35c2f303068b27c1155e4b52f753d9e82731152f0e |
Close
Hashes for aws_cdk.aws_elasticloadbalancing-1.179.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93187ddcfbd1c5ee8f1381d8ef20052b771caa8efa375412e88840e9d4356ee0 |
|
MD5 | 4426a413d7afbbaca34979aeee557436 |
|
BLAKE2b-256 | 0b4fea864cc0f5b453dd3bfdb863d5e65149b8cee217b29b4a9cf8d6cb6947f2 |