---
title: "ezgh objects buckets encryption set"
description: "Use a customer key as a bucket's default."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh objects buckets encryption set

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh objects buckets encryption set <bucket> --key <key> [flags]
```

Make a key from Keys (kms\_…) a bucket's default encryption. It must be enabled and in the bucket's project, and you need keys.keys.generateDataKey and keys.keys.decrypt on it.

New objects use it. Existing objects don't change.

Part of [`ezgh objects buckets encryption`](/cli/reference/objects-buckets-encryption).

## Examples

```sh
ezgh objects buckets encryption set bkt_4k2m9x0a7qpe --key kms_7t3n1v8c2wzd
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--key` | string |  | the key's ID (kms\_…) |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/objects-buckets-encryption-set/index.mdx
