webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.29k stars 601 forks source link

Lambda@Edge Website Router - Use DDB Document Client Commands #4081

Closed adrians5j closed 4 months ago

adrians5j commented 4 months ago

Changes

Our Lambda@Edge function code was using DynamoDB command classes exported from the @aws-sdk/client-dynamodb package, and not @aws-sdk/lib-dynamodb.

This caused a problem in the getTenantIdByDomain function, because it was not returning a string (tenant ID), but an { S: TENANT_ID } unmarshalled object.

Ultimately, this caused the website router not to work in cases where users had 2 or more tenants in their system (the above function only gets called in this case), which the log below made obvious:

image

How Has This Been Tested?

Manually.

Documentation

Changelog.

adrians5j commented 4 months ago

Closing because this fix needs to go out within the 5.39.4 patch release.