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!

질문됨 2년 전642회 조회
1개 답변
1
수락된 답변

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
답변함 2년 전
profile picture
전문가
검토됨 25일 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠