Professional Cloud Database Engineer free question 1 / 10 · Domain 1: Design innovative, scalable, and highly available cloud database solutions
You are creating a new Cloud SQL instance in asia-northeast1 and want to protect it with a customer-managed encryption key (CMEK). Which combination of key project and key location can you use?
- A multi-region key in asia, in the same project as the instance
- A Cloud KMS key in asia-northeast1, in a different project from the instance
- A Cloud KMS key in global, in a different project from the instance
- A Cloud KMS key in asia-northeast2, in the same project as the instance
Show the answer and explanation
Answer: B
Why this is correct
The About keys section of the CMEK page states that a new Cloud SQL instance must be in the same region as the key you associate with it. It adds that the key and the Cloud SQL instance can be in the same project or in different projects. The only requirement is that the regions match, and the project does not matter. For an instance in asia-northeast1, a key in asia-northeast1 works even when it lives in a different project.
Why the other options are wrong
"A multi-region key in asia, in the same project as the instance" … The asia multi-region location does not stand in for asia-northeast1, so this key does not match the instance region even though it is in the same project.
"A Cloud KMS key in asia-northeast2, in the same project as the instance" … A nearby region is not treated as a match, and keeping the key in the same project does not change that requirement.
"A Cloud KMS key in global, in a different project from the instance" … A key in the global location does not match the region of the Cloud SQL instance, so it cannot be used for this purpose.
Key point
Grant the key permission to the Cloud SQL service account. Who owns key management in the organization can be designed separately from the region requirement of the resource.