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

tencentcloud.CbsDiskBackup

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 disk backup.

    NOTE: The parameter disk_backup_quota in the resource tencentcloud.CbsStorage must be greater than 1.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const exampleCbsStorage = new tencentcloud.CbsStorage("exampleCbsStorage", {
        storageName: "tf-example",
        storageType: "CLOUD_SSD",
        storageSize: 100,
        availabilityZone: "ap-guangzhou-6",
        projectId: 0,
        encrypt: false,
        diskBackupQuota: 3,
        tags: {
            createBy: "Terraform",
        },
    });
    const exampleCbsDiskBackup = new tencentcloud.CbsDiskBackup("exampleCbsDiskBackup", {
        diskId: exampleCbsStorage.cbsStorageId,
        diskBackupName: "tf-example",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_cbs_storage = tencentcloud.CbsStorage("exampleCbsStorage",
        storage_name="tf-example",
        storage_type="CLOUD_SSD",
        storage_size=100,
        availability_zone="ap-guangzhou-6",
        project_id=0,
        encrypt=False,
        disk_backup_quota=3,
        tags={
            "createBy": "Terraform",
        })
    example_cbs_disk_backup = tencentcloud.CbsDiskBackup("exampleCbsDiskBackup",
        disk_id=example_cbs_storage.cbs_storage_id,
        disk_backup_name="tf-example")
    
    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 {
    		exampleCbsStorage, err := tencentcloud.NewCbsStorage(ctx, "exampleCbsStorage", &tencentcloud.CbsStorageArgs{
    			StorageName:      pulumi.String("tf-example"),
    			StorageType:      pulumi.String("CLOUD_SSD"),
    			StorageSize:      pulumi.Float64(100),
    			AvailabilityZone: pulumi.String("ap-guangzhou-6"),
    			ProjectId:        pulumi.Float64(0),
    			Encrypt:          pulumi.Bool(false),
    			DiskBackupQuota:  pulumi.Float64(3),
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("Terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCbsDiskBackup(ctx, "exampleCbsDiskBackup", &tencentcloud.CbsDiskBackupArgs{
    			DiskId:         exampleCbsStorage.CbsStorageId,
    			DiskBackupName: pulumi.String("tf-example"),
    		})
    		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 exampleCbsStorage = new Tencentcloud.CbsStorage("exampleCbsStorage", new()
        {
            StorageName = "tf-example",
            StorageType = "CLOUD_SSD",
            StorageSize = 100,
            AvailabilityZone = "ap-guangzhou-6",
            ProjectId = 0,
            Encrypt = false,
            DiskBackupQuota = 3,
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
        var exampleCbsDiskBackup = new Tencentcloud.CbsDiskBackup("exampleCbsDiskBackup", new()
        {
            DiskId = exampleCbsStorage.CbsStorageId,
            DiskBackupName = "tf-example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.CbsStorage;
    import com.pulumi.tencentcloud.CbsStorageArgs;
    import com.pulumi.tencentcloud.CbsDiskBackup;
    import com.pulumi.tencentcloud.CbsDiskBackupArgs;
    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 exampleCbsStorage = new CbsStorage("exampleCbsStorage", CbsStorageArgs.builder()
                .storageName("tf-example")
                .storageType("CLOUD_SSD")
                .storageSize(100)
                .availabilityZone("ap-guangzhou-6")
                .projectId(0)
                .encrypt(false)
                .diskBackupQuota(3)
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
            var exampleCbsDiskBackup = new CbsDiskBackup("exampleCbsDiskBackup", CbsDiskBackupArgs.builder()
                .diskId(exampleCbsStorage.cbsStorageId())
                .diskBackupName("tf-example")
                .build());
    
        }
    }
    
    resources:
      exampleCbsStorage:
        type: tencentcloud:CbsStorage
        properties:
          storageName: tf-example
          storageType: CLOUD_SSD
          storageSize: 100
          availabilityZone: ap-guangzhou-6
          projectId: 0
          encrypt: false
          diskBackupQuota: 3
          tags:
            createBy: Terraform
      exampleCbsDiskBackup:
        type: tencentcloud:CbsDiskBackup
        properties:
          diskId: ${exampleCbsStorage.cbsStorageId}
          diskBackupName: tf-example
    

    Create CbsDiskBackup Resource

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

    Constructor syntax

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

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

    DiskId string
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    CbsDiskBackupId string
    ID of the resource.
    DiskBackupName string
    Backup point name.
    DiskId string
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    CbsDiskBackupId string
    ID of the resource.
    DiskBackupName string
    Backup point name.
    diskId String
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    cbsDiskBackupId String
    ID of the resource.
    diskBackupName String
    Backup point name.
    diskId string
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    cbsDiskBackupId string
    ID of the resource.
    diskBackupName string
    Backup point name.
    disk_id str
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    cbs_disk_backup_id str
    ID of the resource.
    disk_backup_name str
    Backup point name.
    diskId String
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    cbsDiskBackupId String
    ID of the resource.
    diskBackupName String
    Backup point name.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CbsDiskBackup 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 CbsDiskBackup Resource

    Get an existing CbsDiskBackup 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?: CbsDiskBackupState, opts?: CustomResourceOptions): CbsDiskBackup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cbs_disk_backup_id: Optional[str] = None,
            disk_backup_name: Optional[str] = None,
            disk_id: Optional[str] = None) -> CbsDiskBackup
    func GetCbsDiskBackup(ctx *Context, name string, id IDInput, state *CbsDiskBackupState, opts ...ResourceOption) (*CbsDiskBackup, error)
    public static CbsDiskBackup Get(string name, Input<string> id, CbsDiskBackupState? state, CustomResourceOptions? opts = null)
    public static CbsDiskBackup get(String name, Output<String> id, CbsDiskBackupState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CbsDiskBackup    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:
    CbsDiskBackupId string
    ID of the resource.
    DiskBackupName string
    Backup point name.
    DiskId string
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    CbsDiskBackupId string
    ID of the resource.
    DiskBackupName string
    Backup point name.
    DiskId string
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    cbsDiskBackupId String
    ID of the resource.
    diskBackupName String
    Backup point name.
    diskId String
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    cbsDiskBackupId string
    ID of the resource.
    diskBackupName string
    Backup point name.
    diskId string
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    cbs_disk_backup_id str
    ID of the resource.
    disk_backup_name str
    Backup point name.
    disk_id str
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.
    cbsDiskBackupId String
    ID of the resource.
    diskBackupName String
    Backup point name.
    diskId String
    ID of the original cloud disk of the backup point, which can be queried through the DescribeDisks API.

    Import

    CBS disk backup can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/cbsDiskBackup:CbsDiskBackup example dbp-qax6zwvr
    

    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