Questions tagged with Amazon Elastic Container Service
Content language: English
Sort by most recent
ECS FluentBit container is failed to start
I am using Firelens to stream logs to cloudwatch. The fluentbit container is failing to start. ``` AWS for Fluent Bit Container Image Version 2.28.4 Fluent Bit v1.9.9 * Copyright (C) 2015-2022 The Fluent Bit Authors * Fluent Bit is a CNCF sub-project under the umbrella of Fluentd * https://fluentbit.io [2022/12/02 05:06:48] [error] [config] error in /fluent-bit/etc/fluent-bit.conf:32: key has an empty value [2022/12/02 05:06:48] [error] configuration file contains errors, aborting. ``` I didn't make any change to this file "/fluent-bit/etc/fluent-bit.conf" . I tried in both ecs & fargate launch type and both custom & aws default conf. I tried in all the possibilities of the ECS & fluentbit combinations. Everywhere I am getting the same error. Please help me to resolve this. ECS Agent Version: 1.66.2 Platform: Linux Tried in both intel & graviton still getting the same error.
Updating an ECS service automatically using the CLI via Lambda
I have a multi-container application that runs a service on ECS. The images are hosted on ECR, configuration files are pulled from a S3 bucket during container startup via script. The application sits behind a network loadbalancer with EIP. The loadbalancer is in a public subnet and reachable, the app itself is inside a private subnet. My ultimate goal is to automatically update the service when either a.) a new image is checked in or b.) a new configuration file is uploaded. I figured the best way to do this behind a network load balancer (which supports rolling update) is to use the AWS ECS CLi inside a lambda function that triggers upon update. If I did not misread the docs, the CLI should trigger a rolling update. To test the CLI, I tried: `aws ecs update-service --cluster mycluster --service myservice --force-new-deployment` However, this was not successful. A new task was created, but was stopped before deployment was finished with log message: > Essential container in task exited Parameters for the service are min. 100 % and max. 200 %. I also tried to set the lower bound of running tasks to 0 %. This resulted in the successful exit of the old task, but the new tasks failed to deploy with the same error. This makes me think that I probably configured something incorrectly. Questions: 1.) Is using a lambda function a smart choice here? Or is there a better way? 2.) How can I troubleshoot the failing rolling update? I appreciate any help! If you need more information, please let me know. Best regards, Sebastian
Run a task every hour - using containers
I am looking to use containers to run a task every hour using containers. Imagine the task takes 20 minutes, so it's not suitable for lambda, and it's not suitable for EC2, since 40 minutes out of every hour the instance would be idle. I have created a container that runs one simple task, (writes a row into a database) then stops. I created a docker container, pushed this to ECR, then created an ECS task that appears to run the task constantly (starting / restarting). I set the number of tasks to 0 for the cluster to stop this behaviour. I then created a schedule using AWS event bridge, and set it to run the task every hour, but it's not running at all. Can anyone suggest something that I should look at to achieve the desired scheduled task?
How to deploy frontend and backend in one CICD (CodePipeline)?
I have set up a CICD for the frontend of my App which is using Codepipeline, Code Build, and it deploys frontend of my app to ECS Fargate container. Similarly, I have setup a CICD for backend of my App which is also using Codepipeline, Code Build and it deploys backend of my app to ECS Fargate Container. The problem is that both frontend and backend of my application are in two different Bitbucket repositories. Is there any good practice to manage this in one CICD. Basically, I want to deploy my app's frontend and backend to one ECS Fargate cluster. Right now two ECS Fargate clusters are being used. I just want to deploy my application as one solution which eventually contains two containers but in a single cluster. I am following [this tutorial](https://medium.com/swlh/aws-cloudformation-managed-complete-ecs-infrastructure-including-ci-cd-pipeline-from-github-to-ecs-b833bb44e01c) if someone wants to get more details. Is there any best practice that I should follow for my solution? Any suggestion for the improvement will be appreciated greatly.
Facing CORS error on AWS ECS Fargate container
I have deployed my application backend on AWS ECS Fargate container and I deployed my application on second AWS ECS Fargate container. Both, frontend and backend, are using two different load balancers. But when I try to connect my frontend with backend it is throwing a CORS error that you can see in the following picture. ![CORS ERROR](/media/postImages/original/IMtioicrX8ThG8QtwRu35mEQ) Does anyone have any idea why this error is coming and how I can resolve it?
Create a cloudwatch alarm if my running count in ecs service is 0
I have an ecs cluster with fargate as launch type and one service which has desired count as 1. In somecase all my task may stop and there may a bug in the last updated code , hence the task will be created and deleted frequently. If this scenario happens I need to get notified. The desired count would be 1 , but the task keeps on deleting and creating as there may be any scenario that stops the container.
Elastic Beanstalk application deployment took long time than expected.
I'm deploying an ECS Based application via Elastic Bean Stalk, it's been executed for a long time. ``` Environment health has transitioned from Pending to Severe. The command is executing on all instances (15 minutes or more elapsed). ``` This might be an issue with the permissions attached via the service role. How to resolve this issue?
Default Security Group for Task Definition
Hello, I am developing a container deployment on ECS, and I am in a development phase where I am frequently launching a task by deploying from the task definition. I am using the web interface to do this. The container runs a service that requires an inbound port, and I have created a security group to do this. Right now, I have to change from the default security group to this new security group every time I launch the task. This is onerous, and it's only a matter of time before I forget to do that. What is the right way to do this? It seems like the inbound port requirement is a feature of the task definition, but I can't find a way to set a default security group for a task definition. Thanks
EventBridge Scheduler fails on ECS RunTask with Fargate launch type
Hi, When defining the Compute Options on a RunTask call with: Launch type - "FARGATE", Platform Version: "1.4.0" - it seems that only the Platform Version is passed onto the "requestParameters" thus triggering the following error message: "The platform version must be null when specifying an EC2 launch type." Screenshot from Eventbridge Scheduler: ![Enter image description here](/media/postImages/original/IMT22IN3dkSjO5kKtwwyHOGw) Screenshot from the output in CloudTrail: ![Enter image description here](/media/postImages/original/IMqOGxKg7LQ9Klj_FXO3ZbdA) I have successfully triggered and run this task from an EventBridge rule
Docker-based backend distribution by branch
Hello. Nice to meet you. I'd like to distribute the service using dockers on the backend. Once the pull request is complete on the backend, we are considering how to deploy and assign domains. dev branch → default domain: dev.example.com When a new pull request is submitted and distributed, New Domain: 123.dev.example.com If new submitted again, 124.dev.example.com In summary, I would like to have it distributed by branch and distributed when that branch is created. I want this kind of composition. What should I do? I need your help. Thank you.