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.183.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ace1d6727722ceac4746360daf0243ea8f3e80531b67d78c2f4ae04b7be4d7d2 |
|
MD5 | d566fadfe01be75a4a31074dc5d90a0a |
|
BLAKE2b-256 | db669ab299e0e33174df89562ad0e1941c3fec2be3df8cdc5b3fab2c75f69bb4 |
Close
Hashes for aws_cdk.aws_elasticloadbalancing-1.183.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 577e89cfc5d90bbb9795b9fdd8c1b09f812ada541cb154a6642e088b45e9baf0 |
|
MD5 | 1257043f5ac90c3c93c3fa78ac917cf2 |
|
BLAKE2b-256 | 8da81c75c9f6c5a7c05e276e729a15214bdb17ea5b7b8990802c6d9ba7ff78a3 |