Encrypting under your own key
By default a secret’s versions are encrypted under a platform-managed key. Bind the secret to one of your own KMS keys at creation to use that instead:- Console
- API
- CLI
- Go
On Create Secret, open the Encryption card and choose a key under
Encryption key rather than Platform-managed key (default).The picker offers every key in the region that is
enabled and pinned to
Encrypt / Decrypt, which includes RSA keys that this service will not
accept — see the warning below.enabled, and pinned to
encrypt_decrypt.
What it changes
Binding a secret to your key does not change the API surface —value reads
and writes look identical. What changes is that the key becomes a control you
hold:
- Disable the key and reads start failing with
409 KMS_KEY_DISABLED. That error travels to you as itself, not as a500— the key state is yours, and re-enabling the key restores reads. - Schedule the key for deletion and reads fail with
409 KMS_KEY_PENDING_DELETIONfor the whole window. - Let that window elapse and every version of every secret under that key is permanently unreadable. The ciphertext is still in the database; nothing can open it.
The binding is fixed for the life of the secret.
kms_key_id is accepted
only on create, and PATCH edits just description and tags — moving a
secret to a different key means re-wrapping every version, so create a new
secret and retire the old one instead.