serverless / serverless/serverless
Full documentation missing from CloudFront event type
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.9k
- Forks
- 5.7k
- Avg merge
- 10h 7m
- Merged PRs (30d)
- 57
Description
Bug Report
Description
The documentation for cloudfront is very thin (https://serverless.com/framework/docs/providers/aws/events/cloudfront/). There's a few examples, but there's no complete documentation of all supported params. Since its likely that users have to use a Resources object to describe the Cloudfront distribution in detail, this event type is potentially quite complex to get right. It would be good of the documentation was a bit richer.
For example, there's no mention of the fact that CustomOriginConfig is a required field if using non-s3 origins.
As an example: I notice that in code, the QueryString attribute is hard-coded to false (https://github.com/serverless/serverless/blob/c0ec32b4e0f2e3dacce12a614db92dfba6e526a6/lib/plugins/aws/package/compile/events/cloudFront/index.js#L181), which means that I probably have to "overwrite" the entire origin attribute. I'm suspecting this is quite common for uses-cases where cloudfront/lambda@edge is involved so it would be good if that was documented.
In short: Make it as easy as possible to get cloudfront/lambda@edge right using serverless - also for non-trivial/real-life apps.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CloudFront documentation page and the AWS CloudFront compiler at lib/plugins/aws/package/compile/events/cloudFront/index.js, especially the QueryString handling. Compare the supported event parameters with the current examples, then document non-S3 CustomOriginConfig requirements and how origin settings are overridden for CloudFront and Lambda@Edge use cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100