Amazon ECS is a docker based container service. As far as I know if we create a ECS, we do have an EC2 instance having Docker application. Since we have docker application we will be able to build, ship, and run distributed applications. On Amazon ECS we have an option for task creation and using that we will be able ship and run applications like word-press in to the ECS.
In this article , I am just trying to create Amazon ECS using free-tier, sample web application image provided by Amazon and a sample task to shows httpd service running fine in the ECS we created.
- Login to the Amazon web services panel
- Click EC2 Contain service option that shows in the below screenshot.
- Next page shows a short description about Amazon ECS and an option to get started. Click the same.
- Uncheck “Store container images securely with Amazon ECR”, its not a necessary one and click “Continue”
- In “Create a task definition” windows leave all settings as is and click “Next Step”
- In “Configure service ” section leave all settings as is and click “next step”
- In “configure Cluster ” section leave all settings as is and click “Review & Launch “button.
- On “Review” section click “Launch instance & run service”
- In the new windows we can see all the status of tasks running and once all completed we can click the “View service” button to see the status of “sample task and service we created “
This concluded normal steps we need to follow for the creation of an sample Web application enabled ECS. Once the ECS is created if we go the EC2 instance section in the AWS panel, we can see there is a new instance automatically created as part of ECS.
If we visit the public IP address in the web browser can see a page which shows in the below screenshot. It state that the web application(apache service) is running fine in the server and able to disable the sample page created as part of the sample task we created.
We can also see the status of task definition we created from “EC2 Contain service option” section >> Task definition.
NB: We noticed an error “Run tasks failed Reasons : [“RESOURCE:PORTS”] ” in the AWS web interface at the time of ECS creation. But while testing haven’t seen any issues. Not sure whats the exact meaning of the error.