-
Notifications
You must be signed in to change notification settings - Fork 12
Add lambda at edge support #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eahefnawy
merged 5 commits into
serverless-components:master
from
danielcondemarin:add-lambda-at-edge-support
Aug 29, 2019
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3f5a54e
initial commit
danielcondemarin 6e2fa35
add lambda@edge docs
danielcondemarin d5323b8
Merge branch 'master' into add-lambda-at-edge-support
danielcondemarin 3776117
refactor test assertions
danielcondemarin cd59a3f
fix Quantity field for LambdaAssociations
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`Input origin as a custom url creates distribution with lambda associations for each event type 1`] = ` | ||
| Object { | ||
| "DistributionConfig": Object { | ||
| "Aliases": Object { | ||
| "Items": Array [], | ||
| "Quantity": 0, | ||
| }, | ||
| "CacheBehaviors": Object { | ||
| "Items": Array [ | ||
| Object { | ||
| "AllowedMethods": Object { | ||
| "CachedMethods": Object { | ||
| "Items": Array [ | ||
| "GET", | ||
| "HEAD", | ||
| ], | ||
| "Quantity": 2, | ||
| }, | ||
| "Items": Array [ | ||
| "GET", | ||
| "HEAD", | ||
| ], | ||
| "Quantity": 2, | ||
| }, | ||
| "Compress": true, | ||
| "DefaultTTL": 10, | ||
| "FieldLevelEncryptionId": "", | ||
| "ForwardedValues": Object { | ||
| "Cookies": Object { | ||
| "Forward": "all", | ||
| }, | ||
| "Headers": Object { | ||
| "Items": Array [], | ||
| "Quantity": 0, | ||
| }, | ||
| "QueryString": true, | ||
| "QueryStringCacheKeys": Object { | ||
| "Items": Array [], | ||
| "Quantity": 0, | ||
| }, | ||
| }, | ||
| "LambdaFunctionAssociations": Object { | ||
| "Items": Array [ | ||
| Object { | ||
| "EventType": "viewer-request", | ||
| "IncludeBody": true, | ||
| "LambdaFunctionARN": "arn:aws:lambda:us-east-1:123:function:viewerRequestFunction", | ||
| }, | ||
| Object { | ||
| "EventType": "origin-request", | ||
| "IncludeBody": true, | ||
| "LambdaFunctionARN": "arn:aws:lambda:us-east-1:123:function:originRequestFunction", | ||
| }, | ||
| Object { | ||
| "EventType": "origin-response", | ||
| "IncludeBody": true, | ||
| "LambdaFunctionARN": "arn:aws:lambda:us-east-1:123:function:originResponseFunction", | ||
| }, | ||
| Object { | ||
| "EventType": "viewer-response", | ||
| "IncludeBody": true, | ||
| "LambdaFunctionARN": "arn:aws:lambda:us-east-1:123:function:viewerResponseFunction", | ||
| }, | ||
| ], | ||
| "Quantity": 4, | ||
| }, | ||
| "MaxTTL": 10, | ||
| "MinTTL": 10, | ||
| "PathPattern": "/some/path", | ||
| "SmoothStreaming": false, | ||
| "TargetOriginId": "exampleorigin.com", | ||
| "TrustedSigners": Object { | ||
| "Enabled": false, | ||
| "Quantity": 0, | ||
| }, | ||
| "ViewerProtocolPolicy": "https-only", | ||
| }, | ||
| ], | ||
| "Quantity": 1, | ||
| }, | ||
| "CallerReference": "1566599541192", | ||
| "Comment": "", | ||
| "DefaultCacheBehavior": Object { | ||
| "AllowedMethods": Object { | ||
| "CachedMethods": Object { | ||
| "Items": Array [ | ||
| "HEAD", | ||
| "GET", | ||
| ], | ||
| "Quantity": 2, | ||
| }, | ||
| "Items": Array [ | ||
| "HEAD", | ||
| "GET", | ||
| ], | ||
| "Quantity": 2, | ||
| }, | ||
| "Compress": false, | ||
| "DefaultTTL": 86400, | ||
| "FieldLevelEncryptionId": "", | ||
| "ForwardedValues": Object { | ||
| "Cookies": Object { | ||
| "Forward": "none", | ||
| }, | ||
| "Headers": Object { | ||
| "Items": Array [], | ||
| "Quantity": 0, | ||
| }, | ||
| "QueryString": false, | ||
| "QueryStringCacheKeys": Object { | ||
| "Items": Array [], | ||
| "Quantity": 0, | ||
| }, | ||
| }, | ||
| "LambdaFunctionAssociations": Object { | ||
| "Items": Array [], | ||
| "Quantity": 0, | ||
| }, | ||
| "MaxTTL": 31536000, | ||
| "MinTTL": 0, | ||
| "SmoothStreaming": false, | ||
| "TargetOriginId": "exampleorigin.com", | ||
| "TrustedSigners": Object { | ||
| "Enabled": false, | ||
| "Items": Array [], | ||
| "Quantity": 0, | ||
| }, | ||
| "ViewerProtocolPolicy": "redirect-to-https", | ||
| }, | ||
| "Enabled": true, | ||
| "HttpVersion": "http2", | ||
| "Origins": Object { | ||
| "Items": Array [ | ||
| Object { | ||
| "CustomHeaders": Object { | ||
| "Items": Array [], | ||
| "Quantity": 0, | ||
| }, | ||
| "CustomOriginConfig": Object { | ||
| "HTTPPort": 80, | ||
| "HTTPSPort": 443, | ||
| "OriginKeepaliveTimeout": 5, | ||
| "OriginProtocolPolicy": "https-only", | ||
| "OriginReadTimeout": 30, | ||
| "OriginSslProtocols": Object { | ||
| "Items": Array [ | ||
| "TLSv1.2", | ||
| ], | ||
| "Quantity": 1, | ||
| }, | ||
| }, | ||
| "DomainName": "exampleorigin.com", | ||
| "Id": "exampleorigin.com", | ||
| "OriginPath": "", | ||
| }, | ||
| ], | ||
| "Quantity": 1, | ||
| }, | ||
| "PriceClass": "PriceClass_All", | ||
| }, | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the version a strict requirement for Lambda@Edge? I don't think we support versioning in our lambda component 🤔 ... In that case, this component wouldn't be composable with a lambda/function component cause they output a simple versionless ARN.
This effectively means that users of this component could only use it with an already deployed lambda via another tool, which kinda defeats the purpose of the whole thing. What you think? 🤔
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately it must be the ARN of a function version and $LATEST can't be used either. How difficult would it be to add versioning onto the
aws-lambdacomponent? Or maybe a higher level component that usesaws-lambdabut also manages versioning?