Skip to content

Add accelerator_topology_mode to google_compute_resource_policy#16641

Merged
hao-nan-li merged 3 commits intoGoogleCloudPlatform:mainfrom
jamOne-:add-accelerator-topology-mode
Mar 9, 2026
Merged

Add accelerator_topology_mode to google_compute_resource_policy#16641
hao-nan-li merged 3 commits intoGoogleCloudPlatform:mainfrom
jamOne-:add-accelerator-topology-mode

Conversation

@jamOne-
Copy link
Contributor

@jamOne- jamOne- commented Mar 9, 2026

Description

This PR adds support for the accelerator_topology_mode field in the google_compute_resource_policy resource, specifically within the workload_policy block.

This enables "Super-slicing" for TPU clusters on GKE by allowing users to set the topology mode to values such as PROVISION_ONLY or AUTO_CONNECT. The field aligns with the underlying Compute Engine API and gcloud beta compute resource-policies create workload-policy --accelerator-topology-mode capabilities.

Changes Made:

  • Added acceleratorTopologyMode to mmv1/products/compute/ResourcePolicy.yaml as an Enum type.
  • Updated conflict rules between accelerator_topology_mode, accelerator_topology, and max_topology_distance.
  • Added a new Terraform example (resource_policy_workload_policy_accelerator_topology_mode) to auto-generate documentation.
  • Added a handwritten acceptance test (TestAccComputeResourcePolicy_withTopologyMode) to verify creation and destruction.

Release Note Template for Downstream PRs (will be copied)

compute: added `accelerator_topology_mode` field to `google_compute_resource_policy` resource

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Mar 9, 2026
@jamOne- jamOne- marked this pull request as ready for review March 9, 2026 12:27
@github-actions github-actions bot requested a review from hao-nan-li March 9, 2026 12:28
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

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

@hao-nan-li, 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.

@modular-magician modular-magician added service/compute-instances and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Mar 9, 2026
@modular-magician
Copy link
Collaborator

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

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 141 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 5 files changed, 141 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 5 files changed, 50 insertions(+), 2 deletions(-))
Open in Cloud Shell: Diff ( 4 files changed, 110 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1382
Passed tests: 1290
Skipped tests: 90
Affected tests: 2

Click here to see the affected service packages
  • compute

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeResourcePolicy_resourcePolicyWorkloadPolicyAcceleratorTopologyModeExample
  • TestAccComputeResourcePolicy_withTopologyMode

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeResourcePolicy_resourcePolicyWorkloadPolicyAcceleratorTopologyModeExample [Debug log]
TestAccComputeResourcePolicy_withTopologyMode [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@jamOne-
Copy link
Contributor Author

jamOne- commented Mar 10, 2026

@hao-nan-li sending a follow-up PR, because I noticed I incorrectly affected the GA provider, but the change should affect only the beta version: #16653. Sorry for that.

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.

3 participants