Runtime updated to nodejs10.x

This commit is contained in:
Oliver Gutperl
2019-12-16 08:13:20 +01:00
parent 5872e8e1a7
commit 558ab482d9
4 changed files with 16 additions and 10 deletions

View File

@@ -10,11 +10,11 @@ URI paths that do not have an extension and do not end with a "/" are redirected
## Examples
/foo/bar/ -> internal redirect -> /foo/bar/index.html
/foo -> external redirect (301) -> /foo/ -> internal redirect -> /foo/index.html
/foo.html -> no redirect
/foo/bar.html -> no redirect
/foo/index.html -> external redirect (301) -> /foo/
/foo/bar/ -> internal redirect -> /foo/bar/index.html
/foo -> external redirect (301) -> /foo/ -> internal redirect -> /foo/index.html
/foo.html -> no redirect
/foo/bar.html -> no redirect
/foo/index.html -> external redirect (301) -> /foo/
## Notes
@@ -26,6 +26,12 @@ Make sure that your CloudFront distribution handles the URL "/" directly by havi
## Updating
### Lambda Runtime
This package uses the `nodejs10.x` Node.js 10 Runtime. Updating the package in your AWS account requires one manual step, which is outlined below.
### Procedure
1. Install the application "standard-redirects-for-cloudfront".
2. Go to the Cloudformation Console
3. Select the Output Value, this is the ARN (including the version) for the Lambda function.
@@ -69,7 +75,7 @@ Make sure that your CloudFront distribution handles the URL "/" directly by havi
For any questions or comments, do contact us!
Email: contact@digital-sailors.de
Email: contact@digital-sailors.de
Web: https://www.digital-sailors.de/
Enjoy!

View File

@@ -1,7 +1,7 @@
'use strict';
/*
Copyright 2017 DigitalSailors e.K.
Copyright 2017-2019 DigitalSailors e.K.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
let prefixPath; // needed for 2nd condition
if (request.uri.match('.+/$')) {

View File

@@ -1,6 +1,6 @@
{
"name": "standard-redirects-for-cloudfront",
"version": "1.3.1",
"version": "1.4.0",
"description": "",
"main": "index.js",
"scripts": {

View File

@@ -11,7 +11,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs8.10
Runtime: nodejs10.x
Description: 'Standard Redirects for CloudFront by Digital Sailors via the Serverless Application Repository.'
MemorySize: 128
Timeout: 3