Skip to content

Comments

prototype: migrate command for terraform stacks#36461

Closed
liamcervante wants to merge 1 commit intomainfrom
liamcervante/tfstacksmigrate
Closed

prototype: migrate command for terraform stacks#36461
liamcervante wants to merge 1 commit intomainfrom
liamcervante/tfstacksmigrate

Conversation

@liamcervante
Copy link
Contributor

@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
@liamcervante liamcervante force-pushed the liamcervante/tfstacksmigrate branch from a6794d7 to f977c14 Compare February 7, 2025 13:10
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
Member

@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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the mapping doesn't actually have a way of copying data into embedded stacks so this shouldn't ever be triggered

@liamcervante liamcervante deleted the liamcervante/tfstacksmigrate branch March 27, 2025 11:22
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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