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.198.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90414b2d11751980a548f61002a760fdb226936bf2a50d6eaac2f3e7e332e46e |
|
MD5 | 2762a6361932e2fd7da78bfc23138726 |
|
BLAKE2b-256 | e342149ab603c46a02cd1a24c68a4402b047ecd7b0e18193d671f114d0775f54 |
Close
Hashes for aws_cdk.aws_elasticloadbalancing-1.198.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37952ee246aab259e6c22809f28fafe857d075cc6683c39bb04719aa9a69a07a |
|
MD5 | f5921a01aa7df3424498a963f95c6803 |
|
BLAKE2b-256 | 13b6f63eef43f6d06bc92a67b1a56562f0da90571b47ea4eddeb494583d9f0c9 |