https://pulumi.com logo
#general
Title
# general
f

future-morning-96441

05/07/2019, 9:36 AM
Hi, I'm working on a proof of concept to use Pulumi in our project (AWS, Event Sourced). I'm getting an error on
pulumi up
, but I don't really know where to go from there:
Copy code
run pulumi up -s dev
Previewing update (dev):

    pulumi:pulumi:Stack reventless-examples-dev running 
    reventless:CommandTopic CustomerCommandTopic  
    aws:sqs:Queue CustomerCommandTopicQueue  
    aws:sns:Topic CustomerCommandTopicTopic  
    pulumi:pulumi:Stack reventless-examples-dev  (node:5748) ExperimentalWarning: queueMicrotask() is experimental.
    aws:sqs:QueueEventSubscription CustomerAggregateSubscription  
    aws:sns:TopicSubscription CustomerCommandTopicSubscription  
    aws:iam:Role CustomerAggregateSubscription  
    aws:iam:RolePolicyAttachment CustomerAggregateSubscription-7cd09230  
    aws:iam:RolePolicyAttachment CustomerAggregateSubscription-32be53a2  
    pulumi:pulumi:Stack reventless-examples-dev  Error: failed to register new resource CustomerAggregateSubscription [aws:lambda/function:Function]: 2 UNKNOWN: failed to compute asset hash: asset path 'node_modules/reventless' is a directory; try using an archive
    pulumi:pulumi:Stack reventless-examples-dev      at Object.registerResource (/home/chris/Projects/reventless-examples/node_modules/reventless/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/runtime/resource.js:114:27)
The setup is as following: The first project (called "reventless") contains some `componentResource`s (pure javascript) and is versioned in a private git repository. Reventless is required by the second project, stated in
package.json
(private repo with access token). This seems to work. Troubles arise, when I use
npm link
to develop both projects together. Is there some known issue regarding linked node modules?
w

white-balloon-205

05/07/2019, 5:03 PM
I would not have expected
npm link
to cause problems here. We use
yarn link
heavily for testing within Pulumi. What does the code for your
CustomerAggregateSubscription
look like? Are you explicitly passing a path to
node_modules/reventless
? Or is that getting pulled in as part of a callback?
f

future-morning-96441

05/10/2019, 8:07 AM
Thanks for your reply Luke. I'm sorry, I got hold up on another task and just started to work on the mentioned issue again.
CustomerAggregateSubscription
is just a
@pulumi/aws/sns/TopicEventSubscription
.
node_modules/reventless
is indeed a directory: actual modules should be found in
node_modules/reventless/modulexy.js
. I don't really know, where this directory comes from. The moment I remove the link and just depend on it, it works.
Right now I'm facing the same issue-pattern on another component:
Copy code
Diagnostics:
  pulumi:pulumi:Stack (reventless-examples-dev):
    (node:13675) ExperimentalWarning: queueMicrotask() is experimental.
    Error: failed to register new resource autoCommitUser [aws:lambda/function:Function]: 2 UNKNOWN: failed to compute asset hash: asset path 'node_modules/reventless' is a directory; try using an archive
        at Object.registerResource (/home/chris/Projects/reventless/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/runtime/resource.js:114:27)
        at new Resource (/home/chris/Projects/reventless/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/resource.js:96:24)
        at new CustomResource (/home/chris/Projects/reventless/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/resource.js:145:9)
        at new Function (/home/chris/Projects/reventless/node_modules/@pulumi/lambda/function.ts:315:9)
        at new CallbackFunction (/home/chris/Projects/reventless/node_modules/@pulumi/lambda/lambdaMixins.ts:321:9)
        at Array.makeAutoCommiting (/home/chris/Projects/reventless/src/AWS/Cognito.bs.js:25:23)
        at Object.<anonymous> (/home/chris/Projects/reventless-examples/src/AWS/CognitoExample.bs.js:6:69)
        at Module._compile (internal/modules/cjs/loader.js:816:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
        at Module.load (internal/modules/cjs/loader.js:685:32)
In this case I'm trying to deploy an
AWS Cognito UserPool
with a
LambdaConfig
to run the
@pulumi/aws/lambda/EventHandler
named
autoCommitUser
on
preSignUp
. Since the setup is functional without linking the dependency, I don't think there is problem in the logic itself. In the file
reventless/src/AWS/Cognito.bs.js
I'm only requiring
aws-sdk
,
@pulumi/aws
and
bs-platform/lib/js/caml_option.js
. In the file
reventless-examples/src/AWS/CognitoExample.bs.js
I'm just requiring
reventless/src/AWS/Cognito.bs.js
. Therefor I still don't know where
node_modules/reventless
stated in the error message comes from. A side note about the naming
*.bs.js
and the module `bs-platform/lib/js/caml_option.js`: I'm writing the application completely in [Reason](https://reasonml.github.io), which transpiles to javascript. The resulting files are suffixed with
.bs.js
.
3 Views