Open the AWS console, and browse to the AWS App Runner service, or https://console.aws.amazon.com/apprunner/home:
Select âCreate a serviceâ.
For your Repository type, select âSource code repositoryâ. This will require you to add a connection to GitHub in order for AWS App Runner to deploy your new service. Select âAdd newâ.
Give your connection name a suitable name - for example apprunner-example-connection
. Install a GitHub app with access to the repository you have just created by choosing the organization in which you created your new repository. Select your own account name.
Confirm your password
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.
Underneath Deployment trigger, select âAutomaticâ in order to automatically redeploy your application whenever a code change is pushed to the main branch of your Github repository, then select âNextâ.
For this example, we are going to specify all the settings for our service manually. This is in order to show the control that AWS App Runner gives you. Later we will demonstrate giving these settings through a configuration file contained within your code repository.
Select âConfigure all settings hereâ, then underneath Runtime select âNodejs 12â from the dropdown.
Under Build commend, enter npm install
.
Under Start command, enter node index.js
.
Under Port, enter 3000
.
Select âNextâ to continue.
In this step we will give our new service a name - simple-express-app
. Leave the rest of these settings as defaults. Select âNextâ to continue.
Finally, review your settings and select âCreate & deployâ. This will take a few minutes.
Once status has moved to âComplete", you can click on the url listed below “Default domain” in order to view the actual web application you have just deployed.
Congratulations, you have just deployed a simple web service using App Runner!