-
Notifications
You must be signed in to change notification settings - Fork 702
cloud: add terraform migrate cluster resource doc #20659
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
cloud: add terraform migrate cluster resource doc #20659
Conversation
Signed-off-by: FingerLeader <wanxfinger@gmail.com>
Hi @FingerLeader. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
/bot-review |
✅ AI review completed, 10 comments generated. |
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
/gemini review |
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.
Code Review
This pull request adds documentation for migrating cluster resources to serverless/dedicated cluster resources using Terraform. The documentation provides a step-by-step guide with commands and examples. Overall, the documentation is clear and helpful, but there are a few areas that could be improved for clarity and completeness.
Summary of Findings
- Prerequisites: Specific Terraform Provider Version: The prerequisite section mentions updating the TiDB Cloud Terraform Provider but uses a placeholder version (x.x.x). This should be replaced with a specific, tested version to ensure the instructions work correctly.
- Inconsistent Resource Naming in Examples: In Step 4, the example configurations for serverless and dedicated clusters use the same resource name (
new_cluster
). This could lead to confusion and should be clarified or corrected to use distinct names. - Missing Context for
your_target_cluster_resource
: In Step 2, the documentation uses${your_target_cluster_resource}
without explicitly defining or explaining where this value comes from. It should be clarified that this is the full resource name as listed byterraform state list
.
Merge Readiness
The pull request introduces a new documentation page for migrating cluster resources using Terraform. While the steps are generally well-explained, addressing the identified issues regarding the Terraform provider version, resource naming consistency, and clarification of variable usage would significantly improve the documentation's clarity and usability. I am unable to approve this pull request, and recommend that the author address the identified issues before merging.
resource "tidbcloud_serverless_cluster" "new_cluster" {} # Serverless | ||
resource "tidbcloud_serverless_cluster" "new_cluster" {} # Dedicated |
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.
Using the same resource name new_cluster
for both serverless and dedicated clusters might be confusing. Consider using distinct names to avoid potential issues.
resource "tidbcloud_serverless_cluster" "new_cluster" {} # Serverless | |
resource "tidbcloud_serverless_cluster" "new_cluster" {} # Dedicated | |
resource "tidbcloud_serverless_cluster" "new_serverless_cluster" {} # Serverless | |
resource "tidbcloud_dedicated_cluster" "new_dedicated_cluster" {} # Dedicated |
|
||
## Step 2. Delete the existed resource from state | ||
|
||
Run the `terraform state rm ${your_target_cluster_resource}` to delete the resource from state. |
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.
It would be helpful to clarify where the ${your_target_cluster_resource}
value comes from. Perhaps reference the output of the command in Step 1?
Run the `terraform state rm ${your_target_cluster_resource}` to delete the resource from state. | |
Run the `terraform state rm tidbcloud_cluster.your_old_cluster` to delete the resource from state. |
terraform import tidbcloud_serverless_cluster.new_cluster ${id} # Serverless | ||
terraform import tidbcloud_dedicated_cluster.new_cluster ${id} # Dedicated |
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.
To align with the previous suggestion, the resource names here should be updated to reflect the new resource names.
terraform import tidbcloud_serverless_cluster.new_cluster ${id} # Serverless | |
terraform import tidbcloud_dedicated_cluster.new_cluster ${id} # Dedicated | |
terraform import tidbcloud_serverless_cluster.new_serverless_cluster ${id} # Serverless | |
terraform import tidbcloud_dedicated_cluster.new_dedicated_cluster ${id} # Dedicated |
@gemini-code-assist[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: FingerLeader <wanxfinger@gmail.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Aolin <aolinz@outlook.com>
/approve |
1 similar comment
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiancai The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In response to a cherrypick label: new pull request created to branch |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?