Simple website that redirect to a specific URL.
This application creates a CloudFront distribution that use CloudFront Function to return a fixed redirect response.
Region | Deploy Link |
---|---|
eu-west-1 | ![]() |
eu-central-1 | ![]() |
us-east-1 | ![]() |
us-east-2 | ![]() |
Using the SAM CLI:
sam build
sam deploy --guided
Including in an other SAM template:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
WebsiteRedirect:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: # pick a templates links from section below, based on your region
Parameters:
RedirectStatusCode: "301",
RedirectStatusDescription: "Permanent Redirect",
RedirectUrl: "https://www.example.com/",
AcmCertificateArn: "arn:aws:acm:us-east-1:000000000000:certificate/xxxxxxxxxxxxxxxxx",
CloudFrontAliases: "example.com,example1.com,www.example2.com",
CloudFrontPriceClass: "PriceClass_100"
This application need some parameters when you deploy it:
-
RedirectStatusCode: The redirect status code.
-
RedirectStatusDescription: The redirect status description.
-
RedirectUrl: The redirect URL.
-
AcmCertificateArn: The certificate arn for the domain name provided.
-
CloudFrontAliases: The endpoint aliases valid for provided certificate.
-
CloudFrontPriceClass: The price class for CloudFront distribution.
- CloudFrontDistribution: The CloudFront distribution that return redirect response.
- Repository badges by Shields.io
- Infrastructure schema by Cloudcraft