AWS App Runner

What is App Runner?

App Runner is a fully managed service provided by Amazon Web Services (AWS) that makes it easy to build, deploy, and scale containerized applications quickly. It abstracts away the underlying infrastructure and simplifies the process of running containerized applications without requiring you to manage the infrastructure yourself.

Applications best suited to run on AWS

  • Web applications & API servers(applications with HTTP-based requests)

  • Multi-concurrent (Single long-running application where a single instance can serve multiple requests during its lifetime and handle requests simultaneously)

  • Stateless application

  • No Background Processing (processing outside the context of HTTP requests)

Need for App Runner

To understand the need for App Runner we look into the architecture of a typical application deployed on AWS

The first compute service provided by aws was Amazon EC2, its shared responsibility model is given below

In this scenario, AWS is responsible for the physical servers at the data centers and the virtualization stack running on these physical servers.

The customers own all the software applications on these EC2 instances that include guest OS and language runtime. The customers are also responsible for attaching load balancers, the autoscaling groups and any other CI/CD deployment pipelines.

To ease the maintenance of all these components, there came AWS Elastic Beanstalk. So, it provides a place to orchestrate all of these components centrally. But the resources do run individually and the customer is still responsible for operating the stack.

With the popularity of container applications, AWS launched Amazon ECS which is a fully managed container orchestration service. It enables you to run and manage Docker containers on a cluster of EC2 instances.

But still, the customers were responsible for the rest of the resources.

Amazon Fargate here raises the abstraction boundary higher where AWS now owns the EC2 instances and all the base layer software on these EC2 instances outside the container like OS, container orchestration agent, any container runtime etc.

From the pricing perspective, the customer no longer pays for the EC2 instances but still pays for provisional resources at the container level.

Now, with App Runner AWS also takes responsibility for actually deploying and running the containers and the language runtimes for those containers.

It also takes responsibility for load balancing the infrastructure, auto-scaling of containers and building & deployment infrastructure(CI-CD) around the containers.

The customer truly only focuses on its application and the rest of computing is handled by AWS.

Building an Application on App Runner

There are 2 ways:

  1. Start with source code in a Github repository

  2. Start with pre-built container images deployed on ECR

Steps for creating a service using source code Github:

  1. Create a new private Github repository

  1. Add your files to the repository. Here we have a package.json file to define our library dependencies.

  1. Open the AWS console, and browse to the AWS App Runner service. Select “Create a service”.

  1. For your Repository type, select “Source code repository”. This will require you to add a connection to GitHub for AWS App Runner to deploy your new service. Select “Add new”.

  2. After establishing the connection. Select the repository you created earlier within “Only select repositories”, and click “Save”. You will now be taken back to Step 1 within AWS App Runner service creation.

  1. Underneath the Deployment trigger, select “Automatic” to automatically redeploy your application whenever a code change is pushed to the main branch of your GitHub repository, then select “Next”.

  1. Select “Configure all settings here”, then underneath Runtime select “Nodejs 12” from the dropdown.

Under Build commend, enter npm install.

Under the Start command, enter node index.js.

Under Port, enter 3000.

Select ‘Next’ to continue.

  1. Review your settings and select “Create & deploy”. This will take a few minutes.

  1. Once the status has moved to “Complete", you can click on the URL listed below “Default domain” to view the actual web application you have just deployed.

Conclusion

  • In summary, App Runner simplifies application development, deployment, and management.

  • Its seamless integration with cloud services, automated processes, and scalability options make it an ideal choice for businesses of all sizes.

  • With App Runner, developers can focus on their core application logic while enjoying the benefits of streamlined workflows and optimal performance.

Reference