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
Using the Javascript cdk libs, I'm trying to add the lambda caching layer for secretsmanager to my lambda in cdkv2, but I am getting an error Cannot add elements to list token, got <layer arn>,#{Token[TOKEN.xxx]}.Object
I am adding the layer via LayerVersion.fromLayerVersionArn() passing in the arn as documented above. That is wrapped in an array for passing in the FunctionProps to the LambdaFunction constructor.
I'm not an expert user of cdkv2 by any means, so is there something I need to be aware of when using these constructs? If not, does anyone have any idea why this would be happening?
[Update]
After getting into debugging the error, I can see that 2 layers are being added, the first one is the layer I am adding with the AWS arn, and the second one is created within a different part of the stack code and added via Function.addLayers(). The second one is the one referenced by the token. ResolveList() assumes there can only be one item in the array it is passed, when the constructs so far create two.
I'm still a bit lost as to how I can fix this of course....
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Using the Javascript cdk libs, I'm trying to add the lambda caching layer for secretsmanager to my lambda in cdkv2, but I am getting an error
Cannot add elements to list token, got <layer arn>,#{Token[TOKEN.xxx]}.Object
I am adding the layer via
LayerVersion.fromLayerVersionArn()
passing in the arn as documented above. That is wrapped in an array for passing in theFunctionProps
to theLambdaFunction
constructor.I'm not an expert user of cdkv2 by any means, so is there something I need to be aware of when using these constructs? If not, does anyone have any idea why this would be happening?
[Update]
After getting into debugging the error, I can see that 2 layers are being added, the first one is the layer I am adding with the AWS arn, and the second one is created within a different part of the stack code and added via Function.addLayers(). The second one is the one referenced by the token. ResolveList() assumes there can only be one item in the array it is passed, when the constructs so far create two.
I'm still a bit lost as to how I can fix this of course....
Many thanks,
S.
Beta Was this translation helpful? Give feedback.
All reactions