[Backlog][Tooling] Terraform Refactoring Tool
- 主要语言
- Go
- 星标
- 26
- 派生
- 7
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 1
描述
### TL;DR
GitHub workflow that implements https://github.com/padok-team/tfautomv & automatically commits a change to a history.tf file for noop refactoring to resource names.
### Detailed design
```markdown
Refactoring TF resources becomes tedious when the resource names are modified. You can rely on `terraform state mv` for changes that impact a small number of resources but this is manual and painstaking. For more complex changes there is no good solution.
https://github.com/padok-team/tfautomv Is a tool that can be used to automatically generate `moved` blocks from file changes. We can either use this or build our own if this doesn't meet our requirements (use git history + terraform plan on local temporary isolated backend + compare plans to determine which resources have moved = generate moved blocks).
The github workflow would:
* Only trigger on a PR when the user indicates that a trivial move has occurred. Possibly this could be implemented with a PR title, description, or comment tag.
* Automatically generate the `moved` blocks and commit it to the PR.
```
### Alternatives considered
```markdown
Just use the CLI tool instead of creating a github workflow.
```
### Additional information
_No response_
贡献指南
调研方向
The issue describes integrating tfautomv into a GitHub workflow. Start by examining the repository's existing GitHub Actions workflows to understand the structure. Review the tfautomv tool's documentation and usage. The workflow must detect a 'trivial move' from a PR indicator (title, description, or comment), run tfautomv to generate moved blocks, and commit the changes to the PR. Testing will require understanding Terraform state and plan outputs.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- github-actions, terraform
- 领域
- devops, tooling
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100