Professional Cloud Security Engineer free question 9 / 10 · Domain 5: Supporting compliance requirements
In a project where VMs are running in us-central1, you set gcp.resourceLocations to allow in:asia-northeast1-locations (Tokyo). After the location constraint takes effect, what happens to the existing VMs and to creating new VMs in us-central1? Nothing else, such as permissions or settings, causes a problem.
- The existing VMs continue, and new creation in that region is rejected
- The existing VMs stop, and new creation in that region is allowed
- The existing VMs stop, and new creation in that region is rejected
- The existing VMs continue, and new creation in that region is allowed
Show the answer and explanation
Answer: A
Why this is correct
The documentation on restricting resource locations says that when you set resource locations, the restriction applies only to newly created resources, and resources created before you set the constraint continue to exist and work as they are. The VMs running in us-central1 do not stop. A request to create a new VM in us-central1, which is not allowed after the setting, is rejected.
Why the other options are wrong
"The existing VMs stop, and new creation in that region is rejected" … Creating new resources outside the allowed location is rejected, but this constraint does not stop existing VMs retroactively.
"The existing VMs stop, and new creation in that region is allowed" … Existing VMs do not stop, and the constraint does apply to new creation, so both behaviors are reversed here.
"The existing VMs continue, and new creation in that region is allowed" … It is right that the existing VMs continue, but a request to create a new resource outside the allowed location after the setting is rejected.
Key point
Plan the remediation of existing assets separately. For some services, such as Cloud Storage, the constraint has exceptions for creating subresources, so check the coverage for the real resource types.