Skip to content

Add google_compute_service_attachments plural data source - #18317

Open
vr-ibm wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:add-service-attachments-plural-datasource
Open

Add google_compute_service_attachments plural data source#18317
vr-ibm wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:add-service-attachments-plural-datasource

Conversation

@vr-ibm

@vr-ibm vr-ibm commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Fixes hashicorp/terraform-provider-google#23397

Adds a new plural data source google_compute_service_attachments that lists all service attachments in a given project and region, enabling discovery without hardcoding names or self_links.

Details

  • Calls the serviceAttachments.list compute API with pagination support
  • Accepts optional project, region, and filter arguments
  • Returns a service_attachments list with key attributes: name, self_link, target_service, connection_preference, nat_subnets, enable_proxy_protocol, domain_names, fingerprint, region
  • Adds acceptance test TestAccDataSourceGoogleComputeServiceAttachments_basic
  • Adds documentation

Tests

TestAccDataSourceGoogleComputeServiceAttachments_basic

Release Note Template for Downstream PRs (will be copied)

`google_compute_service_attachments`

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jul 17, 2026
@modular-magician

modular-magician commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 3 files changed, 417 insertions(+)
google-beta provider View Diff 3 files changed, 417 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
1548 1450 95 3
Affected Service Packages
  • compute

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

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

Click here to see the affected tests
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeReservation_reservationSharingPolicyExample
  • TestAccDataSourceGoogleComputeServiceAttachments_basic

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccDataSourceGoogleComputeServiceAttachments_basic
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeReservation_reservationSharingPolicyExample

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

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

@vr-ibm VCR tests complete for cc812dd!

@vr-ibm
vr-ibm marked this pull request as ready for review July 17, 2026 17:56
@vr-ibm
vr-ibm requested a review from BBBmau July 17, 2026 17:57
@BBBmau

BBBmau commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

@modular-magician reassign-reviewer

@github-actions

Copy link
Copy Markdown

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

@rileykarson, 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.

@github-actions
github-actions Bot requested a review from rileykarson July 21, 2026 19:42
@github-actions

Copy link
Copy Markdown

@rileykarson This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@github-actions

Copy link
Copy Markdown

@GoogleCloudPlatform/terraform-team @rileykarson This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

@GoogleCloudPlatform/terraform-team @rileykarson This PR has been waiting for review for 2 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Aug 7, 2026
@modular-magician

modular-magician commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 3 files changed, 373 insertions(+)
google-beta provider View Diff 3 files changed, 373 insertions(+)

Step 1: Replaying Mode

Caution

Panic occurred during VCR tests

🔴 REPLAYING mode: The provider crashed with a panic. Please check the build log for details.

Please fix the issue to complete your PR.

View the build log

@vr-ibm, @BBBmau VCR tests complete for 21585c7!

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Aug 7, 2026
@modular-magician

modular-magician commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 3 files changed, 373 insertions(+)
google-beta provider View Diff 3 files changed, 373 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
1557 1459 95 3
Affected Service Packages
  • compute

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

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

Click here to see the affected tests
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeRouterPeer_UpdateMd5AuthenticationKey
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeRouterPeer_UpdateMd5AuthenticationKey
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

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

@vr-ibm, @BBBmau VCR tests complete for d80366b!

@github-actions

Copy link
Copy Markdown

@vr-ibm, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days.

Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

This notification can be disabled with the disable-automatic-closure label.

Comment on lines +60 to +63
call := NewClient(config, userAgent).ServiceAttachments.List(project, region)
if filter, ok := d.GetOk("filter"); ok {
call = call.Filter(filter.(string))
}

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.

is there a reason for using the client library here? i check the normal resource of this data source and it uses transport, we lean more towards using transport since client libraries are more difficult in supporting new fields that get added to the API

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No compute client libraries please, yep! #18639

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unclear documentation for how to create regional Private Service Connect endpoints

4 participants