All Products
Search
Document Center

Object Storage Service:Set Table Bucket encryption

Last Updated:Jun 03, 2026

Sets the server-side encryption configuration for a Table Bucket.

Usage notes

  • To use KMS encryption, activate KMS and make sure you have the required permissions to use the target key.

Command format

ossutil tables-api put-table-bucket-encryption --table-bucket-arn value --encryption-configuration value [flags]

Parameter

Type

Required

Description

--table-bucket-arn

string

Yes

The ARN of the Table Bucket. Format: acs:osstables:{region}:{accountId}:bucket/{name}.

--encryption-configuration

string

Yes

The server-side encryption configuration, specified as a JSON string or a file path (using file://). Set sseAlgorithm to AES256 or KMS. When using KMS, also set kmsKeyId.

Note

--encryption-configuration

Pass the encryption configuration as an inline JSON string or a file:// path. The JSON object supports the following fields:

Field

Type

Required

Valid values

sseAlgorithm

string

Yes

AES256, KMS

kmsKeyId

string

Required when sseAlgorithm is KMS

A KMS key ID

  • To use AES256 encryption:

    {
      "sseAlgorithm": "AES256"
    }
  • To use KMS encryption with a specific key:

    {
      "sseAlgorithm": "KMS",
      "kmsKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
    }

Examples

  • Set AES256 encryption on a Table Bucket:

    ossutil tables-api put-table-bucket-encryption --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --encryption-configuration '{"sseAlgorithm":"AES256"}'
  • Set KMS encryption on a Table Bucket and specify a key ID:

    ossutil tables-api put-table-bucket-encryption --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --encryption-configuration '{"sseAlgorithm":"KMS","kmsKeyId":"1234abcd-12ab-34cd-56ef-1234567890ab"}'
  • Load the encryption configuration from a file. The encryption-config.json file contains:

    {
      "sseAlgorithm": "AES256"
    }

    Command example:

    ossutil tables-api put-table-bucket-encryption --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --encryption-configuration file://encryption-config.json