https://pulumi.com logo
#aws
Title
# aws
k

kind-keyboard-17263

05/01/2022, 4:46 PM
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
aws
via
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
kinesis
module, but I have nothing to install, or I am wrong ?
b

billowy-army-68599

05/01/2022, 5:33 PM
@kind-keyboard-17263 are you using Pulumi INSIDE your lambda function?
k

kind-keyboard-17263

05/01/2022, 5:34 PM
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 ?
b

billowy-army-68599

05/01/2022, 5:35 PM
You can do it, but you need to use the lambda container functionality
I can put an example together if it helps?
k

kind-keyboard-17263

05/01/2022, 5:36 PM
I have to pack the lambda in a docker image ? I have seen that option
b

billowy-army-68599

05/01/2022, 5:36 PM
Yeah, because you need the Pulumi cli as well
k

kind-keyboard-17263

05/01/2022, 5:36 PM
That'd be absolutely fantastic, thanks :)
But feel free to just point me to a (valid) example, don't wanna bother you 🙂
b

billowy-army-68599

05/01/2022, 5:39 PM
What are you specifically trying to deploy from inside the function?
k

kind-keyboard-17263

05/01/2022, 5:50 PM
Well, I have a few lambdas, but consider one lambda receiving an
event
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
b

billowy-army-68599

05/01/2022, 6:04 PM
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
k

kind-keyboard-17263

05/01/2022, 6:06 PM
Reasonable, I am learning but I am in a validation step, so I am a bit on the run
Thanks buddy!
8 Views