Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

AWS ECS: How does it work?

Posted on Oct 22 ECS stands for Elastic Container Service and the reason why it exists is to simplify the deployment, management, and scaling of containerized applications using Docker Containers within AWS.In summary: wanna run Docker Containers? AWS ECS is the way to go.By the way, AWS Lambdas can run Docker Containers as well.We are going to learn about the main pieces that compose AWS ECS:Keep in mind that you'll need to know at least the basics of Docker.Before going over each one of the parts that compose AWS ECS, I would like to explain the relationship between them in an SQL-like language:With that clarified, let's go!A Task Definition is a blueprint that describes how the Docker container(s) should run. You can use a .json file to create a Task Definition. Let's check the example below.If you want to dive into it more:Before moving on to ECS Services, a quick recap: the Task Definition is used to define what Docker Images you want to use and how the Docker Containers within the Tasks — if there's more than one — will communicate with each other.Also, don't forget that the Task Definition has a name, which is the value passed to the family property, and if you haven't noticed yet the word family is not a coincidence!All Docker Containers defined within a given Task Definition will be grouped together (like when using Docker Composer). Why that's important? You may ask... Well, because the ECS Service is what manages the Tasks.An ECS Service is a wrapper that allows you to define how many Tasks (instances of a Task Definition) should be running at any given time and how they should be managed. It ensures that a specified number of Tasks are running and maintains a desired state for your application.If you to dive deep into the ins and outs of ECS Services, go here: Amazon ECS services - Amazon Elastic Container ServiceThere isn't much mystery involved when talking about Clusters, they are pretty straightforward. An ECS Cluster is a wrapper for the ECS Services — which can be comprised of EC2 Instances or Fargate Tasks — on which you can run containerized applications.Clusters are used to isolate resources and define the scope of where your Containers can be deployed. It is pretty common to see companies using the following configuration when using only one AWS account:An ECS Cluster can have multiple ECS Services running within it. That is useful when creating multiple environments to test an application. For instance, let's say there are 2 developers working on new features on WordPress, and after testing things out locally both want to test in the development environment, with only one dev environment that is not possible but we can make it possible by doing this:We basically duplicated Service 1, so now we can use development-env-1and development-env-2 to test things out.Well, we would use AWS Route 53 to manage our Domain DNS Records that would point to the right Load Balancer, and the AWS Load Balancers (ALB) to split traffic accordingly, by pointing to the right ECS Services.I'll be creating a post about that soon with a step-by-step guide on how to set up all this infrastructure using Terraform.Hope that you find this guide useful, find you have any questions or feedback, please feel free to reach out in the comments sections below.Thank you!Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse ᒍᗩᑕE - Oct 9 Steven Marks - Oct 9 Mila Wu - Oct 10 Julien Simon - Oct 10 Once suspended, ltcavalcanti will not be able to comment or publish posts until their suspension is removed. Once unsuspended, ltcavalcanti will be able to comment and publish posts again. Once unpublished, all posts by ltcavalcanti will become hidden and only accessible to themselves. If ltcavalcanti is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Lucas Cavalcanti. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag ltcavalcanti: ltcavalcanti consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging ltcavalcanti will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

AWS ECS: How does it work?

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×