This message was deleted.
# general
s
This message was deleted.
1
g
Serialized functions?
b
Not sure? I use
aws.lambda.CallbackFunction
g
Yes it is then
I think it only happened once with me (but I was using npm). My package.json was correct, but the one in node_modules was wrong. I fixed with a
npm clean-install
, there is something similar on yarn but I don't know the command
You can try to see if it solves it
b
like
rm -r node_modules && yarn
?
g
Yeah that should work too
b
I'll try that, locally the
aws-sdk
version is correct though
g
Hum, not the same as mine then. Is it an indirect transitive dependency as well? Might be a problem on the serializer to decide between such conflicts
Actually, I didn't ask before. What is the version being sent to Lambda? And what is the one you pinned?
b
So
AWS.VERSION
outputs
2.712.0
the pinned is
2.738.0
Not sure what you mean by "indirect transitive as well"? I've got it in my dependencies and
@pulumi/aws
is depending on an older version, which is why I also pinned it via Yarn version resolutions which should, according to
yarn.lock
leave only the pinned version 🤷‍♂️ That's probably what you've asked right?^^
g
Yes it is, yarn pins the new version. But the serialization code on pulumi might find the wrong version. I'm not certain where it looks
It seems aws fixes the aws-sdk on nodejs lambda. But by the docs it should be 2.721.0
b
Yeah that's strange I know, in the issue I opened I was told the same
Uh and I'm using the local backend for that matter, so no Pulumi Cloud Service
g
Hum. No clue then. Since aws pins versions on the runtime this seems to be specific for them, not the serializer. I'm not well versed in aws, so I can't give you any other ideas
b
Okay, still thank you for your time & help @green-school-95910 🙏
There’s a note on Referencing
aws-sdk
in Serializing Functions which might indicate that Pulumi is not bundling
aws-sdk
? Maybe I should provide the desired version via a layer then? 🤔
w
There’s a note on Referencing 
aws-sdk
 in Serializing Functions which might indicate that Pulumi is not bundling 
aws-sdk
 ?
Yes - I believe the AWS Lambda serialization logic intentionally leaves
aws-sdk
out because it is pre-provided in the Lambda environment (and would be very expensive to include by default when typically folks want to use the included version). It would be nice to be able to offer a way to indicate you do want to include this though - and in principal that should be possible. Adding a layer also works - though I'm sure is a little more work for you.
b
Here it mentions
runtimeDependencies
in
package.json
which didn’t work for me and I tried to add this to my index.ts infrastructure
Copy code
pulumi.runtime.computeCodePaths({
  extraIncludePackages: ["aws-sdk"],
});
but it didn’t work either, so there seem to be ways I just don’t understand how to use them, or they’re broken?
I’m using a layer for now and I’ve opened https://github.com/pulumi/pulumi/issues/5239
Closing this in favor of https://github.com/pulumi/pulumi/issues/5239 which tracks simplification of bundling/pinning specific
aws-sdk
version