1. Registry
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. TagAttachmentV2
Viewing docs for tencentcloud 1.83.32
published on Thursday, Sep 17, 2026 by tencentcloudstack
Viewing docs for tencentcloud 1.83.32
published on Thursday, Sep 17, 2026 by tencentcloudstack

    Provides a resource to manage a single tag key/value binding to a single cloud resource (resource six-segment) for TencentCloud Tag. This is the v2 resource that supports updating tag_value in place. If you need the original behavior where changing tag_value forces a new binding (destroy and recreate), please use tencentcloud.TagAttachment.

    NOTE: Compared with tencentcloud.TagAttachment (v1), the v2 resource supports updating tag_value in place via the UpdateResourceTagValue API, instead of destroying and recreating the binding. The ID format is tag_key#resource (without tag_value), while v1 uses tag_key#tag_value#resource. The tag_key and resource fields remain immutable (ForceNew) as in v1.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.TagAttachmentV2("example", {
        tagKey: "env",
        tagValue: "prod",
        resource: "qcs::cvm:ap-guangzhou:uin/100020512675:instance/ins-kfrlvcp4",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.TagAttachmentV2("example",
        tag_key="env",
        tag_value="prod",
        resource="qcs::cvm:ap-guangzhou:uin/100020512675:instance/ins-kfrlvcp4")
    
    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.NewTagAttachmentV2(ctx, "example", &tencentcloud.TagAttachmentV2Args{
    			TagKey:   pulumi.String("env"),
    			TagValue: pulumi.String("prod"),
    			Resource: pulumi.String("qcs::cvm:ap-guangzhou:uin/100020512675:instance/ins-kfrlvcp4"),
    		})
    		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.TagAttachmentV2("example", new()
        {
            TagKey = "env",
            TagValue = "prod",
            Resource = "qcs::cvm:ap-guangzhou:uin/100020512675:instance/ins-kfrlvcp4",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TagAttachmentV2;
    import com.pulumi.tencentcloud.TagAttachmentV2Args;
    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 TagAttachmentV2("example", TagAttachmentV2Args.builder()
                .tagKey("env")
                .tagValue("prod")
                .resource("qcs::cvm:ap-guangzhou:uin/100020512675:instance/ins-kfrlvcp4")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:TagAttachmentV2
        properties:
          tagKey: env
          tagValue: prod
          resource: qcs::cvm:ap-guangzhou:uin/100020512675:instance/ins-kfrlvcp4
    
    Example coming soon!
    

    Create TagAttachmentV2 Resource

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

    Constructor syntax

    new TagAttachmentV2(name: string, args: TagAttachmentV2Args, opts?: CustomResourceOptions);
    @overload
    def TagAttachmentV2(resource_name: str,
                        args: TagAttachmentV2Args,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def TagAttachmentV2(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        resource: Optional[str] = None,
                        tag_key: Optional[str] = None,
                        tag_value: Optional[str] = None,
                        tag_attachment_v2_id: Optional[str] = None)
    func NewTagAttachmentV2(ctx *Context, name string, args TagAttachmentV2Args, opts ...ResourceOption) (*TagAttachmentV2, error)
    public TagAttachmentV2(string name, TagAttachmentV2Args args, CustomResourceOptions? opts = null)
    public TagAttachmentV2(String name, TagAttachmentV2Args args)
    public TagAttachmentV2(String name, TagAttachmentV2Args args, CustomResourceOptions options)
    
    type: tencentcloud:TagAttachmentV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "tencentcloud_tag_attachment_v2" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args TagAttachmentV2Args
    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 TagAttachmentV2Args
    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 TagAttachmentV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TagAttachmentV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TagAttachmentV2Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Resource string
    Six-segment description of resources.
    TagKey string
    Tag key.
    TagValue string
    Tag value.
    TagAttachmentV2Id string
    ID of the resource.
    Resource string
    Six-segment description of resources.
    TagKey string
    Tag key.
    TagValue string
    Tag value.
    TagAttachmentV2Id string
    ID of the resource.
    resource string
    Six-segment description of resources.
    tag_key string
    Tag key.
    tag_value string
    Tag value.
    tag_attachment_v2_id string
    ID of the resource.
    resource String
    Six-segment description of resources.
    tagKey String
    Tag key.
    tagValue String
    Tag value.
    tagAttachmentV2Id String
    ID of the resource.
    resource string
    Six-segment description of resources.
    tagKey string
    Tag key.
    tagValue string
    Tag value.
    tagAttachmentV2Id string
    ID of the resource.
    resource str
    Six-segment description of resources.
    tag_key str
    Tag key.
    tag_value str
    Tag value.
    tag_attachment_v2_id str
    ID of the resource.
    resource String
    Six-segment description of resources.
    tagKey String
    Tag key.
    tagValue String
    Tag value.
    tagAttachmentV2Id String
    ID of the resource.

    Outputs

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

    Get an existing TagAttachmentV2 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?: TagAttachmentV2State, opts?: CustomResourceOptions): TagAttachmentV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            resource: Optional[str] = None,
            tag_attachment_v2_id: Optional[str] = None,
            tag_key: Optional[str] = None,
            tag_value: Optional[str] = None) -> TagAttachmentV2
    func GetTagAttachmentV2(ctx *Context, name string, id IDInput, state *TagAttachmentV2State, opts ...ResourceOption) (*TagAttachmentV2, error)
    public static TagAttachmentV2 Get(string name, Input<string> id, TagAttachmentV2State? state, CustomResourceOptions? opts = null)
    public static TagAttachmentV2 get(String name, Output<String> id, TagAttachmentV2State state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TagAttachmentV2    get:      id: ${id}
    import {
      to = tencentcloud_tag_attachment_v2.example
      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:
    Resource string
    Six-segment description of resources.
    TagAttachmentV2Id string
    ID of the resource.
    TagKey string
    Tag key.
    TagValue string
    Tag value.
    Resource string
    Six-segment description of resources.
    TagAttachmentV2Id string
    ID of the resource.
    TagKey string
    Tag key.
    TagValue string
    Tag value.
    resource string
    Six-segment description of resources.
    tag_attachment_v2_id string
    ID of the resource.
    tag_key string
    Tag key.
    tag_value string
    Tag value.
    resource String
    Six-segment description of resources.
    tagAttachmentV2Id String
    ID of the resource.
    tagKey String
    Tag key.
    tagValue String
    Tag value.
    resource string
    Six-segment description of resources.
    tagAttachmentV2Id string
    ID of the resource.
    tagKey string
    Tag key.
    tagValue string
    Tag value.
    resource str
    Six-segment description of resources.
    tag_attachment_v2_id str
    ID of the resource.
    tag_key str
    Tag key.
    tag_value str
    Tag value.
    resource String
    Six-segment description of resources.
    tagAttachmentV2Id String
    ID of the resource.
    tagKey String
    Tag key.
    tagValue String
    Tag value.

    Import

    tag attachment v2 can be imported using the composite id (tag_key joined with the resource six-segment by #), e.g.

    $ pulumi import tencentcloud:index/tagAttachmentV2:TagAttachmentV2 example env#qcs::cvm:ap-guangzhou:uin/100020512675:instance/ins-kfrlvcp4
    

    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.
    Viewing docs for tencentcloud 1.83.32
    published on Thursday, Sep 17, 2026 by tencentcloudstack

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial