Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prototype: migrate command for terraform stacks #36461

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

liamcervante
Copy link
Member

@liamcervante liamcervante commented Feb 7, 2025

This PR adds a proof of concept for migrating state between Terraform workspaces and Terraform stacks.

@liamcervante liamcervante added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Feb 7, 2025
@liamcervante liamcervante requested a review from a team as a code owner February 7, 2025 11:55
@liamcervante liamcervante marked this pull request as draft February 7, 2025 11:55
@liamcervante liamcervante force-pushed the liamcervante/tfstacksmigrate branch from 50223a0 to a6794d7 Compare February 7, 2025 12:45
Comment on lines +564 to +572
targetStackAddress := append(current.ConfigAddr(), stackaddrs.StackStep(ref))
stack := m.Migration.Config.Stack(targetStackAddress)

// we have the configurations for the components in this stack, we just
// need to scope them down to the components that are in the current
// stack instance.

for name := range stack.Components {
configComponentAddress := stackaddrs.ConfigComponent{
Copy link
Contributor

@dsa0x dsa0x Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't hurt to leave the code here, but just to validate that my understanding is correct. I don't think this part is actually necessary, especially since we are keeping the tool to just root-level migration for now, i.e no migration into components embedded in child stacks, which is what a StackCall would be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog-needed Add this to your PR if the change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants