The secure301 stack is a simple solution to an annoying problem - it allows you to have HTTPS redirects with a 301 message. To achieve this the stack utilizes the API Gateway.
When deploying the stack you have to only manually make a SSL Certificate using the AWS Certificate Manager service, provide all the details in the deployment phase, and you'll get a working redirect.
We chose to use API Gateway for this because using CloudFront in conjunction with S3 is very slow to work with. It take CloudFront 20 min to deploy the resources across all the regions, where as API Gateway is also deliver over CloudFront, but the deployment is instant. Since CloudFront in this case is managed by AWS itself.
The stack was designed to handle one redirectsion per deployment to keep the solution simple and straight forward.
This stack is available to anyone at no cost, but on an as-is basis. 0x4447, LLC. is not responsible for damages or costs of any kind that may occur when you use the stack. You take full responsibility when you use it.
All you need to do to deploy this stack is click the button to the left and follow the instructions that CloudFormation provides in your AWS Dashboard. Alternatively you can download the CF file from here.
- 1x API Gateway
- 1x API Gateway Domain
- Prior to deploying the stack you have to create a SSL Cert for the domain you want to redirect from. Using the Certificate Manager service.
- Once deployed you have to take the geenral API Gateway domian and update your DNS record.
This repo was build using the Grapes Frameworks. First you need to install the framework:
sudo npm install -g @0x4447/grapes
Then, go inside this repo and run this command:
grapes -s .
This will create a CloudFormation.json
file in the root dir of the repo which you can upload to AWS.
If you enjoyed this project, please consider giving it a ๐. And check out our 0x4447 GitHub account, where you'll find additional resources you might find useful or interesting.
This project is brought to you by 0x4447 LLC, a software company specializing in building custom solutions on top of AWS. Follow this link to learn more: https://0x4447.com. Alternatively, send an email to [email protected].