/SpartaHTMLAuth

Sparta HTML site with custom Lambda authorizer

Primary LanguageCSS

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

  1. git clone https://github.com/mweagle/SpartaHTMLAuth
  2. cd SpartaHTMLAuth
  3. make get
  4. S3_BUCKET=<MY_S3_BUCKET_NAME> make provision
  5. 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).

Result

Credits