Deploying ECS cluster + task with Javascript SDK

0

I'm trying to deploy an ECS Cluster with a task to run a docker container with a web application. I found the methods to create the cluster, registering the task definition and running it, but I can't find how to choose the instance type that I want to be used and also the disk size.

In this post ( https://dev.to/raphaelmansuy/deploy-a-docker-app-to-aws-using-ecs-3i1g ) the person is making a deploy from the AWS Console and he is able to choose the instance type and disk type and size.

Is it possible to do the same using the Javascript SDK ( https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ECS.html ). I can't find where.

If it's not possible, do you suggest me some other strategy to make this work? Basically what I need is to create the whole stack triggered from an admin page. May be I trigger the process from a lambda function or directly from the back-end of my application.

Thanks.

  • As I can understand now, this option does really does not exist and we must change the memory and cpu requirements for our application, doesn't matter the EC2 instance type, please correct me if I'm wrong. Thanks!

asked 2 years ago562 views
1 Answer
0
Accepted Answer

Hi,

About the post screenshots - If you look at the main ECS cluster creation screen, when you choose EC2, it says it will create for your an Autoscaling Group of EC2 instances, then, at the Task creation step, you'll be choosing the EC2 provider to deploy the tasks on the EC2 AutoScaling Group.

If you have to reproduce the same setup from the JS SDK, first you need to create an AutoScaling Group from the EC2 API Then you create a Capacity Provider from the ECS API and reference the Autoscaling Group ARN previously created.

AWS
Julien
answered 2 years ago
profile picture
EXPERT
reviewed a day ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions