Skip to content

Fix: Include connection_limit in compute_service_attachment hash#17677

Open
haixin-huang wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
haixin-huang:fix-psc-hash-bug
Open

Fix: Include connection_limit in compute_service_attachment hash#17677
haixin-huang wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
haixin-huang:fix-psc-hash-bug

Conversation

@haixin-huang
Copy link
Copy Markdown

Description

This PR fixes a bug in the google_compute_service_attachment resource where modifications to the connection_limit field within the consumer_accept_lists block would not trigger a Terraform update.

The root cause was that the internal hash function computeServiceAttachmentConsumerAcceptListsHash only incorporated project_id_or_num and network_url. Because consumer_accept_lists is a Set, Terraform uses this hash to identify if an entry has changed. By omitting the connection_limit, Terraform would incorrectly conclude "No changes" when only that field was modified.

This change adds connection_limit to the hashing buffer in the Magic Modules template. An automated acceptance test has been added to verify that limit updates are now correctly detected and applied in-place via a PATCH request.

Fixes: hashicorp/terraform-provider-google#27513


Release Note Template for Downstream PRs (will be copied)

compute: fixed an issue where updating `connection_limit` in the `consumer_accept_lists` block of `google_compute_service_attachment` would not trigger a resource update.

@github-actions github-actions Bot requested a review from shuyama1 May 21, 2026 22:08
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@shuyama1
Copy link
Copy Markdown
Member

Sorry, I won't have time to review this PR today and will be OOO for a week. Rotating a new reviewer

@modular-magician reassign-reviewer

@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 21, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 733a059:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 104 insertions(+)
google-beta provider View Diff 2 files changed, 104 insertions(+)
terraform-google-conversion View Diff 3 files changed, 19 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
1458 1364 93 1
Affected Service Packages
  • compute

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccComputeServiceAttachment_connectionLimitUpdate

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeServiceAttachment_connectionLimitUpdate

🟢 All tests passed!

View the recording VCR build log or the debug logs folder for detailed results.

@haixin-huang, @slevenick VCR tests complete for 733a059!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

google_compute_service_attachment: Updating connection_limit in consumer_accept_lists does not trigger a Terraform update

3 participants