This folder contains helper binaries used to check the status of an ECS deployment from the terraform modules. These
binaries are used to workaround the limitations of terraform in checking the successful deployment of ECS services.
Why not rely on the existing terraform deployment results?
Terraform's ECS modules simply check if the deployment of a task has been scheduled to the cluster and does not actually
check whether or not the deployment was successful. As such, you can encounter failure scenarios where the deployment
fails due to various circumstances (e.g cluster does not have enough capacity) but terraform returns a successful
status. These binaries are designed to ensure the task has actually been scheduled on the cluster and is healthy.
Available Binaries
check-ecs-service-deployment: This binary checks the status of a ECS service and verifies that the requested tasks
have been successfully scheduled on the cluster. Specifically, this binary will:
Check that the expected task definition is deployed and active on the service
[optional] Check that the ALB/NLB healthcheck is returning successfully on the service (does not work with ELB
classic)
Requirements for running
The host machine must have a valid python interpreter available in the PATH under the name python. The binary
supports python versions 2.7, 3.5, 3.6, and 3.7.
Using the check-ecs-service-deployment helper
The helper binary is intended to be used as a local exec
provisioner. The directives for the helper are already
included as part of the various terraform modules for ECS included in this repository. The helper will exit with a
failure if the ECS service fails any of the checks included with the helper, thus causing the terraform deployment to
fail. You can configure the behavior of the checks through various module options provided by the ECS service modules in
this repository. Refer to the available vars in each module for more details.
However, if you wish to run it yourself, the check-ecs-service-deployment binary has the following prerequisites:
It must be run on the host machine executing terraform.
AWS credentials must be configured on the host machine using either a credentials file or environment variables.
To run the binary, you need to pass it the name of the ECS cluster, the service to check, and the desired task
definition that is supposed to be running on the service as command line arguments:
You can also use the optional --check-timeout-seconds parameter to configure how many seconds to wait before timing
out each check and declaring that the task has failed to deploy. Note that the timeout resets after each check, so the
total timeout for the full check will by 2x this value. This will default to 600.
Additionally, you can skip the load balancer checks using the optional --no-loadbalancer parameter. This will tell the
binary to only check for the tasks to be active.
Also, if you are checking the deployment of daemon
services,
provide the --daemon-check option, which will cause the helper to validate that the task is running on all container
instances.
You can see all the available and required options via the help command for the helper:
check-ecs-service-deployment --help
Building the check-ecs-service-deployment helper
As such, the binary only needs to be built when the requirements change. You do not need to rebuild the binary for any
changes to the source files in the aws_auth_configmap_generator library.
The binary is generated using the pex utility. Pex will package
the python script with all its requirements into a single binary, that can be made to be compatible with multiple
versions of python and multiple OS platforms.
To build the binary, you will need the following:
A working python environment with both python2 and python3 setup (so that you can build binaries for both
environments)
tox and pex installed (use pip install -r dev_requirements.txt)
You can then build the binary using the helper script build.sh which will build the binary and copy it to the bin
directory for distribution.
It is recommended to use pyenv to help setup an environment with multiple python
interpreters. The latest binaries are built with the following python environment:
pyenv shell 2.7.153.5.23.6.63.7.0
Questions? Ask away.
We're here to talk about our services, answer any questions, give advice, or just to chat.
{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"313f5d0da760ea1c9f1a8d8389edd290ef48d283"}]},{"name":".gitignore","path":".gitignore","sha":"75a7f4fc360463f11aeaf0fd02f614df1856d06b"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"e31702e7720944837d9fae2e2867cb473f80f372"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"ecbeaab263c59e955b621268f161059633041e3d"},{"name":"LICENSE.txt","path":"LICENSE.txt","sha":"f4e3d9bd4717a044ed31ad847a300eee74371a78"},{"name":"README.adoc","path":"README.adoc","sha":"23da806f326a2987e6fe52280cd9e301d7b53c7d"},{"name":"_docs","children":[{"name":"ecs-architecture.png","path":"_docs/ecs-architecture.png","sha":"7caa9342bfc7ff5c74f26626a9831f22e914ff8e"},{"name":"ecs-fargate-service-icon.png","path":"_docs/ecs-fargate-service-icon.png","sha":"b8825b62a8b9170889c747320e1c79a9298c9bcb"},{"name":"ecs-icon.png","path":"_docs/ecs-icon.png","sha":"8ffdf43575d96d27ceced3d492871fa12403140e"},{"name":"ecs-service-architecture.png","path":"_docs/ecs-service-architecture.png","sha":"1bef2e6b95cb016b8e2c0219679d2d2d3ddd1769"},{"name":"ecs-service-icon.png","path":"_docs/ecs-service-icon.png","sha":"30947a9dcd3612d12ab42f40095b81a13fbaaff4"}]},{"name":"core-concepts.md","path":"core-concepts.md","sha":"816b25e1b3df74a01f2f564447c10b5ea5f5dd55"},{"name":"examples","children":[{"name":"deploy-ecs-task","children":[{"name":"README.md","path":"examples/deploy-ecs-task/README.md","sha":"5de7a89dc7a156f82c016fed690214711943bff6"},{"name":"containers","children":[{"name":"container-definitions.json","path":"examples/deploy-ecs-task/containers/container-definitions.json","sha":"1de2f83af666b622739f89debacc7c7faed35a08"}]},{"name":"main.tf","path":"examples/deploy-ecs-task/main.tf","sha":"8330cd508f1cdc0d55691636c353b43d0cfa0170"},{"name":"outputs.tf","path":"examples/deploy-ecs-task/outputs.tf","sha":"85a778d238b0c9114b80dc532258bf447b5adcd6"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/deploy-ecs-task/user-data/user-data.sh","sha":"7b474fe788eb9581b91f5f58b0cc09d4201a2013"}]},{"name":"vars.tf","path":"examples/deploy-ecs-task/vars.tf","sha":"70a5be0fe5f10906076763b1ec4df79dccf68c34"}]},{"name":"docker-daemon-service","children":[{"name":"containers","children":[{"name":"datadog-agent-ecs.json","path":"examples/docker-daemon-service/containers/datadog-agent-ecs.json","sha":"7f8de1f4c5b716bab279112f14adf7f8dc0f6024"}]},{"name":"main.tf","path":"examples/docker-daemon-service/main.tf","sha":"94debf2a39df6e295d928c7895a581fb63d4de37"},{"name":"outputs.tf","path":"examples/docker-daemon-service/outputs.tf","sha":"2a294a1174fdc88601ebe62f9ab3dd4faf2d89fd"},{"name":"vars.tf","path":"examples/docker-daemon-service/vars.tf","sha":"820dd6293298357da998f1b34283b17d4d204b4f"}]},{"name":"docker-fargate-service-with-alb","children":[{"name":"README.md","path":"examples/docker-fargate-service-with-alb/README.md","sha":"e8754bd39b109b5b181f52596fbddef00302ea15"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-fargate-service-with-alb/containers/container-definition.json","sha":"9091667150daa61c453f31975da897f735812c7c"}]},{"name":"main.tf","path":"examples/docker-fargate-service-with-alb/main.tf","sha":"85ba5553617956971b174dabe1de3ac6b7ba2a1f"},{"name":"outputs.tf","path":"examples/docker-fargate-service-with-alb/outputs.tf","sha":"f6b5bea9f779eaaa2b792f363657e7ba326b605e"},{"name":"vars.tf","path":"examples/docker-fargate-service-with-alb/vars.tf","sha":"e8c123e3392d9dcd093283d3b78caa1812655f65"}]},{"name":"docker-fargate-service-with-efs-volume","children":[{"name":"README.md","path":"examples/docker-fargate-service-with-efs-volume/README.md","sha":"ad85406d663a5f4429cf568ba13c781c6c0090fc"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-fargate-service-with-efs-volume/containers/container-definition.json","sha":"0b6cb6d9e9ab8eec112e6120b6eb4def8c94ef35"}]},{"name":"main.tf","path":"examples/docker-fargate-service-with-efs-volume/main.tf","sha":"b99a32abd3399225d816715200ea68ffcbeb1a4e"},{"name":"outputs.tf","path":"examples/docker-fargate-service-with-efs-volume/outputs.tf","sha":"2a10149cd88dc1b73415185c4aaa3ade4bf879bb"},{"name":"vars.tf","path":"examples/docker-fargate-service-with-efs-volume/vars.tf","sha":"112e34fa0892d613126d7b7f5f4acd5d09fba0e1"}]},{"name":"docker-fargate-service-with-nlb","children":[{"name":"README.md","path":"examples/docker-fargate-service-with-nlb/README.md","sha":"d064e28aebebd7606143feb8e46584f8667c9136"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-fargate-service-with-nlb/containers/container-definition.json","sha":"083fca39166d4b8f243e66cb96f6aa9fad72cbe6"}]},{"name":"main.tf","path":"examples/docker-fargate-service-with-nlb/main.tf","sha":"d5165219999482530d2a3dd46bdea08fc2743726"},{"name":"outputs.tf","path":"examples/docker-fargate-service-with-nlb/outputs.tf","sha":"cd3a662c0a122b9bc276ebe207956b84ca203f31"},{"name":"vars.tf","path":"examples/docker-fargate-service-with-nlb/vars.tf","sha":"79ea2304ef0b31aec2925753e493a2bef0555b8b"}]},{"name":"docker-fargate-service-without-lb","children":[{"name":"README.md","path":"examples/docker-fargate-service-without-lb/README.md","sha":"fb5e52151d29936dd194ef319fc8f3dda277b26c"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-fargate-service-without-lb/containers/container-definition.json","sha":"205833de7c0eabb367be2b16406cd12455d8e94e"}]},{"name":"main.tf","path":"examples/docker-fargate-service-without-lb/main.tf","sha":"51fdf3221a73c8d922943520602bf9a73c5df4ca"},{"name":"outputs.tf","path":"examples/docker-fargate-service-without-lb/outputs.tf","sha":"2a10149cd88dc1b73415185c4aaa3ade4bf879bb"},{"name":"vars.tf","path":"examples/docker-fargate-service-without-lb/vars.tf","sha":"833fd1fcafbf09d0d011e6ddcf46b48a554f0eb0"}]},{"name":"docker-fargate-spot-service-with-alb","children":[{"name":"README.md","path":"examples/docker-fargate-spot-service-with-alb/README.md","sha":"e1911050a7716c9148817d390d640e53a4e979c2"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-fargate-spot-service-with-alb/containers/container-definition.json","sha":"9091667150daa61c453f31975da897f735812c7c"}]},{"name":"main.tf","path":"examples/docker-fargate-spot-service-with-alb/main.tf","sha":"13e8ef4d1cec6aa978a181bc8d59dc97d786e8f3"},{"name":"outputs.tf","path":"examples/docker-fargate-spot-service-with-alb/outputs.tf","sha":"f6b5bea9f779eaaa2b792f363657e7ba326b605e"},{"name":"vars.tf","path":"examples/docker-fargate-spot-service-with-alb/vars.tf","sha":"4d10332b87159c66947e5cc9c5e3c01a0d1cf386"}]},{"name":"docker-service-with-alb-and-nlb","children":[{"name":"README.md","path":"examples/docker-service-with-alb-and-nlb/README.md","sha":"d8515f6083fb03e819d8bbf570396b500c128983"},{"name":"main.tf","path":"examples/docker-service-with-alb-and-nlb/main.tf","sha":"596231b84ef32c643bd55a9ab292f0ade651ecd0"},{"name":"outputs.tf","path":"examples/docker-service-with-alb-and-nlb/outputs.tf","sha":"4dc100d16915fb67a46359048d1a369aea150db6"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-with-alb-and-nlb/user-data/user-data.sh","sha":"5ed91084021a44a3678872771365e574ef7f40c9"}]},{"name":"vars.tf","path":"examples/docker-service-with-alb-and-nlb/vars.tf","sha":"402938bdd18823d212db48fa56bdad9504a11425"}]},{"name":"docker-service-with-alb-autoscaling","children":[{"name":"README.md","path":"examples/docker-service-with-alb-autoscaling/README.md","sha":"8ef7623bdc0058639976fed36e2540763aafac95"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-service-with-alb-autoscaling/containers/container-definition.json","sha":"4e28c983a3050ab7a18fd3e9d9ac4730bd9b285e"}]},{"name":"main.tf","path":"examples/docker-service-with-alb-autoscaling/main.tf","sha":"86e2bfcbd6653a7f42f1a69798be7f2ab197376d"},{"name":"outputs.tf","path":"examples/docker-service-with-alb-autoscaling/outputs.tf","sha":"2d96077e349d62d3e60a0eea34529ceb33e4da52"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-with-alb-autoscaling/user-data/user-data.sh","sha":"5ed91084021a44a3678872771365e574ef7f40c9"}]},{"name":"vars.tf","path":"examples/docker-service-with-alb-autoscaling/vars.tf","sha":"18c248f34f93e2bd896c69a2ff1b89df36a9513e"}]},{"name":"docker-service-with-alb-canary","children":[{"name":"README.md","path":"examples/docker-service-with-alb-canary/README.md","sha":"d0036aaa886915db2ba8976fd7e21486f111e11c"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-service-with-alb-canary/containers/container-definition.json","sha":"4e28c983a3050ab7a18fd3e9d9ac4730bd9b285e"}]},{"name":"main.tf","path":"examples/docker-service-with-alb-canary/main.tf","sha":"84fb1d4e9c321f60dcb716fd22d49ddf489d5fe8"},{"name":"outputs.tf","path":"examples/docker-service-with-alb-canary/outputs.tf","sha":"2d96077e349d62d3e60a0eea34529ceb33e4da52"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-with-alb-canary/user-data/user-data.sh","sha":"5ed91084021a44a3678872771365e574ef7f40c9"}]},{"name":"vars.tf","path":"examples/docker-service-with-alb-canary/vars.tf","sha":"57788ff3bef9deb283cb77c8b29e5c3a321faa88"}]},{"name":"docker-service-with-alb","children":[{"name":"README.md","path":"examples/docker-service-with-alb/README.md","sha":"589149955be5732eb79a478aed058fc632dc371c"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-service-with-alb/containers/container-definition.json","sha":"4a3a2851994cdf389b9a3a9a0bb324981f0d4d59"}]},{"name":"main.tf","path":"examples/docker-service-with-alb/main.tf","sha":"00a62764844d469d5bf3076ac1aa2ea397d0764e"},{"name":"outputs.tf","path":"examples/docker-service-with-alb/outputs.tf","sha":"5ca6edc9e60ae3bfb6ef13003fe8236ebbb39821"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-with-alb/user-data/user-data.sh","sha":"5ed91084021a44a3678872771365e574ef7f40c9"}]},{"name":"vars.tf","path":"examples/docker-service-with-alb/vars.tf","sha":"1899eddd5d6d51101c95d4f64f16367ca08d3fcc"}]},{"name":"docker-service-with-autoscaling","children":[{"name":"README.md","path":"examples/docker-service-with-autoscaling/README.md","sha":"a57a30c7214f71ffc08650301d46a2ea973aa1ba"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-service-with-autoscaling/containers/container-definition.json","sha":"ddcd10cc00465f84a8ce9eb7d937f1cc648bfa7b"}]},{"name":"main.tf","path":"examples/docker-service-with-autoscaling/main.tf","sha":"7c65bc0e6b37bae56b4cad854307cee407d75d44"},{"name":"outputs.tf","path":"examples/docker-service-with-autoscaling/outputs.tf","sha":"c30e145beded6bc152c3e290c6230b31cb89ff71"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-with-autoscaling/user-data/user-data.sh","sha":"5ed91084021a44a3678872771365e574ef7f40c9"}]},{"name":"vars.tf","path":"examples/docker-service-with-autoscaling/vars.tf","sha":"1be3144d0d4b2539239ec5d6d4882eb0f3c07c3f"}]},{"name":"docker-service-with-canary-deployment","children":[{"name":"README.md","path":"examples/docker-service-with-canary-deployment/README.md","sha":"2eeccfce1d53f5bc3b12fffaa830538a78400cd7"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-service-with-canary-deployment/containers/container-definition.json","sha":"ddcd10cc00465f84a8ce9eb7d937f1cc648bfa7b"}]},{"name":"main.tf","path":"examples/docker-service-with-canary-deployment/main.tf","sha":"3ba1da90f296f87cf4b5cf18c6cf5e1ff3f132cd"},{"name":"outputs.tf","path":"examples/docker-service-with-canary-deployment/outputs.tf","sha":"c30e145beded6bc152c3e290c6230b31cb89ff71"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-with-canary-deployment/user-data/user-data.sh","sha":"5ed91084021a44a3678872771365e574ef7f40c9"}]},{"name":"vars.tf","path":"examples/docker-service-with-canary-deployment/vars.tf","sha":"813e14d8e563ad9e5e91ff64f22a144514c7d1a7"}]},{"name":"docker-service-with-elb","children":[{"name":"README.md","path":"examples/docker-service-with-elb/README.md","sha":"f22cb6c52c7e991992c9cf7683a5f71d60c904ae"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-service-with-elb/containers/container-definition.json","sha":"ddcd10cc00465f84a8ce9eb7d937f1cc648bfa7b"}]},{"name":"main.tf","path":"examples/docker-service-with-elb/main.tf","sha":"1687e6fff0ab3c95d3f5e6669f77e9d3c6a489cd"},{"name":"outputs.tf","path":"examples/docker-service-with-elb/outputs.tf","sha":"9e06fbf3bd18efdea1c96669b89cf69ddbc69f39"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-with-elb/user-data/user-data.sh","sha":"83a55d65d90492a33029e246ecd0ca9046a4e27d"}]},{"name":"vars.tf","path":"examples/docker-service-with-elb/vars.tf","sha":"89d55cedb7ba91daed4d64e98fb129fb97ccd33b"}]},{"name":"docker-service-with-private-discovery","children":[{"name":"README.md","path":"examples/docker-service-with-private-discovery/README.md","sha":"03c1d0863e05e6be054b9f8ae83ddc236ecc4c0f"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-service-with-private-discovery/containers/container-definition.json","sha":"d5beb20e8e729d072992009ac38fe67018ef684a"}]},{"name":"main.tf","path":"examples/docker-service-with-private-discovery/main.tf","sha":"dea7be52a24c1a0e69bda19852d12133986b8c63"},{"name":"outputs.tf","path":"examples/docker-service-with-private-discovery/outputs.tf","sha":"ac153ce17150d268fb0567f0ba66cabce6daf63f"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-with-private-discovery/user-data/user-data.sh","sha":"7b474fe788eb9581b91f5f58b0cc09d4201a2013"}]},{"name":"vars.tf","path":"examples/docker-service-with-private-discovery/vars.tf","sha":"dc7faeb68bb8f6b9d002cc0ee1d75459fe4cd324"}]},{"name":"docker-service-with-public-discovery","children":[{"name":"README.md","path":"examples/docker-service-with-public-discovery/README.md","sha":"d7d87171441af601b8a554b3de49fc87b7fd0772"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-service-with-public-discovery/containers/container-definition.json","sha":"d5beb20e8e729d072992009ac38fe67018ef684a"}]},{"name":"main.tf","path":"examples/docker-service-with-public-discovery/main.tf","sha":"e615e9a697e96359a13d8ea019c5862e5ba4dd58"},{"name":"outputs.tf","path":"examples/docker-service-with-public-discovery/outputs.tf","sha":"ac153ce17150d268fb0567f0ba66cabce6daf63f"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-with-public-discovery/user-data/user-data.sh","sha":"7b474fe788eb9581b91f5f58b0cc09d4201a2013"}]},{"name":"vars.tf","path":"examples/docker-service-with-public-discovery/vars.tf","sha":"59e7cc6a095de1bf8fefa19c7eb918964fca1610"}]},{"name":"docker-service-without-elb","children":[{"name":"README.md","path":"examples/docker-service-without-elb/README.md","sha":"178a8376a2225be3c9d760f26c72e46841e0c2b7"},{"name":"containers","children":[{"name":"container-definition.json","path":"examples/docker-service-without-elb/containers/container-definition.json","sha":"ddcd10cc00465f84a8ce9eb7d937f1cc648bfa7b"}]},{"name":"main.tf","path":"examples/docker-service-without-elb/main.tf","sha":"74285ad9ad2114bcbe022b73a5d17948fa5e567a"},{"name":"outputs.tf","path":"examples/docker-service-without-elb/outputs.tf","sha":"ca3a10bee0379ce40a82d45806fa72350f5ae641"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-service-without-elb/user-data/user-data.sh","sha":"5ed91084021a44a3678872771365e574ef7f40c9"}]},{"name":"vars.tf","path":"examples/docker-service-without-elb/vars.tf","sha":"0663828c7959ea063a544f60ce1996e6b6203728"}]},{"name":"docker-vpc-service-with-alb","children":[{"name":"README.md","path":"examples/docker-vpc-service-with-alb/README.md","sha":"98fe3719c813f4920bcd12deed96520468048da7"},{"name":"main.tf","path":"examples/docker-vpc-service-with-alb/main.tf","sha":"97261905fa422cb953ee1ff8c03a2fc90f627dd0"},{"name":"outputs.tf","path":"examples/docker-vpc-service-with-alb/outputs.tf","sha":"c5b02eee222895f5c56fcac0e0d42a04fa3cf08f"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/docker-vpc-service-with-alb/user-data/user-data.sh","sha":"5ed91084021a44a3678872771365e574ef7f40c9"}]},{"name":"vars.tf","path":"examples/docker-vpc-service-with-alb/vars.tf","sha":"7db799cde779942474d1612279f99bad4ca85a2f"}]},{"name":"example-docker-image","children":[{"name":"Dockerfile","path":"examples/example-docker-image/Dockerfile","sha":"f2d4b71ade7473254eb2af4bc49f4e0088e4f77b"},{"name":"README.md","path":"examples/example-docker-image/README.md","sha":"272b6c12cad7ba326582bfca11fce195912021c4"},{"name":"server.js","path":"examples/example-docker-image/server.js","sha":"965b6a2342144bac9559d1328c09f64f31fb4501"}]},{"name":"example-ecs-instance-ami","children":[{"name":"README.md","path":"examples/example-ecs-instance-ami/README.md","sha":"0a239a9c1d5aa7e1a889d40650fbed1cb14f8e8a"},{"name":"build.json","path":"examples/example-ecs-instance-ami/build.json","sha":"0fad38e38b2c103c58c343fff2e4de931ed03e1b"}]},{"name":"example-vpc","children":[{"name":"README.md","path":"examples/example-vpc/README.md","sha":"f938024fd49977302bcb7982a0b7e9049574a78d"},{"name":"main.tf","path":"examples/example-vpc/main.tf","sha":"b912eb78ad446235d9d9e289143e6471cc8de06f"},{"name":"outputs.tf","path":"examples/example-vpc/outputs.tf","sha":"29fe3a59a33e3648c3cdf0afbcc6b7224e1b81ea"},{"name":"vars.tf","path":"examples/example-vpc/vars.tf","sha":"668e867d5bc0938a092cc35a52093d05ede78cfe"}]}]},{"name":"modules","children":[{"name":"ecs-cluster","children":[{"name":"README.md","path":"modules/ecs-cluster/README.md","sha":"a75309127342c6204cb8daf9b4ffc94d78a21ce8"},{"name":"main.tf","path":"modules/ecs-cluster/main.tf","sha":"91934a8bf73f6924f2b121f3b949686b23fab9d6"},{"name":"outputs.tf","path":"modules/ecs-cluster/outputs.tf","sha":"055e5a2894d9bc994625d6004051404615932c7e"},{"name":"roll-out-ecs-cluster-update.py","path":"modules/ecs-cluster/roll-out-ecs-cluster-update.py","sha":"45943e2c81e886d64eb0b437183a52b87466efd2"},{"name":"shut-down-container-instances.py","path":"modules/ecs-cluster/shut-down-container-instances.py","sha":"c82c24df75e37164224e0198abe0aad2ba2bb734"},{"name":"vars.tf","path":"modules/ecs-cluster/vars.tf","sha":"b4ba8331ef0cbdc843edb647d6aacc54e1adc450"}]},{"name":"ecs-daemon-service","children":[{"name":"README.md","path":"modules/ecs-daemon-service/README.md","sha":"93e576a1648fab47ad7b6bb013140f361d19c5ba"},{"name":"main.tf","path":"modules/ecs-daemon-service/main.tf","sha":"8bb8aa0aec48c107f10a971eeb20fc207be3b4b1"},{"name":"outputs.tf","path":"modules/ecs-daemon-service/outputs.tf","sha":"b14be6c2f9498c05be9d3843437940b933b3b669"},{"name":"vars.tf","path":"modules/ecs-daemon-service/vars.tf","sha":"b2fd15f5b7ee84eed36100cfbadd0aa672229a7d"}]},{"name":"ecs-deploy-check-binaries","children":[{"name":"README.md","path":"modules/ecs-deploy-check-binaries/README.md","sha":"5f819dfaab1a1fe16f29314a2117cd14fcb4bb33","toggled":true},{"name":"bin","children":[{"name":"check-ecs-service-deployment","path":"modules/ecs-deploy-check-binaries/bin/check-ecs-service-deployment","sha":"b162ec0c95bd1260995ccc383b89fb1528086d65"},{"name":"check_ecs_service_deployment_env.pex","path":"modules/ecs-deploy-check-binaries/bin/check_ecs_service_deployment_env.pex","sha":"089742e3c1d2b6d38c953adb7f66606858fd4ec1"},{"name":"entrypoint.py","path":"modules/ecs-deploy-check-binaries/bin/entrypoint.py","sha":"09af8e557b93844ce66a028e594b885498eef99c"}]},{"name":"build.sh","path":"modules/ecs-deploy-check-binaries/build.sh","sha":"c4195f1c571a197e2a40b46e8a5896080aa0c260"},{"name":"check_ecs_service_deployment","children":[{"name":"__init__.py","path":"modules/ecs-deploy-check-binaries/check_ecs_service_deployment/__init__.py","sha":"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"},{"name":"checker","children":[{"name":"__init__.py","path":"modules/ecs-deploy-check-binaries/check_ecs_service_deployment/checker/__init__.py","sha":"b3604eaedc6d77c18dd31a282af88377b642073d"},{"name":"active_tasks_checker.py","path":"modules/ecs-deploy-check-binaries/check_ecs_service_deployment/checker/active_tasks_checker.py","sha":"5aa07c2ef3265ecdd3396be3eca962dfed893975"},{"name":"base.py","path":"modules/ecs-deploy-check-binaries/check_ecs_service_deployment/checker/base.py","sha":"b43e7a9f8989b2b6ec9c428c02b7129146c03c9e"},{"name":"daemon_service_checker.py","path":"modules/ecs-deploy-check-binaries/check_ecs_service_deployment/checker/daemon_service_checker.py","sha":"2843fa595ebfb6137601051d3c5183727605c6ad"},{"name":"loadbalancer_checker.py","path":"modules/ecs-deploy-check-binaries/check_ecs_service_deployment/checker/loadbalancer_checker.py","sha":"54070f4b438a48ded5be35753fbc7469caff3cc0"}]},{"name":"exceptions.py","path":"modules/ecs-deploy-check-binaries/check_ecs_service_deployment/exceptions.py","sha":"12ef9651649f2c99ac6cba7a54314a8da197a2b3"},{"name":"utils.py","path":"modules/ecs-deploy-check-binaries/check_ecs_service_deployment/utils.py","sha":"d37d04f0265fe0a6a1faa0bad67358d4c21dc2ac"}]},{"name":"dev_requirements.txt","path":"modules/ecs-deploy-check-binaries/dev_requirements.txt","sha":"923be60db2d99bbeefbedf796478539f78712828"},{"name":"requirements.txt","path":"modules/ecs-deploy-check-binaries/requirements.txt","sha":"1b1257ceb0ad6adb051fe8a2c90392bd93d24a29"}],"toggled":true},{"name":"ecs-deploy","children":[{"name":"README.md","path":"modules/ecs-deploy/README.md","sha":"944a7f354a20ab2abde6ef87c5f49f0d855cb61e"},{"name":"bin","children":[{"name":"run-ecs-task","path":"modules/ecs-deploy/bin/run-ecs-task","sha":"a7cd4f0a8cd2240876f43489b3006da7e3425cf1"}]},{"name":"install.sh","path":"modules/ecs-deploy/install.sh","sha":"c322bebba62fd5a63e7bcb73010f9a52da1137f1"}]},{"name":"ecs-fargate","children":[{"name":"README.md","path":"modules/ecs-fargate/README.md","sha":"3eae9218a5c3fb18d3a4dd45f136df25052a93d9"}]},{"name":"ecs-scripts","children":[{"name":"README.md","path":"modules/ecs-scripts/README.md","sha":"e9b328ebda60d1f5ffcec85a02321af3c4e327a8"},{"name":"bin","children":[{"name":"configure-ecs-instance","path":"modules/ecs-scripts/bin/configure-ecs-instance","sha":"8822c5f57e659895599c2b2ee30f722ffe6e24da"}]},{"name":"install.sh","path":"modules/ecs-scripts/install.sh","sha":"927760f5584ad2019b0ff31424ba8853a27aeffc"}]},{"name":"ecs-service-with-alb","children":[{"name":"README.md","path":"modules/ecs-service-with-alb/README.md","sha":"38c07b1b20f9dbf22479651763535225e716a28c"}]},{"name":"ecs-service-with-discovery","children":[{"name":"README.md","path":"modules/ecs-service-with-discovery/README.md","sha":"fe9dc7350327371959dacddf0471067f8ddbc42b"}]},{"name":"ecs-service","children":[{"name":"README-ECS-Fargate.adoc","path":"modules/ecs-service/README-ECS-Fargate.adoc","sha":"06c828c343a03aaa8fe84a291c8eeb0ce31d1669"},{"name":"README.adoc","path":"modules/ecs-service/README.adoc","sha":"83b65fcebde217f15dd2f2459f847881cccf799b"},{"name":"auto_scaling.tf","path":"modules/ecs-service/auto_scaling.tf","sha":"76aef0cace989a2adfaa458c302f2557833d1644"},{"name":"core-concepts.md","path":"modules/ecs-service/core-concepts.md","sha":"0a64bd6dcbac710eead45984eb55f45f86a1ad6e"},{"name":"deployment_check.tf","path":"modules/ecs-service/deployment_check.tf","sha":"cf5a982a1804588fdab1fe78d6028e806f97b006"},{"name":"elb.tf","path":"modules/ecs-service/elb.tf","sha":"8ef617a50c25285bb85578c79ed72ec1b4ab1e04"},{"name":"main.tf","path":"modules/ecs-service/main.tf","sha":"abe9cc02803a91a3076ebecedd767bb6bba84a2c"},{"name":"outputs.tf","path":"modules/ecs-service/outputs.tf","sha":"a93ac14a8866b5e4dbdecd368ef9164233099d7b"},{"name":"service_discovery.tf","path":"modules/ecs-service/service_discovery.tf","sha":"27096ac9b2593fdd4b78dc548ddfb05d0f26c10c"},{"name":"task_definition.tf","path":"modules/ecs-service/task_definition.tf","sha":"87cb1371b203f40f0be252e93b8ecfc33fbdc51c"},{"name":"vars.tf","path":"modules/ecs-service/vars.tf","sha":"f4fb3501c01e0467a210599103b410c8fb3464cf"}]}],"toggled":true},{"name":"setup.cfg","path":"setup.cfg","sha":"6deafc261704e20369c0983af88042e502ae4880"},{"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":"b830ee03876dc0fc207b0c0fc9a72d83013ec6f1"},{"name":"deploy_ecs_task_test.go","path":"test/deploy_ecs_task_test.go","sha":"91d7affaa394f2ba1751b5ecdd274d234effdc1b"},{"name":"docker_daemon_service_test.go","path":"test/docker_daemon_service_test.go","sha":"f473ce8d4ae6f9630bac968e4feb4b42bc8692ce"},{"name":"docker_ec2_service_test.go","path":"test/docker_ec2_service_test.go","sha":"c8e319913e0ef9de3c25cf222001ee9f57969cb9"},{"name":"docker_fargate_service_alb_deployment_check_fail_by_container_test.go","path":"test/docker_fargate_service_alb_deployment_check_fail_by_container_test.go","sha":"b2e4eef2e3868262d653766927ce2da384a3bb28"},{"name":"docker_fargate_service_nlb_deployment_check_fail_by_container_test.go","path":"test/docker_fargate_service_nlb_deployment_check_fail_by_container_test.go","sha":"e2ee6b72b7400b344dadca3e26a0812a20457f57"},{"name":"docker_fargate_service_with_alb_test.go","path":"test/docker_fargate_service_with_alb_test.go","sha":"a2caf9f5032f3277738a1942cf579153f11a1019"},{"name":"docker_fargate_service_with_efs_volume_test.go","path":"test/docker_fargate_service_with_efs_volume_test.go","sha":"c0f5b4813746155894d2e46e9e2f2859b299d4c3"},{"name":"docker_fargate_service_with_nlb_test.go","path":"test/docker_fargate_service_with_nlb_test.go","sha":"5d131171b14d01898c51e46e232b46b5baf74468"},{"name":"docker_fargate_service_without_lb_deployment_check_fail_by_container_test.go","path":"test/docker_fargate_service_without_lb_deployment_check_fail_by_container_test.go","sha":"79cc5d902515349ecded94ce243ba5389e43dfe3"},{"name":"docker_fargate_service_without_lb_test.go","path":"test/docker_fargate_service_without_lb_test.go","sha":"dd8fcff52d2eed7b22834aa719b7554bda6961ac"},{"name":"docker_fargate_spot_service_with_alb_test.go","path":"test/docker_fargate_spot_service_with_alb_test.go","sha":"6385cf0ac387e00144eebf38cbaaef01aae70fd4"},{"name":"docker_service_failure_testing_utils.go","path":"test/docker_service_failure_testing_utils.go","sha":"69a9c18c777338e1b5a06e8d73f4aa60b5778311"},{"name":"docker_service_utils.go","path":"test/docker_service_utils.go","sha":"23bdf26f43f647511975409b0bf16c96aaa9998d"},{"name":"docker_service_with_alb_and_nlb_test.go","path":"test/docker_service_with_alb_and_nlb_test.go","sha":"70e277c15fbbfa65ac5e61f4dd62e6d4f64229dc"},{"name":"docker_service_with_alb_deployment_check_fail_test.go","path":"test/docker_service_with_alb_deployment_check_fail_test.go","sha":"48f080527c283b42b0b5862c26e9c3828944bc28"},{"name":"docker_service_with_alb_test.go","path":"test/docker_service_with_alb_test.go","sha":"634d085812ab6e6d3223e10bd4afd7109c46ae7a"},{"name":"docker_service_with_autoscaling_deployment_check_fail_test.go","path":"test/docker_service_with_autoscaling_deployment_check_fail_test.go","sha":"db5993b87be2d0ff27c0cd651ad572d5d0f3c148"},{"name":"docker_service_with_autoscaling_test.go","path":"test/docker_service_with_autoscaling_test.go","sha":"719259060d0b51b32ba7082ed3a3305a04a1866c"},{"name":"docker_service_with_canary_deployment_check_fail_test.go","path":"test/docker_service_with_canary_deployment_check_fail_test.go","sha":"5b4f15526e137093db9599d4aee271d4cbe8665e"},{"name":"docker_service_with_canary_deployment_test.go","path":"test/docker_service_with_canary_deployment_test.go","sha":"0be33636188c5c2a1b27409d4f7576f2607e8501"},{"name":"docker_service_with_discovery_check_fail_test.go","path":"test/docker_service_with_discovery_check_fail_test.go","sha":"16ed1d879885c6b08389646e6978d4310a03630a"},{"name":"docker_service_with_discovery_test.go","path":"test/docker_service_with_discovery_test.go","sha":"1bb23ee2db08a16e8ec5d8d1159f6701456a8b43"},{"name":"docker_service_with_elb_deployment_check_fail_test.go","path":"test/docker_service_with_elb_deployment_check_fail_test.go","sha":"7511d8951bdd002d75f4fa0b0d1744edbd30f536"},{"name":"docker_service_with_elb_test.go","path":"test/docker_service_with_elb_test.go","sha":"abc9255d4d487375e47d44356b23a78fa4b66a56"},{"name":"docker_service_without_elb_deployment_check_fail_test.go","path":"test/docker_service_without_elb_deployment_check_fail_test.go","sha":"b60ee57bab6a76516fcddb081ebb53a687a396a7"},{"name":"docker_service_without_elb_test.go","path":"test/docker_service_without_elb_test.go","sha":"9b68c410ac075c3bdbeae908ee58e3e13941062b"},{"name":"docker_vpc_service_with_alb_test.go","path":"test/docker_vpc_service_with_alb_test.go","sha":"704aa7bb81da759322ec60963328861891565eae"},{"name":"ec2_amazon_linux2_test.go","path":"test/ec2_amazon_linux2_test.go","sha":"8d34c658442be08dce0fff2ddf2e2ec4a326cd9c"},{"name":"go.mod","path":"test/go.mod","sha":"871c4555bbc6040bb42fa470ea951c7bf8b08a0a"},{"name":"go.sum","path":"test/go.sum","sha":"0662887fd7cabc516f0badd3c51cc3a4f99c8f32"},{"name":"script_tests","children":[{"name":"executor.sh","path":"test/script_tests/executor.sh","sha":"dedf71d5d3120275daa4df86b8a91c85b58a66b6"},{"name":"requirements.txt","path":"test/script_tests/requirements.txt","sha":"d1d1278133fea59fee5fc14c2a5db35c99bd6fe1"},{"name":"test_check_ecs_service_deployment.py","path":"test/script_tests/test_check_ecs_service_deployment.py","sha":"daabc761bdaeaf467cbfbca0cb2d91efb3179c4a"},{"name":"tox.ini","path":"test/script_tests/tox.ini","sha":"13e2809ee4d66cf9f05f0f3e18633ffe3114aac2"}]},{"name":"terratest_options.go","path":"test/terratest_options.go","sha":"4abf7ffc069e07905c137526fce02661de7d3ae2"},{"name":"test_helpers.go","path":"test/test_helpers.go","sha":"604ee0139159c582d0b35284b192f7647e319fe7"}]}]},"detailsContent":"<h1 class=\"preview__body--title\" id=\"ecs-deploy-check-scripts\">ECS Deploy Check Scripts</h1><div class=\"preview__body--border\"></div><p>This folder contains helper binaries used to check the status of an ECS deployment from the terraform modules. These\nbinaries are used to workaround the limitations of terraform in checking the successful deployment of ECS services.</p>\n<h3 class=\"preview__body--subtitle\" id=\"why-not-rely-on-the-existing-terraform-deployment-results\">Why not rely on the existing terraform deployment results?</h3>\n<p>Terraform's ECS modules simply check if the deployment of a task has been scheduled to the cluster and does not actually\ncheck whether or not the deployment was successful. As such, you can encounter failure scenarios where the deployment\nfails due to various circumstances (e.g cluster does not have enough capacity) but terraform returns a successful\nstatus. These binaries are designed to ensure the task has actually been scheduled on the cluster and is healthy.</p>\n<h2 class=\"preview__body--subtitle\" id=\"available-binaries\">Available Binaries</h2>\n<ul>\n<li>\n<p><code>check-ecs-service-deployment</code>: This binary checks the status of a ECS service and verifies that the requested tasks\nhave been successfully scheduled on the cluster. Specifically, this binary will:</p>\n<ul>\n<li>Check that the expected task definition is deployed and active on the service</li>\n<li>[optional] Check that the ALB/NLB healthcheck is returning successfully on the service (does not work with ELB\nclassic)</li>\n</ul>\n</li>\n</ul>\n<h3 class=\"preview__body--subtitle\" id=\"requirements-for-running\">Requirements for running</h3>\n<p>The host machine must have a valid python interpreter available in the <code>PATH</code> under the name <code>python</code>. The binary\nsupports python versions 2.7, 3.5, 3.6, and 3.7.</p>\n<h2 class=\"preview__body--subtitle\" id=\"using-the-check-ecs-service-deployment-helper\">Using the check-ecs-service-deployment helper</h2>\n<p>The helper binary is intended to be used as a <a href=\"https://www.terraform.io/docs/provisioners/local-exec.html\" class=\"preview__body--description--blue\" target=\"_blank\">local exec\nprovisioner</a>. The directives for the helper are already\nincluded as part of the various terraform modules for ECS included in this repository. The helper will exit with a\nfailure if the ECS service fails any of the checks included with the helper, thus causing the terraform deployment to\nfail. You can configure the behavior of the checks through various module options provided by the ECS service modules in\nthis repository. Refer to the available vars in each module for more details.</p>\n<p>However, if you wish to run it yourself, the <code>check-ecs-service-deployment</code> binary has the following prerequisites:</p>\n<ol>\n<li>It must be run on the host machine executing terraform.</li>\n<li>AWS credentials must be configured on the host machine using either a credentials file or environment variables.</li>\n</ol>\n<p>To run the binary, you need to pass it the name of the ECS cluster, the service to check, and the desired task\ndefinition that is supposed to be running on the service as command line arguments:</p>\n<pre><span class=\"hljs-comment\">check</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">ecs</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">service</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">deployment</span> --<span class=\"hljs-comment\">aws</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">region</span> <span class=\"hljs-comment\">us</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">east</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">1</span> --<span class=\"hljs-comment\">ecs</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">cluster</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">name</span> <span class=\"hljs-comment\">my</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">ecs</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">cluster</span> --<span class=\"hljs-comment\">ecs</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">service</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">name</span> <span class=\"hljs-comment\">my</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">ecs</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">service</span> --<span class=\"hljs-comment\">ecs</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">task</span><span class=\"hljs-literal\">-</span><span class=\"hljs-comment\">definition</span> <span class=\"hljs-comment\">nginx:1</span>\n</pre>\n<p>You can also use the optional <code>--check-timeout-seconds</code> parameter to configure how many seconds to wait before timing\nout each check and declaring that the task has failed to deploy. Note that the timeout resets after each check, so the\ntotal timeout for the full check will by 2x this value. This will default to 600.</p>\n<p>Additionally, you can skip the load balancer checks using the optional <code>--no-loadbalancer</code> parameter. This will tell the\nbinary to only check for the tasks to be active.</p>\n<p>Also, if you are checking the deployment of <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html#service_scheduler_daemon\" class=\"preview__body--description--blue\" target=\"_blank\">daemon\nservices</a>,\nprovide the <code>--daemon-check</code> option, which will cause the helper to validate that the task is running on all container\ninstances.</p>\n<p>You can see all the available and required options via the help command for the helper:</p>\n<pre><span class=\"hljs-keyword\">check</span>-ecs-service-deployment <span class=\"hljs-comment\">--help</span>\n</pre>\n<h2 class=\"preview__body--subtitle\" id=\"building-the-check-ecs-service-deployment-helper\">Building the check-ecs-service-deployment helper</h2>\n<p>As such, the binary only needs to be built when the requirements change. You do not need to rebuild the binary for any\nchanges to the source files in the <code>aws_auth_configmap_generator</code> library.</p>\n<p>The binary is generated using the <a href=\"https://pex.readthedocs.io/en/stable/whatispex.html\" class=\"preview__body--description--blue\" target=\"_blank\"><code>pex</code></a> utility. Pex will package\nthe python script with all its requirements into a single binary, that can be made to be compatible with multiple\nversions of python and multiple OS platforms.</p>\n<p>To build the binary, you will need the following:</p>\n<ul>\n<li>A working python environment with both python2 and python3 setup (so that you can build binaries for both\nenvironments)</li>\n<li>tox and pex installed (use <code>pip install -r dev_requirements.txt</code>)</li>\n</ul>\n<p>You can then build the binary using the helper script <code>build.sh</code> which will build the binary and copy it to the <code>bin</code>\ndirectory for distribution.</p>\n<p>It is recommended to use <a href=\"https://github.com/pyenv/pyenv\" class=\"preview__body--description--blue\" target=\"_blank\"><code>pyenv</code></a> to help setup an environment with multiple python\ninterpreters. The latest binaries are built with the following python environment:</p>\n<pre>pyenv shell <span class=\"hljs-number\">2.7</span><span class=\"hljs-number\">.15</span> <span class=\"hljs-number\">3.5</span><span class=\"hljs-number\">.2</span> <span class=\"hljs-number\">3.6</span><span class=\"hljs-number\">.6</span> <span class=\"hljs-number\">3.7</span><span class=\"hljs-number\">.0</span>\n</pre>\n","repoName":"module-ecs","repoRef":"v0.29.0","serviceDescriptor":{"serviceName":"ECS Service","serviceRepoName":"module-ecs","serviceRepoOrg":"gruntwork-io","serviceMainReadmePath":"/modules/ecs-service-with-alb","cloudProviders":["aws"],"description":"Deploy an ECS service with zero-downtime, rolling deployment, IAM Role, auto scaling, and more.","imageUrl":"ecs.png","licenseType":"subscriber","technologies":["Terraform","Python"],"compliance":[],"tags":[""]},"serviceCategoryName":"Docker services","fileName":"README.md","filePath":"/modules/ecs-deploy-check-binaries","title":"Repo Browser: ECS Service","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}