Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please test as a Feature Integration:
Support for Environment Stages and Colors
We have Red, Yellow, Blue, and Green Deployment Environments
Red - Dev | Yellow - Stage/Test | Blue/Green - Prod/QA
Added supported environment variables:
color="red"
stage="dev"
This allows for multiple Lambda Function names as well
Adding the host as a CNAME to Cloudfront works:
Ex: red.test.com CNAME/Alias d42mp9zdib7he3.cloudfront.net
==================================================
Proof run:
Successfully associated Lambda functions with CloudFront
CLOUDFRONT_DISTRIBUTION_ID="E2NLPLVW7TK8BE" node create-invalidation.js
{ Location: 'https://cloudfront.amazonaws.com/2017-03-25/distribution/E2NLPLVW7TK8BE/invalidation/I124JZO7DAUL8C',
Invalidation:
{ Id: 'I124JZO7DAUL8C',
Status: 'InProgress',
CreateTime: 2018-03-19T17:48:02.874Z,
InvalidationBatch: { Paths: [Object], CallerReference: '2018-03-19T17:48:02.311Z' } } }
colony005:pre-red Fitch$ make deploy
node ./validate.js
./node_modules/.bin/serverless deploy
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Service files not changed. Skipping deployment...
Service Information
service: Lambda-Edge-Prerendercloud
stage: red
region: us-east-1
stack: Lambda-Edge-Prerendercloud-red
api keys:
None
endpoints:
None
functions:
viewerRequest: Lambda-Edge-Prerendercloud-red-viewerRequest
originRequest: Lambda-Edge-Prerendercloud-red-originRequest
CLOUDFRONT_DISTRIBUTION_ID="E2NLPLVW7TK8BE" node deploy.js
Lambda-Edge-Prerendercloud-red-viewerRequest
Lambda-Edge-Prerendercloud-red-originRequest
[ { FunctionName: 'Lambda-Edge-Prerendercloud-red-viewerRequest',
EventType: 'viewer-request' },
{ FunctionName: 'Lambda-Edge-Prerendercloud-red-originRequest',
EventType: 'origin-request' } ]
before []
after [ { EventType: 'viewer-request',
LambdaFunctionARN: 'arn:aws:lambda:us-east-1:422025336571:function:Lambda-Edge-Prerendercloud-red-viewerRequest:49' },
{ EventType: 'origin-request',
LambdaFunctionARN: 'arn:aws:lambda:us-east-1:422025336571:function:Lambda-Edge-Prerendercloud-red-originRequest:49' } ]