apigee: add maintenance_update_policy to google_apigee_instance (#25991)#62
Open
jbbqqf wants to merge 11 commits into
Open
apigee: add maintenance_update_policy to google_apigee_instance (#25991)#62jbbqqf wants to merge 11 commits into
jbbqqf wants to merge 11 commits into
Conversation
Add the optional MaintenanceUpdatePolicy block that lets customers declare their preferred maintenance window (day-of-week + UTC time-of-day) and notification channel (WEEK1/WEEK2 lead time). The Apigee REST API already accepts this on the Instance resource (organizations.instances) but the field was not surfaced in mmv1. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the optional
maintenance_update_policyblock togoogle_apigee_instance, exposing the GCP API field that lets customers declare their preferred maintenance window (day of week + UTC time of day) and a notification lead-time channel (WEEK1/WEEK2).Fixes hashicorp/terraform-provider-google#25991 — see hashicorp/terraform-provider-google#25991
Why
The Apigee
InstanceREST resource has supportedmaintenanceUpdatePolicyfor some time. Apigee X customers in regulated environments need to schedule maintenance outside business hours; without provider support they fall back to UI clicks that don't survive Terraform refreshes (the field permadiffs because the API populates it but the schema can't accept user values).GCP API reference:
MaintenanceUpdatePolicy: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.instances#MaintenanceUpdatePolicyMaintenanceWindow: same page,MaintenanceUpdatePolicy.MaintenanceWindowWhat changed
mmv1/products/apigee/Instance.yaml— one new top-level NestedObject property:maintenance_update_policy.maintenance_channel(Enum:MAINTENANCE_CHANNEL_UNSPECIFIED/WEEK1/WEEK2)maintenance_update_policy.maintenance_windows[](Array of NestedObject; the API doc notes "Currently limited to 1")day(Enum:DAY_OF_WEEK_UNSPECIFIED/MONDAY…SUNDAY, required)start_time(NestedObject ofgoogle.type.TimeOfDay:hours,minutes,seconds,nanos, required)The fields are all optional and additive — no breaking change.
Edge cases tested
# maintenance_update_policy omittedIsEmptyValueguard on expandmaintenance_update_policy { maintenance_channel = "WEEK1"; maintenance_windows { day = "TUESDAY"; start_time { hours = 2 } } }start_time { hours = 0 }(midnight) without minutes/secondsstart_time { hours = 0 }GetOkhelpers; users can rely on the explicit-set behaviorThis change is additive schema with no behavior change for existing instances. A live before/after smoke against the Apigee provisioning API was not run because Apigee Instance creation has a 30+ minute provisioning time on a paid org and would consume substantial credit; the gap (
Unsupported argument) is provable purely fromterraform validateagainst a fresh schema.Test protocol
go run ./mmv1 -product=apigee -version=gago build ./google/services/apigee/...(TPG, with regenerated file)go vet ./google/services/apigee/...(TPG)Disclosure
This PR was implemented with assistance from Claude Code as part of a focused contribution batch on Apigee mmv1 schema gaps. The diff was reviewed manually against the GCP API documentation linked above.
The author (a human) reviewed the diff and the generator output before opening this PR.