mirror of
https://github.com/eledio-cloud/standard-redirects-for-cloudfront.git
synced 2025-10-30 16:12:30 +01:00
Bugfixes for automated version creation
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,4 +5,5 @@ npm-debug.log
|
||||
*.log
|
||||
git-commit.json
|
||||
.vscode
|
||||
standard-redirects-for-cloudfront-sam.yaml
|
||||
standard-redirects-for-cloudfront-sam.yaml
|
||||
standard-redirects-for-cloudfront-sam-test.yaml
|
||||
@@ -24,6 +24,14 @@ It allows you to have very nice outward facing URLs like "/cooltopic", that inte
|
||||
|
||||
Make sure that your CloudFront distribution handles the URL "/" directly by having the property "Default Root Object" set to "index.html".
|
||||
|
||||
## Updating
|
||||
|
||||
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.
|
||||
4. In CloudFront edit a **Behaviour** and add a **Lambda Function Association** with the *Event Type* "Origin Request" and enter the Lambda function ARN from the previous step.
|
||||
5. Wait for the CloudFront distribution to deploy.
|
||||
|
||||
## Installation
|
||||
|
||||
### Installation via the Serverless Application Repository
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "standard-redirects-for-cloudfront",
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -8,7 +8,8 @@
|
||||
"test-coverage": "istanbul cover _mocha",
|
||||
"predeploy": "git log -1 --pretty=format:'{ \"date\":\"%cI\", \"commit\":\"%H\" }' > git-commit.json",
|
||||
"deploy": "zip -r LATE-standard-redirects-for-cloudfront.zip . -i \\*.js -i git-commit.json -i node_modules/\\* -x test/\\* -x node_modules/aws-sdk/\\* -x node_modules/mocha/\\* && echo Uploading... && aws lambda update-function-code --region us-east-1 --function-name LATE-standard-redirects-for-cloudfront --zip-file fileb://LATE-standard-redirects-for-cloudfront.zip --publish",
|
||||
"package": "aws cloudformation package --template-file sam.yaml --output-template-file standard-redirects-for-cloudfront-sam.yaml --s3-bucket public.digital-sailors.de --s3-prefix serverless-application-repo/standard-redirects-for-cloudfront"
|
||||
"package": "aws cloudformation package --template-file sam.yaml --output-template-file standard-redirects-for-cloudfront-sam.yaml --s3-bucket public.digital-sailors.de --s3-prefix serverless-application-repo/standard-redirects-for-cloudfront",
|
||||
"package-test": "aws cloudformation package --template-file sam.yaml --output-template-file standard-redirects-for-cloudfront-sam-test.yaml --s3-bucket demo.digital-sailors.work --s3-prefix serverless-application-repo/standard-redirects-for-cloudfront-test"
|
||||
},
|
||||
"dependencies": {},
|
||||
"license": "Apache-2.0",
|
||||
|
||||
9
sam.yaml
9
sam.yaml
@@ -3,8 +3,7 @@ Transform: AWS::Serverless-2016-10-31
|
||||
Outputs:
|
||||
StandardRedirectsForCloudFrontVersionOutput:
|
||||
Description: The ARN of the function, including the version
|
||||
Value:
|
||||
Ref: DeployedFunction
|
||||
Value: !Ref StandardRedirectsForCloudFront.Version
|
||||
Export:
|
||||
Name: StandardRedirectsForCloudFrontARN
|
||||
Resources:
|
||||
@@ -17,9 +16,3 @@ Resources:
|
||||
MemorySize: 128
|
||||
Timeout: 3
|
||||
AutoPublishAlias: 'CurrentProd'
|
||||
DeployedFunction:
|
||||
Type: AWS::Lambda::Version
|
||||
Properties:
|
||||
Description: The deployed version of the function
|
||||
FunctionName:
|
||||
Ref: StandardRedirectsForCloudFront
|
||||
Reference in New Issue
Block a user