# Amazon Elastic Load Balancing Construct Library
<!--BEGIN STABILITY BANNER-->---
![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)
![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge)
---
<!--END STABILITY BANNER-->
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.
```python
# 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:
```python
# my_security_group: ec2.SecurityGroup
# lb: elb.LoadBalancer
lb.add_listener(
external_port=80,
allow_connections_from=[my_security_group]
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/aws/aws-cdk",
"name": "aws-cdk.aws-elasticloadbalancing",
"maintainer": "",
"docs_url": null,
"requires_python": "~=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Amazon Web Services",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/09/54/c708fdc54700bc8fa0cf42db2b7ff903c5dd0655d495672751243f0ea182/aws-cdk.aws-elasticloadbalancing-1.203.0.tar.gz",
"platform": null,
"description": "# Amazon Elastic Load Balancing Construct Library\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)\n\n![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge)\n\n---\n<!--END STABILITY BANNER-->\n\nThe `@aws-cdk/aws-elasticloadbalancing` package provides constructs for configuring\nclassic load balancers.\n\n## Configuring a Load Balancer\n\nLoad balancers send traffic to one or more AutoScalingGroups. Create a load\nbalancer, set up listeners and a health check, and supply the fleet(s) you want\nto load balance to in the `targets` property.\n\n```python\n# vpc: ec2.IVpc\n\n# my_auto_scaling_group: autoscaling.AutoScalingGroup\n\nlb = elb.LoadBalancer(self, \"LB\",\n vpc=vpc,\n internet_facing=True,\n health_check=elb.HealthCheck(\n port=80\n )\n)\nlb.add_target(my_auto_scaling_group)\nlb.add_listener(\n external_port=80\n)\n```\n\nThe load balancer allows all connections by default. If you want to change that,\npass the `allowConnectionsFrom` property while setting up the listener:\n\n```python\n# my_security_group: ec2.SecurityGroup\n# lb: elb.LoadBalancer\n\nlb.add_listener(\n external_port=80,\n allow_connections_from=[my_security_group]\n)\n```\n\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "The CDK Construct Library for AWS::ElasticLoadBalancing",
"version": "1.203.0",
"project_urls": {
"Homepage": "https://github.com/aws/aws-cdk",
"Source": "https://github.com/aws/aws-cdk.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "15e3160f855d811daa7520d177af1e8e544afdfe9fbcd70487c4e52eea6760d8",
"md5": "050f24a31d59f014e070476b2df6b483",
"sha256": "43c6215ff9902824e3823b1ba018b4c99edcb3582483a2750b58efb8c23249a9"
},
"downloads": -1,
"filename": "aws_cdk.aws_elasticloadbalancing-1.203.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "050f24a31d59f014e070476b2df6b483",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.7",
"size": 108577,
"upload_time": "2023-05-31T22:54:48",
"upload_time_iso_8601": "2023-05-31T22:54:48.721755Z",
"url": "https://files.pythonhosted.org/packages/15/e3/160f855d811daa7520d177af1e8e544afdfe9fbcd70487c4e52eea6760d8/aws_cdk.aws_elasticloadbalancing-1.203.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0954c708fdc54700bc8fa0cf42db2b7ff903c5dd0655d495672751243f0ea182",
"md5": "90a17ecabacf2fcfc6b8742b938e979a",
"sha256": "ed0b646b527eb2c939d191a103cccb97ccda0038db7acffa6e40cb350980f891"
},
"downloads": -1,
"filename": "aws-cdk.aws-elasticloadbalancing-1.203.0.tar.gz",
"has_sig": false,
"md5_digest": "90a17ecabacf2fcfc6b8742b938e979a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.7",
"size": 108535,
"upload_time": "2023-05-31T23:02:20",
"upload_time_iso_8601": "2023-05-31T23:02:20.227845Z",
"url": "https://files.pythonhosted.org/packages/09/54/c708fdc54700bc8fa0cf42db2b7ff903c5dd0655d495672751243f0ea182/aws-cdk.aws-elasticloadbalancing-1.203.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-31 23:02:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aws",
"github_project": "aws-cdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aws-cdk.aws-elasticloadbalancing"
}