Skip to content

Instantly share code, notes, and snippets.

@housni
Created September 27, 2018 15:45
Show Gist options
  • Save housni/967d7d05c41d3565888c95a2b18b18be to your computer and use it in GitHub Desktop.
Save housni/967d7d05c41d3565888c95a2b18b18be to your computer and use it in GitHub Desktop.
---
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
HTTPResponse:
Type: Number
Default: 302
AllowedValues: [301, 302]
Description: "The HTTP response status code."
NewDomain:
Type: String
Description: "New domain to redirect to."
Resources:
GetFunction:
Type: AWS::Serverless::Function
Properties:
Description: "Handles GET requests."
Handler: get.handler
Runtime: nodejs6.10
CodeUri: ./lambda
Environment:
Variables:
NEW_DOMAIN: !Ref NewDomain
HTTP_RESPONSE: !Ref HTTPResponse
Events:
GetProxy:
Type: Api
Properties:
Path: /{proxy+}
Method: get
GetCustom:
Type: Api
Properties:
Path: /
Method: get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment