{"id":13904448,"url":"https://github.com/websterclay/chef-elb","last_synced_at":"2025-07-18T02:31:13.888Z","repository":{"id":1515183,"uuid":"1773264","full_name":"websterclay/chef-elb","owner":"websterclay","description":"Chef Cookbook for AWS ELB (Elastic Load Balancer)","archived":false,"fork":false,"pushed_at":"2011-08-24T14:13:30.000Z","size":118,"stargazers_count":26,"open_issues_count":5,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-07T23:38:51.206Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/websterclay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-19T20:27:19.000Z","updated_at":"2020-06-22T21:13:42.000Z","dependencies_parsed_at":"2022-08-16T13:35:06.240Z","dependency_job_id":null,"html_url":"https://github.com/websterclay/chef-elb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websterclay%2Fchef-elb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websterclay%2Fchef-elb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websterclay%2Fchef-elb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websterclay%2Fchef-elb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/websterclay","download_url":"https://codeload.github.com/websterclay/chef-elb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226329216,"owners_count":17607766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T23:00:54.988Z","updated_at":"2024-11-25T12:31:30.541Z","avatar_url":"https://github.com/websterclay.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"Chef Helpers\n============\n\nThis cookbook handles configuring Elastic Load Balancers at AWS\n\nInstallation\n------------\n\nThe easiest way to install this is to use [knife-github-cookbooks](https://github.com/websterclay/knife-github-cookbooks):\n\n    gem install knife-github-cookbooks\n    knife github cookbook install websterclay/chef-elb\n\nUsage\n-----\n\nThis cookbook is designed to be run on a single node in your infrastructure. I\nhave a role called the 'rooster' I assign to one node to coordinate AWS API\ncalls based on the presence of other nodes.\n\nPut `recipe[elb]` in the runlist of your coordinating node to install the\nrequired dependeicnes on that node. Then, in a recipe also in that node's\nrunlist:\n\n    # Load your AWS credentials databag\n    aws = data_bag_item(\"aws\", \"main\")\n\n    elb_load_balancer \"http-frontend\" do\n      aws_access_key        aws['aws_access_key_id']\n      aws_secret_access_key aws['aws_secret_access_key']\n      search_query          \"role:app\"\n      action :create\n    end\n\nThis will automatically create a Elastic Load Balancer that listens on port\n80 and forwards requests to all servers that match the specified search on\nport 80. You can change those defaults by specifying the `listeners`\nattribute:\n\n    elb_load_balancer \"http-frontend\" do\n      aws_access_key        aws['aws_access_key_id']\n      aws_secret_access_key aws['aws_secret_access_key']\n      search_query          \"role:app\"\n      listeners             [{\"InstancePort\" =\u003e 8080, \"Protocol\" =\u003e \"HTTP\", \"LoadBalancerPort\" =\u003e 80}]\n      action :create\n    end\n\nYou can also specify the `region` attribute to change what region the ELB is\ncreated in, or specify the `instances` manually if you don't want to use a\nsearch:\n\n    elb_load_balancer \"ap-tcp-frontend\" do\n      aws_access_key        aws['aws_access_key_id']\n      aws_secret_access_key aws['aws_secret_access_key']\n      instances             ['i-xxxxx', 'i-xxxxx']\n      region                'ap-southeast-1'\n      listeners             [{\"InstancePort\" =\u003e 1234, \"Protocol\" =\u003e \"TCP\", \"LoadBalancerPort\" =\u003e 1234}]\n      action :create\n    end\n\nYou can also do SSL, but it's a little funky.\n\nFirst, you have to [upload your cert](http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/DeveloperGuide/index.html?US_SettingUpLoadBalancerHTTPSIntegrated.html).\n\nThen setup your listeners array like so:\n\n    elb_load_balancer \"http-and-https\" do\n      aws_access_key        aws['aws_access_key_id']\n      aws_secret_access_key aws['aws_secret_access_key']\n      search_query          \"chef_environment:#{node.chef_environment} AND role:my_ssl_app\"\n      listeners             [\n        {\n          \"InstancePort\"     =\u003e 80,\n          \"Protocol\"         =\u003e \"HTTP\",\n          \"LoadBalancerPort\" =\u003e 80\n        },\n        {\n          \"InstancePort\"     =\u003e 80,\n          \"Protocol\"         =\u003e \"HTTPS\",\n          \"LoadBalancerPort\" =\u003e 443,\n          \"SSLCertificateId\" =\u003e \"arn:aws:iam::xxxxxxxx:server-certificate/YourCertName\"\n        }\n      ]\n      action :create\n    end\n\nThis resource can't [update the\ncert](http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/DeveloperGuide/index.html?US_UpdatingLoadBalancerSSL.html)\nID for you yet because of missing support in Fog - it will only do that on ELB\ncreation, but you should update it to reflect reality.\n\nCaveats\n-------\n\nThe cookbook automates determining what availability zones your instances are\nin and automatically registers the instances. ELB's distribute traffic equally\nbetween all enabled Availibity Zones. It's up to you to confirm that your \ninstance distribution is equal if you have instances on more than one AZ.\n\nResources\n---------\n\n[ELB Docs](http://aws.amazon.com/documentation/elasticloadbalancing/)\n\nAuthor\n------\n\nJesse Newland  \njesse@websterclay.com  \n@jnewland  \njnewland on freenode  \n\nLicense\n-------\n\n    Author:: Jesse Newland (\u003cjesse@websterclay.com\u003e)\n    Copyright:: Copyright (c) 2011 Webster Clay, LLC\n    License:: Apache License, Version 2.0\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebsterclay%2Fchef-elb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebsterclay%2Fchef-elb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebsterclay%2Fchef-elb/lists"}