-
Notifications
You must be signed in to change notification settings - Fork 10.2k
migrate command for terraform stacks #36482
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
Conversation
64c0395 to
e07a751
Compare
b151767 to
22bf079
Compare
39cf8e9 to
c994424
Compare
3cfde5a to
3b4976b
Compare
liamcervante
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good overall, just a couple of suggestions!
60b9f0b to
00a362b
Compare
00a362b to
125e537
Compare
| } | ||
|
|
||
| if resource.Module.IsRoot() { | ||
| // If there is no resource mapping, we check for a root module mapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be explicit here to begin with - it is safer to loosen restrictions later than to tighten them so I think either return an error for now and we can add this later if needed.
liamcervante
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, small nit - but looks good otherwise
| if ok { | ||
| inst, diags := parseComponentInstance(target) | ||
| if diags.HasErrors() { | ||
| return ret, diags | ||
| } | ||
| ret.AbsResource = stackaddrs.AbsResource{ | ||
| Component: inst, | ||
| Item: resource, | ||
| } | ||
| return ret, diags | ||
| } else { | ||
| diags = diags.Append(tfdiags.Sourceless(tfdiags.Error, "Resource not found", fmt.Sprintf("Resource %q not found in mapping.", resource.Resource.String()))) | ||
| return ret, diags | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: don't need this if-else statement anymore
|
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. |
This adds a new stacks command for migrating from module terraform state to terraform stack state. The Client is expected to consume this via the rpcapi.
Target Release
1.11.x
CHANGELOG entry