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.164.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55fa92abb9aa220070437192f6748a7fa0c87d4fb3634fba5d054aa9ffa9fa3e |
|
MD5 | f515e49d52ee24020a6908ddbc190051 |
|
BLAKE2b-256 | 460922e0fa5bc5c9235228912369c4f07472034b1443406b38a15a70e94db5c8 |
Close
Hashes for aws_cdk.aws_elasticloadbalancing-1.164.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b608c4cb9459e1f69d51d040d9335ee07ab06c59283a202b5217e90f4dcf31d |
|
MD5 | b820677d48aebd49cc423501c94de248 |
|
BLAKE2b-256 | ad02c41143afeca289edd111e3d966e28940bb3cbcd6c6963ff7cfaf23a10d99 |