You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the v3 SDK, lambda response payloads are now encoded as a uint8array -- which can break some implementations e.g. using AwsCustomResource to invoke a lambda function and then attempting to read the payload
Having a stack like this worked on versions before AwsCustomResource updated to SDK v3, like 2.75.0:
However, it will end up failing on a newer version where the AwsCustomResource is updated to SDK v3 like 2.90.0. Checking the CloudTrail logs, you can see that the payload returned looks like this instead of what you would normally expect:
When `AwsCustomResource` was updated to use sdkv3, it wasn't updated to
correctly handle the change in returned value when calling
`lambda.invokeFunction`. The payload property was changed from type
`Buffer` to `Uint8Array` to increase compatibility in browsers.
Added a check in the `flatten` function used to format payloads in
`AwsCustomResource`'s runtime to correctly decode values if they are a
typed array or a buffer.
Created a new integ test which fails to deploy if the payload property
is not serialized correctly and able to be made a Cfn output.
Fixes: #26730
When `AwsCustomResource` was updated to use sdkv3, it wasn't updated to correctly handle the change in returned value when calling `lambda.invokeFunction`. The payload property was changed from type `Buffer` to `Uint8Array` to increase compatibility in browsers.
Added a check in the `flatten` function used to format payloads in `AwsCustomResource`'s runtime to correctly decode values if they are a typed array or a buffer.
Created a new integ test which fails to deploy if the payload property is not serialized correctly and able to be made a Cfn output.
Fixes: #26730
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
In the v3 SDK, lambda response payloads are now encoded as a uint8array -- which can break some implementations e.g. using AwsCustomResource to invoke a lambda function and then attempting to read the payload
Having a stack like this worked on versions before AwsCustomResource updated to SDK v3, like
2.75.0
:However, it will end up failing on a newer version where the AwsCustomResource is updated to SDK v3 like
2.90.0
. Checking the CloudTrail logs, you can see that the payload returned looks like this instead of what you would normally expect:Expected Behavior
I expected the resource to have readable properties like this being returned from the custom resource as it did prior to the update:
Current Behavior
The resource's returned properties aren't parseable
Reproduction Steps
See description
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.90.0
Framework Version
No response
Node.js Version
16
OS
Mac
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: