This a mono-repo several packages to serve as an example getting up and running with Remix on AWS using AWS CDK.
It uses @m14t/remix-run-apigateway for the Remix
bindings to AWS Lambda. This the AWS Lambda equivalent of @remix-run/express
when using Remix with Express.
It comprises of 2 packages:
remix-starter-apigateway
- An example project using @m14t/remix-run-apigatewaycdk
- An AWS CDK project to deployremix-starter-apigateway
git clone [email protected]:m14t/starter-aws-cdk.git
cd starter-aws-cdk
npm ci
The following steps need to be ran once before you can use AWS CDK on your account.
- Configure your AWS credentials.
- Boostrap your environment.
npm run bootstrap #installs NPM dependencies in all child projects cd cdk cdk bootstrap
The remix-stack-config.ts
can be used to configure your deployment. It
contains the following options:
Key | Default | Description |
---|---|---|
stackname |
remix |
The name of the CloudFormation stack that will be created |
domainName |
The domain name to be used as an alias for the CloudFront CDN distribution | |
lambdaMemorySize |
128 |
The amount of memory, in MB, to assign to the lambda function. After deploying, you can use lumigo-cli powertune-lambda to determine the best value to use here |
lambdaEnvironmentVariables |
An object of key/value pairs of the ENV variables that you want to expose to your lambda function | |
certificateArn |
The ARN for the AWS Certificate Manager certificate for the domainName |
|
hostedZoneId & zoneName |
If both of these values are provided, then an A Record will be created in this hosted Zone for the domainName |
The following command will use CDK to create a CloudFormation stack for the remix-starter-apigateway
package.
npm run deploy
cd cdk
cdk destroy