Questions tagged [ecs-taskdefinition]

94 questions
2
votes
1 answer

Why do I get CannotStartContainerError when trying to start my ECS task?

I have a FastAPI application with the below Dockerfile. FROM python:3.8 WORKDIR /usr/src/app COPY . . RUN pip install --no-cache-dir -r requirements.txt CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "5000"] Everything runs…
2
votes
1 answer

Environment variable inside ecs container definition vs same environment variable defined in Dockerfile. Which one will be used?

If there is an environment variable SAMPLE_VALUE defined in the ecs task definition like so { "containerDefinitions": [ { "command": [ "./app" ], "image": "sample-image:latest", "name": "sample-app", …
Kidus
  • 1,785
  • 2
  • 20
  • 36
2
votes
1 answer

AWS ECS Service FastAPI Project is Spamming "GET / HTTP/1.1" 404 Not Found

I am using AWS to deploy dockerized FastAPI project. I choosed FARGATE for task definition and Task Memory is 512, Task CPU is 256. ECS service is spamming '"GET / HTTP/1.1" 404 Not Found' itself and shutting down then responsing 503. Do you know…
2
votes
2 answers

AWS Elastic Beanstalk EFS Mount Error: unknown filesystem type 'efs'

I am trying to mount my EFS to a multi-docker Elastic Beanstalk environment using task definition with Dockerrun.aws.json. Also, I have configured the security group of EFS to accept NFS traffic from EC2 (EB environment) security group. However, I…
2
votes
1 answer

Amazon AWS ECS Container Docker Port not binding correctly

I have deployed a docker Image via ECS Task Definitions picked up from ECR. The Task definition json is given below. I have mapped container port as 80 & Network Mode : awsvpc But when the ECS service is started and docker runs in an EC2 instance…
1
vote
0 answers

How to write task definition based on different enviroments - dev, staging & prod

I have an ECS service that is running a task with one container each. Challenge is here is that I have different compute configuration based on environment. For example in dev environment I intend to use .25cpu with .5MB memory but in production I…
1
vote
0 answers

Why is deploying ecr image to ecs uses the first (and not latest) task definition?

I use circleci with orbs: aws/ecr, aws/ecs that uploads the new docker image, and supposed to update ecs service. My issue is that it uses the first, and not the latest task definition, and cannot seem to find a way to set the deployment to update…
1
vote
0 answers

amazon-ecs-deploy-task-definition not creating service - Error : "Service is INACTIVE"

I'm trying to deploy a dotnet service to a cluster in ECS using a git action on a pull request. Everything works fine up to the aws-actions/amazon-ecs-deploy-task-definition@v1 step which fails giving an error of "Service is INACTIVE". In this case…
Mike
  • 2,120
  • 1
  • 23
  • 40
1
vote
1 answer

How to address another container in the same task definition in AWS ECS on Fargate?

I have an MQTT application which consists of a broker and multiple clients. The broker and each client run in their own container. Locally I am using Docker compose to set up my application: services: broker: image: mqtt-broker:latest …
1
vote
1 answer

AWS CDK Step Function EcsRunTask Use Input Variable For Task Definition

I am trying to convert a Step Function that I have in JSON to CDK (Typescript), but am not sure how to reference input variables from the previous step. My existing Step Function Task: "Start Task": { "Type": "Task", …
1
vote
1 answer

How to specify human readable name for ECS Task Definition in AWS CDK?

I use aws-cdk-lib/aws-ecs-patterns/ApplicationLoadBalancedFargateService class to deploy ECS Service from CDK. const service = new ecs_patterns.ApplicationLoadBalancedFargateService(this, `service-${envName}`, { serviceName:…
Andrew
  • 3,696
  • 3
  • 40
  • 71
1
vote
1 answer

AWS fargate tasks won't start reliably

I have an ECS cluster with a bunch of different tasks in it (using the same docker image but with different environment variables). Some of the tasks come up without problem but others fail a lot even though i've used the same VPC, subnet and…
F.H.
  • 1,456
  • 1
  • 20
  • 34
1
vote
1 answer

Cloudformation ECS / fargate - Run two containers in one task

I'm trying to run two containers in one task. The two containers must be resolvable using their DNS. What I did ; I defined the two containers in the same task definition : MyTwoContainerTaskDefinition: Type: 'AWS::ECS::TaskDefinition' …
1
vote
1 answer

Cloudformation / ECS - How to retrieve taskdefinition IP directly from the template?

Do you know if there is an easy way to retrieve a container's IP from its task definition? From what I see in AWS documentation, no attribute is returned for AWS::ECS::TaskDefinition resource type. I need this IP to set it in my…
1
vote
1 answer

AWS | Laravel | ECS(G/B) | CodeDeploy unfinish

I'm using Laravel. I want to deploy it to ECS (B/G) to see how it works. In the development environment, Laravel is running. I was able to launch my Laravel project on EC2 using docker. I want to use Fargate for the first time and deploy to…