1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CbsSnapshotPolicyAttachment
tencentcloud 1.82.17 published on Thursday, Aug 14, 2025 by tencentcloudstack

tencentcloud.CbsSnapshotPolicyAttachment

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.82.17 published on Thursday, Aug 14, 2025 by tencentcloudstack

    Provides a CBS snapshot policy attachment resource.

    NOTE: To distinguish between storage_id and storage_id, use storage_id when there is only one diskId, otherwise use storage_ids.

    Example Usage

    Attachment CBS snapshot policy by storage_id

    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: 60,
        availabilityZone: "ap-guangzhou-6",
        projectId: 0,
        encrypt: false,
        tags: {
            createBy: "Terraform",
        },
    });
    const exampleCbsSnapshotPolicy = new tencentcloud.CbsSnapshotPolicy("exampleCbsSnapshotPolicy", {
        snapshotPolicyName: "tf-example",
        repeatWeekdays: [
            1,
            4,
        ],
        repeatHours: [1],
        retentionDays: 7,
    });
    const exampleCbsSnapshotPolicyAttachment = new tencentcloud.CbsSnapshotPolicyAttachment("exampleCbsSnapshotPolicyAttachment", {
        storageId: exampleCbsStorage.cbsStorageId,
        snapshotPolicyId: exampleCbsSnapshotPolicy.cbsSnapshotPolicyId,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_cbs_storage = tencentcloud.CbsStorage("exampleCbsStorage",
        storage_name="tf-example",
        storage_type="CLOUD_SSD",
        storage_size=60,
        availability_zone="ap-guangzhou-6",
        project_id=0,
        encrypt=False,
        tags={
            "createBy": "Terraform",
        })
    example_cbs_snapshot_policy = tencentcloud.CbsSnapshotPolicy("exampleCbsSnapshotPolicy",
        snapshot_policy_name="tf-example",
        repeat_weekdays=[
            1,
            4,
        ],
        repeat_hours=[1],
        retention_days=7)
    example_cbs_snapshot_policy_attachment = tencentcloud.CbsSnapshotPolicyAttachment("exampleCbsSnapshotPolicyAttachment",
        storage_id=example_cbs_storage.cbs_storage_id,
        snapshot_policy_id=example_cbs_snapshot_policy.cbs_snapshot_policy_id)
    
    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(60),
    			AvailabilityZone: pulumi.String("ap-guangzhou-6"),
    			ProjectId:        pulumi.Float64(0),
    			Encrypt:          pulumi.Bool(false),
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("Terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleCbsSnapshotPolicy, err := tencentcloud.NewCbsSnapshotPolicy(ctx, "exampleCbsSnapshotPolicy", &tencentcloud.CbsSnapshotPolicyArgs{
    			SnapshotPolicyName: pulumi.String("tf-example"),
    			RepeatWeekdays: pulumi.Float64Array{
    				pulumi.Float64(1),
    				pulumi.Float64(4),
    			},
    			RepeatHours: pulumi.Float64Array{
    				pulumi.Float64(1),
    			},
    			RetentionDays: pulumi.Float64(7),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCbsSnapshotPolicyAttachment(ctx, "exampleCbsSnapshotPolicyAttachment", &tencentcloud.CbsSnapshotPolicyAttachmentArgs{
    			StorageId:        exampleCbsStorage.CbsStorageId,
    			SnapshotPolicyId: exampleCbsSnapshotPolicy.CbsSnapshotPolicyId,
    		})
    		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 = 60,
            AvailabilityZone = "ap-guangzhou-6",
            ProjectId = 0,
            Encrypt = false,
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
        var exampleCbsSnapshotPolicy = new Tencentcloud.CbsSnapshotPolicy("exampleCbsSnapshotPolicy", new()
        {
            SnapshotPolicyName = "tf-example",
            RepeatWeekdays = new[]
            {
                1,
                4,
            },
            RepeatHours = new[]
            {
                1,
            },
            RetentionDays = 7,
        });
    
        var exampleCbsSnapshotPolicyAttachment = new Tencentcloud.CbsSnapshotPolicyAttachment("exampleCbsSnapshotPolicyAttachment", new()
        {
            StorageId = exampleCbsStorage.CbsStorageId,
            SnapshotPolicyId = exampleCbsSnapshotPolicy.CbsSnapshotPolicyId,
        });
    
    });
    
    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.CbsSnapshotPolicy;
    import com.pulumi.tencentcloud.CbsSnapshotPolicyArgs;
    import com.pulumi.tencentcloud.CbsSnapshotPolicyAttachment;
    import com.pulumi.tencentcloud.CbsSnapshotPolicyAttachmentArgs;
    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(60)
                .availabilityZone("ap-guangzhou-6")
                .projectId(0)
                .encrypt(false)
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
            var exampleCbsSnapshotPolicy = new CbsSnapshotPolicy("exampleCbsSnapshotPolicy", CbsSnapshotPolicyArgs.builder()
                .snapshotPolicyName("tf-example")
                .repeatWeekdays(            
                    1,
                    4)
                .repeatHours(1)
                .retentionDays(7)
                .build());
    
            var exampleCbsSnapshotPolicyAttachment = new CbsSnapshotPolicyAttachment("exampleCbsSnapshotPolicyAttachment", CbsSnapshotPolicyAttachmentArgs.builder()
                .storageId(exampleCbsStorage.cbsStorageId())
                .snapshotPolicyId(exampleCbsSnapshotPolicy.cbsSnapshotPolicyId())
                .build());
    
        }
    }
    
    resources:
      exampleCbsStorage:
        type: tencentcloud:CbsStorage
        properties:
          storageName: tf-example
          storageType: CLOUD_SSD
          storageSize: 60
          availabilityZone: ap-guangzhou-6
          projectId: 0
          encrypt: false
          tags:
            createBy: Terraform
      exampleCbsSnapshotPolicy:
        type: tencentcloud:CbsSnapshotPolicy
        properties:
          snapshotPolicyName: tf-example
          repeatWeekdays:
            - 1
            - 4
          repeatHours:
            - 1
          retentionDays: 7
      exampleCbsSnapshotPolicyAttachment:
        type: tencentcloud:CbsSnapshotPolicyAttachment
        properties:
          storageId: ${exampleCbsStorage.cbsStorageId}
          snapshotPolicyId: ${exampleCbsSnapshotPolicy.cbsSnapshotPolicyId}
    

    Attachment CBS snapshot policy by storage_ids

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example1 = new tencentcloud.CbsStorage("example1", {
        storageName: "tf-example1",
        storageType: "CLOUD_SSD",
        storageSize: 60,
        availabilityZone: "ap-guangzhou-6",
        projectId: 0,
        encrypt: false,
        tags: {
            createBy: "Terraform",
        },
    });
    const example2 = new tencentcloud.CbsStorage("example2", {
        storageName: "tf-example2",
        storageType: "CLOUD_SSD",
        storageSize: 60,
        availabilityZone: "ap-guangzhou-6",
        projectId: 0,
        encrypt: false,
        tags: {
            createBy: "Terraform",
        },
    });
    const exampleCbsSnapshotPolicy = new tencentcloud.CbsSnapshotPolicy("exampleCbsSnapshotPolicy", {
        snapshotPolicyName: "tf-example",
        repeatWeekdays: [
            1,
            4,
        ],
        repeatHours: [1],
        retentionDays: 7,
    });
    const exampleCbsSnapshotPolicyAttachment = new tencentcloud.CbsSnapshotPolicyAttachment("exampleCbsSnapshotPolicyAttachment", {
        storageIds: [
            example1.cbsStorageId,
            example2.cbsStorageId,
        ],
        snapshotPolicyId: exampleCbsSnapshotPolicy.cbsSnapshotPolicyId,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example1 = tencentcloud.CbsStorage("example1",
        storage_name="tf-example1",
        storage_type="CLOUD_SSD",
        storage_size=60,
        availability_zone="ap-guangzhou-6",
        project_id=0,
        encrypt=False,
        tags={
            "createBy": "Terraform",
        })
    example2 = tencentcloud.CbsStorage("example2",
        storage_name="tf-example2",
        storage_type="CLOUD_SSD",
        storage_size=60,
        availability_zone="ap-guangzhou-6",
        project_id=0,
        encrypt=False,
        tags={
            "createBy": "Terraform",
        })
    example_cbs_snapshot_policy = tencentcloud.CbsSnapshotPolicy("exampleCbsSnapshotPolicy",
        snapshot_policy_name="tf-example",
        repeat_weekdays=[
            1,
            4,
        ],
        repeat_hours=[1],
        retention_days=7)
    example_cbs_snapshot_policy_attachment = tencentcloud.CbsSnapshotPolicyAttachment("exampleCbsSnapshotPolicyAttachment",
        storage_ids=[
            example1.cbs_storage_id,
            example2.cbs_storage_id,
        ],
        snapshot_policy_id=example_cbs_snapshot_policy.cbs_snapshot_policy_id)
    
    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 {
    		example1, err := tencentcloud.NewCbsStorage(ctx, "example1", &tencentcloud.CbsStorageArgs{
    			StorageName:      pulumi.String("tf-example1"),
    			StorageType:      pulumi.String("CLOUD_SSD"),
    			StorageSize:      pulumi.Float64(60),
    			AvailabilityZone: pulumi.String("ap-guangzhou-6"),
    			ProjectId:        pulumi.Float64(0),
    			Encrypt:          pulumi.Bool(false),
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("Terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		example2, err := tencentcloud.NewCbsStorage(ctx, "example2", &tencentcloud.CbsStorageArgs{
    			StorageName:      pulumi.String("tf-example2"),
    			StorageType:      pulumi.String("CLOUD_SSD"),
    			StorageSize:      pulumi.Float64(60),
    			AvailabilityZone: pulumi.String("ap-guangzhou-6"),
    			ProjectId:        pulumi.Float64(0),
    			Encrypt:          pulumi.Bool(false),
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("Terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleCbsSnapshotPolicy, err := tencentcloud.NewCbsSnapshotPolicy(ctx, "exampleCbsSnapshotPolicy", &tencentcloud.CbsSnapshotPolicyArgs{
    			SnapshotPolicyName: pulumi.String("tf-example"),
    			RepeatWeekdays: pulumi.Float64Array{
    				pulumi.Float64(1),
    				pulumi.Float64(4),
    			},
    			RepeatHours: pulumi.Float64Array{
    				pulumi.Float64(1),
    			},
    			RetentionDays: pulumi.Float64(7),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCbsSnapshotPolicyAttachment(ctx, "exampleCbsSnapshotPolicyAttachment", &tencentcloud.CbsSnapshotPolicyAttachmentArgs{
    			StorageIds: pulumi.StringArray{
    				example1.CbsStorageId,
    				example2.CbsStorageId,
    			},
    			SnapshotPolicyId: exampleCbsSnapshotPolicy.CbsSnapshotPolicyId,
    		})
    		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 example1 = new Tencentcloud.CbsStorage("example1", new()
        {
            StorageName = "tf-example1",
            StorageType = "CLOUD_SSD",
            StorageSize = 60,
            AvailabilityZone = "ap-guangzhou-6",
            ProjectId = 0,
            Encrypt = false,
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
        var example2 = new Tencentcloud.CbsStorage("example2", new()
        {
            StorageName = "tf-example2",
            StorageType = "CLOUD_SSD",
            StorageSize = 60,
            AvailabilityZone = "ap-guangzhou-6",
            ProjectId = 0,
            Encrypt = false,
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
        var exampleCbsSnapshotPolicy = new Tencentcloud.CbsSnapshotPolicy("exampleCbsSnapshotPolicy", new()
        {
            SnapshotPolicyName = "tf-example",
            RepeatWeekdays = new[]
            {
                1,
                4,
            },
            RepeatHours = new[]
            {
                1,
            },
            RetentionDays = 7,
        });
    
        var exampleCbsSnapshotPolicyAttachment = new Tencentcloud.CbsSnapshotPolicyAttachment("exampleCbsSnapshotPolicyAttachment", new()
        {
            StorageIds = new[]
            {
                example1.CbsStorageId,
                example2.CbsStorageId,
            },
            SnapshotPolicyId = exampleCbsSnapshotPolicy.CbsSnapshotPolicyId,
        });
    
    });
    
    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.CbsSnapshotPolicy;
    import com.pulumi.tencentcloud.CbsSnapshotPolicyArgs;
    import com.pulumi.tencentcloud.CbsSnapshotPolicyAttachment;
    import com.pulumi.tencentcloud.CbsSnapshotPolicyAttachmentArgs;
    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 example1 = new CbsStorage("example1", CbsStorageArgs.builder()
                .storageName("tf-example1")
                .storageType("CLOUD_SSD")
                .storageSize(60)
                .availabilityZone("ap-guangzhou-6")
                .projectId(0)
                .encrypt(false)
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
            var example2 = new CbsStorage("example2", CbsStorageArgs.builder()
                .storageName("tf-example2")
                .storageType("CLOUD_SSD")
                .storageSize(60)
                .availabilityZone("ap-guangzhou-6")
                .projectId(0)
                .encrypt(false)
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
            var exampleCbsSnapshotPolicy = new CbsSnapshotPolicy("exampleCbsSnapshotPolicy", CbsSnapshotPolicyArgs.builder()
                .snapshotPolicyName("tf-example")
                .repeatWeekdays(            
                    1,
                    4)
                .repeatHours(1)
                .retentionDays(7)
                .build());
    
            var exampleCbsSnapshotPolicyAttachment = new CbsSnapshotPolicyAttachment("exampleCbsSnapshotPolicyAttachment", CbsSnapshotPolicyAttachmentArgs.builder()
                .storageIds(            
                    example1.cbsStorageId(),
                    example2.cbsStorageId())
                .snapshotPolicyId(exampleCbsSnapshotPolicy.cbsSnapshotPolicyId())
                .build());
    
        }
    }
    
    resources:
      example1:
        type: tencentcloud:CbsStorage
        properties:
          storageName: tf-example1
          storageType: CLOUD_SSD
          storageSize: 60
          availabilityZone: ap-guangzhou-6
          projectId: 0
          encrypt: false
          tags:
            createBy: Terraform
      example2:
        type: tencentcloud:CbsStorage
        properties:
          storageName: tf-example2
          storageType: CLOUD_SSD
          storageSize: 60
          availabilityZone: ap-guangzhou-6
          projectId: 0
          encrypt: false
          tags:
            createBy: Terraform
      exampleCbsSnapshotPolicy:
        type: tencentcloud:CbsSnapshotPolicy
        properties:
          snapshotPolicyName: tf-example
          repeatWeekdays:
            - 1
            - 4
          repeatHours:
            - 1
          retentionDays: 7
      exampleCbsSnapshotPolicyAttachment:
        type: tencentcloud:CbsSnapshotPolicyAttachment
        properties:
          storageIds:
            - ${example1.cbsStorageId}
            - ${example2.cbsStorageId}
          snapshotPolicyId: ${exampleCbsSnapshotPolicy.cbsSnapshotPolicyId}
    

    Create CbsSnapshotPolicyAttachment Resource

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

    Constructor syntax

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

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

    SnapshotPolicyId string
    ID of CBS snapshot policy.
    CbsSnapshotPolicyAttachmentId string
    ID of the resource.
    StorageId string
    ID of CBS.
    StorageIds List<string>
    IDs of CBS.
    SnapshotPolicyId string
    ID of CBS snapshot policy.
    CbsSnapshotPolicyAttachmentId string
    ID of the resource.
    StorageId string
    ID of CBS.
    StorageIds []string
    IDs of CBS.
    snapshotPolicyId String
    ID of CBS snapshot policy.
    cbsSnapshotPolicyAttachmentId String
    ID of the resource.
    storageId String
    ID of CBS.
    storageIds List<String>
    IDs of CBS.
    snapshotPolicyId string
    ID of CBS snapshot policy.
    cbsSnapshotPolicyAttachmentId string
    ID of the resource.
    storageId string
    ID of CBS.
    storageIds string[]
    IDs of CBS.
    snapshot_policy_id str
    ID of CBS snapshot policy.
    cbs_snapshot_policy_attachment_id str
    ID of the resource.
    storage_id str
    ID of CBS.
    storage_ids Sequence[str]
    IDs of CBS.
    snapshotPolicyId String
    ID of CBS snapshot policy.
    cbsSnapshotPolicyAttachmentId String
    ID of the resource.
    storageId String
    ID of CBS.
    storageIds List<String>
    IDs of CBS.

    Outputs

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

    Get an existing CbsSnapshotPolicyAttachment 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?: CbsSnapshotPolicyAttachmentState, opts?: CustomResourceOptions): CbsSnapshotPolicyAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cbs_snapshot_policy_attachment_id: Optional[str] = None,
            snapshot_policy_id: Optional[str] = None,
            storage_id: Optional[str] = None,
            storage_ids: Optional[Sequence[str]] = None) -> CbsSnapshotPolicyAttachment
    func GetCbsSnapshotPolicyAttachment(ctx *Context, name string, id IDInput, state *CbsSnapshotPolicyAttachmentState, opts ...ResourceOption) (*CbsSnapshotPolicyAttachment, error)
    public static CbsSnapshotPolicyAttachment Get(string name, Input<string> id, CbsSnapshotPolicyAttachmentState? state, CustomResourceOptions? opts = null)
    public static CbsSnapshotPolicyAttachment get(String name, Output<String> id, CbsSnapshotPolicyAttachmentState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CbsSnapshotPolicyAttachment    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:
    CbsSnapshotPolicyAttachmentId string
    ID of the resource.
    SnapshotPolicyId string
    ID of CBS snapshot policy.
    StorageId string
    ID of CBS.
    StorageIds List<string>
    IDs of CBS.
    CbsSnapshotPolicyAttachmentId string
    ID of the resource.
    SnapshotPolicyId string
    ID of CBS snapshot policy.
    StorageId string
    ID of CBS.
    StorageIds []string
    IDs of CBS.
    cbsSnapshotPolicyAttachmentId String
    ID of the resource.
    snapshotPolicyId String
    ID of CBS snapshot policy.
    storageId String
    ID of CBS.
    storageIds List<String>
    IDs of CBS.
    cbsSnapshotPolicyAttachmentId string
    ID of the resource.
    snapshotPolicyId string
    ID of CBS snapshot policy.
    storageId string
    ID of CBS.
    storageIds string[]
    IDs of CBS.
    cbs_snapshot_policy_attachment_id str
    ID of the resource.
    snapshot_policy_id str
    ID of CBS snapshot policy.
    storage_id str
    ID of CBS.
    storage_ids Sequence[str]
    IDs of CBS.
    cbsSnapshotPolicyAttachmentId String
    ID of the resource.
    snapshotPolicyId String
    ID of CBS snapshot policy.
    storageId String
    ID of CBS.
    storageIds List<String>
    IDs of CBS.

    Import

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

    If use storage_id

    $ pulumi import tencentcloud:index/cbsSnapshotPolicyAttachment:CbsSnapshotPolicyAttachment example disk-fesgc43m#asp-8abupspr
    

    If use storage_ids

    $ pulumi import tencentcloud:index/cbsSnapshotPolicyAttachment:CbsSnapshotPolicyAttachment example disk-ghylus9y,disk-0tm61hla#asp-ng87uf4t
    

    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.82.17 published on Thursday, Aug 14, 2025 by tencentcloudstack