This is a basic example of how to deploy a container image to an AWS App Runner service. The API is located in the express-ts-api
folder and was generated with npx express-generator-typescript
.
The Express API is containerised and deployed using the included GitHub action.
- node
- npm
- AWS API credentials and an IAM role to assume (there is an IAM policy included but it has not been extensively tested and assumes the use of default CF parameter values and requires you to replace
${AWSRegion}
and${AWSAccountId}
with your desired deployment region and AWS account ID)
- Install node modules with
npm
cd express-ts-api
npm install
- Create an Elastic Container Repository in AWS (manually create or deploy included
ecr.yml
) - If using GitHub Actions to build the image and deploy the stack:
- Configure GitHub Secrets:
AWS_ACCESS_KEY
: AWS API Access KeyAWS_ECR_REPO
: URI of image repository created in step 2AWS_REGION
: AWS Region to deploy AWS App Runner inAWS_ROLE_TO_ASSUME
: An IAM Role to assume for stack deploymentAWS_SECRET_KEY
: AWS API Secret Key
- Configure GitHub Secrets:
Run the following:
npm build
npm run start:dev