IBM MQ in ECS on AWS Fargate

AWS Fargate is a serverless compute resource specifically designed for running containers. With AWS Fargate the deployment and management of the container(s) are controlled by either Elastic Container Service (ECS) or Elastic Kubernetes Service (EKS).

Initially, users often get confused by the relationship between Fargate and the container management solution (EKS or ECS). Therefore, I want to labor the point of the difference, when deploying a container within the context of an enterprise, any solution will include two components:

How to Deploy a Spring Boot App on AWS Fargate

In this blog, you will learn how to deploy a basic Dockerized Spring Boot application to AWS Fargate. AWS Fargate is a serverless AWS environment. Enjoy!

1. Introduction

In a previous post, you learned how to deploy a basic Dockerized Spring Boot application on an AWS ECS Cluster. You learned about the different components like the ECR Docker repository, Task Definitions, the ECS Cluster itself and Services. It is advised to read that post first when these components are new to you. In this post, you will create and deploy the same Dockerized Spring Boot application. This time you deploy it to AWS Fargate. AWS Fargate is identical to AWS ECS Cluster, but this time you will not need to manage the EC2 instances yourself which is a great advantage! It is completely serverless.

Automate Docker Container Deployment to AWS ECS Using CloudFormation

Deploying Docker containers to AWS Elastic Container Service (ECS) is straightforward and automated when you make use of CloudFormation to define your infrastructure in a YAML template. Here we'll be running through a simple example where we'll setup everything required to run an NGINX container in AWS and access it over the internet.

AWS ECS Overview

We've chosen to run the NGINX official Docker image as it will allow us to browse to port 80 and view the response to prove the container is running. To get this deployed into ECS, we'll need the following buildings blocks: