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.186.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc9e20a3b5006513ce59f281ef17f04de407f77c54e865736d0590b81ba9565 |
|
MD5 | d433f9d3228c419ffb4981e42f066e17 |
|
BLAKE2b-256 | 288fb221db98f1e7395f9638d6c6544d2e46a5d66565fc0c7177feb49b06dc5e |
Close
Hashes for aws_cdk.aws_elasticloadbalancing-1.186.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 773f31874cdf9f22fa04b109e61e300cd7ad6d1856be570d7a62d45e41afbca1 |
|
MD5 | 68c2476c365c8782b095131003177c61 |
|
BLAKE2b-256 | 15c88757e6279cc9c599407e2e82e37b921a6ac3b6a93400667b1945e935cea2 |