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!

gefragt vor 2 Jahren609 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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
beantwortet vor 2 Jahren
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen