Open njr2128 opened 5 months ago
WAIT until we are ready to release the first public release of the site. Use the github.io site as "dev" or "staging"
We have set up a CloudFront distribution, but have encountered errors with accessing site pages from the landing page. This seems to be due to Hugo's index.html needs that are different from AWS
to Everyone https://fastfoodcoding.com/recipes/hugo/hosting-hugo-on-aws-s3-cloudfront/
Terry Catapano 12:33 PM
def lambda_handler(event, context):
request = event['Records'][0]['cf']['request']
uri = request['uri']
# If URL ends with a slash, append index.html
if uri.endswith('/'):
request['uri'] += 'index.html'
return request
Another issue just encountered - permissions:
Working now. The function is actually:
def lambda_handler(event, context):
request = event['Records'][0]['cf']['request']
uri = request['uri']
# If URL ends with a slash, append index.html
if uri.endswith('/'):
request['uri'] += 'index.html'
return request
Also, need to publish a version and use that version's ARN in the Lambda Function Association Viewer Request
in the 'Behaviors" for the distribution in CloudFront, as well as specifying Path Pattern is
* `
Also using IAM Trust Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": [
"lambda.amazonaws.com",
"edgelambda.amazonaws.com"
]
},
"Action": "sts:AssumeRole"
}
]
}
Through cloudfront?
https://cu-mkp.github.io/research-teaching-companion/
https://teaching640.makingandknowing.org/