Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): messages from
annotations.ts
can show up as `[object Obj…
…ect]` (#28414) **CDK Version**: 2.115.0 (build 58027ee) **Os**: macOS 14.2 (BuildVersion: 23C64) I have observed the following warning showing up in my console today when running `cdk`: > [Warning at /CdkStack/AuthorizerFunction] [object Object] I was able to track down where this message was generated and apply a patch to see the error in a more descriptive format. For the records the error in my case was: > addPermission() has no effect on a Lambda Function with region=${Token[TOKEN.23]}, account=${Token[TOKEN.24]}, in a Stack with region=${Token[AWS.Region.12]}, account=${Token[AWS.AccountId.8]}. Suppress this warning if this is is intentional, or pass sameEnvironment=true to fromFunctionAttributes() if you would like to add the permissions. [ack: UnclearLambdaEnvironment] The fix proposed here makes sure that if I am not sure this is the best way to fix this issue. The signature of the `addMessage` seems to expect a `string` for the `message` value, so maybe the error needs to be corrected downstream where the `addMessage` call is made (which judging from the stack trace seems to come from `aws-cdk-lib/aws-lambda/lib/function-base.js`). Thoughts? ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information