SpartaHTML
Sparta application that demonstrates provisioning an S3 backed site with a CORS-enabled API Gateway that includes a custom API Gateway Lambda Authorizer:
// Get the ARN and the Authorization Token
methodArn, _ := request["methodArn"].(string)
authToken, _ := request["authorizationToken"].(string)
effect := "Deny"
if authToken == "Sparta" {
effect = "Allow"
}
Instructions
git clone https://github.com/mweagle/SpartaHTMLAuth
cd SpartaHTMLAuth
make get
S3_BUCKET=<MY_S3_BUCKET_NAME> make provision
- In the Stack output section of the log, look for the S3SiteURL key and open the provided URL in your browser (eg: http://spartahtml-site09b75dfd6a3e4d7e2167f6eca73957e-zp9okcokn7o.s3-website-us-west-2.amazonaws.com).