1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. TsfUnitRule
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.TsfUnitRule

Explore with Pulumi AI

Provides a resource to create a tsf unit_rule

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const unitRule = new tencentcloud.TsfUnitRule("unitRule", {
    description: "terraform-desc",
    gatewayInstanceId: "gw-ins-rug79a70",
    unitRuleItemLists: [{
        description: "rule1-desc",
        destNamespaceId: "namespace-y8p88eka",
        destNamespaceName: "garden-test_default",
        name: "Rule1",
        relationship: "AND",
        unitRuleTagLists: [{
            tagField: "aaa",
            tagOperator: "IN",
            tagType: "U",
            tagValue: "1",
        }],
    }],
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

unit_rule = tencentcloud.TsfUnitRule("unitRule",
    description="terraform-desc",
    gateway_instance_id="gw-ins-rug79a70",
    unit_rule_item_lists=[{
        "description": "rule1-desc",
        "dest_namespace_id": "namespace-y8p88eka",
        "dest_namespace_name": "garden-test_default",
        "name": "Rule1",
        "relationship": "AND",
        "unit_rule_tag_lists": [{
            "tag_field": "aaa",
            "tag_operator": "IN",
            "tag_type": "U",
            "tag_value": "1",
        }],
    }])
Copy
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.NewTsfUnitRule(ctx, "unitRule", &tencentcloud.TsfUnitRuleArgs{
			Description:       pulumi.String("terraform-desc"),
			GatewayInstanceId: pulumi.String("gw-ins-rug79a70"),
			UnitRuleItemLists: tencentcloud.TsfUnitRuleUnitRuleItemListArray{
				&tencentcloud.TsfUnitRuleUnitRuleItemListArgs{
					Description:       pulumi.String("rule1-desc"),
					DestNamespaceId:   pulumi.String("namespace-y8p88eka"),
					DestNamespaceName: pulumi.String("garden-test_default"),
					Name:              pulumi.String("Rule1"),
					Relationship:      pulumi.String("AND"),
					UnitRuleTagLists: tencentcloud.TsfUnitRuleUnitRuleItemListUnitRuleTagListArray{
						&tencentcloud.TsfUnitRuleUnitRuleItemListUnitRuleTagListArgs{
							TagField:    pulumi.String("aaa"),
							TagOperator: pulumi.String("IN"),
							TagType:     pulumi.String("U"),
							TagValue:    pulumi.String("1"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var unitRule = new Tencentcloud.TsfUnitRule("unitRule", new()
    {
        Description = "terraform-desc",
        GatewayInstanceId = "gw-ins-rug79a70",
        UnitRuleItemLists = new[]
        {
            new Tencentcloud.Inputs.TsfUnitRuleUnitRuleItemListArgs
            {
                Description = "rule1-desc",
                DestNamespaceId = "namespace-y8p88eka",
                DestNamespaceName = "garden-test_default",
                Name = "Rule1",
                Relationship = "AND",
                UnitRuleTagLists = new[]
                {
                    new Tencentcloud.Inputs.TsfUnitRuleUnitRuleItemListUnitRuleTagListArgs
                    {
                        TagField = "aaa",
                        TagOperator = "IN",
                        TagType = "U",
                        TagValue = "1",
                    },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TsfUnitRule;
import com.pulumi.tencentcloud.TsfUnitRuleArgs;
import com.pulumi.tencentcloud.inputs.TsfUnitRuleUnitRuleItemListArgs;
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 unitRule = new TsfUnitRule("unitRule", TsfUnitRuleArgs.builder()
            .description("terraform-desc")
            .gatewayInstanceId("gw-ins-rug79a70")
            .unitRuleItemLists(TsfUnitRuleUnitRuleItemListArgs.builder()
                .description("rule1-desc")
                .destNamespaceId("namespace-y8p88eka")
                .destNamespaceName("garden-test_default")
                .name("Rule1")
                .relationship("AND")
                .unitRuleTagLists(TsfUnitRuleUnitRuleItemListUnitRuleTagListArgs.builder()
                    .tagField("aaa")
                    .tagOperator("IN")
                    .tagType("U")
                    .tagValue("1")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  unitRule:
    type: tencentcloud:TsfUnitRule
    properties:
      description: terraform-desc
      gatewayInstanceId: gw-ins-rug79a70
      unitRuleItemLists:
        - description: rule1-desc
          destNamespaceId: namespace-y8p88eka
          destNamespaceName: garden-test_default
          name: Rule1
          relationship: AND
          unitRuleTagLists:
            - tagField: aaa
              tagOperator: IN
              tagType: U
              tagValue: '1'
Copy

Create TsfUnitRule Resource

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

Constructor syntax

new TsfUnitRule(name: string, args: TsfUnitRuleArgs, opts?: CustomResourceOptions);
@overload
def TsfUnitRule(resource_name: str,
                args: TsfUnitRuleArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def TsfUnitRule(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                gateway_instance_id: Optional[str] = None,
                description: Optional[str] = None,
                name: Optional[str] = None,
                tsf_unit_rule_id: Optional[str] = None,
                unit_rule_item_lists: Optional[Sequence[TsfUnitRuleUnitRuleItemListArgs]] = None)
func NewTsfUnitRule(ctx *Context, name string, args TsfUnitRuleArgs, opts ...ResourceOption) (*TsfUnitRule, error)
public TsfUnitRule(string name, TsfUnitRuleArgs args, CustomResourceOptions? opts = null)
public TsfUnitRule(String name, TsfUnitRuleArgs args)
public TsfUnitRule(String name, TsfUnitRuleArgs args, CustomResourceOptions options)
type: tencentcloud:TsfUnitRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TsfUnitRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TsfUnitRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TsfUnitRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TsfUnitRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TsfUnitRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

GatewayInstanceId This property is required. string
gateway entity ID.
Description string
rule description.
Name string
rule name.
TsfUnitRuleId string
ID of the resource.
UnitRuleItemLists List<TsfUnitRuleUnitRuleItemList>
list of rule items.
GatewayInstanceId This property is required. string
gateway entity ID.
Description string
rule description.
Name string
rule name.
TsfUnitRuleId string
ID of the resource.
UnitRuleItemLists []TsfUnitRuleUnitRuleItemListArgs
list of rule items.
gatewayInstanceId This property is required. String
gateway entity ID.
description String
rule description.
name String
rule name.
tsfUnitRuleId String
ID of the resource.
unitRuleItemLists List<TsfUnitRuleUnitRuleItemList>
list of rule items.
gatewayInstanceId This property is required. string
gateway entity ID.
description string
rule description.
name string
rule name.
tsfUnitRuleId string
ID of the resource.
unitRuleItemLists TsfUnitRuleUnitRuleItemList[]
list of rule items.
gateway_instance_id This property is required. str
gateway entity ID.
description str
rule description.
name str
rule name.
tsf_unit_rule_id str
ID of the resource.
unit_rule_item_lists Sequence[TsfUnitRuleUnitRuleItemListArgs]
list of rule items.
gatewayInstanceId This property is required. String
gateway entity ID.
description String
rule description.
name String
rule name.
tsfUnitRuleId String
ID of the resource.
unitRuleItemLists List<Property Map>
list of rule items.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
RuleId string
rule ID.
Status string
usage status: enabled/disabled.
Id string
The provider-assigned unique ID for this managed resource.
RuleId string
rule ID.
Status string
usage status: enabled/disabled.
id String
The provider-assigned unique ID for this managed resource.
ruleId String
rule ID.
status String
usage status: enabled/disabled.
id string
The provider-assigned unique ID for this managed resource.
ruleId string
rule ID.
status string
usage status: enabled/disabled.
id str
The provider-assigned unique ID for this managed resource.
rule_id str
rule ID.
status str
usage status: enabled/disabled.
id String
The provider-assigned unique ID for this managed resource.
ruleId String
rule ID.
status String
usage status: enabled/disabled.

Look up Existing TsfUnitRule Resource

Get an existing TsfUnitRule 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?: TsfUnitRuleState, opts?: CustomResourceOptions): TsfUnitRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        gateway_instance_id: Optional[str] = None,
        name: Optional[str] = None,
        rule_id: Optional[str] = None,
        status: Optional[str] = None,
        tsf_unit_rule_id: Optional[str] = None,
        unit_rule_item_lists: Optional[Sequence[TsfUnitRuleUnitRuleItemListArgs]] = None) -> TsfUnitRule
func GetTsfUnitRule(ctx *Context, name string, id IDInput, state *TsfUnitRuleState, opts ...ResourceOption) (*TsfUnitRule, error)
public static TsfUnitRule Get(string name, Input<string> id, TsfUnitRuleState? state, CustomResourceOptions? opts = null)
public static TsfUnitRule get(String name, Output<String> id, TsfUnitRuleState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:TsfUnitRule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
rule description.
GatewayInstanceId string
gateway entity ID.
Name string
rule name.
RuleId string
rule ID.
Status string
usage status: enabled/disabled.
TsfUnitRuleId string
ID of the resource.
UnitRuleItemLists List<TsfUnitRuleUnitRuleItemList>
list of rule items.
Description string
rule description.
GatewayInstanceId string
gateway entity ID.
Name string
rule name.
RuleId string
rule ID.
Status string
usage status: enabled/disabled.
TsfUnitRuleId string
ID of the resource.
UnitRuleItemLists []TsfUnitRuleUnitRuleItemListArgs
list of rule items.
description String
rule description.
gatewayInstanceId String
gateway entity ID.
name String
rule name.
ruleId String
rule ID.
status String
usage status: enabled/disabled.
tsfUnitRuleId String
ID of the resource.
unitRuleItemLists List<TsfUnitRuleUnitRuleItemList>
list of rule items.
description string
rule description.
gatewayInstanceId string
gateway entity ID.
name string
rule name.
ruleId string
rule ID.
status string
usage status: enabled/disabled.
tsfUnitRuleId string
ID of the resource.
unitRuleItemLists TsfUnitRuleUnitRuleItemList[]
list of rule items.
description str
rule description.
gateway_instance_id str
gateway entity ID.
name str
rule name.
rule_id str
rule ID.
status str
usage status: enabled/disabled.
tsf_unit_rule_id str
ID of the resource.
unit_rule_item_lists Sequence[TsfUnitRuleUnitRuleItemListArgs]
list of rule items.
description String
rule description.
gatewayInstanceId String
gateway entity ID.
name String
rule name.
ruleId String
rule ID.
status String
usage status: enabled/disabled.
tsfUnitRuleId String
ID of the resource.
unitRuleItemLists List<Property Map>
list of rule items.

Supporting Types

TsfUnitRuleUnitRuleItemList
, TsfUnitRuleUnitRuleItemListArgs

DestNamespaceId This property is required. string
destination namespace ID.
DestNamespaceName This property is required. string
destination namespace name.
Name This property is required. string
rule item name.
Relationship This property is required. string
logical relationship: AND/OR.
Description string
rule description.
Priority double
rule order, the smaller the higher the priority: the default is 0.
RuleId string
rule ID.
UnitRuleId string
Unitization rule ID.
UnitRuleTagLists List<TsfUnitRuleUnitRuleItemListUnitRuleTagList>
list of rule labels.
DestNamespaceId This property is required. string
destination namespace ID.
DestNamespaceName This property is required. string
destination namespace name.
Name This property is required. string
rule item name.
Relationship This property is required. string
logical relationship: AND/OR.
Description string
rule description.
Priority float64
rule order, the smaller the higher the priority: the default is 0.
RuleId string
rule ID.
UnitRuleId string
Unitization rule ID.
UnitRuleTagLists []TsfUnitRuleUnitRuleItemListUnitRuleTagList
list of rule labels.
destNamespaceId This property is required. String
destination namespace ID.
destNamespaceName This property is required. String
destination namespace name.
name This property is required. String
rule item name.
relationship This property is required. String
logical relationship: AND/OR.
description String
rule description.
priority Double
rule order, the smaller the higher the priority: the default is 0.
ruleId String
rule ID.
unitRuleId String
Unitization rule ID.
unitRuleTagLists List<TsfUnitRuleUnitRuleItemListUnitRuleTagList>
list of rule labels.
destNamespaceId This property is required. string
destination namespace ID.
destNamespaceName This property is required. string
destination namespace name.
name This property is required. string
rule item name.
relationship This property is required. string
logical relationship: AND/OR.
description string
rule description.
priority number
rule order, the smaller the higher the priority: the default is 0.
ruleId string
rule ID.
unitRuleId string
Unitization rule ID.
unitRuleTagLists TsfUnitRuleUnitRuleItemListUnitRuleTagList[]
list of rule labels.
dest_namespace_id This property is required. str
destination namespace ID.
dest_namespace_name This property is required. str
destination namespace name.
name This property is required. str
rule item name.
relationship This property is required. str
logical relationship: AND/OR.
description str
rule description.
priority float
rule order, the smaller the higher the priority: the default is 0.
rule_id str
rule ID.
unit_rule_id str
Unitization rule ID.
unit_rule_tag_lists Sequence[TsfUnitRuleUnitRuleItemListUnitRuleTagList]
list of rule labels.
destNamespaceId This property is required. String
destination namespace ID.
destNamespaceName This property is required. String
destination namespace name.
name This property is required. String
rule item name.
relationship This property is required. String
logical relationship: AND/OR.
description String
rule description.
priority Number
rule order, the smaller the higher the priority: the default is 0.
ruleId String
rule ID.
unitRuleId String
Unitization rule ID.
unitRuleTagLists List<Property Map>
list of rule labels.

TsfUnitRuleUnitRuleItemListUnitRuleTagList
, TsfUnitRuleUnitRuleItemListUnitRuleTagListArgs

TagField This property is required. string
label name.
TagOperator This property is required. string
Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
TagType This property is required. string
Tag Type: U(User Tag).
TagValue This property is required. string
tag value.
RuleId string
rule ID.
UnitRuleItemId string
Unitization rule item ID.
TagField This property is required. string
label name.
TagOperator This property is required. string
Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
TagType This property is required. string
Tag Type: U(User Tag).
TagValue This property is required. string
tag value.
RuleId string
rule ID.
UnitRuleItemId string
Unitization rule item ID.
tagField This property is required. String
label name.
tagOperator This property is required. String
Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
tagType This property is required. String
Tag Type: U(User Tag).
tagValue This property is required. String
tag value.
ruleId String
rule ID.
unitRuleItemId String
Unitization rule item ID.
tagField This property is required. string
label name.
tagOperator This property is required. string
Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
tagType This property is required. string
Tag Type: U(User Tag).
tagValue This property is required. string
tag value.
ruleId string
rule ID.
unitRuleItemId string
Unitization rule item ID.
tag_field This property is required. str
label name.
tag_operator This property is required. str
Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
tag_type This property is required. str
Tag Type: U(User Tag).
tag_value This property is required. str
tag value.
rule_id str
rule ID.
unit_rule_item_id str
Unitization rule item ID.
tagField This property is required. String
label name.
tagOperator This property is required. String
Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
tagType This property is required. String
Tag Type: U(User Tag).
tagValue This property is required. String
tag value.
ruleId String
rule ID.
unitRuleItemId String
Unitization rule item ID.

Import

tsf unit_rule can be imported using the id, e.g.

$ pulumi import tencentcloud:index/tsfUnitRule:TsfUnitRule unit_rule unit-rl-zbywqeca
Copy

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.