add project moving ability - #140
Merged
Merged
Conversation
egramens
approved these changes
Jan 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Project Move Between OUs Support
Summary
This PR adds the ability to move projects between OUs without destroying and recreating them. Previously, changing a project's
ou_idwould trigger a destroy/recreate cycle, which failed if the project had accounts attached ("Cannot delete a project with accounts attached" error).Now, changing
ou_iduses Kion's/v2/project/{id}/moveAPI to relocate the project in-place, preserving attached accounts.Changes
New Features
ou_idnow moves the project instead of destroying/recreating itmove_ou_settingsBlock: Optional configuration to control move behavior:cloud_rule_setting:"convert"(default) or"remove"- how inherited cloud rules are handledfinancial_setting:"move"(default) or"preserve"- how financial history is handledBug Fixes
project_idnot being included in the move API request body (caused 400 Bad Request)Default Behavior
cloud_rule_settingdefaults to"convert"(inherited cloud rules become local rules)financial_settingdefaults to"move"(financial history moves with project, project ID stays the same)Example Usage
Files Changed
kion/resource_project.go- Added move logic andmove_ou_settingsschemakion/internal/kionclient/models_project.go- AddedProjectMoveCommandstructexamples/resources/kion_project/resource.tf- Added move exampledocs/resources/project.md- Auto-generated from examplesTesting
Tested the following scenarios against a local Kion instance:
move_ou_settings)convert+movefinancial_setting = "move"cloud_rule_setting = "remove"moveAll tests confirmed:
financial_setting = "move")