tencentcloud.TcrNamespace
Explore with Pulumi AI
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:
- Instance
Id string - ID of the TCR instance.
- Cve
Whitelist List<TcrItems Namespace Cve Whitelist Item> - Vulnerability Whitelist.
- Is
Auto boolScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - Is
Prevent boolVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - Is
Public 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
. - Tcr
Namespace stringId - ID of the resource.
- Instance
Id string - ID of the TCR instance.
- Cve
Whitelist []TcrItems Namespace Cve Whitelist Item Args - Vulnerability Whitelist.
- Is
Auto boolScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - Is
Prevent boolVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - Is
Public 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
. - Tcr
Namespace stringId - ID of the resource.
- instance
Id String - ID of the TCR instance.
- cve
Whitelist List<TcrItems Namespace Cve Whitelist Item> - Vulnerability Whitelist.
- is
Auto BooleanScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - is
Prevent BooleanVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - is
Public 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
. - tcr
Namespace StringId - ID of the resource.
- instance
Id string - ID of the TCR instance.
- cve
Whitelist TcrItems Namespace Cve Whitelist Item[] - Vulnerability Whitelist.
- is
Auto booleanScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - is
Prevent booleanVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - is
Public 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
. - tcr
Namespace stringId - ID of the resource.
- instance_
id str - ID of the TCR instance.
- cve_
whitelist_ Sequence[Tcritems Namespace Cve Whitelist Item Args] - Vulnerability Whitelist.
- is_
auto_ boolscan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - is_
prevent_ boolvul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - 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_ strid - ID of the resource.
- instance
Id String - ID of the TCR instance.
- cve
Whitelist List<Property Map>Items - Vulnerability Whitelist.
- is
Auto BooleanScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - is
Prevent BooleanVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - is
Public 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
. - tcr
Namespace StringId - 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.
- Cve
Whitelist List<TcrItems Namespace Cve Whitelist Item> - Vulnerability Whitelist.
- Instance
Id string - ID of the TCR instance.
- Is
Auto boolScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - Is
Prevent boolVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - Is
Public 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
. - Tcr
Namespace stringId - ID of the resource.
- Cve
Whitelist []TcrItems Namespace Cve Whitelist Item Args - Vulnerability Whitelist.
- Instance
Id string - ID of the TCR instance.
- Is
Auto boolScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - Is
Prevent boolVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - Is
Public 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
. - Tcr
Namespace stringId - ID of the resource.
- cve
Whitelist List<TcrItems Namespace Cve Whitelist Item> - Vulnerability Whitelist.
- instance
Id String - ID of the TCR instance.
- is
Auto BooleanScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - is
Prevent BooleanVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - is
Public 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
. - tcr
Namespace StringId - ID of the resource.
- cve
Whitelist TcrItems Namespace Cve Whitelist Item[] - Vulnerability Whitelist.
- instance
Id string - ID of the TCR instance.
- is
Auto booleanScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - is
Prevent booleanVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - is
Public 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
. - tcr
Namespace stringId - ID of the resource.
- cve_
whitelist_ Sequence[Tcritems Namespace Cve Whitelist Item Args] - Vulnerability Whitelist.
- instance_
id str - ID of the TCR instance.
- is_
auto_ boolscan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - is_
prevent_ boolvul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - 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_ strid - ID of the resource.
- cve
Whitelist List<Property Map>Items - Vulnerability Whitelist.
- instance
Id String - ID of the TCR instance.
- is
Auto BooleanScan - Scanning level,
True
is automatic,False
is manual. Default isfalse
. - is
Prevent BooleanVul - Blocking switch,
True
is open,False
is closed. Default isfalse
. - is
Public 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
. - tcr
Namespace StringId - ID of the resource.
Supporting Types
TcrNamespaceCveWhitelistItem, TcrNamespaceCveWhitelistItemArgs
- Cve
Id string - Vulnerability Whitelist ID.
- Cve
Id string - Vulnerability Whitelist ID.
- cve
Id String - Vulnerability Whitelist ID.
- cve
Id string - Vulnerability Whitelist ID.
- cve_
id str - Vulnerability Whitelist ID.
- cve
Id 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.