How can I connect my autoscaling group to my ecs cluster?

In all tutorials for ECS you need to create a cluster and after that an autoscaling group, that will spawn instances. Somehow in all these tutorials the instances magically show up in the cluster,...

Updating rather than replacing ECS Task Definition with CloudFormation

When updating a TaskDefinition in CloudFormation the docs say that a replacement action occurs...

Amazon API Gateway in front of ELB and ECS Cluster

I'm trying to put an Amazon API Gateway in front of an Application Load Balancer, which balances traffic to my ECS Cluster, where all my microservices are deployed. The motivation to use the API...

AWS ECS - Ways to deploy containers

The use case is like - developer makes some code changes and the below things happen automatically - build runs, application artifact created, docker image generated with the artifact, image...

How to restart containers in AWS ECS?

I have provided application configuration via consul's key-value store to the application containers running in ECS services. The application reads its configuration from consul only once on start...

Cloudwatch failedinvocation error no logs available

I have set up a Cloudwatch rule event where an ECS task definition is started when a previous task definition is completed. I can see the event triggers the task definition however it fails. The...

ECS auto deploy with ECR

I'm using GitHub, Jenkins, AWS ECR, AWS ECS. I want to deploy automatically when GitHub has a new commit. When GitHub, have new commit, GitHub, sent webhook to Jenkins, Jenkins build images and...

how to add AWS API gateway with application load balancer for ECS?

How to integrate API gateway with application load balancer? I have integrated ECS with ALB, now I want to add API gateway in front without lambda. But I got confused how to connect API gateway with ALB..

Docker links with awsvpc network mode

I have a Java webapp deployed in ECS using the tomcat:8.5-jre8-alpine image. The network mode for this task is awsvpc; I have many of these tasks running across 3 EC2 instances fronted by an...

.NET Core high memory usage in Docker (AWS ECS Fargate)

Here is a description of the application. I have a console application that runs Hangfire. There are several jobs that are recurring. One job, in particular, parses several large XML files. I...

aws ecs ec2 continuous deployment with jenkins

I am using jenkins for continuous deployment from gitlab into aws ecs ec2 container instance. I am using jenkins file for this purpose. For registering the task definition on each push I have...

Merge two separate Angular project to one URL on apache server

I have two different projects in Angular (one is in version 6, other in 7) and each project has own routing module. I must merge them into one domain url. To be clear I must do in that...

How can I expose both TCP and UDP on a single port in a AWS EC2 Task?

I am running into an issue with port mappings on my AWS Fargate AWS::ECS::TaskDefinition. The app inside the container listens for both TCP and UDP traffic on a single specific port. The AWS...

How to use ECSCredentials with AWS SDK?

I have a react application that is being run on an ECS container. I am trying to provide AWS credentials via the ECS container so that I can make calls to other AWS services from within the...

AWS ALB Invalid Host header

I'm using AWS ECS to deploy my docker image and created Task definitions. Mapped it to AWS ALB and its Target Groups is healthy. When i try to access my Load Balancer from browser i'm getting...

Update AWS Task definition.json file from jenkins file dynamically

I have an AWS ECS task definition.json file in Gitlab repo and i am calling the same from my jenkins file to create new task definition. All the content in the task definition file i.e. container...

Use an existing EBS volume with the Docker REX-Ray plugin on ECS

I'm using Terraform to create an ECS Cluster, a task definition and a service. For task definition, the piece of code looks like this: resource "aws_ecs_task_definition" "postgres" { ...

Deploying Docker image to AWS ECS using Jenkins

I created a sample project on GitHub and I would like to accomplish following on every PR: Build React application and get it running inside a Docker container Using pipeline build the Docker...

How do I change my IAM ECSTaskExecutionRole to give me permission to get parameters from Systems Manager - Parameter Store?

I want to pass secrets or sensitive information securely to containers in a task for Amazon Elastic Container Service (Amazon ECS). I have a Docker container on ECS and a Task Definition that...

Amazon ECS: Target Group Health Check vs Container Health Check

Amazon ECS supports two different types of health checks: Target Group health checks make a configurable network request Container health checks run in the docker container and can be configured...

Accessing rexray/ebs volume from ECS host

I've managed to follow https://aws.amazon.com/blogs/compute/amazon-ecs-and-docker-volume-drivers-amazon-ebs/ and run my Container-based service on ECS using rex-ray Docker volume plugin. I can...

IAM policy/role setup for Start and Stop EC2 instances in a different AWS account

I would like to start and stop EC2 instances in an AWS account (Account: AAA) from another AWS account (Account: BBB). Specifically, I am setting up an API to do this on ECS in Account BBB. When I...

Passing environment variables to `docker-compose` when using ecs context

I am trying to use the new ecs context that the latest docker cli exposes. When I create the context using docker context create ecs my_context, I select the use environment variables method (the...

Docker compose job in ECS context fails to fetch AWS secret to retrieve image from DockerHub

I'm trying to use docker compose to create and launch a small ECS-Fargate cluster with just 2 containers. One of the container images is located in my private repository at DockerHub. However,...

AWS CloudFormation blue/green deployments for EC2

Does AWS CloudFormation support blue/green deployments for EC2? I was able to create blue/green deployment using CodeDeploy for EC2; however, I couldn't figure out how to create one using...

YAML_FILE_ERROR Message: batch yaml definition is required

I'm implementing a codebuild project, but I'm getting the error YAML_FILE_ERROR Message: batch yaml definition is required. Searched everywhere but with no luck. Full Error: [Container] 2021/07/13...

How to mount a FUSE-based filesystem on docker container running on AWS?

I need to mount a FUSE-based filesystem (using rclone) on a docker container that must be executed on AWS ECS Fargate. I have no problem running the container locally using the following...

ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)

I'm running this simple flask app in vs code. Dockerized it and loaded to ECS. The task is exiting with the following error: ImportError: cannot import name 'MutableMapping' from 'collections'...

How can I get output from boto3 ecs execute_command?

I have an ECS task running on Fargate on which I want to run a command in boto3 and get back the output. I can do so in the awscli just fine. ➜ aws ecs execute-command --cluster cluster1 \ ...

Provided region_name '"$region"' doesn't match a supported format for Windows (CMD)

I am trying to deploy ECS using Terraform and it's throwing the above error while I am Provisioning the ECR this is happening. It tried removing the double quotes, then enabled trace for...