Use the PutTableBucketEncryption operation to set the server-side encryption configuration for a specified table bucket.
Usage notes
-
After you configure encryption for a
table bucket, newtables created without a specific encryption setting inherit this configuration. Existingtables are unaffected. -
Currently, only the AES256 encryption algorithm is supported.
-
If the table bucket already has an encryption configuration, this operation overwrites the existing configuration.
Permissions
|
API |
Action |
Description |
|
PutTableBucketEncryption |
oss:PutTableBucketEncryption |
Sets the server-side encryption for a table bucket. |
Request syntax
PUT /buckets/{tableBucketARN}/encryption HTTP/1.1
Content-Type: application/json
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: GMT Date
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/osstables/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c****
{
"encryptionConfiguration": {
"kmsKeyArn": "string",
"sseAlgorithm": "string"
}
}
Request parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
tableBucketARN |
string |
Yes |
acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket |
The Alibaba Cloud Resource Name (ARN) of the |
|
encryptionConfiguration |
object |
Yes |
- |
The server-side encryption configuration. Parent: None Children: |
|
sseAlgorithm |
string |
Yes |
AES256 |
The encryption algorithm. Currently, only AES256 is supported. Parent: encryptionConfiguration Child: None |
Examples
This example sets AES256 server-side encryption for a specified table bucket.
Request example
PUT /buckets/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/encryption HTTP/1.1
Content-Type: application/json
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: GMT Date
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/osstables/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c****
{
"encryptionConfiguration": {
"sseAlgorithm": "AES256"
}
}
Response example
HTTP/1.1 200 OK
Server: AliyunOSS
x-oss-request-id: 5C06A3B67B8B5A3DA422****
x-oss-server-time: 3
SDKs
You can call the PutTableBucketEncryption operation by using the following SDKs:
ossutil command-line tool
For the corresponding ossutil command, see put-table-bucket-encryption.
Error codes
|
Error code |
HTTP status code |
Description |
|
BadRequestException |
400 |
The request is invalid or malformed. |
|
ForbiddenException |
403 |
You do not have the required permissions to perform this operation. |
|
NotFoundException |
404 |
The requested resource does not exist. |