wrenderer | CloudFront integration | on premise setup guide
This guide will walk you through the steps to set up wrenderer in an AWS environment using AWS CloudFormation templates.
wrenderer.example.com
setup/aws-lambda directory from wrenderer GitHub repository
Pull the pre-built image from Docker Hub.
docker pull liuminhaw/wrenderer:latest
Clone wrenderer git repository.
git clone --depth 1 [email protected]:liuminhaw/wrenderer.git && cd wrenderer
Build docker image.
docker build -t wrenderer .
All environment resources will be created using CloudFormation templates provided in the setup/aws-lambda directory. Choose a name for your wrenderer setup, wrenderer-demo will be use as the ${Name} for demonstration purpose in this guide, you can replace it with your own setting.
Note: All CloudFormation stacks created in this guide should be in the same AWS region unless the step has specific region requirement.
Create ECR with template: setup/aws-lambda/wrenderer-img.yaml.
Specify stack name and parameters
Stack name: ${Name}-img
Parameters:
${Name}
Configure stack options: Keep the default options or change as required.
Review and create stack: Review the configuration and create the stack.
A stack with name ${Name}-img with status CREATE_COMPLETE should be seen in CloudFormation Stacks page once creation is complete.
Upload wrenderer docker image to ECR repository created in step 1. Push commands can be found in the ECR repository console page.
Create environemnt resources with template: setup/aws-lambda/wrenderer-main.yaml.
Specify stack name and parameters
Stack name: ${Name}
Parameters:
${Name}
sha256:... (can be found in ECR repository page)
4096 (in MB)
Configure stack options: Keep the default options or change as required.
Review and create stack: Review the configuration and create the stack.
A stack with name ${Name} with status CREATE_COMPLETE should be seen in CloudFormation Stacks page once creation is complete.
Generate SSL certificate in us-east-1 (N. Virginia) region for CloudFront distribution.
This step is required only if no certificate for the domain hosting wrenderer service exist in
us-east-1AWS Certificate Manager.
Set aws region: change region to us-east-1 (N. Virginia)
Generate SSL certificate with template: setup/aws-lambda/wrenderer-acm.yaml.
Specify stack name and parameters
Stack name: ${Name}-acm
Parameters:
${Name}
WrendererDomain
Configure stack options: Keep the default options or change as required.
Review and create stack: Review the configuration and create the stack.
DNS validation: CloudFormation will pause for DNS validation, set DNS record according to the value shown in events view and the progress will continue after the record is validated.
A stack with name ${Name}-acm with status CREATE_COMPLETE should be seen in CloudFormation Stacks page once creation is complete.
Set aws region: change region to us-east-1 (N. Virginia)
Create CloudFront distribution with template: setup/aws-lambda/wrenderer-cdn.yaml.
Stack name: ${Name}-cdn
Parameters:
${Name}
WrendererRestApiDomain of the wrenderer main stack created in step 3
WrendererApiDeploymentStage of the wrenderer main stack created in step 3
WrendererBucketRegionalDomain of the wrenderer main stack created in step 3
WrendererCertificateArn of the ACM stack.
Configure stack options: Keep the default options or change as required.
Review and create stack: Review the configuration and create the stack.
A stack with name ${Name}-cdn with status CREATE_COMPLETE should be seen in CloudFormation Stacks page once creation is complete.
Get the domain name of the CloudFront distribution created in step 5 from the output WrendererDistributionDomain of the CloudFront stack and point your domain to this domain name with a CNAME record.
Once DNS changes have propagated, wrenderer service should be accessible at the domain specified. You can start making requests to the API. Refer to the API documentation for available endpoints and usage.
Obtain api key from API Gateway console under API keys section.
![]()
Add middleware to your application for forwarding bot requests to the wrenderer service.