Assigning a Key to an Object Storage Bucket
Assign a Vault master encryption key to an Object Storage bucket.
You can encrypt the data encryption keys that encrypt the objects in a bucket by using your own Vault master encryption key. By default, buckets are encrypted with keys managed by Oracle. For more information, see Object Storage Data Encryption and Overview of Vault
Important
Buckets in a security zone can't use the default encryption key managed by Oracle. You must use your own Vault master encryption key.
Buckets in a security zone can't use the default encryption key managed by Oracle. You must use your own Vault master encryption key.
Use the oci os bucket update command and required parameters to assign a Vault key to a bucket. We recommended that you enable Bucket Key with SSE-KMS because this setting reduces calls from Object Storage to KMS, which lowers PUT and GET latency, and decreases the likelihood of KMS throttling.
oci os bucket update --name bucket_name --namespace-name namespace_name --kms-key-id kms_key_id --is-bucket-key-enabled true [OPTIONS]For example:
oci os bucket update --bucket-name MyBucket --namespace-name namespace --kms-key-id ocid1.key.oc1..exampleuniqueID --is-bucket-key-enabled true { "data": { "acl-group-id": null, "approximate-count": null, "approximate-size": null, "auto-tiering": "Disabled", "bucket-scope": "NAMESPACE", "compartment-id": "ocid1.tenancy.oc1..exampleuniqueID", "created-by": "ocid1.user.oc1..exampleuniqueID", "defined-tags": {}, "etag": "8bac979a-754f-4af5-9625-c1a1079d57c1", "freeform-tags": {}, "id": "ocid1.bucket.oc1.exampleuniqueID", "is-bucket-key-enabled": true, "is-read-only": false, "kms-key-id": "ocid1.key.oc1.exampleuniqueID", "metadata": {}, "name": "MyBucket", "namespace": "namespace", "object-events-enabled": false, "object-level-audit-mode": "Disabled", "object-lifecycle-policy-etag": null, "public-access-type": "NoPublicAccess", "replication-enabled": false, "soft-delete-policy": { "current-policy": { "cool-off-duration": null, "restore-duration": null, "soft-delete-mode": "Disabled", "time-activation": null }, "next-policy": null, "time-modified": null }, "storage-tier": "Standard", "time-created": "2026-06-17T22:35:38.081000+00:00", "versioning": "Disabled" }, "etag": "8bac979a-754f-4af5-9625-c1a1079d57c1" }If you're updating the key, run the same oci os bucket update command with the updated
kms_key_idvalue.See Overview of Vault for more details.
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
This task can't be performed using the API.