hi all, I have a resouce which used to be a c# void where resource were created, and now it's refactored to a "proper" pulumi class - inheriting from pulumi "stack". When I do pulumi preview now, I get
Copy code
error: Duplicate resource URN 'urn:pulumi:<stuff>::pulumi:pulumi:Stack::<stuff>'; try giving it a unique name
anyone know if there's a way around this? The entire stack is the same, its just that I now inherit from the "stack" class so I can provide outputs. Is there any way of fixing this without having to tear down the stack?
n
nutritious-air-21788
11/14/2024, 11:02 PM
i use the
return await …
method myself - but it sounds like the
Stack
class is trying to create something that already exists, ordinarily you might use import to fix this but idt you can import a stack.
nutritious-air-21788
11/14/2024, 11:02 PM
maybe edit the state directly? what do you get if you do
pulumi stack export > blah
and then look for the URN referenced? it should have an entry under
resources
that has the matching
urn
and a
type
.
nutritious-air-21788
11/14/2024, 11:04 PM
(wondering if the type is
pulumi:pulumi:Stack
or something else)
l
late-airplane-27955
11/15/2024, 8:21 AM
yup, its stack. I figure out the error, I need to initialize the program differently when subclassing from "stack". THanks!
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.