{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"8ef09be71ddcf7a88143179d408f2f600bea6b5e"}]},{"name":".github","children":[{"name":"ISSUE_TEMPLATE","children":[{"name":"bug_report.md","path":".github/ISSUE_TEMPLATE/bug_report.md","sha":"d2e87e27c601e423865ed660ec697082470ca60f"},{"name":"feature_request.md","path":".github/ISSUE_TEMPLATE/feature_request.md","sha":"023a33099be2336476930c96e17ff1ba5dc55348"}]},{"name":"pull_request_template.md","path":".github/pull_request_template.md","sha":"1ed18daca8d8613b91574ddd1641f2d129204f50"}]},{"name":".gitignore","path":".gitignore","sha":"fd04ff401a18d9c8595968dbbd3a9996d37b6a8b"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"605d316ff7fc0ae6e303f790b71c61a2dc31337a"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"836b55ea3e16c9adce0b816f6cad1e0cc92e6264"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","sha":"2fb126e11410f30d644f9219847f0a24a52ef4dc"},{"name":"LICENSE.txt","path":"LICENSE.txt","sha":"f4e3d9bd4717a044ed31ad847a300eee74371a78"},{"name":"README.md","path":"README.md","sha":"1237bb93ebf89e33daea0079db7970456b7f7fbe"},{"name":"examples","children":[{"name":"asg-instance-refresh","children":[{"name":"README.md","path":"examples/asg-instance-refresh/README.md","sha":"f566fae0867be0be2cecbd8ca6d20234c5cc17dc"},{"name":"with-elb","children":[{"name":"main.tf","path":"examples/asg-instance-refresh/with-elb/main.tf","sha":"4658c934f69c3bcc6e529e3076908c4a5b26c95c"},{"name":"outputs.tf","path":"examples/asg-instance-refresh/with-elb/outputs.tf","sha":"330a02ec9378c2c9c4a1423b075384f4ae3ed241"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/asg-instance-refresh/with-elb/user-data/user-data.sh","sha":"7b5fbe6f33805eb5356e9c49db9bd5b141b0816a"}]},{"name":"variables.tf","path":"examples/asg-instance-refresh/with-elb/variables.tf","sha":"2056963b26c09d4579a5a860075e4a7a3d7875e5"}]},{"name":"without-elb","children":[{"name":"main.tf","path":"examples/asg-instance-refresh/without-elb/main.tf","sha":"0eb8364f8cd879696931b628b425bb7c3cd13f6a"},{"name":"outputs.tf","path":"examples/asg-instance-refresh/without-elb/outputs.tf","sha":"c8db3c807aab3d75888c2dd039b9e81b1312a137"},{"name":"variables.tf","path":"examples/asg-instance-refresh/without-elb/variables.tf","sha":"42452d0ed062cf8afce3f23319bb5e81690d12a1"}]}]},{"name":"asg-rolling-deploy","children":[{"name":"README.md","path":"examples/asg-rolling-deploy/README.md","sha":"e49c9763fede83ef1c91c83515458afe841d8f54"},{"name":"with-elb","children":[{"name":"main.tf","path":"examples/asg-rolling-deploy/with-elb/main.tf","sha":"445aab34ac900a050ddf41dc5d79960393ec5b8e"},{"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":"variables.tf","path":"examples/asg-rolling-deploy/with-elb/variables.tf","sha":"dab89e417460b5fa2676796e945acf27803c6553"}]},{"name":"without-elb","children":[{"name":"main.tf","path":"examples/asg-rolling-deploy/without-elb/main.tf","sha":"99dae5bc480ab3ab7aff074e3c8106085f7df2a4"},{"name":"outputs.tf","path":"examples/asg-rolling-deploy/without-elb/outputs.tf","sha":"c8db3c807aab3d75888c2dd039b9e81b1312a137"},{"name":"variables.tf","path":"examples/asg-rolling-deploy/without-elb/variables.tf","sha":"1d6d2ee9904841723c7e7c29d9fe5e12e7f6fd6a"}]}]},{"name":"server-group","children":[{"name":"README.md","path":"examples/server-group/README.md","sha":"b8e402b19abbdd94693f872cea9b78d291a68c73"},{"name":"ami","children":[{"name":"server.json","path":"examples/server-group/ami/server.json","sha":"bb08fa43aa2c146a2280af4df25fabc1a39cf65f"}]},{"name":"with-alb","children":[{"name":"main.tf","path":"examples/server-group/with-alb/main.tf","sha":"92ae8fdde422666f39d4f2da00fbe40b282b10dd"},{"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":"variables.tf","path":"examples/server-group/with-alb/variables.tf","sha":"dc708850a0e1169ba4101135f6a707e79bd82850"}]},{"name":"with-elb","children":[{"name":"main.tf","path":"examples/server-group/with-elb/main.tf","sha":"19d7e7e5d766bd1d7698250e1fe07b5deedf3856"},{"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":"variables.tf","path":"examples/server-group/with-elb/variables.tf","sha":"4eb70bfff00b837c8404d044fee311b16e0e0c73"}]},{"name":"without-load-balancer","children":[{"name":"main.tf","path":"examples/server-group/without-load-balancer/main.tf","sha":"6b39aaec5cfa8bf5b3e74004857f80ae5b4ea562"},{"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":"variables.tf","path":"examples/server-group/without-load-balancer/variables.tf","sha":"0724aa38905b313165b621e7866575e0e0abdd4b"}]}]}]},{"name":"modules","children":[{"name":"asg-instance-refresh","children":[{"name":"README.md","path":"modules/asg-instance-refresh/README.md","sha":"972cfd23e4a68b4b77839549b15392eaa1fbc0a3"},{"name":"main.tf","path":"modules/asg-instance-refresh/main.tf","sha":"f585aa357e3e24a953914d4cb6ef2dcbb73455e6"},{"name":"outputs.tf","path":"modules/asg-instance-refresh/outputs.tf","sha":"5225c1f98cfc9f91411d91eae7bd692168ea8f4c"},{"name":"variables.tf","path":"modules/asg-instance-refresh/variables.tf","sha":"8e07aaf904d5341de27c4a16b53d388dd73fd107"}]},{"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":"cb93889b022ae8aee6015d2a9a3caf1e79f66c05"},{"name":"boto3-1.20.24.zip","path":"modules/asg-rolling-deploy/describe-autoscaling-group/boto3-1.20.24.zip","sha":"b4b675780634cea8a0eb06a0b0458dbb0a39385d"},{"name":"get-desired-capacity.py","path":"modules/asg-rolling-deploy/describe-autoscaling-group/get-desired-capacity.py","sha":"a980df805a4d65e77ecd1dbba5892803415c9c5b","toggled":true}],"toggled":true},{"name":"main.tf","path":"modules/asg-rolling-deploy/main.tf","sha":"df789e14a36992927f38f29679d9a900d2a210ad"},{"name":"outputs.tf","path":"modules/asg-rolling-deploy/outputs.tf","sha":"5225c1f98cfc9f91411d91eae7bd692168ea8f4c"},{"name":"variables.tf","path":"modules/asg-rolling-deploy/variables.tf","sha":"321d479f093d8abb0234197b73788580748126a7"}],"toggled":true},{"name":"server-group","children":[{"name":"README.md","path":"modules/server-group/README.md","sha":"13d133fb833f3298f4e4755ad9fe0d767a0682ad"},{"name":"main.tf","path":"modules/server-group/main.tf","sha":"c86f376ddd1cb2297d43912d3c8e9ed92c93d590"},{"name":"outputs.tf","path":"modules/server-group/outputs.tf","sha":"b5666cf3e0d9b85cbb9f13cb5d87f27b148c39f8"},{"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":"35dc0d9d154895e3ede805fcb72a7fd6ac8c7c1f"},{"name":"rolling_deployment.py","path":"modules/server-group/rolling-deploy/rolling_deployment.py","sha":"e63f3e9a2072daf9d261b739ea9b6eddb2a95f0f"}]},{"name":"variables.tf","path":"modules/server-group/variables.tf","sha":"fb6d85ed89e0dfae2c733f45022a304046ec8d24"}]}],"toggled":true},{"name":"terraform-cloud-enterprise-private-module-registry-placeholder.tf","path":"terraform-cloud-enterprise-private-module-registry-placeholder.tf","sha":"ae586c0fe830819580e1009d41a9074f16e65bed"},{"name":"test","children":[{"name":"README.md","path":"test/README.md","sha":"cfa55a38cc6fbd09a311291216eb758159973629"},{"name":"asg_instance_refresh_test.go","path":"test/asg_instance_refresh_test.go","sha":"f06793710154659b1c463cb1b5bc5a7ced72a758"},{"name":"asg_rolling_deploy_test.go","path":"test/asg_rolling_deploy_test.go","sha":"ca7bc5e7ac8b57f3eaee07f4f7417d1ab1e67cd3"},{"name":"go.mod","path":"test/go.mod","sha":"c488d295532d91884b436dc9aee62739cad6957f"},{"name":"go.sum","path":"test/go.sum","sha":"617efa8a713e3484215323f043e5a5e4930bf107"},{"name":"server_group_test.go","path":"test/server_group_test.go","sha":"7248bb6bbb54a515d8ec9363febf4b4fed90390b"},{"name":"test_helpers.go","path":"test/test_helpers.go","sha":"565d17806f226b7cbbaf58d7b3a3f3c62625d617"},{"name":"validation","children":[{"name":"validate_all_modules_and_examples_test.go","path":"test/validation/validate_all_modules_and_examples_test.go","sha":"74c928d0cbc2914e5cd708277bd857cb2375b660"}]}]}]},"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.20.24.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.20.24'</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.17.1","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."}