Hi all, what is generally happening when running p...
# getting-started
o
Hi all, what is generally happening when running pulumi up but some infra has been previously deleted manually and stack is still referencing the infra that is gone? Is there a general rule to this case or it depends on the particular provider, or even particular resource being deleted? In particular it is AWS resource. Would pulumi up notice the discrepancy and fail, would it try to seamlessly recreate the missing infra and correctly update the stack?
l
Hey Matko. In short, it mostly comes down to whether or not you either
refresh
before running
up
, or run
up --refresh
. If you do, Pulumi will refresh (re-read) the provider state and notice the deletion. If you don't, Pulumi won't know about the deletion. What happens after that depends of course on how your program is or isn't referencing the deleted resource: • If you refresh and you have removed it from your program -- the refresh means that Pulumi will see there's no work to be done and will probably result in a no-op (for that resource, at least -- other resources will proceed as normal) • If you refresh and you are still referencing it -- the refresh means that Pulumi will see it's missing and recreate it before carrying on with other changes. • If you don't refresh and you have removed it -- Pulumi will attempt to delete it again (it thinks it's still there), which may succeed or fail depending on the provider and the semantics of the underlying API operation that Pulumi invokes • If you don't refresh and you haven't removed it from your program -- Pulumi may try to update or create other resources that depend on it, which may or may not fail depending on the nature of those operations and the relevant cloud provider Hope that makes sense/answers your questions!
🙌 1
o
Thank you Will. Makes perfect sense!