1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CbsSnapshot
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.CbsSnapshot

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a CBS snapshot.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.CbsSnapshot("example", {
        snapshotName: "tf-example",
        storageId: "disk-alc1r5sw",
        tags: {
            createBy: "Terraform",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.CbsSnapshot("example",
        snapshot_name="tf-example",
        storage_id="disk-alc1r5sw",
        tags={
            "createBy": "Terraform",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewCbsSnapshot(ctx, "example", &tencentcloud.CbsSnapshotArgs{
    			SnapshotName: pulumi.String("tf-example"),
    			StorageId:    pulumi.String("disk-alc1r5sw"),
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("Terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Tencentcloud.CbsSnapshot("example", new()
        {
            SnapshotName = "tf-example",
            StorageId = "disk-alc1r5sw",
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.CbsSnapshot;
    import com.pulumi.tencentcloud.CbsSnapshotArgs;
    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 example = new CbsSnapshot("example", CbsSnapshotArgs.builder()
                .snapshotName("tf-example")
                .storageId("disk-alc1r5sw")
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:CbsSnapshot
        properties:
          snapshotName: tf-example
          storageId: disk-alc1r5sw
          tags:
            createBy: Terraform
    

    Create CbsSnapshot Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CbsSnapshot(name: string, args: CbsSnapshotArgs, opts?: CustomResourceOptions);
    @overload
    def CbsSnapshot(resource_name: str,
                    args: CbsSnapshotArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def CbsSnapshot(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    snapshot_name: Optional[str] = None,
                    storage_id: Optional[str] = None,
                    cbs_snapshot_id: Optional[str] = None,
                    tags: Optional[Mapping[str, str]] = None)
    func NewCbsSnapshot(ctx *Context, name string, args CbsSnapshotArgs, opts ...ResourceOption) (*CbsSnapshot, error)
    public CbsSnapshot(string name, CbsSnapshotArgs args, CustomResourceOptions? opts = null)
    public CbsSnapshot(String name, CbsSnapshotArgs args)
    public CbsSnapshot(String name, CbsSnapshotArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CbsSnapshot
    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 CbsSnapshotArgs
    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 CbsSnapshotArgs
    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 CbsSnapshotArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CbsSnapshotArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CbsSnapshotArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    CbsSnapshot 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 CbsSnapshot resource accepts the following input properties:

    SnapshotName string
    Name of the snapshot.
    StorageId string
    ID of the the CBS which this snapshot created from.
    CbsSnapshotId string
    ID of the resource.
    Tags Dictionary<string, string>
    The available tags within this CBS Snapshot.
    SnapshotName string
    Name of the snapshot.
    StorageId string
    ID of the the CBS which this snapshot created from.
    CbsSnapshotId string
    ID of the resource.
    Tags map[string]string
    The available tags within this CBS Snapshot.
    snapshotName String
    Name of the snapshot.
    storageId String
    ID of the the CBS which this snapshot created from.
    cbsSnapshotId String
    ID of the resource.
    tags Map<String,String>
    The available tags within this CBS Snapshot.
    snapshotName string
    Name of the snapshot.
    storageId string
    ID of the the CBS which this snapshot created from.
    cbsSnapshotId string
    ID of the resource.
    tags {[key: string]: string}
    The available tags within this CBS Snapshot.
    snapshot_name str
    Name of the snapshot.
    storage_id str
    ID of the the CBS which this snapshot created from.
    cbs_snapshot_id str
    ID of the resource.
    tags Mapping[str, str]
    The available tags within this CBS Snapshot.
    snapshotName String
    Name of the snapshot.
    storageId String
    ID of the the CBS which this snapshot created from.
    cbsSnapshotId String
    ID of the resource.
    tags Map<String>
    The available tags within this CBS Snapshot.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CbsSnapshot resource produces the following output properties:

    CreateTime string
    Creation time of snapshot.
    DiskType string
    Types of CBS which this snapshot created from.
    Id string
    The provider-assigned unique ID for this managed resource.
    Percent double
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    SnapshotStatus string
    Status of the snapshot.
    StorageSize double
    Volume of storage which this snapshot created from.
    CreateTime string
    Creation time of snapshot.
    DiskType string
    Types of CBS which this snapshot created from.
    Id string
    The provider-assigned unique ID for this managed resource.
    Percent float64
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    SnapshotStatus string
    Status of the snapshot.
    StorageSize float64
    Volume of storage which this snapshot created from.
    createTime String
    Creation time of snapshot.
    diskType String
    Types of CBS which this snapshot created from.
    id String
    The provider-assigned unique ID for this managed resource.
    percent Double
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    snapshotStatus String
    Status of the snapshot.
    storageSize Double
    Volume of storage which this snapshot created from.
    createTime string
    Creation time of snapshot.
    diskType string
    Types of CBS which this snapshot created from.
    id string
    The provider-assigned unique ID for this managed resource.
    percent number
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    snapshotStatus string
    Status of the snapshot.
    storageSize number
    Volume of storage which this snapshot created from.
    create_time str
    Creation time of snapshot.
    disk_type str
    Types of CBS which this snapshot created from.
    id str
    The provider-assigned unique ID for this managed resource.
    percent float
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    snapshot_status str
    Status of the snapshot.
    storage_size float
    Volume of storage which this snapshot created from.
    createTime String
    Creation time of snapshot.
    diskType String
    Types of CBS which this snapshot created from.
    id String
    The provider-assigned unique ID for this managed resource.
    percent Number
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    snapshotStatus String
    Status of the snapshot.
    storageSize Number
    Volume of storage which this snapshot created from.

    Look up Existing CbsSnapshot Resource

    Get an existing CbsSnapshot 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?: CbsSnapshotState, opts?: CustomResourceOptions): CbsSnapshot
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cbs_snapshot_id: Optional[str] = None,
            create_time: Optional[str] = None,
            disk_type: Optional[str] = None,
            percent: Optional[float] = None,
            snapshot_name: Optional[str] = None,
            snapshot_status: Optional[str] = None,
            storage_id: Optional[str] = None,
            storage_size: Optional[float] = None,
            tags: Optional[Mapping[str, str]] = None) -> CbsSnapshot
    func GetCbsSnapshot(ctx *Context, name string, id IDInput, state *CbsSnapshotState, opts ...ResourceOption) (*CbsSnapshot, error)
    public static CbsSnapshot Get(string name, Input<string> id, CbsSnapshotState? state, CustomResourceOptions? opts = null)
    public static CbsSnapshot get(String name, Output<String> id, CbsSnapshotState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CbsSnapshot    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.
    The following state arguments are supported:
    CbsSnapshotId string
    ID of the resource.
    CreateTime string
    Creation time of snapshot.
    DiskType string
    Types of CBS which this snapshot created from.
    Percent double
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    SnapshotName string
    Name of the snapshot.
    SnapshotStatus string
    Status of the snapshot.
    StorageId string
    ID of the the CBS which this snapshot created from.
    StorageSize double
    Volume of storage which this snapshot created from.
    Tags Dictionary<string, string>
    The available tags within this CBS Snapshot.
    CbsSnapshotId string
    ID of the resource.
    CreateTime string
    Creation time of snapshot.
    DiskType string
    Types of CBS which this snapshot created from.
    Percent float64
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    SnapshotName string
    Name of the snapshot.
    SnapshotStatus string
    Status of the snapshot.
    StorageId string
    ID of the the CBS which this snapshot created from.
    StorageSize float64
    Volume of storage which this snapshot created from.
    Tags map[string]string
    The available tags within this CBS Snapshot.
    cbsSnapshotId String
    ID of the resource.
    createTime String
    Creation time of snapshot.
    diskType String
    Types of CBS which this snapshot created from.
    percent Double
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    snapshotName String
    Name of the snapshot.
    snapshotStatus String
    Status of the snapshot.
    storageId String
    ID of the the CBS which this snapshot created from.
    storageSize Double
    Volume of storage which this snapshot created from.
    tags Map<String,String>
    The available tags within this CBS Snapshot.
    cbsSnapshotId string
    ID of the resource.
    createTime string
    Creation time of snapshot.
    diskType string
    Types of CBS which this snapshot created from.
    percent number
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    snapshotName string
    Name of the snapshot.
    snapshotStatus string
    Status of the snapshot.
    storageId string
    ID of the the CBS which this snapshot created from.
    storageSize number
    Volume of storage which this snapshot created from.
    tags {[key: string]: string}
    The available tags within this CBS Snapshot.
    cbs_snapshot_id str
    ID of the resource.
    create_time str
    Creation time of snapshot.
    disk_type str
    Types of CBS which this snapshot created from.
    percent float
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    snapshot_name str
    Name of the snapshot.
    snapshot_status str
    Status of the snapshot.
    storage_id str
    ID of the the CBS which this snapshot created from.
    storage_size float
    Volume of storage which this snapshot created from.
    tags Mapping[str, str]
    The available tags within this CBS Snapshot.
    cbsSnapshotId String
    ID of the resource.
    createTime String
    Creation time of snapshot.
    diskType String
    Types of CBS which this snapshot created from.
    percent Number
    Snapshot creation progress percentage. If the snapshot has created successfully, the constant value is 100.
    snapshotName String
    Name of the snapshot.
    snapshotStatus String
    Status of the snapshot.
    storageId String
    ID of the the CBS which this snapshot created from.
    storageSize Number
    Volume of storage which this snapshot created from.
    tags Map<String>
    The available tags within this CBS Snapshot.

    Import

    CBS snapshot can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/cbsSnapshot:CbsSnapshot example snap-3sa3f39b
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack