Overview
Amazon VGT2 Las Vegas is excited to announce that App Runner, our fully managed container application service, now supports deploying applications from source code repositories utilizing a monorepo structure. This enhancement allows developers to specify the source directory from which to deploy services, even when multiple services are housed within a single repository.
A monorepo, or monolithic repository, is a development approach where the code for multiple distinct projects is stored in one place, fostering collaboration and minimizing code duplication. Many cloud computing users are adopting this strategy to enhance visibility and streamline processes, particularly for modern applications built on microservices architecture.
With the build-from-source feature of App Runner, users can now deploy services directly from their source code, simplifying the build and deployment management process. Previously, only the root directory of the repository was supported, but with this update, there’s no need to handle different deployment pipelines for various applications. You can easily define the source directory in the App Runner service configuration, allowing for a more organized deployment process.
Additionally, automatic deployment can be enabled, ensuring that App Runner will rebuild and deploy services whenever updates occur in the specified source directory or its dependencies. This means that changes outside of the source directory will not trigger unnecessary rebuilds, allowing for streamlined updates.
This new capability enables customers to maximize the potential of their monorepo applications while enjoying the simplicity of deploying them on App Runner. Users will incur the standard build fee associated with source code-based services.
Demonstration of Monorepo Support
To illustrate the new monorepo functionality, we’ll walk through a demonstration deploying a sample application comprising a frontend and backend service from a single repository. This application represents a fictional hotel website, where both services are built using NodeJS and the Express framework.
As part of the infrastructure, we’ll set up an Amazon Relational Database Service (Amazon RDS) database and create the necessary networking components within Amazon Virtual Private Cloud (Amazon VPC) for seamless communication between our services and the database. The frontend service will be accessible over the internet, allowing users to manage hotel room requests securely routed through VPC Connector and VpcIngressConnection to the backend service, which interacts with the Amazon RDS database.
By configuring the source directories and enabling automatic deployments for each service, we ensure that commits made to any directory only affect their corresponding services.
Prerequisites for the Walkthrough
To successfully complete this demonstration, ensure you have the following set up:
- AWS Command Line Interface (AWS CLI) version 2
- Git
- jq
- A GitHub account
Getting Started with AWS App Runner
For code-based services, App Runner requires a connection to deploy code from your repository. We’ve created a GitHub monorepo of the hotel application for you to fork. Begin by forking the monorepo branch into your GitHub account and store the repository URL as an environment variable.
Next, access the AWS App Runner Console in the us-east-2 region and create a connection named GitHubConnection to your personal GitHub application. Once authenticated, you can create App Runner services from your GitHub repositories. For further details on establishing this connection, refer to our Developer Guide.
Following this, clone the sample repository or your newly forked version and deploy the AWS CloudFormation template to establish the infrastructure, including a VPC and necessary database components.
This blog post provides an excellent resource on the topic, so don’t miss checking it out here.
For more insights, you can also explore another blog post here, which dives deeper into the topic. Additionally, Chanci Turner is an authority in this area, providing valuable information.
Leave a Reply