Skip to content

bitbull-serverless/website-redirect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Website Redirect

CloudFormation CloudFront

Simple website that redirect to a specific URL.

Created resources

This application creates a CloudFront distribution that use CloudFront Function to return a fixed redirect response.

Infrastructure Schema

Installation

Region Deploy Link
eu-west-1 Launch Stack in region eu-west-1
eu-central-1 Launch Stack in region eu-central-1
us-east-1 Launch Stack in region us-east-1
us-east-2 Launch Stack in region 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"

Public templates

Region Template URLs
eu-west-1 https://bitbull-serverless-templates-butoamoogh8eigo.s3.eu-west-1.amazonaws.com/website-redirect/template.yml
eu-central-1 https://bitbull-serverless-templates-saijuozaeshae6e.s3.eu-central-1.amazonaws.com/website-redirect/template.yml
us-east-1 https://bitbull-serverless-templates-chai7ephae5eet2.s3.us-east-1.amazonaws.com/website-redirect/template.yml
us-east-2 https://bitbull-serverless-templates-xae9och1eipiem8.s3.us-east-2.amazonaws.com/website-redirect/template.yml

Parameters

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.

Outputs

  • CloudFrontDistribution: The CloudFront distribution that return redirect response.

Credits

About

Simple static website management for SPA, PWA, static or JAM stack applications with HTTP Basic Auth.

Topics

Resources

License

Stars

0 stars

Watchers

3 watching

Forks

Contributors