https://pulumi.com logo
#general
Title
# general
w

wide-judge-30323

03/20/2019, 8:28 AM
Trying out the
cloud
api for the first time (aws lambda). Is it possible to use the aws sdk directly (or other js libs?) in a
aws.lambda.CallbackFunction
? I'm trying to just s3 cp a file from one place to another -
pulumi.cloud.Bucket
doesn't seem to offer this (only get and put the actual contents, which would not be ideal for larger files). The examples spin off a separate
cloud.Task
- but this seems unnecessary for this use-case.
w

white-balloon-205

03/20/2019, 4:34 PM
Yep! In fact, you can just write
let s3client = new aws.sdk.S3()
to get an S3 client. We expose a copy of the AWS SDK off the
aws.sdk
variable. You can see an example of this at https://github.com/pulumi/examples/blob/master/aws-ts-s3-lambda-copyzip/index.ts#L18. Which was also covered in a recent blog post at https://blog.pulumi.com/easy-serverless-apps-and-infrastructure-real-events-real-code.
w

wide-judge-30323

03/21/2019, 12:53 AM
Great, thanks @white-balloon-205! I'll try that out.