設定Table Bucket加密

更新時間:
Copy as MD

put-table-bucket-encryption用於設定Table Bucket的服務端加密配置。

注意事項

  • 如果使用KMS加密方式,請確保已開通KMS服務並擁有對應密鑰的使用許可權。

命令格式

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

參數

類型

說明

--table-bucket-arn

string

Table BucketARN,格式為acs:osstables:{region}:{accountId}:bucket/{name}。

--encryption-configuration

string

Table Bucket的服務端加密配置,JSON格式字串。包含密碼編譯演算法sseAlgorithm和可選的KMS密鑰ID kmsKeyId。

說明
  • put-table-bucket-encryption命令對應API介面PutTableBucketEncryption。關於API中的具體參數含義,請參見PutTableBucketEncryption

  • 關於支援的全域命令列選項,請參見ossutil全域選項

--encryption-configuration

--encryption-configuration配置選項支援JSON文法:

  • 使用AES256加密:

    {
      "sseAlgorithm": "AES256"
    }
  • 使用KMS加密:

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

使用樣本

  • 使用JSON參數設定Table Bucket的加密方式為AES256。

    ossutil tables-api put-table-bucket-encryption --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --encryption-configuration '{"sseAlgorithm":"AES256"}'
  • 使用JSON參數設定Table Bucket的加密方式為KMS並指定密鑰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"}'
  • 使用設定檔設定Table Bucket的加密配置。encryption-config.json內容如下:

    {
      "sseAlgorithm": "AES256"
    }

    命令樣本如下:

    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