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

tencentcloud.TsfUnitRule

Explore with Pulumi AI

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

    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",
            }],
        }],
    });
    
    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",
            }],
        }])
    
    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
    	})
    }
    
    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",
                        },
                    },
                },
            },
        });
    
    });
    
    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());
    
        }
    }
    
    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'
    

    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 string
    The unique name of the resource.
    args TsfUnitRuleArgs
    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 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 string
    The unique name of the resource.
    args TsfUnitRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TsfUnitRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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 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 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 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 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 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 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
    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:
    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 string
    destination namespace ID.
    DestNamespaceName string
    destination namespace name.
    Name string
    rule item name.
    Relationship 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 string
    destination namespace ID.
    DestNamespaceName string
    destination namespace name.
    Name string
    rule item name.
    Relationship 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 String
    destination namespace ID.
    destNamespaceName String
    destination namespace name.
    name String
    rule item name.
    relationship 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 string
    destination namespace ID.
    destNamespaceName string
    destination namespace name.
    name string
    rule item name.
    relationship 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 str
    destination namespace ID.
    dest_namespace_name str
    destination namespace name.
    name str
    rule item name.
    relationship 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 String
    destination namespace ID.
    destNamespaceName String
    destination namespace name.
    name String
    rule item name.
    relationship 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 string
    label name.
    TagOperator string
    Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
    TagType string
    Tag Type: U(User Tag).
    TagValue string
    tag value.
    RuleId string
    rule ID.
    UnitRuleItemId string
    Unitization rule item ID.
    TagField string
    label name.
    TagOperator string
    Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
    TagType string
    Tag Type: U(User Tag).
    TagValue string
    tag value.
    RuleId string
    rule ID.
    UnitRuleItemId string
    Unitization rule item ID.
    tagField String
    label name.
    tagOperator String
    Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
    tagType String
    Tag Type: U(User Tag).
    tagValue String
    tag value.
    ruleId String
    rule ID.
    unitRuleItemId String
    Unitization rule item ID.
    tagField string
    label name.
    tagOperator string
    Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
    tagType string
    Tag Type: U(User Tag).
    tagValue string
    tag value.
    ruleId string
    rule ID.
    unitRuleItemId string
    Unitization rule item ID.
    tag_field str
    label name.
    tag_operator str
    Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
    tag_type str
    Tag Type: U(User Tag).
    tag_value str
    tag value.
    rule_id str
    rule ID.
    unit_rule_item_id str
    Unitization rule item ID.
    tagField String
    label name.
    tagOperator String
    Operator: IN/NOT_IN/EQUAL/NOT_EQUAL/REGEX.
    tagType String
    Tag Type: U(User Tag).
    tagValue 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
    

    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