Working with Amazon Elastic Container Service
SPL-50 - Version 2.0.6
© 2018 Amazon Web Services, Inc. and its affiliates. All rights reserved. This work may not be reproduced or redistributed, in whole or in part, without prior written permission from Amazon Web Services, Inc. Commercial copying, lending, or selling is prohibited.
Errors or corrections? Email us at firstname.lastname@example.org.
Other questions? Contact us at https://aws.amazon.com/contact-us/aws-training/
Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster of Amazon EC2 instances.
This lab leads you through the steps to:
- Create a Task Definition, a description of an application that contains one or more Docker containers.
- Create a Cluster, a logical grouping of Amazon EC2 instances on which you can place tasks.
- Create a Service, that allows you to run and maintain a specified number of instances of a task definition simultaneously.
The lab environment will provide you with an Auto Scaling group of EC2 instances that you will use to populate the Cluster and an Elastic Load Balancer for use with your ECS Service.
By the end of this lab, you will be able to:
- Create an ECS Task Definition
- Populate an ECS Cluster
- Deploy an application to an ECS Service
- Deploy an application update by changing the Task Definition
- Scale up the application
Technical Knowledge Prerequisites
To successfully complete this lab, you should be familiar with Docker containers as well as general techniques and vocabulary of server administration and dev ops.
You also should have basic understanding of web applications and networking, such as TCP port, HTTP Proxies, and Load Balancers.
Notice the lab properties below the lab title:
- setup - The estimated time to set up the lab environment
- access - The time the lab will run before automatically shutting down
- completion - The estimated time the lab should take to complete
- At the top of your screen, launch your lab by clicking
If you are prompted for a token, use the one distributed to you (or credits you have purchased).
A status bar shows the progress of the lab environment creation process. The AWS Management Console is accessible during lab resource creation, but your AWS resources may not be fully available until the process is complete.
- Open your lab by clicking
This will automatically log you into the AWS Management Console.
Please do not change the Region unless instructed.
Common login errors
Error : Federated login credentials
If you see this message:
- Close the browser tab to return to your initial lab window
- Wait a few seconds
- Click again
You should now be able to access the AWS Management Console.
Error: You must first log out
If you see the message, You must first log out before logging into a different AWS account:
- Click click here
- Close your browser tab to return to your initial Qwiklabs window
- Click again
What is Amazon Elastic Container Service?
Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster of Amazon EC2 instances. Amazon ECS lets you launch and stop container-enabled applications with simple API calls, allows you to get the state of your cluster from a centralized service, and gives you access to many familiar Amazon EC2 features.
You can use Amazon ECS to schedule the placement of containers across your cluster based on your resource needs, isolation policies, and availability requirements. Amazon ECS eliminates the need for you to operate your own cluster management and configuration management systems or worry about scaling your management infrastructure.
Components of Amazon ECS
Amazon ECS contains the following components:
Container Instance: An Amazon EC2 instance that is running the Amazon ECS agent and has been registered into a cluster.
Cluster: A logical grouping of container instances on which you can place tasks.
Task Definition: A description of an application that contains one or more container definitions. For more information, see Amazon ECS Task Definitions.
Task: A single instantiation of a Task Definition.
Scheduler: The method used for placing tasks on container instances. For more information about the different scheduling options available in Amazon ECS, see Scheduling Amazon ECS Tasks.
Amazon ECS service: Allows you to run and maintain a specified number of instances of a task definition simultaneously. For more information, see Services.
Scheduling Amazon ECS Tasks
Amazon Elastic Container Service (Amazon ECS) is a shared state, optimistic concurrency system that provides flexible scheduling capabilities for your tasks and containers. The Amazon ECS schedulers leverage cluster state information provided by the Amazon ECS API to make an appropriate placement decision. Amazon ECS provides the service scheduler for long running stateless services and applications.
The service scheduler ensures that the specified number of tasks are constantly running and reschedules tasks when a task fails (for example, if the underlying container instance fails for some reason). The service scheduler optionally ensures that tasks are registered against a load balancer. You can update your services that are maintained by the service scheduler, such as deploying a new task definition, or changing the running number of desired tasks.
Service Definition Parameters
A service definition defines which task definition to use with your service, how many instantiations of that task to run, and which load balancers (if any) to associate with your tasks.
Service Load Balancing
Your Amazon ECS service can optionally be configured to use Elastic Load Balancing to manage traffic.
Join Qwiklabs to read the rest of this lab...and more!
- Get temporary access to the Amazon Web Services Console.
- Over 200 labs from beginner to advanced levels.
- Bite-sized so you can learn at your own pace.