Questions tagged [amazon-ecs]
Amazon Elastic Container Service (ECS) is a highly scalable, high performance container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances.
254
questions
41
votes
11
answers
79k
views
How do you restart all Tasks of a Service?
We have a task that loads some configuration files from an external data source. After the settings are uploaded we would like to be able to restart all the tasks in a service so that the settings ...
40
votes
7
answers
29k
views
Update the container of a service in Amazon ECS
What kind of approach is recommended for updating the container of a service which is running in Amazon ECS?
The AWS documentation says: "If you have updated the Docker image of your application, you ...
34
votes
4
answers
30k
views
Assigning a domain name to an AWS Fargate task
I have an AWS Fargate task running a web app in a public subnet so it has a public address. My question is how to I connect a domain (through Route 53) to that task, so that nothing breaks when I ...
27
votes
3
answers
21k
views
Amazon ECS (Docker): binding container to specific IP address
I'm playing with Amazon ECS (a repackaging of Docker) and I'm finding there's one Docker capability that ECS does not seem to provide. Namely, I would like to have multiple containers running in an ...
20
votes
3
answers
20k
views
Confused by the role requirement of ECS
I am trying to set up a ECS but so far I have encountered a few permission issue for which I have created some questions on this forum already.
I think I am stuck so far because honestly I cannot ...
15
votes
6
answers
19k
views
ECS cluster has no ecs instances but two ecs instances are visible in EC2
I am trying to create a very simple cluster in sydney region.
It is a very straightforward setup. I specified the harddisk to be 60G. I want to have two ec2 instances in the cluster.
They show up as ...
14
votes
2
answers
14k
views
ECR cross-account pull permissions
We have two AWS accounts. Account A has ECR repositories and Account B is meant to be able to pull from them.
I have tried setting the repository permission statements in Account A to allow pulling ...
14
votes
2
answers
5k
views
CannotPullContainerError on AWS ECS
I can't quite grok the image [registry-url]/[namespace]/[image]:[tag] URL for a Docker Hub image of mine for AWS ECS.
With the Docker client it's just docker run -it hendry/count.
So what would ...
12
votes
1
answer
13k
views
AWS Fargate + Application Load Balancer SSL Termination
I'm trying to configure ECS Fargate behind an Application Loader Balancer (ELBv2), and I would like to terminate the TLS/SSL connections on the ALB, and send HTTP traffic (port 80) to the Fargate ...
10
votes
2
answers
7k
views
AWS Code Build Error : Cannot connect to docker daemon
I was trying to build docker image using aws code build service and then push it to ECR. Commands which i used for it in "buildspec.yml" is specified in below.
version: 0.2
phases:
install:
...
10
votes
2
answers
5k
views
How To: Dockerized MongoDB Replication on Elastic Container Service
I have a Node.js app together with a MongoDB database running on AWS ECS. The setup I've got currently is formed of 2 ELB's and 2 Instances running each a Docker container with its assigned service (...
9
votes
5
answers
18k
views
Ecs service doesn't update the task definition
In the ecs cluster, I have a service running with 2 ec2 instances. And i update the task definition to take the new docker image. But the old task definition is still running even though there is a ...
9
votes
5
answers
22k
views
AWS ECS service not starting any tasks
I've set up a cluster, container, task and service on ECS.
After I created the service, it appears to be running with '3 desired tasks', however no tasks are being created as pending or running. ...
9
votes
2
answers
30k
views
How to get the IP Address for a specific AWS ECS task?
I am attempting to build my own version of service discovery within ECS, since the services that I wish to scale up and down are not HTTP servers and so cannot be managed by ELB. Also, ECS doesn't ...
9
votes
2
answers
2k
views
Change task placement strategy of Amazon ECS Service
I have about 15 micro-services running in a single ECS cluster with 5 EC2 instances. While setting up the services I did not pay too much attention to the task placement strategy and now I want to ...
8
votes
4
answers
30k
views
HealthCheck on ECS task without an ELB
We have a Docker container(Spring Boot) that runs in an ECS cluster. We run it without Elastic Load Balancing.
We want to update the service without downtime, so when the new task is up and healthy,...
8
votes
1
answer
11k
views
How to turn off access log for only a certain url in this nginx configuration?
This is a nginx configuration
server {
listen $PORT;
location ~ ^/documents/(.*)$ {
proxy_pass http://127.0.0.1:5000/$1;
proxy_set_header Host $host;
...
8
votes
1
answer
6k
views
Docker volume permissions in ECS
I'm migrating an existing application from running on bare EC2 instances to a containerized setup with ECS. I have two situations where I need to share data between containers. One is an EFS share ...
7
votes
2
answers
2k
views
Is Fargate a good fit for independent containers that have low resource utilization?
I'm new to docker and ECS, so I might not use the right terms. Please let me know if I need to clarify.
My Scenario: I have a number of independent containers. Each container represents a web site. ...
7
votes
1
answer
5k
views
AWS ECS: Unable to place task
I am trying to set up an AWS service with autoscaling. I have created a cluster with an application loadbalancer and created a task using a docker image that should be open on port 8080 for use. I ...
6
votes
3
answers
9k
views
how to pull docker image on ECR using cloudformation template
I want to use docker image hosted on ECR and i want to automate the pull operation using cloudformation template.
I attached IAM role with ECR full access to ec2 instance and it doesn't work.
i am ...
6
votes
2
answers
9k
views
HEALTHCHECK in ECS Container
I'm struggling setting up the correct HEALTHCHECK for a Container inside Task Definition in Amazon ECS.
I've tried multiple solutions and can't get the simplest "always true" healthcheck to actually ...
6
votes
1
answer
10k
views
ALB Connection Draining is always reaching the "Deregistration Delay"
I'm using ECS along with ALB to expose my containers to the internet. When I'm updating a container image (I'm using CloudFormation to update the tasks and services), the target group set the ...
6
votes
1
answer
1k
views
Are the units incorrect for Storage Read / Write graphs in AWS ECS Container Insights?
In AWS Console > CloudWatch > Container Insights > Performance monitoring > ECS Tasks, the graphs for both Storage Read and Storage Write have units shown as Bytes/Second like this:
...
6
votes
1
answer
4k
views
create a CloudWatch Alarm when an ECS service unable to consistently start tasks successfully
If I release a new Docker image with a bug to my ECS Service, then the service will attempt to start new Tasks but will keep the old version around if the new tasks fail to start.
In that scenario, it ...
6
votes
3
answers
4k
views
Best way to log to two different CloudWatch log streams from an ECS container?
We are running our services on AWS's ECS platform, and we send our logs to AWS CloudWatch.
We have two types of logs, any container can produce either type:
the usual application logs (access, error,...
5
votes
1
answer
7k
views
How to send HTTP requests between AWS ECS services
Currently, I'm trying to figure out how to configure communication between ECS services.
I'm planning to have the following setup:
Backend service
Fronted service
One application load balancer
I ...
5
votes
3
answers
650
views
How to choose between Elastic Container Service (ECS) or Elastic Container Registry (ECR), Elastic Beanstalk, and Lambda?
Background:
I've worked with EC2 and RDS. Recently I received a query from a client in which he wants to develop both mobile and web applications using Amazon Web Services, and need advice on which ...
5
votes
1
answer
7k
views
What is the best way to run cronjob in AWS ECS?
I have a web app powered by Laravel that is set up on AWS ECS. I would need to run an artisan command as a cronjob.
I'm looking at "Scheduled Tasks" in ECS Cluster configuration. I can launch new ...
5
votes
1
answer
5k
views
AWS ALB resolves to 2 IPs. What are they?
I have set up an AWS ALB for my application. The ALB is connected to AWS ECS cluster which has 2 instances. The 2 instances are in private subnets. When I resolve the IP of the ALB DNS name, I get 2 ...
5
votes
1
answer
5k
views
How to mount Amazon EFS as data volume in ECS task?
Userdata on launch configuration:
#!/bin/bash
echo ECS_CLUSTER=prodcluster >> /etc/ecs/ecs.config
sudo yum install -y nfs-utils
sudo mkdir /home/ec2-user/web_file_uploads
sudo chmod 777 /...
5
votes
1
answer
2k
views
Grace Period? - AWS EC2 Container Service and Elastic Load Balancers
When an elastic load balancer (ELB) is associated with an auto-scaling group, it is possible to specify a grace period during which new EC2 instances will not be terminated even if they are marked as ...
5
votes
1
answer
1k
views
How to scale up one container using Amazon EC2 Container Service
I am new using Amazon ECS and I would like to know how to set up services in order to scale up / down one container easily.
Here is my project architecture:
website: container with the website, only ...
5
votes
1
answer
5k
views
Autoscaling health checks fail in Amazon-provided ECS CloudFormation template.
I am attempting to stand up a new ECS cluster using the CloudFormation ECS Service template AWS provided here as a guide. My ECS instances boot within the AutoScaling group, but then fail a health ...
5
votes
1
answer
895
views
ECS Stopped Task not Releasing Port
I have an ECS cluster with ELB. Last night I saw that a task was stuck in restarting loop. From the service Events log, it said:
"service xxxxx was unable to place a task because no container
...
4
votes
2
answers
5k
views
Do I need an internal Load Balancer for my ECS Services?
I have an ECS cluster with 3 services(FARGATE), the 3 services are in private subnets. 1 is the web app that is publicly accessible through an Internet-facing Load Balancer and the 2 others are only ...
4
votes
3
answers
9k
views
How to add a domain name to an ECS container (EC2/ECS Service) without a load balancer?
I'm searching for a way to add a domain name to an ECS service (EC2 not Fargate).
To be clear I'm looking for a solution which DNS resolves a domain name A or AAAA name (possibly CNAME if it and ...
4
votes
1
answer
7k
views
AWS ECS CannotStartContainerError: Error response from daemon
I'm trying to start a task with a container with the following command:
/bin/sh -c "export KAFKA_LISTENERS=\"PLAINTEXT://$$(hostname -i):9092\" && start-kafka.sh"
But I'm getting this error ...
4
votes
1
answer
5k
views
EC2 Instance cannot connect to ECS Cluster
Helo,
I have empty AWS ECS Cluster but I am unable to put instances into it.
I wanted to use Launch templates and Autoscaling Group, but I am unable to assign created EC2 Instance.
The issue is in ...
4
votes
3
answers
2k
views
AWS - shutdown EC2 of an ECS cluster after task is done
I have a small job in docker (10 minutes) which I want to run daily in the morning.
What I'd like to achive from AWS is this:
1. Start EC2 instance.
2. Run my docker job.
3. Shutdown EC2 instance.
...
4
votes
2
answers
2k
views
Failed registering Scalable Target when defining auto scale option for ECS
But I am getting this error:
Failed registering Scalable Target
Scalable Target could not register
scalable target: 1 validation error detected: Value '' at 'roleARN'
failed to satisfy ...
4
votes
0
answers
1k
views
Autoscaling AWS ECS services with soft limits
As per the service utilization documentation it is possible to have a Memory utilizations over 100% when using soft limits in the ECS tasks (because you don't want to kill your app with hard limits). ...
4
votes
1
answer
4k
views
Unable to start task in ecs. Tasks are in PENDING state
My tasks are in PENDING status
That's what I can see in the events
There is not many information in the service events.
Here is the task definition in json
{
"requiresAttributes": [
{
...
3
votes
2
answers
4k
views
Terraform returns "Unsupported service namespace, resource type or scalable dimension" when I attach an auto-scaling group to an ECS service
In my terraform code, I am trying to attach an auto-scaling group to my ECS Service using aws_autoscaling_target.
resource "aws_appautoscaling_target" "service_app_asg_target" {
resource_id = "${...
3
votes
2
answers
7k
views
Is reverse proxy still required between AWS ALB and application server?
Context
Web application with application server, i.e. Ruby on Rails with puma. Running within a container on AWS ECS with Fargate. Traffic is routed by AWS Application Load Balancer directly to ...
3
votes
1
answer
2k
views
AWS: MySQL running on ECS vs RDS
I'm working on a project where we will be using ECS to run the API of each client, it will start with one but it will eventually grow. We will also need a database for each client and the Project ...
3
votes
1
answer
1k
views
Cloudformation ECS keep all taskdefinition revisions
In CloudFormation ECS when I update TaskDefinition tag Image:app:2 and make update-stack, I get only the one last new revision a myapp:2. How I can keep all previous revisions in which case manually ...
3
votes
1
answer
3k
views
How to update the minimum & maximum number of running tasks in ECS
I want to update the min and max number of tasks for a service in ECS in a lambda function (python with boto3). It looks like the closest thing is the desired count: desiredCount, but I don't think ...
3
votes
3
answers
8k
views
TERRAFORM how do i have 1 ecs cluster with 2 or more ecs service/task definitions?
Using Terraform, I have tried the hardest to find out how to create 1 ECS cluster and have multiple services running under it. SO basically i have 2 different containers i want to run with this 1 ECS ...
3
votes
1
answer
3k
views
How do I determine the Container ID so that Terraform can attach it to an ALB target group?
I've used Terraform to create a VPC, subnets, ECS instances, routing and a task definition which I am able to run via the AWS console. That gives me a few instances of my small web app running in ...