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

tencentcloud.TcrRepository

Explore with Pulumi AI

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

    Use this resource to create tcr repository.

    Example Usage

    Create a tcr repository instance

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const exampleTcrInstance = new tencentcloud.TcrInstance("exampleTcrInstance", {
        instanceType: "premium",
        deleteBucket: true,
    });
    const exampleTcrNamespace = new tencentcloud.TcrNamespace("exampleTcrNamespace", {
        instanceId: exampleTcrInstance.tcrInstanceId,
        isPublic: true,
        isAutoScan: true,
        isPreventVul: true,
        severity: "medium",
        cveWhitelistItems: [{
            cveId: "cve-xxxxx",
        }],
    });
    const exampleTcrRepository = new tencentcloud.TcrRepository("exampleTcrRepository", {
        instanceId: exampleTcrInstance.tcrInstanceId,
        namespaceName: exampleTcrNamespace.name,
        briefDesc: "111",
        description: "111111111111111111111111111111111111",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_tcr_instance = tencentcloud.TcrInstance("exampleTcrInstance",
        instance_type="premium",
        delete_bucket=True)
    example_tcr_namespace = tencentcloud.TcrNamespace("exampleTcrNamespace",
        instance_id=example_tcr_instance.tcr_instance_id,
        is_public=True,
        is_auto_scan=True,
        is_prevent_vul=True,
        severity="medium",
        cve_whitelist_items=[{
            "cve_id": "cve-xxxxx",
        }])
    example_tcr_repository = tencentcloud.TcrRepository("exampleTcrRepository",
        instance_id=example_tcr_instance.tcr_instance_id,
        namespace_name=example_tcr_namespace.name,
        brief_desc="111",
        description="111111111111111111111111111111111111")
    
    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("premium"),
    			DeleteBucket: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		exampleTcrNamespace, err := tencentcloud.NewTcrNamespace(ctx, "exampleTcrNamespace", &tencentcloud.TcrNamespaceArgs{
    			InstanceId:   exampleTcrInstance.TcrInstanceId,
    			IsPublic:     pulumi.Bool(true),
    			IsAutoScan:   pulumi.Bool(true),
    			IsPreventVul: pulumi.Bool(true),
    			Severity:     pulumi.String("medium"),
    			CveWhitelistItems: tencentcloud.TcrNamespaceCveWhitelistItemArray{
    				&tencentcloud.TcrNamespaceCveWhitelistItemArgs{
    					CveId: pulumi.String("cve-xxxxx"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewTcrRepository(ctx, "exampleTcrRepository", &tencentcloud.TcrRepositoryArgs{
    			InstanceId:    exampleTcrInstance.TcrInstanceId,
    			NamespaceName: exampleTcrNamespace.Name,
    			BriefDesc:     pulumi.String("111"),
    			Description:   pulumi.String("111111111111111111111111111111111111"),
    		})
    		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 = "premium",
            DeleteBucket = true,
        });
    
        var exampleTcrNamespace = new Tencentcloud.TcrNamespace("exampleTcrNamespace", new()
        {
            InstanceId = exampleTcrInstance.TcrInstanceId,
            IsPublic = true,
            IsAutoScan = true,
            IsPreventVul = true,
            Severity = "medium",
            CveWhitelistItems = new[]
            {
                new Tencentcloud.Inputs.TcrNamespaceCveWhitelistItemArgs
                {
                    CveId = "cve-xxxxx",
                },
            },
        });
    
        var exampleTcrRepository = new Tencentcloud.TcrRepository("exampleTcrRepository", new()
        {
            InstanceId = exampleTcrInstance.TcrInstanceId,
            NamespaceName = exampleTcrNamespace.Name,
            BriefDesc = "111",
            Description = "111111111111111111111111111111111111",
        });
    
    });
    
    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.TcrNamespace;
    import com.pulumi.tencentcloud.TcrNamespaceArgs;
    import com.pulumi.tencentcloud.inputs.TcrNamespaceCveWhitelistItemArgs;
    import com.pulumi.tencentcloud.TcrRepository;
    import com.pulumi.tencentcloud.TcrRepositoryArgs;
    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("premium")
                .deleteBucket(true)
                .build());
    
            var exampleTcrNamespace = new TcrNamespace("exampleTcrNamespace", TcrNamespaceArgs.builder()
                .instanceId(exampleTcrInstance.tcrInstanceId())
                .isPublic(true)
                .isAutoScan(true)
                .isPreventVul(true)
                .severity("medium")
                .cveWhitelistItems(TcrNamespaceCveWhitelistItemArgs.builder()
                    .cveId("cve-xxxxx")
                    .build())
                .build());
    
            var exampleTcrRepository = new TcrRepository("exampleTcrRepository", TcrRepositoryArgs.builder()
                .instanceId(exampleTcrInstance.tcrInstanceId())
                .namespaceName(exampleTcrNamespace.name())
                .briefDesc("111")
                .description("111111111111111111111111111111111111")
                .build());
    
        }
    }
    
    resources:
      exampleTcrInstance:
        type: tencentcloud:TcrInstance
        properties:
          instanceType: premium
          deleteBucket: true
      exampleTcrNamespace:
        type: tencentcloud:TcrNamespace
        properties:
          instanceId: ${exampleTcrInstance.tcrInstanceId}
          isPublic: true
          isAutoScan: true
          isPreventVul: true
          severity: medium
          cveWhitelistItems:
            - cveId: cve-xxxxx
      exampleTcrRepository:
        type: tencentcloud:TcrRepository
        properties:
          instanceId: ${exampleTcrInstance.tcrInstanceId}
          namespaceName: ${exampleTcrNamespace.name}
          briefDesc: '111'
          description: '111111111111111111111111111111111111'
    

    Create TcrRepository Resource

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

    Constructor syntax

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

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

    InstanceId string
    ID of the TCR instance.
    NamespaceName string
    Name of the TCR namespace.
    BriefDesc string
    Brief description of the repository. Valid length is [1~100].
    Description string
    Description of the repository. Valid length is [1~1000].
    Name string
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    TcrRepositoryId string
    ID of the resource.
    InstanceId string
    ID of the TCR instance.
    NamespaceName string
    Name of the TCR namespace.
    BriefDesc string
    Brief description of the repository. Valid length is [1~100].
    Description string
    Description of the repository. Valid length is [1~1000].
    Name string
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    TcrRepositoryId string
    ID of the resource.
    instanceId String
    ID of the TCR instance.
    namespaceName String
    Name of the TCR namespace.
    briefDesc String
    Brief description of the repository. Valid length is [1~100].
    description String
    Description of the repository. Valid length is [1~1000].
    name String
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    tcrRepositoryId String
    ID of the resource.
    instanceId string
    ID of the TCR instance.
    namespaceName string
    Name of the TCR namespace.
    briefDesc string
    Brief description of the repository. Valid length is [1~100].
    description string
    Description of the repository. Valid length is [1~1000].
    name string
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    tcrRepositoryId string
    ID of the resource.
    instance_id str
    ID of the TCR instance.
    namespace_name str
    Name of the TCR namespace.
    brief_desc str
    Brief description of the repository. Valid length is [1~100].
    description str
    Description of the repository. Valid length is [1~1000].
    name str
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    tcr_repository_id str
    ID of the resource.
    instanceId String
    ID of the TCR instance.
    namespaceName String
    Name of the TCR namespace.
    briefDesc String
    Brief description of the repository. Valid length is [1~100].
    description String
    Description of the repository. Valid length is [1~1000].
    name String
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    tcrRepositoryId String
    ID of the resource.

    Outputs

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

    CreateTime string
    Create time.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsPublic bool
    Indicate the repository is public or not.
    UpdateTime string
    Last updated time.
    Url string
    URL of the repository.
    CreateTime string
    Create time.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsPublic bool
    Indicate the repository is public or not.
    UpdateTime string
    Last updated time.
    Url string
    URL of the repository.
    createTime String
    Create time.
    id String
    The provider-assigned unique ID for this managed resource.
    isPublic Boolean
    Indicate the repository is public or not.
    updateTime String
    Last updated time.
    url String
    URL of the repository.
    createTime string
    Create time.
    id string
    The provider-assigned unique ID for this managed resource.
    isPublic boolean
    Indicate the repository is public or not.
    updateTime string
    Last updated time.
    url string
    URL of the repository.
    create_time str
    Create time.
    id str
    The provider-assigned unique ID for this managed resource.
    is_public bool
    Indicate the repository is public or not.
    update_time str
    Last updated time.
    url str
    URL of the repository.
    createTime String
    Create time.
    id String
    The provider-assigned unique ID for this managed resource.
    isPublic Boolean
    Indicate the repository is public or not.
    updateTime String
    Last updated time.
    url String
    URL of the repository.

    Look up Existing TcrRepository Resource

    Get an existing TcrRepository 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?: TcrRepositoryState, opts?: CustomResourceOptions): TcrRepository
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            brief_desc: Optional[str] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            instance_id: Optional[str] = None,
            is_public: Optional[bool] = None,
            name: Optional[str] = None,
            namespace_name: Optional[str] = None,
            tcr_repository_id: Optional[str] = None,
            update_time: Optional[str] = None,
            url: Optional[str] = None) -> TcrRepository
    func GetTcrRepository(ctx *Context, name string, id IDInput, state *TcrRepositoryState, opts ...ResourceOption) (*TcrRepository, error)
    public static TcrRepository Get(string name, Input<string> id, TcrRepositoryState? state, CustomResourceOptions? opts = null)
    public static TcrRepository get(String name, Output<String> id, TcrRepositoryState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TcrRepository    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:
    BriefDesc string
    Brief description of the repository. Valid length is [1~100].
    CreateTime string
    Create time.
    Description string
    Description of the repository. Valid length is [1~1000].
    InstanceId string
    ID of the TCR instance.
    IsPublic bool
    Indicate the repository is public or not.
    Name string
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    NamespaceName string
    Name of the TCR namespace.
    TcrRepositoryId string
    ID of the resource.
    UpdateTime string
    Last updated time.
    Url string
    URL of the repository.
    BriefDesc string
    Brief description of the repository. Valid length is [1~100].
    CreateTime string
    Create time.
    Description string
    Description of the repository. Valid length is [1~1000].
    InstanceId string
    ID of the TCR instance.
    IsPublic bool
    Indicate the repository is public or not.
    Name string
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    NamespaceName string
    Name of the TCR namespace.
    TcrRepositoryId string
    ID of the resource.
    UpdateTime string
    Last updated time.
    Url string
    URL of the repository.
    briefDesc String
    Brief description of the repository. Valid length is [1~100].
    createTime String
    Create time.
    description String
    Description of the repository. Valid length is [1~1000].
    instanceId String
    ID of the TCR instance.
    isPublic Boolean
    Indicate the repository is public or not.
    name String
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    namespaceName String
    Name of the TCR namespace.
    tcrRepositoryId String
    ID of the resource.
    updateTime String
    Last updated time.
    url String
    URL of the repository.
    briefDesc string
    Brief description of the repository. Valid length is [1~100].
    createTime string
    Create time.
    description string
    Description of the repository. Valid length is [1~1000].
    instanceId string
    ID of the TCR instance.
    isPublic boolean
    Indicate the repository is public or not.
    name string
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    namespaceName string
    Name of the TCR namespace.
    tcrRepositoryId string
    ID of the resource.
    updateTime string
    Last updated time.
    url string
    URL of the repository.
    brief_desc str
    Brief description of the repository. Valid length is [1~100].
    create_time str
    Create time.
    description str
    Description of the repository. Valid length is [1~1000].
    instance_id str
    ID of the TCR instance.
    is_public bool
    Indicate the repository is public or not.
    name str
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    namespace_name str
    Name of the TCR namespace.
    tcr_repository_id str
    ID of the resource.
    update_time str
    Last updated time.
    url str
    URL of the repository.
    briefDesc String
    Brief description of the repository. Valid length is [1~100].
    createTime String
    Create time.
    description String
    Description of the repository. Valid length is [1~1000].
    instanceId String
    ID of the TCR instance.
    isPublic Boolean
    Indicate the repository is public or not.
    name String
    Name of the TCR repository. Valid length is [2~200]. It can only contain lowercase letters, numbers and separators (., _, -, /), and cannot start, end or continue with separators. Support the use of multi-level address formats, such as sub1/sub2/repo.
    namespaceName String
    Name of the TCR namespace.
    tcrRepositoryId String
    ID of the resource.
    updateTime String
    Last updated time.
    url String
    URL of the repository.

    Import

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

    $ pulumi import tencentcloud:index/tcrRepository:TcrRepository foo instance_id#namespace_name#repository_name
    

    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