This message was deleted.
s
This message was deleted.
b
You need to use the aws api or http to do so. You can’t refer to your MyBucket directly. The eventHandler parameter is just a convenience because the pulumi resource is uploading that delegate to aws as is and the lambda will execute that function independently with no knowledge of the outer scope of your pulumi function.
🙌 1
My bad didn’t mean to send that to the channel too.
s
Hmm ok, so I believe a simple
const aws = require('aws-sdk')
inside the handler should allow me to interact with the aws sdk, correct? In that case, how does the "aws-sdk" dependency gets managed? Should I just npm install it alongside the pulumi project?
Sorry if the question seems lazy, I've really looked up for this but couldn't manage to find an answer
b
Hmmm I don’t actually know, good question. Usually I do lambda deployment via a zip file that includes everything (your dependencies) instead o this invent handler parameter
s
That's ok, I'm gonna try a few things then. Thank you!
👌 1
l
Pulumi handles the bundling for you. It even has a shortcut so that it does the right thing in the lambda, but looks short in your source code..
https://github.com/pulumi/examples/blob/master/aws-ts-s3-lambda-copyzip/index.ts And the shortcut is line 13:
const s3 = new aws.sdk.S3();
, meaning you don't need to
require("aws-sdk");
or similar.
💯 1
s
Wonderful! Thank you