Let's host a NodeJS application in the cloud from a GitHub repository using AWS AppRunner.
AWS App Runner offers two different types of service sources: source code and source image. Regardless of the source type, App Runner takes care of starting, running, scaling, and load balancing your service. You can use the CI/CD capability of App Runner to track changes to your source image or code. When App Runner discovers a change, it automatically builds (for source code) and deploys the new version to your App Runner service.
To learn more about these two service types, please refer to the AWS App Runner documentation.
For this demo, we will focus on services based on source code. Source code is the application code that App Runner builds and deploys for you. You need to point App Runner to a source code repository with a supported runtime. App Runner will then build an image based on the base image of the runtime and your application code. Finally, it will start a service that runs a container based on this image. You don't need to provide container configuration or build instructions such as a Dockerfile.
Check the supported runtimes for more information.
In this demo, you can use a NodeJS app that is stored in a GitHub repository. AppRunner will automatically build, deploy, and host it in the cloud for you.
You have two options to perform this demo:
Console: You can use the AWS Management Console to follow along. The video below demonstrates how to use the console for this demo.
Infrastructure as Code: The video demonstrates how to perform the demo using AWS CDK. You can access the NodeJS application code from the GitHub repository here. For the AWS CDK infrastructure code used in the video, you can find it here.