is there any tutorial to split/convert stack to mi...
# general
is there any tutorial to split/convert stack to microstack? don't show how to do it
As I known, we must backup and restore state into multiple microstacks Then delete unused ones?
1. Use
pulumi import
to import resources into a new stack (and generate corresponding code). 2. Use
pulumi state delete
to remove resources from state in the old stack. Update code to no longer create those resources. 3. Verify that
pulumi up
behaves as expected for each stack (old and new), adjust code as needed.
very bad idea to import thousand of states 🥹
It is possible to use
pulumi stack export
to get the state (in JSON), modify that, import it back in to a new stack with
pulumi stack import
, and then follow steps 2 and 3 from above. However, we don’t generally recommend this process.