AWS, Cloud Computing

5 Mins Read

A Guide to Deploy Simple Web App using Amazon ECR with AWS App Runner

Overview

Imagine being a developer who has built a containerized web application using Docker. It would be great if you could deploy this web app to the cloud without managing the underlying infrastructure or worrying about scaling it as user demand increases. Your containerized web application can be deployed and scaled in the cloud using ECR and App Runner.

Following are the steps involved in deploying a simple web app using ECR and App Runner:

  • Dockerize your web application.
  • The docker image should be pushed to ECR.
  • Configure the App Runner service to use the ECR repository as a source.
  • You must configure the App Runner service with the appropriate port number and environment variables.
  • Deploy the App Runner service and access the web app using the generated URL.
  • App Runner automates web application deployment and scaling. It will be much easier to manger your application.

What is AWS App Runner?

App Runner is a fully managed service by Amazon Web Services (AWS) that helps developers and organizations build, test, and deploy their applications quickly and easily. The platform provides a simple, streamlined solution for automating the application deployment process, reducing the time and effort required to get applications up and running.

With App Runner, developers can focus on writing code while the platform takes care of the rest.

At its core, App Runner is a continuous delivery platform that helps automate the deployment pipeline. It integrates with various AWS services, including Amazon ECR, Amazon S3, and Amazon EC2, to provide a complete end-to-end solution for deploying and managing applications.

The platform supports a wide range of programming languages and frameworks, making it easy for developers to use their preferred tools and technologies.

One of the key benefits of App Runner is its ease of use. The platform provides a simple and intuitive user interface, making it easy for developers to build and manage their applications.

With a few clicks, developers can create a new application, set up a deployment pipeline, and start testing and deploying their applications.

The platform also integrates with popular version control systems like Git, allowing developers to manage their code and collaborate with others easily.

Another benefit of App Runner is its scalability. The platform can handle many applications and deployment pipelines, making it ideal for organizations of all sizes. It also provides a robust security model, ensuring that all data is protected.

This is particularly important for organizations that handle sensitive information, as they can trust that their data will be protected when using App Runner.

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

What is Amazon ECR?

Amazon ECR, or Amazon Elastic Container Registry, is a fully managed Docker container registry that enables developers to store, manage, and deploy Docker container images. It is part of the Amazon Web Services (AWS) cloud computing platform and provides a secure and scalable way to store, distribute, and manage container images.

ECR eliminates the need for managing a separate infrastructure for container images and offers easy integration with other AWS services like Amazon ECS and Amazon ECR, as well as CI/CD pipelines. The service integrates with the Docker CLI and provides a simple user interface for managing images.

One of the key features of ECR is its security features, including access control and image signing. Access control can be managed through AWS IAM policies, and images can be signed to provide authenticity and integrity. Additionally, ECR integrates with Amazon Inspector to provide automatic security scans for vulnerabilities in container images.

Steps to Deploy a Web Application using AWS App Runner

Deploying a web application using Amazon Elastic Container Service (ECS) and Amazon Elastic Container Registry (ECR) can be hassle-free.

This tutorial will show you how to deploy a web application using App Runner and source the image from ECR.

Prerequisites:

  • An AWS account
  • AWS configure
  • Docker installed on your machine
  • AWS CLI installed on your machine
  • An AWS ECR repository created and configured on your machine

The architecture of App Runner in AWS:

ecr1

Step 1 – Building the Docker Image

First, we need to build the Docker image for our web application. To do this, we’ll need to pull a docker image.

Then run the docker image using:

Step 2 – Pushing the Docker Image to ECR

Next, we must push the Docker image to ECR to access it from App Runner. We’ll need to log in to ECR using the AWS CLI and then push the image to the ECR repository.

Here’s the command to log in to ECR using the AWS CLI:

Replace “us-west-2” with the region in which your ECR repository was created, and replace “<account_id>” with your AWS account ID.

Tag the docker image and use ECR repo URL:

Push the image:

Step 3 – Deploying the Web Application using App Runner

Now that our Docker image is stored in ECR, we can use App Runner to deploy our web application. App Runner is a fully managed service that makes it easy to automate containerized application deployment.

To deploy our web application using App Runner, we’ll need to create a new App Runner task and configure it to use our Docker image from ECR.

Here’s the high-level steps to create an App Runner task:

  • Open the App Runner console in the AWS Management Console.
  • Click the “Create a new task” button.

ecr2

  • Choose source as Repository type and provider as Amazon ECR, and paste container image URL.

ecr3

  • In Deployment settings, Create a new service role, choose manual, and click next.

ecr4

  • Give a service name and configure other settings like add port 80 to access the application, then click next.

ecr5

It will take a few minutes to lunch the app runner:

ecr6

Final output:

ecr7

Conclusion

In conclusion, App Runner is a powerful and flexible platform that makes it easy for developers and organizations to build, test, and deploy their applications. Its ease of use, scalability, and security features make it a must-have for any organization looking to streamline its application deployment process and improve its overall development efficiency.

Get your new hires billable within 1-60 days. Experience our Capability Development Framework today.

  • Cloud Training
  • Customized Training
  • Experiential Learning
Read More

About CloudThat

CloudThat is also the official AWS (Amazon Web Services) Advanced Consulting Partner and Training partner and Microsoft gold partner, helping people develop knowledge of the cloud and help their businesses aim for higher goals using best in industry cloud computing practices and expertise. We are on a mission to build a robust cloud computing ecosystem by disseminating knowledge on technological intricacies within the cloud space. Our blogs, webinars, case studies, and white papers enable all the stakeholders in the cloud computing sphere.

Drop a query if you have any questions regarding AWS App Runner and I will get back to you quickly.

To get started, go through our Consultancy page and Managed Services Package that is CloudThat’s offerings.

FAQs

1. Can I use my container image with AWS App Runner?

ANS: – Yes, AWS App Runner supports both public and private container images stored in Amazon ECR or any other container registry that supports Docker.

2. How much does AWS App Runner cost?

ANS: – AWS App Runner is a pay-as-you-go service, pricing based on the application’s number of vCPU and memory resources. There are no upfront costs or minimum fees, and pricing is based on actual usage.

WRITTEN BY Swaraj Sirsat

Share

Comments

  1. Aishwarya

    Apr 5, 2023

    Reply

    It worked for me, thank you!!

  2. Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!