Is there any way to signal to pulumi that all reso...
# aws
m
Is there any way to signal to pulumi that all resources of a certain type, or with a shared parent, should be deleted before others created? Wonder if this is non computable in terms of dependencies. The problem I have is re-naming an ApiGateway Route, where the newly named resource clashes because the old one is not yet deleted. Naming ofc doesn't change too often but it's a nice problem to solve at the platform level if possible for more "throw away and change things quickly" dev environments.
b
if you use auto naming, you rarely run into this. if you don't use autonaming, you'll need to set the
deleteBeforeReplace
resource option
m
yeah the problem is the
routeKey
clash. I use auto-naming for the resource but this is an exceptional case where the basename changes and the provider doesn't know that the old resource being deleted is related at all to the new one created (with the same
routeKey
which therefore fails).
m
I wouldn’t mind seeing a bit of code if you’re still experiencing this, specifically what your
Route
declarations look like. If you are using auto-naming for the
Route
resource, then there shouldn’t be a conflict, as the
routeKey
should just be updated, rather than result in a whole new
Route
. That doesn’t seem to be what you’re seeing, though, so would be good to see some code if you could share any.