Skip to content
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

Cloudfront configuration for custom lambda @ edge #297

Closed
skycremaschinin opened this issue Feb 14, 2020 · 6 comments
Closed

Cloudfront configuration for custom lambda @ edge #297

skycremaschinin opened this issue Feb 14, 2020 · 6 comments

Comments

@skycremaschinin
Copy link
Contributor

skycremaschinin commented Feb 14, 2020

Describe the bug
i need to link a custom lambda @ edge to viewer-request event

To Reproduce
add following section (according to aws-cloudfront component) in serverless.yml
defaults:
lambda@edge: # added to cloudfront default cache behavior
viewer-request: arn:aws:lambda:us-east-1:123:function:myFunc:version

Expected behavior
Lambda @ edge is attached to default behavior on viewer-request

@danielcondemarin
Copy link
Contributor

@skycremaschinin May I ask why do you need to hook up to viewer-request?

@skycremaschinin
Copy link
Contributor Author

@danielcondemarin it could be useful in many cases: for example, to redirect users to login page checking a session cookie, or some url rewrite.

Anyway, for the default behavior the origin request is hooked by routing lambda, so if i need to do something on request-side the viewer request is the only way.

@danielcondemarin
Copy link
Contributor

I see what you mean now. Is something that potentially could be supported by #282

@skycremaschinin
Copy link
Contributor Author

fine, with those feats your component would be customizable enough to be used in production envs.
hope #282 would be merged soon! thank you

@harryd31
Copy link

harryd31 commented Mar 30, 2020

@danielcondemarin has this been merged yet? I really need to connect to the viewer-response in our case. Right now I have to manually go and add it every time after deploying which can be a really big pain.
Thank you,

@danielcondemarin
Copy link
Contributor

danielcondemarin commented May 9, 2020

#282 has now been merged and published 🎉 Closing.

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

No branches or pull requests

3 participants