A cloud administrator needs to ensure that Compute Engine virtual machines created within a specific environment folder cannot be assigned public IP addresses. Which Google Cloud mechanism should be used to enforce this restriction across all projects within that folder?
- Apply the `constraints/compute.vmExternalIpAccess` Organization Policy constraint at the target folder level to restrict external IP addresses.Answer
- BGrant the primitive Owner role (`roles/owner`) to project administrators so they can audit and remove public IP configurations.
- CDefine a VPC Service Controls perimeter around the folder to block external network interface configuration.
- DAssign the Service Account User role (`roles/iam.serviceAccountUser`) to developers across all projects in the folder.
Answer
Apply the `constraints/compute.vmExternalIpAccess` Organization Policy constraint at the target folder level to restrict external IP addresses.
Applying the `constraints/compute.vmExternalIpAccess` Organization Policy constraint at the folder level programmatically prevents any VM created within child projects from receiving external IP addresses, fulfilling the organizational compliance mandate.
Step-by-Step Solution
Key Concept
Organization Policies and Constraints