This repository was built for demoing how to deploy a "Bring your own code" project to AWS App Runner, following a short clip that was uploaded to YouTube in Hebrew. In the short clip you will be able to see a step by step console demo, and this repository will demonstrate how to deploy the app using AWS Cli.
The application is a very simple page impression counter nodejs
app for demo purposes only, that is built and deployed to AWS App Runner service, the app will use a DynamoDB table as described in the following diagram as a counter.
awscli
>= 2.2.34, if you are using AWS CLI version 1, you might get errors on--no-cli-pager
switch ofUnknown options
, you can remove it from the scripts.- In AWS App Runner console, create a GitHub connection, and named it
github
as described in our documentation.
In the ./scripts
folder are all the scripts that you can use to deploy this app.
Steps:
1_prep_dynamodb.sh
- Creates the counter DynamoDB table.2_permissions.sh
- Creates proper permissions for app runner task to access DynamoDB securely.- Create App Runner service with Github hook auto deployment
3_apprunner_github.sh
, Make sure to update the REPO_URL variable with yours before running the script. the AWS Connector that was configured in the prerequisite, should have access to this repo. - showing the auto scale with stressing the application with
wrk
using4_stress_test.sh
In AWS App Runner, in addition built and run your code, as described above, you also have the option to run your container.
In order to deploy your container, you will need to build this app using the Dockerfile
and push it to your ECR Repository.
Make sure you have Docker installed and running, and you have IAM permissions to create and push to an ECR repository.
Steps:
- To create an ECR repository, build and push the application docker image
5_create_ecr_build_push.sh
- Create access role, to allow App Runner to pull images from ECR using
6_permissions_ecr.sh
- Create App Runner service with ECR auto deployment
7_apprunner_ecr.sh
See CONTRIBUTING for more information.
This repository is licensed under the MIT-0 License. See the LICENSE file.