Trying out the `cloud` api for the first time (aws...
# general
w
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
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
Great, thanks @white-balloon-205! I'll try that out.