Skip to content

tidb-cloud: fix Terraform import ID formats for network container and private endpoint connection - #23992

Open
yahonda wants to merge 2 commits into
pingcap:masterfrom
yahonda:fix-terraform-import-id-formats
Open

yahonda wants to merge 2 commits into
pingcap:masterfrom
yahonda:fix-terraform-import-id-formats

Conversation

@yahonda

@yahonda yahonda commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

What is changed, added, or deleted? (Required)

Fixes the import ID formats in two Terraform resource docs. The documented formats do not match what the TiDB Cloud Terraform Provider accepts.

  • tidb-cloud/terraform-use-dedicated-network-container-resource.md: the doc says to replace ${id} with cluster_id,network_container_id. The provider's ImportState passes the whole import ID through as network_container_id:

    func (r *DedicatedNetworkContainerResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
    	resource.ImportStatePassthroughID(ctx, path.Root("network_container_id"), req, resp)
    }

    Read then calls GetNetworkContainer(ctx, data.NetworkContainerId.ValueString()), so an import ID that contains a cluster_id, prefix fails. The doc now says to use the network container ID.

  • tidb-cloud/terraform-use-dedicated-private-endpoint-connection-resource.md: the doc says cluster_id,dedicated_private_endpoint_connection_id (two parts). The provider requires three parts and rejects anything else:

    idParts := strings.Split(req.ID, ",")
    if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" {
    	resp.Diagnostics.AddError(
    		"Unexpected Import Identifier",
    		fmt.Sprintf("Expected import identifier with format: cluster_id, node_group_id, private_endpoint_connection_id. Got: %q", req.ID),
    	)
    	return
    }

    The doc now says cluster_id,node_group_id,private_endpoint_connection_id.

Source: internal/provider/dedicated_network_container_resource.go and internal/provider/dedicated_private_endpoint_connection_resource.go in tidbcloud/terraform-provider-tidbcloud.

This was flagged by CodeRabbit on the Japanese translation PR #23987, which inherited the same formats from EN.

Update (73f9dd6): the terraform apply example outputs later in both sections still showed the old import IDs. They now use the corrected formats, with the ID values that already appear on the same pages:

  • Network container: [id=10423692645683000000,example] → [id=1934235512696000000] (the network_container_id value).
  • Private endpoint connection: [id=aws-1934187953894000000,example] (and aws-19341879538940000000 in the Import complete line, which also had a different digit count) → [id=10757937805044000000,1934178998036000000,1934214559409000000] (the cluster_id, node_group_id, and private_endpoint_connection_id values).

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)

What is the related PR or file link(s)?

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

🤖 Generated with Claude Code

… private endpoint connection

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: pingcap/docs/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: da96e1fb-38d4-4111-b63c-75c50868541b

📥 Commits

Reviewing files that changed from the base of the PR and between 2ea1beb and 73f9dd6.

📒 Files selected for processing (2)
  • tidb-cloud/terraform-use-dedicated-network-container-resource.md
  • tidb-cloud/terraform-use-dedicated-private-endpoint-connection-resource.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 29, 2026
@qiancai qiancai added translation/no-need No need to translate this PR. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. and removed missing-translation-status This PR does not have translation status info. labels Sep 29, 2026

@qiancai qiancai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 30, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-09-30 01:22:32.512107957 +0000 UTC m=+759077.737329065: ☑️ agreed by qiancai.

@qiancai qiancai self-assigned this Sep 30, 2026
@qiancai

qiancai commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

The corrected import ID formats look right, but the example import outputs later in both sections still use the old/invalid formats. Could we update them as part of this PR as well? Otherwise, each section gives users two conflicting import ID formats.

…ted ID formats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ti-chi-bot

ti-chi-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from qiancai. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 30, 2026
@yahonda

yahonda commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Updated the output ids. 73f9dd6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. translation/no-need No need to translate this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants