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

fast-river-57630

10/04/2022, 2:53 PM
I'm trying to replace a reference with a stub: essentially an aws VPC object with a mostly empty ComponentResource. https://gist.github.com/sheenobu/a58297508055a3e4c83aee1b5f38432e I'm getting
Copy code
... (...-vpc):
    error: expected '::' in provider reference ''
Maybe you can't replace a resource from the AWS provider for one from a different provider? or is my aliases: wrong?
1
the XY problem is "moving a pulumi object with lots of dependencies from codebase A to codebase B while keeping references to vpc.id in A entact" I'm going to try to upgrade to 3.40.2... nope.
b

billowy-army-68599

10/04/2022, 3:19 PM
@fast-river-57630 your type token is wrong
Copy code
super("...", "my-vpc", {}, opts);
it needs to be
Copy code
super("foo:index:vpc"
f

fast-river-57630

10/04/2022, 3:20 PM
my type token is right. I just removed the specifics from my example
I tried pkgcompanynameVpc
b

billowy-army-68599

10/04/2022, 3:22 PM
ah got it
f

fast-river-57630

10/04/2022, 3:35 PM
i'm assuming pulumi.ComponentResources just dont have providers (i tried setting provider in opts) so when the dependency graph code is resolving a provider reference for a replaced object and that object is component resource it just throws up in the pulumi binary. not sure if you can trace the errors in the pulumi binary (+%v???) Found a workaround, will post. Thank you!
use a dynamic resource with a stub?? it did work: https://gist.github.com/sheenobu/a58297508055a3e4c83aee1b5f38432e I purposefully made create error out since this is just for stubbing out migrated objects!