Files
floci/src/main/java
Vũ Thế Huy 3d3ab0023f fix(cloudfront): persist and echo LambdaFunctionAssociations and FunctionAssociations (#2915)
* fix(cloudfront): persist and echo LambdaFunctionAssociations and FunctionAssociations

CreateDistribution accepted LambdaFunctionAssociations and then silently
dropped them: the parser never read the element and the serializer
hardcoded Quantity 0. A distribution meant to run a viewer-request
Lambda@Edge function ended up with no function attached and no error.
FunctionAssociations (CloudFront Functions) had the same bug, so it is
fixed in the same change.

- parseDefaultCacheBehavior + parseCacheBehaviors: read LambdaFunctionARN,
  EventType, IncludeBody for Lambda and FunctionARN, EventType for
  Functions into the existing model fields.
- xmlDefaultCacheBehavior + xmlCacheBehavior: replace the two hardcoded
  blocks with xmlLambdaFunctionAssociations / xmlFunctionAssociations,
  still emitting <Quantity>0</Quantity> when empty.
- Validate EventType: Lambda allows all four event types, Functions only
  viewer-request and viewer-response; an empty ARN or an invalid
  EventType returns 400 InvalidArgument.

Closes #2835

* fix(cloudfront): validate association Quantity and brace association parsers

Address review feedback on the LambdaFunctionAssociations / FunctionAssociations
round-trip:

- The parsers now read the declared <Quantity> for each association block.
  A malformed value returns 400 InvalidArgument; a value that differs from
  the number of items returns 400 InconsistentQuantities, matching the
  existing TrustedKeyGroups handling, instead of being silently recomputed
  on read-back. An omitted Quantity is still accepted.
- Add braces to every conditional in the new association parsing paths, per
  the repository convention in AGENTS.md.
2026-09-02 10:29:19 -04:00
..