pulumi: Deserializing some resources in 2.14 is failing
As with #5705, I’m seeing these error messages when referring to one resource from another.
Unable to deserialize resource urn:pulumi:stack::project::myproj:aws:MyComponentResource$aws:iam/role:Role::myObjName, no module is registered for iam/role. and Unable to deserialize resource urn:pulumi:stack::project::aws:cloudwatch:EventRuleEventSubscription$aws:lambda/function:Function::myObjName, no module is registered for lambda/function.
And these exceptions are being thrown.
unhandled rejection: CONTEXT(35242): monitor.registerResource(resource:resource-id[aws:iam/rolePolicyAttachment:RolePolicyAttachment])-initial
STACK_TRACE:
Error
at Object.debuggablePromise (/pulumi/projects/node_modules/@pulumi/pulumi/runtime/debuggable.js:69:75)
at runAsyncResourceOp (/pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:546:75)
at Object.<anonymous> (/pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:169:9)
at Generator.next (<anonymous>)
at /pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:21:71
at new Promise (<anonymous>)
at __awaiter (/pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:17:12)
at /pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:132:63
unhandled rejection: CONTEXT(35260): monitor.registerResource(resource:ObjectUnderTest-RDSInstanceSchedule-start[aws:lambda/permission:Permission])-initial
STACK_TRACE:
Error
at Object.debuggablePromise (/pulumi/projects/node_modules/@pulumi/pulumi/runtime/debuggable.js:69:75)
at runAsyncResourceOp (/pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:546:75)
at Object.<anonymous> (/pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:169:9)
at Generator.next (<anonymous>)
at /pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:21:71
at new Promise (<anonymous>)
at __awaiter (/pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:17:12)
at /pulumi/projects/node_modules/@pulumi/pulumi/runtime/resource.js:132:63
The problem goes away when I downgrade Pulumi to 2.12.1 and Pulumi/AWS to 3.12.2. The Pulumi CLI is as 2.14.0 throughout.
Expected Behavior
RolePolicyAttachments should be able to refer to Roles via the role
input. EventRuleSubscriptions should be able to refer to EventRules via the handler
input.
Current Behavior
The above error messages are displayed and the tests abort with the above exception.
Steps to Reproduce
Refer to a Role from a RolePolicyAttachment:
const role = new aws.iam.Role(name, {
assumeRolePolicy: assumeRolePolicy.json
});
new aws.iam.RolePolicyAttachment(name, {
role: role,
policyArn: aws.iam.ManagedPolicy.AmazonSSMManagedInstanceCore
});
It also happens when referring to an EventHandler from an EventHandlerSubscription.
const handler = async (
_: cloudwatch.EventRuleEvent,
) => {
console.log("Stuff happens");
};
const subscription = new cloudwatch.EventRuleEventSubscription(name, rule, handler, {}, {});
Context (Environment)
It doesn’t happen during a pulumi preview
or pulumi up
. It does prevent Mocha tests from completing.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (9 by maintainers)
I am also receiving this error. I am trying to create a Lambda permission:
But I get both types of error as everyone else. Oddly, I can preview the stack locally just fine with
pulumi up
, but I get the error on Github Actions where I am using the Pulumi GitHub action. I don’t know how to tell what version of Pulumi it uses (presumably the latest?) but I can see it usespulumi-aws
version 3.23.0.I am getting very similar errors when running
pulumi up
, also only when I usefunction-type
resources and only when I’m running it in the context of a large, typescript app (where the @pulumi dependencies are installed as dev depencencies), not when I try to reproduce in a separate repo.This fails to run
pulumi up
:This succeeds: