https://pulumi.com logo
Title
d

damp-school-17708

07/09/2021, 4:56 PM
Hi I am hitting this
Could not include required dependency '@aws-sdk/client-codepipeline' in '/Users/toni/code/link/infrastructure'.
I am not entirely sure why it would happen, while the same stack used to use '@aws-sdk/client-codebuild' The code using it it's an 'inline lambda' done with
new awsx.apigateway.API
How is that possible? there's a closed github issue but it doesn't seem related, what could be the culprit? Do I need to define a 'standard' lambda to circumvent this? Latest versions of all packages, just updated. Not sure if it matters but using a monorepo structure, with this dependency/stack inside a folder.
f

fierce-camera-61577

07/11/2021, 8:26 AM
Ciao fratello!
πŸ‘‹ 1
I think the in-line lambda code is serialized and packaged in a way that just because the import/require is in the pulumi code file doesn’t mean it (or the required node_modules) make it into the zip file that is sent to AWS Lambda and executed at runtime
try the hacky
NODE_PATH=$PWD pulumi up
to see if that helps drag the right dependencies along. If that works let me know and I have a smoother mechanism to try.
(See my recent pinned note in the #typescript channel - because it’s even more dastardly when ts-node is in the mix)
c

curved-pharmacist-41509

07/11/2021, 9:26 PM
Likely the import is in the Pulumi program, not the lambda When I was still using inline callbacks I would use
require()
inside the callback for any imports
d

damp-school-17708

07/12/2021, 7:58 AM
doesn't work with NODE_PATH and doesn't work with require. I think there's something else going on
possibly fixed with this, so I was right about the nohoist, but simply changing that it didn't work. I should have done a cleanup of all node_modules. Luckily I checked for an updated version of code-pipe and the node_modules got sorted out
πŸ‘ 1
@fierce-camera-61577 I am still waiting on that blog post on localstack πŸ˜‰ πŸ˜„
f

fierce-camera-61577

07/22/2021, 8:50 AM
I’m waiting for a 1 line deletion PR to be merged on LocalStackπŸ™‚
πŸ‘€ 1
d

damp-school-17708

08/26/2021, 8:46 AM
@fierce-camera-61577 you managed to misspell both my name and family name πŸ˜‚ but thanks for the mention
Toni Terreno πŸ˜‰
f

fierce-camera-61577

08/27/2021, 4:03 AM
I did it to make sure you read the article πŸ˜›
d

damp-school-17708

08/27/2021, 7:51 AM
lol