{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"3b69f7bf481fe18ca42e8b40e0e6369d1efb4494"}]},{"name":".gitignore","path":".gitignore","sha":"62841321b0ad8768831d29e34422fafa4c24751e"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"c727e29761f9d32c212546d1c47ebc05a16b2d37"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"38e274e73edb347a7f35c6d9e84a125a2e7bb063"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","sha":"6ce0d84e615b63ee870e407c93740f491cbcd27d"},{"name":"LICENSE.txt","path":"LICENSE.txt","sha":"f4e3d9bd4717a044ed31ad847a300eee74371a78"},{"name":"README.md","path":"README.md","sha":"648489bca9cb5d56b2a29d0eabf6d5ba5e2639e3"},{"name":"examples","children":[{"name":"asg-rolling-deploy","children":[{"name":"README.md","path":"examples/asg-rolling-deploy/README.md","sha":"f5f2a8e2db00bb7c95975437ac913ef2f9769f7c"},{"name":"with-elb","children":[{"name":"main.tf","path":"examples/asg-rolling-deploy/with-elb/main.tf","sha":"28c2f0037746c32e28e3083a4518c8ff5c03870d"},{"name":"outputs.tf","path":"examples/asg-rolling-deploy/with-elb/outputs.tf","sha":"330a02ec9378c2c9c4a1423b075384f4ae3ed241"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/asg-rolling-deploy/with-elb/user-data/user-data.sh","sha":"7b5fbe6f33805eb5356e9c49db9bd5b141b0816a"}]},{"name":"vars.tf","path":"examples/asg-rolling-deploy/with-elb/vars.tf","sha":"dab89e417460b5fa2676796e945acf27803c6553"}]},{"name":"without-elb","children":[{"name":"main.tf","path":"examples/asg-rolling-deploy/without-elb/main.tf","sha":"e4591c78c05fc4178827e9291d55463320a0dea3"},{"name":"outputs.tf","path":"examples/asg-rolling-deploy/without-elb/outputs.tf","sha":"c8db3c807aab3d75888c2dd039b9e81b1312a137"},{"name":"vars.tf","path":"examples/asg-rolling-deploy/without-elb/vars.tf","sha":"1d6d2ee9904841723c7e7c29d9fe5e12e7f6fd6a"}]}]},{"name":"server-group","children":[{"name":"README.md","path":"examples/server-group/README.md","sha":"63c6917a20e10cb2b569e5314bbf3d4ec38ff491"},{"name":"ami","children":[{"name":"server.json","path":"examples/server-group/ami/server.json","sha":"8eb0e050068c94f085b4a4bf188365f5c0c45d1b"}]},{"name":"with-alb","children":[{"name":"main.tf","path":"examples/server-group/with-alb/main.tf","sha":"f911b264e56d9a465c703cd244dd82cea05ce29d"},{"name":"outputs.tf","path":"examples/server-group/with-alb/outputs.tf","sha":"3565caece2f11d61dc0b0a6ed23cc58ce7e6e61c"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/server-group/with-alb/user-data/user-data.sh","sha":"064d042a5d0ba6956f4eb8d7ece309b4d6eb4b33"}]},{"name":"vars.tf","path":"examples/server-group/with-alb/vars.tf","sha":"dc708850a0e1169ba4101135f6a707e79bd82850"}]},{"name":"with-elb","children":[{"name":"main.tf","path":"examples/server-group/with-elb/main.tf","sha":"0dcff963a4e68e846366a894c356d37c712918ae"},{"name":"outputs.tf","path":"examples/server-group/with-elb/outputs.tf","sha":"fd38915d96770f9588e2fcc79369e64449492286"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/server-group/with-elb/user-data/user-data.sh","sha":"f0b175520e85da002b8c26a4a92347fb1eaa1d13"}]},{"name":"vars.tf","path":"examples/server-group/with-elb/vars.tf","sha":"4eb70bfff00b837c8404d044fee311b16e0e0c73"}]},{"name":"without-load-balancer","children":[{"name":"main.tf","path":"examples/server-group/without-load-balancer/main.tf","sha":"70f8ee203e31736b3a87c273faae98ad0c2c1aa3"},{"name":"outputs.tf","path":"examples/server-group/without-load-balancer/outputs.tf","sha":"27911554f10688f23ba9f8e31eadd4409c635f97"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/server-group/without-load-balancer/user-data/user-data.sh","sha":"064d042a5d0ba6956f4eb8d7ece309b4d6eb4b33"}]},{"name":"vars.tf","path":"examples/server-group/without-load-balancer/vars.tf","sha":"0724aa38905b313165b621e7866575e0e0abdd4b"}]}]}]},{"name":"modules","children":[{"name":"asg-rolling-deploy","children":[{"name":"README.md","path":"modules/asg-rolling-deploy/README.md","sha":"fbbc6657f0cef2493e9fdb7b42549d69e5ff4080"},{"name":"describe-autoscaling-group","children":[{"name":"README.md","path":"modules/asg-rolling-deploy/describe-autoscaling-group/README.md","sha":"062e4ebc0b65610874998a354f441f56114b4e7e"},{"name":"boto3-1.7.10.zip","path":"modules/asg-rolling-deploy/describe-autoscaling-group/boto3-1.7.10.zip","sha":"4b76be11cfa98ddb4314e11a0b28700a11cd2fcc"},{"name":"get-desired-capacity.py","path":"modules/asg-rolling-deploy/describe-autoscaling-group/get-desired-capacity.py","sha":"c4972706f07ca0275c08bb8acbdf03e3a0e7a778","toggled":true}],"toggled":true},{"name":"main.tf","path":"modules/asg-rolling-deploy/main.tf","sha":"986f00d77f93eb2e6918b692820791451205be20"},{"name":"outputs.tf","path":"modules/asg-rolling-deploy/outputs.tf","sha":"7db73654cd55edcf3706aeb3ba4a2a0ddac8dc5b"},{"name":"vars.tf","path":"modules/asg-rolling-deploy/vars.tf","sha":"1c4052b26ddc2dc4ec71d5d1a759d201e5db9e9f"}],"toggled":true},{"name":"server-group","children":[{"name":"README.md","path":"modules/server-group/README.md","sha":"677f3bef60b5b90a1d2c32220dfd536887d7e805"},{"name":"main.tf","path":"modules/server-group/main.tf","sha":"3a9bd5e1a44f83e6a2161184f827eaf436d08ded"},{"name":"outputs.tf","path":"modules/server-group/outputs.tf","sha":"42217027f4a9807a5eae6e786b7a1cd0f6976137"},{"name":"rolling-deploy","children":[{"name":"boto3-1.7.10.zip","path":"modules/server-group/rolling-deploy/boto3-1.7.10.zip","sha":"852dcda88e4e760ce8bdb5c56823f08659959a50"},{"name":"helpers.py","path":"modules/server-group/rolling-deploy/helpers.py","sha":"cbd7f09f0877e7b18fa39e7db8dd70a7cf6eea02"},{"name":"rolling_deployment.py","path":"modules/server-group/rolling-deploy/rolling_deployment.py","sha":"e63f3e9a2072daf9d261b739ea9b6eddb2a95f0f"}]},{"name":"vars.tf","path":"modules/server-group/vars.tf","sha":"895f03d536d9922a979009284ee40dcea681944a"}]}],"toggled":true},{"name":"test","children":[{"name":"Gopkg.lock","path":"test/Gopkg.lock","sha":"936d6a18e6c09a998aa0e4acabc41edb3bb3d3c6"},{"name":"Gopkg.toml","path":"test/Gopkg.toml","sha":"006fb2dc5bc7b10c5e40bc3dc36eef626b0bc4bc"},{"name":"README.md","path":"test/README.md","sha":"cfa55a38cc6fbd09a311291216eb758159973629"},{"name":"asg_rolling_deploy_test.go","path":"test/asg_rolling_deploy_test.go","sha":"612907b131f214a1b6faa1546be8e1ff2de8b600"},{"name":"server_group_test.go","path":"test/server_group_test.go","sha":"6afc3507ab079a0143ada7dbace01d6f7339dbe5"},{"name":"test_helpers.go","path":"test/test_helpers.go","sha":"4034c4614efff195db3ca30f01301b11dcb8fd56"}]}]},"detailsContent":"<div class=\"preview__body--content\"><div><ul class=\"code__list\"><li class=\"code__item\"><span class=\"code__text\">from __future__ import print_function</span></li>\n<li class=\"code__item\"><span class=\"code__text\">import zipfile</span></li>\n<li class=\"code__item\"><span class=\"code__text\">import tempfile</span></li>\n<li class=\"code__item\"><span class=\"code__text\">import os</span></li>\n<li class=\"code__item\"><span class=\"code__text\">import logging</span></li>\n<li class=\"code__item\"><span class=\"code__text\">import time</span></li>\n<li class=\"code__item\"><span class=\"code__text\">import json</span></li>\n<li class=\"code__item\"><span class=\"code__text\"></span></li>\n<li class=\"code__item\"><span class=\"code__text\">logging.basicConfig()</span></li>\n<li class=\"code__item\"><span class=\"code__text\">logger = logging.getLogger()</span></li>\n<li class=\"code__item\"><span class=\"code__text\">logger.setLevel(logging.INFO)</span></li>\n<li class=\"code__item\"><span class=\"code__text\"></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># We can't run boto3 directly from a zip file, so we have to extract it: https://github.com/boto/boto3/issues/749</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\">current_dir = os.path.dirname(os.path.realpath(__file__))</span></li>\n<li class=\"code__item\"><span class=\"code__text\">boto3_src = os.path.join(current_dir, <span class=\"hljs-string\">'boto3-1.7.10.zip'</span>)</span></li>\n<li class=\"code__item\"><span class=\"code__text\">boto3_dest = os.path.join(tempfile.gettempdir(), <span class=\"hljs-string\">'boto3-1.7.10'</span>)</span></li>\n<li class=\"code__item\"><span class=\"code__text\">boto3_init = os.path.join(boto3_dest, <span class=\"hljs-string\">\"boto3\"</span>, <span class=\"hljs-string\">\"__init__.py\"</span>)</span></li>\n<li class=\"code__item\"><span class=\"code__text\"></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># Code below taken from: https://stackoverflow.com/a/12468091/991958</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># We may have a race condition extracting the zip archive below if several</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># processes try to extract it at the same time. Try to catch the</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># concurrency issue and swallow the exception and just retry rather than dealing</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-comment\"># with cross OS locking.</span></span></li>\n<li class=\"code__item\"><span class=\"code__text\"></span></li>\n<li class=\"code__item\"><span class=\"code__text\"><span class=\"hljs-keyword\">while</span> True:</span></li></ul></div></div>","repoName":"module-asg","repoRef":"v0.8.3","serviceDescriptor":{"serviceName":"Auto Scaling Group (stateless)","serviceRepoName":"module-asg","serviceRepoOrg":"gruntwork-io","serviceMainReadmePath":"/modules/asg-rolling-deploy","cloudProviders":["aws"],"description":"Run an Auto Scaling Group for stateless apps. Supports zero-downtime, rolling deployment, auto healing, auto scaling, and IAM Roles.","imageUrl":"auto-scaling2.png","licenseType":"subscriber","technologies":["Terraform","Python","Bash"],"compliance":[],"tags":[""]},"serviceCategoryName":"Server orchestration","fileName":"get-desired-capacity.py","filePath":"/modules/asg-rolling-deploy/describe-autoscaling-group/get-desired-capacity.py","title":"Repo Browser: Auto Scaling Group (stateless)","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}