Skip to content

Conversation

printedheart
Copy link
Contributor

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' } ]

@jotto
Copy link
Collaborator

jotto commented Mar 19, 2018

why delete?

@jotto
Copy link
Collaborator

jotto commented Mar 19, 2018

errr, why did you close?

@printedheart
Copy link
Contributor Author

I found errors in testing. Just submitted #6
Sill have some error control work to do:
Programmatically cleanup failed CloudFormation Deletions
--stuck sls buckets
--stuck lambda from cloudfront publish invalidations
--checks for invalidations on cloudfront

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants