Skip to content

feat(0-bootstrap): make compute.restrictVpcPeering producers configurable - #352

Merged
aghassemlouei merged 1 commit into
google:mainfrom
WandLZhang:fix/restrict-vpc-peering-folder
Oct 29, 2026
Merged

aghassemlouei merged 1 commit into
google:mainfrom
WandLZhang:fix/restrict-vpc-peering-folder

Conversation

@WandLZhang

@WandLZhang WandLZhang commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Description

Make the Google producer values in compute.restrictVpcPeering configurable, as digitalresistor proposed on this PR and aghassemlouei endorsed in review.

The first version of this PR removed under:folders/832634261155. That was wrong. It's Google's Service Networking producer folder, and private services access peers with it. This version replaces that commit and keeps the folder as the default.

  • The new org_policies_config.constraints.allowed_vpc_peering_producers list in fast/stages-aw/0-bootstrap/variables.tf defaults to ["under:folders/832634261155"].
  • organization.tf passes the list to the data/custom-org-policies/ templates, the same way it passes allowed_policy_member_domains.
  • networking_policy.yaml renders the list after under:organizations/${organization_id}.
  • A comment replaces the Medium link. It cites the constraint reference, the private services access overview and the Private Service Connect security page, and links aghassemlouei's review for the other producer IDs.
  • terraform.tfvars.sample shows the new key with its default, and tools/tfdoc.py regenerated the README variables table.

With the default, the rendered policy doesn't change. A deployment can add producers, such as under:folders/391150242170 for legacy peering-based GKE private clusters, or set the list to [] if it uses only Private Service Connect.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Deployment & Compliance Impact

  • Applicable Regimes:
    • US Region Restricted (e.g., Access Policy constraint)
    • FedRAMP Moderate
    • FedRAMP High
    • DoD IL4
    • DoD IL5
    • General / All
  • NIST 800-53r5 Controls: None. With the default, every regime renders the same organization policies as main.

Checklist

Code Quality & Reusability

  • My code adheres to the Maximize Reusability principle. I have not redefined common elements and have reused existing base configurations and modules where possible.
  • I have checked that no existing module or configuration in modules/ or fast/stages-aw/ can be leveraged for this change.
  • My code follows the established naming conventions outlined in docs/naming-convention.md.

Documentation

  • I have updated the README.md of the modified module or blueprint.
  • I have added/updated documentation for inputs (variables) and outputs.

Security

  • My change adheres to GCP security best practices and the principle of least privilege.
  • I have ensured compliance with the targeted regime (FedRAMP Moderate, FedRAMP High, IL4, IL5, etc.).

Testing

  • I have tested my changes locally.
  • I have included details of my testing in this PR.

Testing Performed

  • terraform console rendered Stage 0's local.org_policies on main and on this branch, after terraform init -backend=false, with test inputs.
  • With the default, with an existing org_policies_config that omits the new key, and with null, compute.restrictVpcPeering allows the organization and under:folders/832634261155. The whole local.org_policies map hashes the same as on main under IL5, IL4 and FEDRAMP_HIGH (69 policies) and FEDRAMP_MODERATE (63 policies).
  • With [], the policy allows only the organization.
  • With ["under:folders/832634261155", "under:folders/391150242170"], the policy allows the organization and both folders.
  • terraform init -backend=false and terraform validate in fast/stages-aw/0-bootstrap/ report a valid configuration.
  • bash tools/lint.sh with TFLint v0.64.0 passes all 10 checks.
  • uv run --locked pytest passes 107 tests, and the tests/test_*.sh suites pass.

@github-actions github-actions Bot added the Scope - Fast Related to Fabric FAST deployment stages in the fast directory label Oct 23, 2026
@digitalresistor

Copy link
Copy Markdown
Contributor

This was added in this commit: 2be4597

Which does not provide a reasoning for why it was added.

However reading the attached blog post that it links to:

constraint: constraints/compute.restrictVpcPeering
listPolicy:
  inheritFromParent: false
  allowedValues:
  # Required if projects use services that rely on peering via service
networking. E.g., Cloud SQL.
  - under:folders/832634261155  #
[google.com/tenancy-units/service-networking](http://google.com/tenancy-units/service-networking) folder.
  - under:folders/1087601843002  # [google.com/products/speckle/](http://google.com/products/speckle/) folder for
the use of Cloud SQL
  # Required if projects use GKE private clusters.
  - under:folders/391150242170  # [google.com/tenancy-units/gke/prod](http://google.com/tenancy-units/gke/prod) folder
for GKE master peering.

Is required to allow Google services to peer with VPC's in our projects.

Quote from the blog post:

Some Google products like Cloud SQL and Kubernetes Engine rely on customer VPCs peering with Google’s own VPCs

So removing this line would effectively disallow the peering that is required. Instead of removing this line we should add documentation around this, and if possible link to somewhere other than that blog post for that information.

On top of that we should have automation that allows this particular item to be turned on/off as necessary, for example when CloudSQL/GKE private clusters are not used or not required.

@digitalresistor

Copy link
Copy Markdown
Contributor

Follow-up on a canonical source for the under:folders/832634261155 value.

Google Cloud documentation does not publish this folder ID, nor the other two from the blog post. The only sources found are the Medium post and third-party deployment guides that copy it. What official documentation does cover:

  • Organization policies for Compute Engine documents compute.restrictVpcPeering and the under:organizations/, under:folders/ and under:projects/ value syntax, but no Google-owned folders.
  • Dataproc Metastore troubleshooting is the only page that names a Google-owned folder for this constraint, under:folders/270204312590, and it applies to Dataproc Metastore only. Folder IDs differ per producer service.
  • Configure private services access for Cloud SQL explains that private IP depends on VPC Network Peering through Service Networking, which is why the constraint blocks it. The page does not mention the constraint itself.
  • Private Service Connect in GKE clusters, and Cloud SQL over Private Service Connect, do not use VPC peering and are unaffected by the constraint.

The current policy is also incomplete for the use cases the blog post covers. It allows only the service networking tenancy folder. Legacy peering-based GKE private clusters also need under:folders/391150242170, and pubsec-declarative-toolkit#812 shows that failure.

Proposed direction instead of removing the line:

  1. Keep the service networking folder and replace the Medium link with a comment that explains what it allows and cites the official pages above.
  2. Expose the Google producer folders as a Stage 0 variable, so deployments that rely only on Private Service Connect can drop them.
  3. Get the authoritative folder list for Service Networking, Cloud SQL and GKE from the owning product teams.

@aghassemlouei, could you help find an internal owner who can confirm these folder IDs, or point to a supported public reference for them?

@digitalresistor

Copy link
Copy Markdown
Contributor

@Calvin-Cheng1 I was referred to you by AJ, do you have a good contact?

@WandLZhang

Copy link
Copy Markdown
Member Author

Thanks for catching this, and you're right. I read 832634261155 as a folder in someone else's org. It's Google's Service Networking producer folder, and removing it would break private services access for Cloud SQL, Memorystore and Filestore private IP. That was my mistake, and I've put it back in my fork.

I'd like to rework this PR into your first two items rather than close it:

  1. Keep under:folders/832634261155, and replace the Medium link with a comment that says what the value allows and cites the Compute Engine organization policy page, the Cloud SQL private IP page and the GKE Private Service Connect page.
  2. Add a Stage 0 variable for Google producer folders. The default keeps today's value, so existing deployments see no change. Deployments that only use Private Service Connect can set it to an empty list, and ones with legacy peering-based GKE private clusters can add under:folders/391150242170.

On the third item, I can help find the owning team inside Google and will post back here with whatever public reference they can point to.

If you'd rather have the rework in a fresh PR, I'll close this one instead.

@aghassemlouei aghassemlouei added Bug Something isn't working Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete Priority - Medium Standard features and non-blocking bugs; important for the current milestone but not urgent labels Oct 26, 2026

@aghassemlouei aghassemlouei left a comment •

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.

Confirmed today's Google-managed producer folder and organization IDs for constraints/compute.restrictVpcPeering:

  • under:folders/832634261155 covers Private Services Access (servicenetworking.googleapis.com) tenant networks used by Cloud SQL, AlloyDB, Memorystore, Filestore, Vertex AI, and Cloud Build private pools.
  • under:folders/1087601843002 covers Cloud SQL dedicated private IP peering (cloudsql-mysql-googleapis-com and cloudsql-postgres-googleapis-com).
  • under:folders/391150242170 covers legacy VPC peering-based GKE private cluster control planes.
  • under:folders/270204312590 covers Dataproc Metastore VPC peering.
  • under:folders/38889423310 covers Filestore Basic tier direct VPC peering.
  • under:folders/1073120509012 covers Memorystore for Redis direct VPC peering.
  • under:folders/102761826467 covers Cloud TPU VPC peering.
  • under:organizations/433637338589 is the top-level Google producer organization ID (published in the Private Service Connect consumer security documentation) if an organization prefers a single producer org entry over per-service folders.

We are submitting updates to the public Private Services Access, GKE cluster creation troubleshooting, and Stellar Engine deployment walkthrough documentation on cloud.google.com so these producer IDs and org_policies_config.constraints options are documented directly and dynamically updated whenever any changes occur.

…able

Private services access peers VPC networks with Google producer networks,
so compute.restrictVpcPeering has to allow the producer folder. Stage 0
hard-coded the Service Networking producer folder next to a blog link.

Add org_policies_config.constraints.allowed_vpc_peering_producers. It
defaults to ["under:folders/832634261155"], so the rendered policy doesn't
change. Deployments can add other Google producers, or set it to [] if they
use only Private Service Connect. Replace the blog link with a comment that
cites the constraint reference, the private services access overview and
the Private Service Connect security page, and points at the google#352 review
for other producer IDs.
@WandLZhang
WandLZhang force-pushed the fix/restrict-vpc-peering-folder branch from 8803763 to eeed051 Compare October 26, 2026 13:39
@WandLZhang WandLZhang changed the title fix(0-bootstrap): drop a fixed folder from compute.restrictVpcPeering feat(0-bootstrap): make compute.restrictVpcPeering producers configurable Oct 26, 2026
@aghassemlouei aghassemlouei added the Enhancement New feature or request label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Enhancement New feature or request Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete Priority - Medium Standard features and non-blocking bugs; important for the current milestone but not urgent Scope - Fast Related to Fabric FAST deployment stages in the fast directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants