Will AWS ECS Task with ECS & Fargate compatibilities run on managed EC2 instances?

0

In aws ecs, i have created task to be fargate type, and in managed EC2 i have few tooling vm ec2 instances, i know that fargate is aws managing the underlying infrastructure and it can be running under any machines and we have no ideal on, my question is since i have few tooling vm ec2 instances provisioned. will aws spin up my task in one of my tooling vm ec2 sometime?

My task definition configured below:

.... ** "placementConstraints": [], "compatibilities": [ "EC2", "FARGATE" ], "requiresCompatibilities": [ "FARGATE" ],** ...

1개 답변
1
수락된 답변

If your ECS task is configured to use Fargate, it will not run on your manually managed EC2 instances. Fargate is a serverless compute engine for containers that abstracts the underlying infrastructure, meaning AWS manages the compute resources required to run your tasks. This allows you to focus solely on defining your containerized applications without managing the underlying EC2 instances.

Understanding ECS and Fargate Compatibility ECS on Fargate:

When you specify requiresCompatibilities as FARGATE, ECS will run your task using AWS Fargate, and the infrastructure is fully managed by AWS. You have no control over the specific EC2 instances on which your tasks run, as Fargate handles provisioning, scaling, and managing the compute resources. ECS on EC2:

When you run ECS tasks using EC2, you are responsible for managing the EC2 instances that serve as the underlying compute infrastructure for your tasks. Tasks with requiresCompatibilities set to EC2 will run on the EC2 instances that you have provisioned and registered to your ECS cluster. Task Definition Example Given your task definition configuration:

Json:

"placementConstraints": [],
"compatibilities": [ "EC2", "FARGATE" ],
"requiresCompatibilities": [ "FARGATE" ],

This configuration specifies that the task can run on both EC2 and Fargate (compatibilities: [ "EC2", "FARGATE" ]), but it requires Fargate (requiresCompatibilities: [ "FARGATE" ]). Key Points Fargate Tasks: If your task requires Fargate, it will not run on your managed EC2 instances. Fargate tasks run on infrastructure managed by AWS. EC2 Tasks: To run tasks on your specific EC2 instances, you need to set requiresCompatibilities to EC2 in your task definition. Example of EC2-Only Task Definition If you want to run a task on your managed EC2 instances, you need to configure your task definition like this: Json:

"placementConstraints": [],
"compatibilities": [ "EC2", "FARGATE" ],
"requiresCompatibilities": [ "EC2" ],

Summary Fargate: Tasks defined with requiresCompatibilities: [ "FARGATE" ] will not utilize your manually managed EC2 instances. EC2: Tasks defined with requiresCompatibilities: [ "EC2" ] will run on your manually managed EC2 instances. In your case, since your task definition requires Fargate, AWS will manage the underlying infrastructure, and your tasks will not run on your tooling VM EC2 instances.

답변함 3달 전
profile picture
전문가
검토됨 3달 전
profile pictureAWS
전문가
검토됨 3달 전
  • Thank you for the explanation.

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

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

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

관련 콘텐츠