published on Thursday, Apr 23, 2026 by Volcengine
published on Thursday, Apr 23, 2026 by Volcengine
Set server-side encryption for the bucket. After server-side encryption is set for the bucket, if you upload a file to this bucket without specifying a server-side encryption method for the file, the file will inherit the bucket’s server-side encryption method by default
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcenginecc from "@volcengine/pulumi-volcenginecc";
const tOSBucketEncryptionDemo = new volcenginecc.tos.BucketEncryption("TOSBucketEncryptionDemo", {
kmsMasterKeyId: "trn:kms:cn-beijing:21xxxxxxxxxxx:keyrings/ccapi-text/keys/terratest-kms-key-u-xxxxx",
name: "ccapi-test",
sseAlgorithm: "kms",
});
import pulumi
import pulumi_volcenginecc as volcenginecc
t_os_bucket_encryption_demo = volcenginecc.tos.BucketEncryption("TOSBucketEncryptionDemo",
kms_master_key_id="trn:kms:cn-beijing:21xxxxxxxxxxx:keyrings/ccapi-text/keys/terratest-kms-key-u-xxxxx",
name="ccapi-test",
sse_algorithm="kms")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcenginecc/sdk/go/volcenginecc/tos"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tos.NewBucketEncryption(ctx, "TOSBucketEncryptionDemo", &tos.BucketEncryptionArgs{
KmsMasterKeyId: pulumi.String("trn:kms:cn-beijing:21xxxxxxxxxxx:keyrings/ccapi-text/keys/terratest-kms-key-u-xxxxx"),
Name: pulumi.String("ccapi-test"),
SseAlgorithm: pulumi.String("kms"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcenginecc = Volcengine.Pulumi.Volcenginecc;
return await Deployment.RunAsync(() =>
{
var tOSBucketEncryptionDemo = new Volcenginecc.Tos.BucketEncryption("TOSBucketEncryptionDemo", new()
{
KmsMasterKeyId = "trn:kms:cn-beijing:21xxxxxxxxxxx:keyrings/ccapi-text/keys/terratest-kms-key-u-xxxxx",
Name = "ccapi-test",
SseAlgorithm = "kms",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.volcengine.volcenginecc.tos.BucketEncryption;
import com.volcengine.volcenginecc.tos.BucketEncryptionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var tOSBucketEncryptionDemo = new BucketEncryption("tOSBucketEncryptionDemo", BucketEncryptionArgs.builder()
.kmsMasterKeyId("trn:kms:cn-beijing:21xxxxxxxxxxx:keyrings/ccapi-text/keys/terratest-kms-key-u-xxxxx")
.name("ccapi-test")
.sseAlgorithm("kms")
.build());
}
}
resources:
tOSBucketEncryptionDemo:
type: volcenginecc:tos:BucketEncryption
name: TOSBucketEncryptionDemo
properties:
kmsMasterKeyId: trn:kms:cn-beijing:21xxxxxxxxxxx:keyrings/ccapi-text/keys/terratest-kms-key-u-xxxxx
name: ccapi-test
sseAlgorithm: kms
Create BucketEncryption Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BucketEncryption(name: string, args: BucketEncryptionArgs, opts?: CustomResourceOptions);@overload
def BucketEncryption(resource_name: str,
args: BucketEncryptionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BucketEncryption(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
kms_master_key_id: Optional[str] = None,
sse_algorithm: Optional[str] = None)func NewBucketEncryption(ctx *Context, name string, args BucketEncryptionArgs, opts ...ResourceOption) (*BucketEncryption, error)public BucketEncryption(string name, BucketEncryptionArgs args, CustomResourceOptions? opts = null)
public BucketEncryption(String name, BucketEncryptionArgs args)
public BucketEncryption(String name, BucketEncryptionArgs args, CustomResourceOptions options)
type: volcenginecc:tos:BucketEncryption
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args BucketEncryptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args BucketEncryptionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args BucketEncryptionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BucketEncryptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BucketEncryptionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var bucketEncryptionResource = new Volcenginecc.Tos.BucketEncryption("bucketEncryptionResource", new()
{
Name = "string",
KmsMasterKeyId = "string",
SseAlgorithm = "string",
});
example, err := tos.NewBucketEncryption(ctx, "bucketEncryptionResource", &tos.BucketEncryptionArgs{
Name: pulumi.String("string"),
KmsMasterKeyId: pulumi.String("string"),
SseAlgorithm: pulumi.String("string"),
})
var bucketEncryptionResource = new BucketEncryption("bucketEncryptionResource", BucketEncryptionArgs.builder()
.name("string")
.kmsMasterKeyId("string")
.sseAlgorithm("string")
.build());
bucket_encryption_resource = volcenginecc.tos.BucketEncryption("bucketEncryptionResource",
name="string",
kms_master_key_id="string",
sse_algorithm="string")
const bucketEncryptionResource = new volcenginecc.tos.BucketEncryption("bucketEncryptionResource", {
name: "string",
kmsMasterKeyId: "string",
sseAlgorithm: "string",
});
type: volcenginecc:tos:BucketEncryption
properties:
kmsMasterKeyId: string
name: string
sseAlgorithm: string
BucketEncryption Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The BucketEncryption resource accepts the following input properties:
- Name string
- Bucket name
- Kms
Master stringKey Id - The master key used for SSE-KMS encryption
- Sse
Algorithm string - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- Name string
- Bucket name
- Kms
Master stringKey Id - The master key used for SSE-KMS encryption
- Sse
Algorithm string - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- name String
- Bucket name
- kms
Master StringKey Id - The master key used for SSE-KMS encryption
- sse
Algorithm String - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- name string
- Bucket name
- kms
Master stringKey Id - The master key used for SSE-KMS encryption
- sse
Algorithm string - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- name str
- Bucket name
- kms_
master_ strkey_ id - The master key used for SSE-KMS encryption
- sse_
algorithm str - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- name String
- Bucket name
- kms
Master StringKey Id - The master key used for SSE-KMS encryption
- sse
Algorithm String - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
Outputs
All input properties are implicitly available as output properties. Additionally, the BucketEncryption resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing BucketEncryption Resource
Get an existing BucketEncryption resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: BucketEncryptionState, opts?: CustomResourceOptions): BucketEncryption@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
kms_master_key_id: Optional[str] = None,
name: Optional[str] = None,
sse_algorithm: Optional[str] = None) -> BucketEncryptionfunc GetBucketEncryption(ctx *Context, name string, id IDInput, state *BucketEncryptionState, opts ...ResourceOption) (*BucketEncryption, error)public static BucketEncryption Get(string name, Input<string> id, BucketEncryptionState? state, CustomResourceOptions? opts = null)public static BucketEncryption get(String name, Output<String> id, BucketEncryptionState state, CustomResourceOptions options)resources: _: type: volcenginecc:tos:BucketEncryption get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Kms
Master stringKey Id - The master key used for SSE-KMS encryption
- Name string
- Bucket name
- Sse
Algorithm string - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- Kms
Master stringKey Id - The master key used for SSE-KMS encryption
- Name string
- Bucket name
- Sse
Algorithm string - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- kms
Master StringKey Id - The master key used for SSE-KMS encryption
- name String
- Bucket name
- sse
Algorithm String - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- kms
Master stringKey Id - The master key used for SSE-KMS encryption
- name string
- Bucket name
- sse
Algorithm string - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- kms_
master_ strkey_ id - The master key used for SSE-KMS encryption
- name str
- Bucket name
- sse_
algorithm str - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
- kms
Master StringKey Id - The master key used for SSE-KMS encryption
- name String
- Bucket name
- sse
Algorithm String - Default server-side encryption method. The values are explained as follows: kms: uses SSE-KMS encryption. AES256: uses SSE-TOS encryption with the AES256 algorithm. SM4: uses SSE-TOS encryption with the SM4 algorithm
Import
$ pulumi import volcenginecc:tos/bucketEncryption:BucketEncryption example "name"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcenginecc volcengine/pulumi-volcenginecc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
volcengineccTerraform Provider.
published on Thursday, Apr 23, 2026 by Volcengine
