serverless/serverless

Full documentation missing from CloudFront event type

Open

#6,785 opened on Oct 4, 2019

View on GitHub
 (2 comments) (5 reactions) (0 assignees)JavaScript (5,734 forks)batch import
cat/aws-event-cloudfrontdocumentationhelp wantedneeds feedback

Repository metrics

Stars
 (46,915 stars)
PR merge metrics
 (Avg merge 3d 5h) (68 merged PRs in 30d)

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