1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. TcrToken
tencentcloud 1.81.186 published on Thursday, Apr 24, 2025 by tencentcloudstack

tencentcloud.TcrToken

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.186 published on Thursday, Apr 24, 2025 by tencentcloudstack

    Use this resource to create tcr long term token.

    Example Usage

    Create a token for tcr instance

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const exampleTcrInstance = new tencentcloud.TcrInstance("exampleTcrInstance", {
        instanceType: "basic",
        deleteBucket: true,
        tags: {
            createdBy: "terraform",
        },
    });
    const exampleTcrToken = new tencentcloud.TcrToken("exampleTcrToken", {
        instanceId: exampleTcrInstance.tcrInstanceId,
        description: "example for the tcr token",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_tcr_instance = tencentcloud.TcrInstance("exampleTcrInstance",
        instance_type="basic",
        delete_bucket=True,
        tags={
            "createdBy": "terraform",
        })
    example_tcr_token = tencentcloud.TcrToken("exampleTcrToken",
        instance_id=example_tcr_instance.tcr_instance_id,
        description="example for the tcr token")
    
    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 {
    		exampleTcrInstance, err := tencentcloud.NewTcrInstance(ctx, "exampleTcrInstance", &tencentcloud.TcrInstanceArgs{
    			InstanceType: pulumi.String("basic"),
    			DeleteBucket: pulumi.Bool(true),
    			Tags: pulumi.StringMap{
    				"createdBy": pulumi.String("terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewTcrToken(ctx, "exampleTcrToken", &tencentcloud.TcrTokenArgs{
    			InstanceId:  exampleTcrInstance.TcrInstanceId,
    			Description: pulumi.String("example for the tcr token"),
    		})
    		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 exampleTcrInstance = new Tencentcloud.TcrInstance("exampleTcrInstance", new()
        {
            InstanceType = "basic",
            DeleteBucket = true,
            Tags = 
            {
                { "createdBy", "terraform" },
            },
        });
    
        var exampleTcrToken = new Tencentcloud.TcrToken("exampleTcrToken", new()
        {
            InstanceId = exampleTcrInstance.TcrInstanceId,
            Description = "example for the tcr token",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TcrInstance;
    import com.pulumi.tencentcloud.TcrInstanceArgs;
    import com.pulumi.tencentcloud.TcrToken;
    import com.pulumi.tencentcloud.TcrTokenArgs;
    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 exampleTcrInstance = new TcrInstance("exampleTcrInstance", TcrInstanceArgs.builder()
                .instanceType("basic")
                .deleteBucket(true)
                .tags(Map.of("createdBy", "terraform"))
                .build());
    
            var exampleTcrToken = new TcrToken("exampleTcrToken", TcrTokenArgs.builder()
                .instanceId(exampleTcrInstance.tcrInstanceId())
                .description("example for the tcr token")
                .build());
    
        }
    }
    
    resources:
      exampleTcrInstance:
        type: tencentcloud:TcrInstance
        properties:
          instanceType: basic
          deleteBucket: true
          tags:
            createdBy: terraform
      exampleTcrToken:
        type: tencentcloud:TcrToken
        properties:
          instanceId: ${exampleTcrInstance.tcrInstanceId}
          description: example for the tcr token
    

    Create TcrToken Resource

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

    Constructor syntax

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

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

    InstanceId string
    ID of the TCR instance.
    Description string
    Description of the token. Valid length is [0~255].
    Enable bool
    Indicate to enable this token or not.
    TcrTokenId string
    ID of the resource.
    InstanceId string
    ID of the TCR instance.
    Description string
    Description of the token. Valid length is [0~255].
    Enable bool
    Indicate to enable this token or not.
    TcrTokenId string
    ID of the resource.
    instanceId String
    ID of the TCR instance.
    description String
    Description of the token. Valid length is [0~255].
    enable Boolean
    Indicate to enable this token or not.
    tcrTokenId String
    ID of the resource.
    instanceId string
    ID of the TCR instance.
    description string
    Description of the token. Valid length is [0~255].
    enable boolean
    Indicate to enable this token or not.
    tcrTokenId string
    ID of the resource.
    instance_id str
    ID of the TCR instance.
    description str
    Description of the token. Valid length is [0~255].
    enable bool
    Indicate to enable this token or not.
    tcr_token_id str
    ID of the resource.
    instanceId String
    ID of the TCR instance.
    description String
    Description of the token. Valid length is [0~255].
    enable Boolean
    Indicate to enable this token or not.
    tcrTokenId String
    ID of the resource.

    Outputs

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

    CreateTime string
    Create time.
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    The content of the token.
    TokenId string
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    UserName string
    User name of the token.
    CreateTime string
    Create time.
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    The content of the token.
    TokenId string
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    UserName string
    User name of the token.
    createTime String
    Create time.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    The content of the token.
    tokenId String
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    userName String
    User name of the token.
    createTime string
    Create time.
    id string
    The provider-assigned unique ID for this managed resource.
    token string
    The content of the token.
    tokenId string
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    userName string
    User name of the token.
    create_time str
    Create time.
    id str
    The provider-assigned unique ID for this managed resource.
    token str
    The content of the token.
    token_id str
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    user_name str
    User name of the token.
    createTime String
    Create time.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    The content of the token.
    tokenId String
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    userName String
    User name of the token.

    Look up Existing TcrToken Resource

    Get an existing TcrToken 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?: TcrTokenState, opts?: CustomResourceOptions): TcrToken
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            enable: Optional[bool] = None,
            instance_id: Optional[str] = None,
            tcr_token_id: Optional[str] = None,
            token: Optional[str] = None,
            token_id: Optional[str] = None,
            user_name: Optional[str] = None) -> TcrToken
    func GetTcrToken(ctx *Context, name string, id IDInput, state *TcrTokenState, opts ...ResourceOption) (*TcrToken, error)
    public static TcrToken Get(string name, Input<string> id, TcrTokenState? state, CustomResourceOptions? opts = null)
    public static TcrToken get(String name, Output<String> id, TcrTokenState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TcrToken    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:
    CreateTime string
    Create time.
    Description string
    Description of the token. Valid length is [0~255].
    Enable bool
    Indicate to enable this token or not.
    InstanceId string
    ID of the TCR instance.
    TcrTokenId string
    ID of the resource.
    Token string
    The content of the token.
    TokenId string
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    UserName string
    User name of the token.
    CreateTime string
    Create time.
    Description string
    Description of the token. Valid length is [0~255].
    Enable bool
    Indicate to enable this token or not.
    InstanceId string
    ID of the TCR instance.
    TcrTokenId string
    ID of the resource.
    Token string
    The content of the token.
    TokenId string
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    UserName string
    User name of the token.
    createTime String
    Create time.
    description String
    Description of the token. Valid length is [0~255].
    enable Boolean
    Indicate to enable this token or not.
    instanceId String
    ID of the TCR instance.
    tcrTokenId String
    ID of the resource.
    token String
    The content of the token.
    tokenId String
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    userName String
    User name of the token.
    createTime string
    Create time.
    description string
    Description of the token. Valid length is [0~255].
    enable boolean
    Indicate to enable this token or not.
    instanceId string
    ID of the TCR instance.
    tcrTokenId string
    ID of the resource.
    token string
    The content of the token.
    tokenId string
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    userName string
    User name of the token.
    create_time str
    Create time.
    description str
    Description of the token. Valid length is [0~255].
    enable bool
    Indicate to enable this token or not.
    instance_id str
    ID of the TCR instance.
    tcr_token_id str
    ID of the resource.
    token str
    The content of the token.
    token_id str
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    user_name str
    User name of the token.
    createTime String
    Create time.
    description String
    Description of the token. Valid length is [0~255].
    enable Boolean
    Indicate to enable this token or not.
    instanceId String
    ID of the TCR instance.
    tcrTokenId String
    ID of the resource.
    token String
    The content of the token.
    tokenId String
    Sub ID of the TCR token. The full ID of token format like instance_id#token_id.
    userName String
    User name of the token.

    Import

    tcr token can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/tcrToken:TcrToken example instance_id#token_id
    

    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.186 published on Thursday, Apr 24, 2025 by tencentcloudstack