Elastic Container Service (ECS) is the official AWS solution for running Docker containers on a cluster of servers in a
fault-tolerant, scalable, and highly available way. Its primary advantage over alternatives like
Mesos and Kubernetes is that it's much easier to set up,
understand, and integrate with other AWS services. Its primary downside is that it offers less powerful options for
"scheduling" containers across different hosts.
Helpful Vocabulary
Amazon has its own vocabulary for ECS that can be confusing. Here's a helpful guide:
ECS Cluster: One or more servers (i.e. EC2 instances) that ECS can use for deploying Docker containers.
Container Instance: A single node (i.e. EC2 Instance) in an ECS Cluster.
ECS Task: One or more Docker containers that should be run as a group on a single instance.
ECS Task Definition (AKA ECS Container Definition): A JSON file that defines an ECS Task, including the
container(s) to run, the resources (memory, CPU) those containers need, the volumes to mount, the environment
variables to set, and so on.
Task Definition Revision: ECS Tasks are immutable. Once you define a Task Definition, you can never change it:
you can only create new Task Definitions, which are known as revisions. The most common revision is to change what
version of a Docker container to deploy.
ECS Service: A way to deploy and manage long-running ECS Tasks, such as a web service. The service can deploy
your Tasks across one or more instances in the ECS Cluster, restart any failed Tasks, and route traffic across your
Tasks using an optional Elastic Load Balancer.
Cluster hosting options
ECS supports hosting your docker services using either ECS container instances or Fargate.
What are ECS Container Instances?
ECS container instances are EC2 instances associated with an ECS cluster. These instances register with the cluster to
allow scheduling of Docker containers managed by ECS. This gives you control over the hosting platform used for running
your Docker containers so that you can choose how much compute or dedicated hardware to provide to your containers.
What is Fargate?
Fargate is a technology for Amazon ECS that allows you to run containers without having to manage servers or clusters. With AWS Fargate, you no longer have to provision, configure, and scale clusters of virtual machines to run containers. This removes the need to choose server types, decide when to scale your clusters, or optimize cluster packing.
EC2 vs Fargate launch types
EC2 launch type Functionality
You have full control over the servers and how they are configured.
You deploy, maintain, patch, monitor, and scale the servers yourself.
You can control costs with spot instances and reserved instances.
You can use Docker images in private registeries.
You have to manually monitor the EC2 instances in your cluster.
You hand AWS a container and it figures out how to deploy it. You don't have to worry about the servers at all, just your app/containers.
Fargate could be slightly more expensive than ECS because of the lack of fine grained control over the instance sizes. Detailed pricing breakdown here
Fargate starts up containers slightly slower because of the overhead of newly creating the underlying infrastructure.
Fargate doesn't support all Task Definition parameters, more info here
Fargate only supports images in Amazon ECR or public repositories in Docker Hub.
Fargate automatically sets up Cloudwatch metric and logs for your service.
Fargate is limited to Application Load Balancers and Network Load Balancers
Fargate is currently not supported in all regions. See the full support matrix here
Which service you decide to go with is entirely dependent on your infrastructure needs. If you want to focus entirely on the application you're deploying and not have to worry about servers, clusters and the underlying infrastructure as a whole then Fargate is for you. However, if your application does require you to have fine grained control over the details of the underlying EC2 instances, auto scaling rules etc than ECS is more appropriate.
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":"cfb8871be516e9f96455a82071cc679d4b598106"}]},{"name":".gitignore","path":".gitignore","sha":"29d2940c5f57a61ecb8873f67bc06bc22d4e89e9"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"f1c2078a2f571b67d25e7ab70e8c68a7e2d3cb2e"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"a861b9cf58e0fe84f76e8c7d9e68652005f715a6"},{"name":"LICENSE.txt","path":"LICENSE.txt","sha":"f4e3d9bd4717a044ed31ad847a300eee74371a78"},{"name":"README.adoc","path":"README.adoc","sha":"07eea94afe49a26d19bb54ce752ffccc1ecc6507"},{"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","toggled":true},{"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":"58ba8fdd800608f4dc18f70ca6bdb238c2ff6ebb"},{"name":"outputs.tf","path":"examples/deploy-ecs-task/outputs.tf","sha":"f5df5493e277f4abe61e646fb719af7ca7688323"},{"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":"5147059721dca8ae65387caba2b59094302e14b0"}]},{"name":"docker-daemon-service","children":[{"name":"containers","children":[{"name":"datadog-agent-ecs.json","path":"examples/docker-daemon-service/containers/datadog-agent-ecs.json","sha":"2ca20904deaabee35357192e95f8bf6a04fc41b3"}]},{"name":"main.tf","path":"examples/docker-daemon-service/main.tf","sha":"f3adcdb4a8e046a8b7ce5a2aa48f27a90fb71d7d"},{"name":"outputs.tf","path":"examples/docker-daemon-service/outputs.tf","sha":"2a294a1174fdc88601ebe62f9ab3dd4faf2d89fd"},{"name":"vars.tf","path":"examples/docker-daemon-service/vars.tf","sha":"5d47a110c100ec3764dedc79226912d467094614"}]},{"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":"483205dec964eb5c8d261c37b3d6c00818883c32"},{"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":"89c1dfc0c0e8fdb60c432fde45bfae216e75df36"}]},{"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":"d270c93abc24b130e34d0a664e338ac035ab46d6"},{"name":"outputs.tf","path":"examples/docker-fargate-service-with-nlb/outputs.tf","sha":"b70fb7144134f7a12470711953437ff94aca37d0"},{"name":"vars.tf","path":"examples/docker-fargate-service-with-nlb/vars.tf","sha":"45dc7bf8f56844fba980cd650cf47d6f990b8415"}]},{"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":"0091f64ee586f96b9d3a3ba0191aaca42d7e410c"},{"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":"85e201158ab1883911a48c3e03911299ec4b4ded"}]},{"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":"c36d5099fba686589c9e30c26759c4e1a55909f9"},{"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":"b5da959dff86c3b9bcec29b01b294d889dbf1d1a"}]},{"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":"4185c86bd5f59cd569b860521affba334e1eabf6"},{"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":"66d5e62ef077265a81611f242c0f434667484d25"}]},{"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":"3287b88f24fda96d2ea58c329bca7dcf4f0ddea3"},{"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":"8b9b459c2c1f27cefe0beeca63dc1022729239ac"}]},{"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":"a5fdc686be748850d5ead7de08ddb884546e86b2"},{"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":"241c6c462b329433f28ca06ae6bbde09577b3b8e"}]},{"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":"f9c0873f62e67296548cd8e1e49b26542f799a8d"},{"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":"dbdb54a0d7c12b021ca4c37a2b1a526e86b3fdb9"}]},{"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":"a84adea719a9bdf08c3fea9543bbb77970d5c5a2"},{"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":"58a0978bac48cf9508d4a94f031ab4858ef833d8"}]},{"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":"9a04828d26a10a0dcd74dba96cfe369ecc722c00"},{"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":"eebcce7a48919fd9fe07667886d3ca1c382e1c43"}]},{"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":"9922ce7193c3eda7da94231ed6b8911dc3567d40"},{"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":"a2a3637fd1a2bcdd161d607e1987677c252757ae"}]},{"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":"c934b83054463a8a327100614d4fc71b3c707327"},{"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":"679bab7c39f3d2303c153912b5dcf69c385c16ce"}]},{"name":"example-docker-image","children":[{"name":"Dockerfile","path":"examples/example-docker-image/Dockerfile","sha":"de3ca3326574c092c92905c1f30421379812cc0e"},{"name":"README.md","path":"examples/example-docker-image/README.md","sha":"272b6c12cad7ba326582bfca11fce195912021c4"},{"name":"server.js","path":"examples/example-docker-image/server.js","sha":"9ede84f2f4692de1c53a73c40ec44286b9ad6faa"}]},{"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":"59f7dbf9166cf4f8ceb5c12c7170875516a2dad6"}]},{"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":"c5a37db7dd18e45df6642b43c1c6f310ded75b27"},{"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":"d7ce3143346786e3726dd80f8ce163a58d7362f3"},{"name":"main.tf","path":"modules/ecs-cluster/main.tf","sha":"a6e14dcaa7b372b985ce23afb281acf0a211de25"},{"name":"outputs.tf","path":"modules/ecs-cluster/outputs.tf","sha":"2261d944b2345fa0adb654d6360444bede11342c"},{"name":"roll-out-ecs-cluster-update.py","path":"modules/ecs-cluster/roll-out-ecs-cluster-update.py","sha":"7f2c101763f920cd708ab873862a1f3488233e5b"},{"name":"vars.tf","path":"modules/ecs-cluster/vars.tf","sha":"ca7af001eb02f6fae035787add0a764b53756141"}]},{"name":"ecs-daemon-service","children":[{"name":"README.md","path":"modules/ecs-daemon-service/README.md","sha":"adda324e605cf743115b9d916bde9dcef432bbf1"},{"name":"main.tf","path":"modules/ecs-daemon-service/main.tf","sha":"18a043c1fca11f42fe2bf90a82dc2ff57c2382a2"},{"name":"outputs.tf","path":"modules/ecs-daemon-service/outputs.tf","sha":"b14be6c2f9498c05be9d3843437940b933b3b669"},{"name":"vars.tf","path":"modules/ecs-daemon-service/vars.tf","sha":"19994a1c8cce5531feb623f72310241615f29969"}]},{"name":"ecs-deploy-check-binaries","children":[{"name":"README.md","path":"modules/ecs-deploy-check-binaries/README.md","sha":"5f819dfaab1a1fe16f29314a2117cd14fcb4bb33"},{"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":"6b11ea81ebdcfeaa5d365f3b5bc4e744b3f881ed"},{"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":"fe4c3983fb61fcf82137f220045ba73426c6bb0a"}]},{"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":"ba318921d20f329c6df7612d39aea098be871a44"}]},{"name":"ecs-deploy","children":[{"name":"README.md","path":"modules/ecs-deploy/README.md","sha":"5bfb0c6c4d6197666f9df3a8ef7c0a63f2579171"},{"name":"bin","children":[{"name":"run-ecs-task","path":"modules/ecs-deploy/bin/run-ecs-task","sha":"86161970f9dae0d327ace437a1dfe6dec39ccef5"}]},{"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":"d3233fc90051979d17b6d4d9654aa003245837c9"}]},{"name":"ecs-scripts","children":[{"name":"README.md","path":"modules/ecs-scripts/README.md","sha":"d1ece4d7573a4e157409ae72075bc5d2a1849812"},{"name":"bin","children":[{"name":"configure-ecs-instance","path":"modules/ecs-scripts/bin/configure-ecs-instance","sha":"6c1a6a842e1d88cda9fb81d9c61817ebf0232bad"}]},{"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":"51c9015df45f7eb2470a826a9113463035ea00fb"}]},{"name":"ecs-service-with-discovery","children":[{"name":"README.md","path":"modules/ecs-service-with-discovery/README.md","sha":"40f05c5aeb3245e474f98605753b9051adef3e4c"}]},{"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":"67662d058d09066a4da6823ca90c460e10bb1477"},{"name":"auto_scaling.tf","path":"modules/ecs-service/auto_scaling.tf","sha":"c344260ad32cdc38a284433f90a3c9f500f38db2"},{"name":"core-concepts.md","path":"modules/ecs-service/core-concepts.md","sha":"8e64db83121e0bc16c91bfb0787e34400f88b09c"},{"name":"deployment_check.tf","path":"modules/ecs-service/deployment_check.tf","sha":"2062aa9be3e08794466c975299dab3febcabf50b"},{"name":"elb.tf","path":"modules/ecs-service/elb.tf","sha":"41fe9c23d25d2ed7fcb74097219281e586cdd566"},{"name":"main.tf","path":"modules/ecs-service/main.tf","sha":"dc4b43e9ad2c5ce6e1aa31408e7fabf9c4d421e6"},{"name":"outputs.tf","path":"modules/ecs-service/outputs.tf","sha":"1d50baa93d2243e10cace34248b5a2f19c3092d2"},{"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":"c7f682d69cf3810f4dea2ab6fa97846068872837"},{"name":"vars.tf","path":"modules/ecs-service/vars.tf","sha":"04c8ff49774b780ee01a6a63d35ffce25b87bee9"}]}]},{"name":"setup.cfg","path":"setup.cfg","sha":"6deafc261704e20369c0983af88042e502ae4880"},{"name":"test","children":[{"name":"Gopkg.lock","path":"test/Gopkg.lock","sha":"fdeb45198829d614b3458f141c336b68671e555c"},{"name":"Gopkg.toml","path":"test/Gopkg.toml","sha":"cdf62eda8012cb3391666b1a9957830d81f596bf"},{"name":"README.md","path":"test/README.md","sha":"b830ee03876dc0fc207b0c0fc9a72d83013ec6f1"},{"name":"deploy_ecs_task_test.go","path":"test/deploy_ecs_task_test.go","sha":"47e0d76b58ab5a3685f4777c3098bc4735efaaab"},{"name":"docker_daemon_service_test.go","path":"test/docker_daemon_service_test.go","sha":"5f0744dbc3de66ea12282eda437153a339ce3c2c"},{"name":"docker_ec2_service_test.go","path":"test/docker_ec2_service_test.go","sha":"4d37c8faec5a2210c1aabd3610dd08a14d0ded3d"},{"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":"78bd52c37c402807900f52cac2600edc8babec50"},{"name":"docker_fargate_service_with_nlb_test.go","path":"test/docker_fargate_service_with_nlb_test.go","sha":"03d16ba7bfafce73f646ae0b435a5927b4586efd"},{"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":"7ebffbe0dd7221a154edb62e2b58dd9d1e6493e5"},{"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":"1ba9fc710ef612c16c3a78087624c9433e4bd702"},{"name":"docker_service_with_alb_deployment_check_fail_test.go","path":"test/docker_service_with_alb_deployment_check_fail_test.go","sha":"9191b6561b3f03aff5e3237594bf30815220e763"},{"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":"5fd68e10a0e39e75bca60f54e8de0049463006b1"},{"name":"docker_service_with_autoscaling_test.go","path":"test/docker_service_with_autoscaling_test.go","sha":"1f8235bafea1e161fe16d090ba7a7b920588a43e"},{"name":"docker_service_with_canary_deployment_check_fail_test.go","path":"test/docker_service_with_canary_deployment_check_fail_test.go","sha":"e9510f9b5b9657ae7d84e5be6ecf1fa57f630773"},{"name":"docker_service_with_canary_deployment_test.go","path":"test/docker_service_with_canary_deployment_test.go","sha":"dd2557690c5ff82a2a6e07ad6fda11cd23881647"},{"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":"9c4cab5844ca40bafeb1c671faf5bf3e5c70aa3f"},{"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":"c473118e08a5cacaac408036a83bade7648d1cfc"},{"name":"ec2_amazon_linux2_test.go","path":"test/ec2_amazon_linux2_test.go","sha":"8d34c658442be08dce0fff2ddf2e2ec4a326cd9c"},{"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":"96464a47dbc3209aac0b6eeb9ddb72daff7cb72e"}]},{"name":"terratest_options.go","path":"test/terratest_options.go","sha":"8f8a3829843ab3c8300f3ca0820c62ae029780d3"},{"name":"test_helpers.go","path":"test/test_helpers.go","sha":"d733b7ec8561340af3840b3e35ee3434673ffd1d"}]}]},"detailsContent":"<h1 class=\"preview__body--title\" id=\"core-ecs-concepts\">Core ECS Concepts</h1><div class=\"preview__body--border\"></div><h2 class=\"preview__body--subtitle\" id=\"what-is-elastic-container-service\">What is Elastic Container Service?</h2>\n<p>Elastic Container Service (ECS) is the official AWS solution for running Docker containers on a cluster of servers in a\nfault-tolerant, scalable, and highly available way. Its primary advantage over alternatives like\n<a href=\"http://mesos.apache.org/\" class=\"preview__body--description--blue\" target=\"_blank\">Mesos</a> and <a href=\"http://kubernetes.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Kubernetes</a> is that it's much easier to set up,\nunderstand, and integrate with other AWS services. Its primary downside is that it offers less powerful options for\n"scheduling" containers across different hosts.</p>\n<h2 class=\"preview__body--subtitle\" id=\"helpful-vocabulary\">Helpful Vocabulary</h2>\n<p>Amazon has its own vocabulary for ECS that can be confusing. Here's a helpful guide:</p>\n<ul>\n<li><strong>ECS Cluster:</strong> One or more servers (i.e. EC2 instances) that ECS can use for deploying Docker containers.</li>\n<li><strong>Container Instance:</strong> A single node (i.e. EC2 Instance) in an ECS Cluster.</li>\n<li><strong>ECS Task:</strong> One or more Docker containers that should be run as a group on a single instance.</li>\n<li><strong>ECS Task Definition (AKA ECS Container Definition):</strong> A JSON file that defines an ECS Task, including the\ncontainer(s) to run, the resources (memory, CPU) those containers need, the volumes to mount, the environment\nvariables to set, and so on.</li>\n<li><strong>Task Definition Revision:</strong> ECS Tasks are immutable. Once you define a Task Definition, you can never change it:\nyou can only create new Task Definitions, which are known as revisions. The most common revision is to change what\nversion of a Docker container to deploy.</li>\n<li><strong>ECS Service:</strong> A way to deploy and manage long-running ECS Tasks, such as a web service. The service can deploy\nyour Tasks across one or more instances in the ECS Cluster, restart any failed Tasks, and route traffic across your\nTasks using an optional Elastic Load Balancer.</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"cluster-hosting-options\">Cluster hosting options</h2>\n<p>ECS supports hosting your docker services using either ECS container instances or Fargate.</p>\n<h3 class=\"preview__body--subtitle\" id=\"what-are-ecs-container-instances\">What are ECS Container Instances?</h3>\n<p>ECS container instances are EC2 instances associated with an ECS cluster. These instances register with the cluster to\nallow scheduling of Docker containers managed by ECS. This gives you control over the hosting platform used for running\nyour Docker containers so that you can choose how much compute or dedicated hardware to provide to your containers.</p>\n<h3 class=\"preview__body--subtitle\" id=\"what-is-fargate\">What is Fargate?</h3>\n<p>Fargate is a technology for Amazon ECS that allows you to run containers without having to manage servers or clusters. With AWS Fargate, you no longer have to provision, configure, and scale clusters of virtual machines to run containers. This removes the need to choose server types, decide when to scale your clusters, or optimize cluster packing.</p>\n<h3 class=\"preview__body--subtitle\" id=\"ec-2-vs-fargate-launch-types\">EC2 vs Fargate launch types</h3>\n<h4 id=\"ec-2-launch-type-functionality\">EC2 launch type Functionality</h4>\n<ul>\n<li>You have full control over the servers and how they are configured.</li>\n<li>You deploy, maintain, patch, monitor, and scale the servers yourself.</li>\n<li>You can control costs with spot instances and reserved instances.</li>\n<li>You can use Docker images in private registeries.</li>\n<li>You have to manually monitor the EC2 instances in your cluster.</li>\n<li>Supports Classic Load Balancers, Application Load Balancers and Network Load Balancers</li>\n</ul>\n<h4 id=\"fargate-functionality\">Fargate Functionality</h4>\n<ul>\n<li>You hand AWS a container and it figures out how to deploy it. You don't have to worry about the servers at all, just your app/containers.</li>\n<li>Fargate could be slightly more expensive than ECS because of the lack of fine grained control over the instance sizes. Detailed pricing breakdown <a href=\"https://aws.amazon.com/fargate/pricing/\" class=\"preview__body--description--blue\" target=\"_blank\">here</a></li>\n<li>Fargate starts up containers slightly slower because of the overhead of newly creating the underlying infrastructure.</li>\n<li>Fargate doesn't support all Task Definition parameters, more info <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-task-defs\" class=\"preview__body--description--blue\" target=\"_blank\">here</a></li>\n<li>Fargate only supports images in Amazon ECR or public repositories in Docker Hub.</li>\n<li>Fargate automatically sets up Cloudwatch metric and logs for your service.</li>\n<li>Fargate is limited to Application Load Balancers and Network Load Balancers</li>\n<li>Fargate is currently not supported in all regions. See the full support matrix <a href=\"https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/\" class=\"preview__body--description--blue\" target=\"_blank\">here</a></li>\n</ul>\n<p>Which service you decide to go with is entirely dependent on your infrastructure needs. If you want to focus entirely on the application you're deploying and not have to worry about servers, clusters and the underlying infrastructure as a whole then Fargate is for you. However, if your application does require you to have fine grained control over the details of the underlying EC2 instances, auto scaling rules etc than ECS is more appropriate.</p>\n","repoName":"module-ecs","repoRef":"v0.16.3","serviceDescriptor":{"serviceName":"EC2 Container Service (ECS) Cluster","serviceRepoName":"module-ecs","serviceRepoOrg":"gruntwork-io","cloudProviders":["aws"],"description":"Deploy a cluster of servers for use with EC2 Container Service (ECS), Amazon's container orchestration system","imageUrl":"ecs.png","licenseType":"subscriber","technologies":["Terraform","Python","Bash"],"compliance":[],"tags":[""]},"serviceCategoryName":"Docker orchestration","fileName":"core-concepts.md","filePath":"/core-concepts.md","title":"Repo Browser: EC2 Container Service (ECS) Cluster","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}