Skip to content

compute: make zone configurable on google_compute_future_reservation#18249

Open
GitOleksandrBokov wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
GitOleksandrBokov:compute-future-reservation-zone
Open

compute: make zone configurable on google_compute_future_reservation#18249
GitOleksandrBokov wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
GitOleksandrBokov:compute-future-reservation-zone

Conversation

@GitOleksandrBokov

Copy link
Copy Markdown
Contributor

google_compute_future_reservation cannot be created: zone was declared as an output-only property, so the generated schema rejects any configured value (Can't configure a value for "zone"), while the create URL (projects/{{project}}/zones/{{zone}}/futureReservations) still requires it and fails with Cannot determine zone unless a provider-level zone is set.

This PR declares zone as an optional immutable parameter with a provider-level fallback, following the compute.Disk / compute.Reservation pattern. The generated schema becomes Optional + Computed + ForceNew with self-link diff suppression, so both a zone name and a zone URL are accepted without a permadiff.

Verified against the regenerated google-beta provider:

  • terraform plan with zone set on the resource succeeds (previously failed at plan time).
  • terraform apply builds the request URL from the configured zone.
  • Provider schema validation (TestProvider) and compute unit tests pass.
  • Requests without zone in config are unchanged (still resolved from the provider zone), so existing VCR cassettes stay valid.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: fixed `zone` field being output-only in `google_compute_future_reservation`, which made the resource impossible to create without a provider-level zone

@modular-magician

modular-magician commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 1 file changed, 5 insertions(+), 4 deletions(-)
google-beta provider View Diff 3 files changed, 59 insertions(+), 38 deletions(-)
terraform-google-conversion View Diff 1 file changed, 14 insertions(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_future_reservation (6 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_future_reservation" "primary" {
  zone = # value needed
}

Test report

Analytics

Total Tests Passed Skipped Affected
1525 1431 94 0
Affected Service Packages
  • compute

Learn how VCR tests work


Step 1: Replaying Mode

🟢 All tests passed in Replaying mode! No Recording was needed.

View the replaying VCR build log

@GitOleksandrBokov VCR tests complete for 42310d0!

zone was declared as an output-only property while base_url requires it
as an input, so the resource could not be created unless a provider-level
zone was set. Declare zone as an optional immutable parameter, following
the compute.Disk pattern.
@modular-magician

modular-magician commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 1 file changed, 6 insertions(+), 4 deletions(-)
google-beta provider View Diff 3 files changed, 61 insertions(+), 38 deletions(-)
terraform-google-conversion View Diff 1 file changed, 14 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
1525 1430 94 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
  • TestAccComputeFutureReservation_futureReservationBasicExample

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeFutureReservation_futureReservationBasicExample

🟢 All tests passed!

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

@GitOleksandrBokov VCR tests complete for a037e2f!

@GitOleksandrBokov GitOleksandrBokov force-pushed the compute-future-reservation-zone branch from a037e2f to b0fe9ef Compare July 10, 2026 13:11
@modular-magician

modular-magician commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 1 file changed, 6 insertions(+), 4 deletions(-)
google-beta provider View Diff 3 files changed, 61 insertions(+), 38 deletions(-)
terraform-google-conversion View Diff 1 file changed, 14 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
1525 1430 94 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
  • TestAccComputeFutureReservation_futureReservationBasicExample

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeFutureReservation_futureReservationBasicExample

🟢 All tests passed!

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

@GitOleksandrBokov VCR tests complete for b0fe9ef!

@GitOleksandrBokov GitOleksandrBokov marked this pull request as ready for review July 10, 2026 14:01
@github-actions github-actions Bot requested a review from shuyama1 July 10, 2026 14:02
@github-actions

Copy link
Copy Markdown

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

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

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.

2 participants