Hey folks, hi ! I have a small pulumi lambda to wh...
# aws
Hey folks, hi ! I have a small pulumi lambda to which I have now added a kinesis stream creation (I am validating an idea, nothing to be production-ready, so don't focus on the creation inside the function 😄 ), and so I added:
Copy code
new aws.kinesis.Stream("events", {
        shardCount: 1
Of course I was already using
import * as aws from "@pulumi/aws
. The problem is that I have the following error while I try to execute the lambda:
Copy code
ERROR   Uncaught Exception      {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '@pulumi/aws/kinesis/index.js'\nRequire stack:\n- /var/task/__index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js","stack":["Runtime.ImportModuleError: Error: Cannot find module '@pulumi/aws/kinesis/index.js'","Require stack:","- /var/task/__index.js","- /var/runtime/UserFunction.js","- /var/runtime/index.js","    at _loadUserApp (/var/runtime/UserFunction.js:100:13)","    at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)","    at Object.<anonymous> (/var/runtime/index.js:43:30)","    at Module._compile (internal/modules/cjs/loader.js:999:30)","    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)","    at Module.load (internal/modules/cjs/loader.js:863:32)","    at Function.Module._load (internal/modules/cjs/loader.js:708:14)","    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)","    at internal/main/run_main_module.js:17:47"]}
To the best of my understanding it's not finding the
module, but I have nothing to install, or I am wrong ?
@kind-keyboard-17263 are you using Pulumi INSIDE your lambda function?
Yeah, I have read that it's not possible. I should use pulumi to orchestrate deployment, but in order to -say - use dynamodb, kinesis, i should use aws-sdk libs, right ?
You can do it, but you need to use the lambda container functionality
I can put an example together if it helps?
I have to pack the lambda in a docker image ? I have seen that option
Yeah, because you need the Pulumi cli as well
That'd be absolutely fantastic, thanks :)
But feel free to just point me to a (valid) example, don't wanna bother you 🙂
What are you specifically trying to deploy from inside the function?
Well, I have a few lambdas, but consider one lambda receiving an
payload which tries optimistically to store to dynamodb. I was also trying to write a second version, pushing the payload to kinesis
that endpoint should be used as an datapoint ingestion endpoint
Okay, I suspect there might be a disconnect on what Pulumi can do. It's not an SDK to store into dynamo or kineses, it's designed to provision infrastructure declaratively
Reasonable, I am learning but I am in a validation step, so I am a bit on the run
Thanks buddy!