I am using my provider as gcp. What i want to do i...
# general
e
I am using my provider as gcp. What i want to do is promote my dev stack to prod. How do i do this ? ( I want to copy all the data as well like in the buckets )
First is there a way to create a new prod stack using already exists dev stack blueprint
f
if I'm understanding correctly - you can copy config from one stack to another via pulumi config cp or during creation you can move actual resources to different stacks via pulumi state move so then a general approach might be: 1. create prod stack
pulumi stack init prod --copy-config-from dev
2.
pulumi up
the
prod
stack
copying data like that is a bit outside of what
pulumi
does as that's more of a data thing, if that makes sense?
e
awesome Thanks alot @future-hairdresser-70637
@future-hairdresser-70637 what are the options for automation api ?
f
@echoing-noon-85874 Automation API will make it easier to make a hypothetical data promotion more... automated 🙂 ... with Pulumi. Something like the database migration example (golang version here) may spark some ideas
e
awesome! thanks !
f
np!
e
@future-hairdresser-70637 let's say I saved all stack data on the separate DB. if i want to create a new stack using previous stack data, I have two ways I can ignore the pulumi data and create a new stack using already existing db data, or i seems like pulumi has export and import functionalities. what do you think the best ? ( when i create a another stack i can only access the resources data on the db or projectname, and the names of the prev stack and new stack )
f
(catching up here from the holiday) Pulumi has import and export of resources themselves, yes. There's nothing "built-in" in terms of resource data - in other words, there's no Pulumi Resource that's analogous to a DB table or rows in a table. A Pulumi program can do anything you can write code to do, though. Take that database migration example above; there's nothing stopping your Pulumi program from: • creating a DB resource • connecting to the newly created DB • looking for a DB schema • upon not finding it, creating the schema and importing data The task is upon you to write code to do all that
Generally, you're using Pulumi to define, construct, and manage your IaC; you manage the data contained in that IaC via other means. Make sense?
e
Yes got the idea ! Thanks a lot, I'm new to pulumi and I'm working on few complex task at my work. Anyway thanks again
f
no worries and welcome!