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

tencentcloud.TcrNamespace

Explore with Pulumi AI

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

    Use this resource to create tcr namespace.

    Example Usage

    Create a tcr namespace instance

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const exampleTcrInstance = new tencentcloud.TcrInstance("exampleTcrInstance", {
        instanceType: "premium",
        tags: {
            createdBy: "terraform",
        },
    });
    const exampleTcrNamespace = new tencentcloud.TcrNamespace("exampleTcrNamespace", {
        instanceId: exampleTcrInstance.tcrInstanceId,
        isPublic: true,
        isAutoScan: true,
        isPreventVul: true,
        severity: "medium",
        cveWhitelistItems: [{
            cveId: "cve-xxxxx",
        }],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_tcr_instance = tencentcloud.TcrInstance("exampleTcrInstance",
        instance_type="premium",
        tags={
            "createdBy": "terraform",
        })
    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",
        }])
    
    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"),
    			Tags: pulumi.StringMap{
    				"createdBy": pulumi.String("terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, 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
    		}
    		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",
            Tags = 
            {
                { "createdBy", "terraform" },
            },
        });
    
        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",
                },
            },
        });
    
    });
    
    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 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")
                .tags(Map.of("createdBy", "terraform"))
                .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());
    
        }
    }
    
    resources:
      exampleTcrInstance:
        type: tencentcloud:TcrInstance
        properties:
          instanceType: premium
          tags:
            createdBy: terraform
      exampleTcrNamespace:
        type: tencentcloud:TcrNamespace
        properties:
          instanceId: ${exampleTcrInstance.tcrInstanceId}
          isPublic: true
          isAutoScan: true
          isPreventVul: true
          severity: medium
          cveWhitelistItems:
            - cveId: cve-xxxxx
    

    Create TcrNamespace Resource

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

    Constructor syntax

    new TcrNamespace(name: string, args: TcrNamespaceArgs, opts?: CustomResourceOptions);
    @overload
    def TcrNamespace(resource_name: str,
                     args: TcrNamespaceArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def TcrNamespace(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     instance_id: Optional[str] = None,
                     cve_whitelist_items: Optional[Sequence[TcrNamespaceCveWhitelistItemArgs]] = None,
                     is_auto_scan: Optional[bool] = None,
                     is_prevent_vul: Optional[bool] = None,
                     is_public: Optional[bool] = None,
                     name: Optional[str] = None,
                     severity: Optional[str] = None,
                     tcr_namespace_id: Optional[str] = None)
    func NewTcrNamespace(ctx *Context, name string, args TcrNamespaceArgs, opts ...ResourceOption) (*TcrNamespace, error)
    public TcrNamespace(string name, TcrNamespaceArgs args, CustomResourceOptions? opts = null)
    public TcrNamespace(String name, TcrNamespaceArgs args)
    public TcrNamespace(String name, TcrNamespaceArgs args, CustomResourceOptions options)
    
    type: tencentcloud:TcrNamespace
    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 TcrNamespaceArgs
    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 TcrNamespaceArgs
    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 TcrNamespaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TcrNamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TcrNamespaceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    InstanceId string
    ID of the TCR instance.
    CveWhitelistItems List<TcrNamespaceCveWhitelistItem>
    Vulnerability Whitelist.
    IsAutoScan bool
    Scanning level, True is automatic, False is manual. Default is false.
    IsPreventVul bool
    Blocking switch, True is open, False is closed. Default is false.
    IsPublic bool
    Indicate that the namespace is public or not. Default is false.
    Name string
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    Severity string
    Block vulnerability level, currently only supports low, medium, high.
    TcrNamespaceId string
    ID of the resource.
    InstanceId string
    ID of the TCR instance.
    CveWhitelistItems []TcrNamespaceCveWhitelistItemArgs
    Vulnerability Whitelist.
    IsAutoScan bool
    Scanning level, True is automatic, False is manual. Default is false.
    IsPreventVul bool
    Blocking switch, True is open, False is closed. Default is false.
    IsPublic bool
    Indicate that the namespace is public or not. Default is false.
    Name string
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    Severity string
    Block vulnerability level, currently only supports low, medium, high.
    TcrNamespaceId string
    ID of the resource.
    instanceId String
    ID of the TCR instance.
    cveWhitelistItems List<TcrNamespaceCveWhitelistItem>
    Vulnerability Whitelist.
    isAutoScan Boolean
    Scanning level, True is automatic, False is manual. Default is false.
    isPreventVul Boolean
    Blocking switch, True is open, False is closed. Default is false.
    isPublic Boolean
    Indicate that the namespace is public or not. Default is false.
    name String
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    severity String
    Block vulnerability level, currently only supports low, medium, high.
    tcrNamespaceId String
    ID of the resource.
    instanceId string
    ID of the TCR instance.
    cveWhitelistItems TcrNamespaceCveWhitelistItem[]
    Vulnerability Whitelist.
    isAutoScan boolean
    Scanning level, True is automatic, False is manual. Default is false.
    isPreventVul boolean
    Blocking switch, True is open, False is closed. Default is false.
    isPublic boolean
    Indicate that the namespace is public or not. Default is false.
    name string
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    severity string
    Block vulnerability level, currently only supports low, medium, high.
    tcrNamespaceId string
    ID of the resource.
    instance_id str
    ID of the TCR instance.
    cve_whitelist_items Sequence[TcrNamespaceCveWhitelistItemArgs]
    Vulnerability Whitelist.
    is_auto_scan bool
    Scanning level, True is automatic, False is manual. Default is false.
    is_prevent_vul bool
    Blocking switch, True is open, False is closed. Default is false.
    is_public bool
    Indicate that the namespace is public or not. Default is false.
    name str
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    severity str
    Block vulnerability level, currently only supports low, medium, high.
    tcr_namespace_id str
    ID of the resource.
    instanceId String
    ID of the TCR instance.
    cveWhitelistItems List<Property Map>
    Vulnerability Whitelist.
    isAutoScan Boolean
    Scanning level, True is automatic, False is manual. Default is false.
    isPreventVul Boolean
    Blocking switch, True is open, False is closed. Default is false.
    isPublic Boolean
    Indicate that the namespace is public or not. Default is false.
    name String
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    severity String
    Block vulnerability level, currently only supports low, medium, high.
    tcrNamespaceId String
    ID of the resource.

    Outputs

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

    Get an existing TcrNamespace 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?: TcrNamespaceState, opts?: CustomResourceOptions): TcrNamespace
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cve_whitelist_items: Optional[Sequence[TcrNamespaceCveWhitelistItemArgs]] = None,
            instance_id: Optional[str] = None,
            is_auto_scan: Optional[bool] = None,
            is_prevent_vul: Optional[bool] = None,
            is_public: Optional[bool] = None,
            name: Optional[str] = None,
            severity: Optional[str] = None,
            tcr_namespace_id: Optional[str] = None) -> TcrNamespace
    func GetTcrNamespace(ctx *Context, name string, id IDInput, state *TcrNamespaceState, opts ...ResourceOption) (*TcrNamespace, error)
    public static TcrNamespace Get(string name, Input<string> id, TcrNamespaceState? state, CustomResourceOptions? opts = null)
    public static TcrNamespace get(String name, Output<String> id, TcrNamespaceState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TcrNamespace    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:
    CveWhitelistItems List<TcrNamespaceCveWhitelistItem>
    Vulnerability Whitelist.
    InstanceId string
    ID of the TCR instance.
    IsAutoScan bool
    Scanning level, True is automatic, False is manual. Default is false.
    IsPreventVul bool
    Blocking switch, True is open, False is closed. Default is false.
    IsPublic bool
    Indicate that the namespace is public or not. Default is false.
    Name string
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    Severity string
    Block vulnerability level, currently only supports low, medium, high.
    TcrNamespaceId string
    ID of the resource.
    CveWhitelistItems []TcrNamespaceCveWhitelistItemArgs
    Vulnerability Whitelist.
    InstanceId string
    ID of the TCR instance.
    IsAutoScan bool
    Scanning level, True is automatic, False is manual. Default is false.
    IsPreventVul bool
    Blocking switch, True is open, False is closed. Default is false.
    IsPublic bool
    Indicate that the namespace is public or not. Default is false.
    Name string
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    Severity string
    Block vulnerability level, currently only supports low, medium, high.
    TcrNamespaceId string
    ID of the resource.
    cveWhitelistItems List<TcrNamespaceCveWhitelistItem>
    Vulnerability Whitelist.
    instanceId String
    ID of the TCR instance.
    isAutoScan Boolean
    Scanning level, True is automatic, False is manual. Default is false.
    isPreventVul Boolean
    Blocking switch, True is open, False is closed. Default is false.
    isPublic Boolean
    Indicate that the namespace is public or not. Default is false.
    name String
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    severity String
    Block vulnerability level, currently only supports low, medium, high.
    tcrNamespaceId String
    ID of the resource.
    cveWhitelistItems TcrNamespaceCveWhitelistItem[]
    Vulnerability Whitelist.
    instanceId string
    ID of the TCR instance.
    isAutoScan boolean
    Scanning level, True is automatic, False is manual. Default is false.
    isPreventVul boolean
    Blocking switch, True is open, False is closed. Default is false.
    isPublic boolean
    Indicate that the namespace is public or not. Default is false.
    name string
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    severity string
    Block vulnerability level, currently only supports low, medium, high.
    tcrNamespaceId string
    ID of the resource.
    cve_whitelist_items Sequence[TcrNamespaceCveWhitelistItemArgs]
    Vulnerability Whitelist.
    instance_id str
    ID of the TCR instance.
    is_auto_scan bool
    Scanning level, True is automatic, False is manual. Default is false.
    is_prevent_vul bool
    Blocking switch, True is open, False is closed. Default is false.
    is_public bool
    Indicate that the namespace is public or not. Default is false.
    name str
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    severity str
    Block vulnerability level, currently only supports low, medium, high.
    tcr_namespace_id str
    ID of the resource.
    cveWhitelistItems List<Property Map>
    Vulnerability Whitelist.
    instanceId String
    ID of the TCR instance.
    isAutoScan Boolean
    Scanning level, True is automatic, False is manual. Default is false.
    isPreventVul Boolean
    Blocking switch, True is open, False is closed. Default is false.
    isPublic Boolean
    Indicate that the namespace is public or not. Default is false.
    name String
    Name of the TCR namespace. Valid length is [2~30]. It can only contain lowercase letters, numbers and separators (., _, -), and cannot start, end or continue with separators.
    severity String
    Block vulnerability level, currently only supports low, medium, high.
    tcrNamespaceId String
    ID of the resource.

    Supporting Types

    TcrNamespaceCveWhitelistItem, TcrNamespaceCveWhitelistItemArgs

    CveId string
    Vulnerability Whitelist ID.
    CveId string
    Vulnerability Whitelist ID.
    cveId String
    Vulnerability Whitelist ID.
    cveId string
    Vulnerability Whitelist ID.
    cve_id str
    Vulnerability Whitelist ID.
    cveId String
    Vulnerability Whitelist ID.

    Import

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

    $ pulumi import tencentcloud:index/tcrNamespace:TcrNamespace example tcr_instance_id#namespace_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