Deployment of SpringBoot Services on AWS Elastic Container Services: Part 3 Create Task Definitions
Task definitions specify how Amazon ECS deploys the application containers across the cluster.
- From the Amazon ECS left navigation menu, select Task Definitions.
- Select Create new Task Definition.
- On the Select launch type compatibility page, select the EC2 option then select Next step.
- On the Configure task and container definitions page, do the following:
- In the Task Definition Name field, enter api.
- Scroll down to Container Definitions and select Add container.
- In the Add container window:
- Parameters that are not defined can be either left blank or with the default settings.
- In the Container name field, enter api.
- In the Image field, enter [account-ID].dkr.ecr.[region].amazonaws.com/api:v1
Replace [account-ID] and [region] with your specific information. Ensure the tag v1 matches the value you used in Module 1 to tag and push the image. This is the URL of your ECR repository image that was created in the previous module. - In the Memory Limits field, verify Hard limit is selected and enter 256 as the value.
- Under Port mappings, Host port = 0 and Container port = 3000.
- Scroll to ENVIRONMENT, CPU units = 256.
- Select Add.
You will return to the Configure task and container definitions page. - Scroll to the bottom of the page and select Create.
Your Task Definition is listed in the console.
The Task Definition looks like as follows: