serverless/serverless

Full documentation missing from CloudFront event type

Open

#6 785 ouverte le 4 oct. 2019

Voir sur GitHub
 (2 commentaires) (5 réactions) (0 assignés)JavaScript (5 734 forks)batch import
cat/aws-event-cloudfrontdocumentationhelp wantedneeds feedback

Métriques du dépôt

Stars
 (46 915 stars)
Métriques de merge PR
 (Merge moyen 3j 5h) (68 PRs mergées en 30 j)

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.

Guide contributeur