Questions tagged [aws-fargate]

AWS Fargate is a service within Amazon Web Services that allows for running containers without managing servers or clusters. Use this tag for questions about AWS Fargate. For context, also tag your question with [amazon-ecs] or [amazon-eks] to denote which managed container service you're using.

AWS Fargate is a compute engine for deploying and managing containers without having to manage any of the underlying infrastructure (servers or clusters). AWS Fargate supports Amazon ECS and Amazon EKS.

Usage guidance

Use this tag for questions about AWS Fargate. For context, also tag your question with or to denote which managed container service you're using.

Resources

1725 questions
29
votes
6 answers

AWS Secrets Manager can’t find the specified secret

I'm using AWS Fargate and storing sensitive data with Secrets Manager. Task definition should get environment variables from secrets store - name: "app" image: "ecr-image:tag" essential: true secrets: - name: "VAR1" valueFrom:…
29
votes
1 answer

AWS Fargate startup time

Currently I'm researching on how our dockerised microservices could be orchestrated on AWS. The Fargate option of ECS looks promising eliminating the need of managing EC2 instances. Although it's a surprisingly long time needed to start a "task" in…
esboych
  • 985
  • 2
  • 10
  • 16
29
votes
6 answers

How to diagnose ECS Fargate task failing to start?

I'm trying to launch/run a Dockerfile on AWS using their ECS service. I can run my docker image locally just fine, but it's failing on the Fargate launch type. I've uploaded my Docker image to ECR, and I've created a cluster/service/task from…
Cerin
  • 60,957
  • 96
  • 316
  • 522
27
votes
4 answers

AWS ECS Fargate and port mapping

I have two containers and they expose the same port. I want to run them in the same task as they are part of the same system. But I cannot do this with Fargate because there are no port mapping and the host port should be the same as container port…
Anton Zherdev
  • 674
  • 1
  • 8
  • 10
27
votes
2 answers

How do I associate an Elastic IP with a Fargate container?

I'm exploring using the new Fargate option for my ECS containers. One constraint is that the running task must always be accessible at the same Public IP address. My first thought was to allocate an Elastic IP but I can't tell what to associate it…
Gabe Durazo
  • 1,789
  • 2
  • 19
  • 27
26
votes
2 answers

`aws ecs execute-command` results in `TargetNotConnectedException` `The execute command failed due to an internal error`

I am running a Docker image on an ECS cluster to shell into it and run some simple tests. However when I run this: aws ecs execute-command \ --cluster MyEcsCluster \ --task $ECS_TASK_ARN \ --container MainContainer \ --command "/bin/bash"…
clay
  • 18,138
  • 28
  • 107
  • 192
26
votes
4 answers

Auto Scale Fargate Service Based On SQS ApproximateNumberOfMessagesVisible

I would like to scale out my aws fargate containers based on the size of the SQS queue. It appears that I can only scale based on the container's CPU or Memory usage. Is there a way to create a policy that would scale out and in based on queue size?…
26
votes
5 answers

Can't access S3 bucket from within Fargate container (Bad Request and unable to locate credentials)

I created a private s3 bucket and a fargate cluster with a simple task that attempts to read from that bucket using python 3 and boto3. I've tried this on 2 different docker images and on one I get a ClientError from boto saying HeadObject Bad…
vane
  • 2,125
  • 1
  • 21
  • 40
25
votes
2 answers

What is vCPU in AWS

In AWS service, I see a section in ECS Fargate for vCPU which is choosable from 0.25 to N value, I see lots of documentation on How to configure these vCPU value but I didn't see any doc on the difference between the values of vCPU Example : …
Harry
  • 3,072
  • 6
  • 43
  • 100
25
votes
3 answers

Error : Network Configuration must be provided when networkMode 'awsvpc' is specified

I have this task definition code, which has a problem: { "family": "ikg-api", "taskRoleArn": "", "executionRoleArn": "arn:aws:iam::913xxxx371:role/ecsTaskExecutionRole", "networkMode": "awsvpc", "containerDefinitions": [ { …
user11810899
25
votes
4 answers

How can I run commands in a running container in AWS ECS using Fargate

If I am running container in AWS ECS using EC2, then I can access running container and execute any command. ie. docker exec -it How can I run commands in the running container or access container in AWS ECS using Fargate?
Nitin
  • 2,701
  • 2
  • 30
  • 60
24
votes
4 answers

Persistence in AWS Fargate Containers

I have 2 containers in a Fargate task definition. One of the containers is a database server. I'm wanting to persist the data directory. However, Fargate doesn't support the Source Path field when setting up a volume in the task definition. Does…
Ira Klein
  • 425
  • 3
  • 6
23
votes
3 answers

How to speed up deployments on AWS Fargate?

After migrating from EC2 cluster instances to AWS Fargate, I realized that deployments take a lot longer. Before they would take 1-2 minutes, now some deplyoments take up to 5 minutes. This post claims that their deployments on Fargate even take up…
EagleBeak
  • 6,939
  • 8
  • 31
  • 47
23
votes
4 answers

How to update container image in AWS Fargate

I have pushed the initial docker image into repository and created AWS Fargate using the image, is there any way to update the image as there are certain changes in my docker image.
Ram
  • 407
  • 2
  • 6
  • 12
21
votes
8 answers

ECS task not starting - STOPPED (CannotPullContainerError: “Error response from daemon request canceled while waiting for connection”

I'm starting a task in ECS using Fargate and after being in PENDING for a little bit it ends up in STOPPED with the following error: STOPPED (CannotPullContainerError: "Error response from daem When I expand out the details I see STOPPED…
tschumann
  • 2,776
  • 3
  • 26
  • 42