Open solovyevt opened 5 days ago
Thanks for suggesting this! We were actually thinking about similar use-cases. Let me discuss this with the team and get back to you!
What is the difference between terramate clone
keeping all stack ids intact and plain cp -R from/stacks to/stacks
?
@i4ki Currently terramate clone
can be executed if the target folder does not exist, so it copies the source stack and it's nested stacks and generates new IDs.
Now, the requested feature should allow to execute terraform clone
even if the target folder exists, and, naturally, you would want for the current target stack IDs to be preserved, while all other content is overwritten with the contents of the source stack.
Is your feature request related to a problem? Please describe. One convenient use-case for Clone feature is to promote environment stack, e.g.
staging
->prod
, but currently it's not possible due to one-time nature ofterramate clone
.Describe the solution you'd like A useful improvement would be a
--sync
or--destructive
flag that will allow to runterramate clone
on existing folders and synhcronize everything, but keepingstack.id
field intact.Describe alternatives you've considered I've been using a custom script that did the following:
stack.id
field, store in a variableterramate clone
stack.id
fieldAdditional context It might be wise to think about additional field that would be preferable to store, e.g.
stack.description
orstack.name
, but I will leave this to maintainers.P.S. Thank you for your great work.