DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Deploy Docker Images to AWS Fargate — Run Containers Without Managing Infrastructure

Deploy Docker Images to AWS Fargate — Run Containers Without Managing Infrastructure

This tutorial shows how you can deploy Docker images of microservices to AWS Fargate without having to worry about container management.

Raman Sharma user avatar by
Raman Sharma
·
Jun. 15, 18 · Tutorial
Like (6)
Save
Tweet
Share
15.85K Views

Join the DZone community and get the full member experience.

Join For Free

In the previous article, we looked at how to create a simple Spring Boot application and push it over to DockerHub. In this final article of this series, we will look into using the Docker image and deploying the application using AWS Fargate. AWS Fargate is a technology for Amazon ECS and EKS that allows you to run containers without having to manage servers or clusters. Fargate is an abstraction, so instead of you managing your instances and clusters, it will accomplish this for you.

Picking up from where we left, we have our image at DockerHub. We could easily have this pushed to AWS ECR as well. On AWS Fargate, we have the option to choose an existing configuration or create a custom one. Since we are working with a Spring Boot application, we will choose "Custom."

Default Container Definitions

Click on "configure" to add the Container Definition.

Container name: employeeapp

Image: coolindguy/employeeapp

*By default, the field accepts images from Document Hub. If you are using ECR, you have to provide the complete ECR URL.

  1. Memory limits: We can leave it at the soft limit of 128 MiB for our sample deployment.
  2. Port mappings: The service is running on port 8080, so we can map it to the same.

Task Definition: A task definition describes one or more containers through attributes. We leave everything as default for our purposes.


awsvpc
Create new
FARGATE
0.5GB (512)
0.25 vCPU (256)

Defining the Service and provisioning an ALB:

employeeapp-service
(This can be changed to a desired count of simultaneous task definitions in a cluster).

Automatically create new

8080
HTTP

Define the cluster for the application:

Automatically create new
Automatically create new

This is the desired state of our deployment:

Image title

At this point, we can review our deployment state and click on the "create" button. I did not have much luck getting the desired state a few times, so be patient with that.

Image title

After you see all 10 tasks completed, you can see the service details by clicking "View Service."

You can navigate to "Target Group Name" -> "Load Balancer" to get the DNS Name of the Load Balancer URL, which should give load balancer access to your containerized application running on AWS Fargate.

The same application can be deployed via ECS as well, but Fargate abstracts a lot of the complexity and you can focus on your application and not have to worry about the nitty-gritty of container management.

AWS Docker (software) Load balancing (computing) application Spring Framework Task (computing) Infrastructure

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Web Application Architecture: The Latest Guide
  • Distributed SQL: An Alternative to Database Sharding
  • The Future of Cloud Engineering Evolves
  • Java Development Trends 2023

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: