This message was deleted.
# general
s
This message was deleted.
l
Pulumi doesn't support being run in lambdas or other serverless code. You need to fall back to the AWS SDK for that.
They do provide some wrappers to make that a bit easier. Onesec I'll get an example.
Nope, lost them, I've refactored my code to use the SDK directly.
b
The dependencies would be correctly resolved if I used an inline function though right? Instead of in a separate file.
l
The modules are not available when running on AWS lambdas. They're not packaged up into the zip file that's uploaded to lambda.
b
I see. So the only solution really is to use the aws sdk as you say?
l
Anything that can be inlined (constant values, etc.) is fine. And there's some Pulumi wrappers to enable accessing SDK functions via Pulumi imports (which is what I mentioned earlier).
Just trying to find an example of that now...
b
Thanks. But the AWS SDK is available inside a lambda right?
l
Yes, that's available to all serverless code, for free. Doesn't need to be uploaded, it's magically there.
b
Makes sense
l
Copy code
import * as aws from "@pulumi/aws";
 // ...
  const s3Client = new aws.sdk.S3();
// ...
That s3 client is the SDK, but you don't need to import the SDK into your Pulumi code if you do it this way.
b
Yeah. Thanks for the help mate
👍 1
The sdk package in @pulumi/aws does not seem to be there anymore. Has this recently changed or something? I guess I need to import ‘aws-sdk’ instead.