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

tencentcloud.DayuL7RuleV2

Explore with Pulumi AI

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

    Use this resource to create dayu new layer 7 rule

    NOTE: This resource only support resource Anti-DDoS of type bgpip

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const tencentcloudDayuL7RuleV2 = new tencentcloud.DayuL7RuleV2("tencentcloudDayuL7RuleV2", {
        resourceId: "bgpip-000004xe",
        resourceIp: "119.28.217.162",
        resourceType: "bgpip",
        rule: {
            domain: "github.com",
            keepEnable: false,
            keeptime: 0,
            lbType: 1,
            protocol: "http",
            sourceLists: [
                {
                    source: "1.2.3.5",
                    weight: 100,
                },
                {
                    source: "1.2.3.6",
                    weight: 100,
                },
            ],
            sourceType: 2,
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    tencentcloud_dayu_l7_rule_v2 = tencentcloud.DayuL7RuleV2("tencentcloudDayuL7RuleV2",
        resource_id="bgpip-000004xe",
        resource_ip="119.28.217.162",
        resource_type="bgpip",
        rule={
            "domain": "github.com",
            "keep_enable": False,
            "keeptime": 0,
            "lb_type": 1,
            "protocol": "http",
            "source_lists": [
                {
                    "source": "1.2.3.5",
                    "weight": 100,
                },
                {
                    "source": "1.2.3.6",
                    "weight": 100,
                },
            ],
            "source_type": 2,
        })
    
    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.NewDayuL7RuleV2(ctx, "tencentcloudDayuL7RuleV2", &tencentcloud.DayuL7RuleV2Args{
    			ResourceId:   pulumi.String("bgpip-000004xe"),
    			ResourceIp:   pulumi.String("119.28.217.162"),
    			ResourceType: pulumi.String("bgpip"),
    			Rule: &tencentcloud.DayuL7RuleV2RuleArgs{
    				Domain:     pulumi.String("github.com"),
    				KeepEnable: pulumi.Float64(false),
    				Keeptime:   pulumi.Float64(0),
    				LbType:     pulumi.Float64(1),
    				Protocol:   pulumi.String("http"),
    				SourceLists: tencentcloud.DayuL7RuleV2RuleSourceListArray{
    					&tencentcloud.DayuL7RuleV2RuleSourceListArgs{
    						Source: pulumi.String("1.2.3.5"),
    						Weight: pulumi.Float64(100),
    					},
    					&tencentcloud.DayuL7RuleV2RuleSourceListArgs{
    						Source: pulumi.String("1.2.3.6"),
    						Weight: pulumi.Float64(100),
    					},
    				},
    				SourceType: pulumi.Float64(2),
    			},
    		})
    		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 tencentcloudDayuL7RuleV2 = new Tencentcloud.DayuL7RuleV2("tencentcloudDayuL7RuleV2", new()
        {
            ResourceId = "bgpip-000004xe",
            ResourceIp = "119.28.217.162",
            ResourceType = "bgpip",
            Rule = new Tencentcloud.Inputs.DayuL7RuleV2RuleArgs
            {
                Domain = "github.com",
                KeepEnable = false,
                Keeptime = 0,
                LbType = 1,
                Protocol = "http",
                SourceLists = new[]
                {
                    new Tencentcloud.Inputs.DayuL7RuleV2RuleSourceListArgs
                    {
                        Source = "1.2.3.5",
                        Weight = 100,
                    },
                    new Tencentcloud.Inputs.DayuL7RuleV2RuleSourceListArgs
                    {
                        Source = "1.2.3.6",
                        Weight = 100,
                    },
                },
                SourceType = 2,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.DayuL7RuleV2;
    import com.pulumi.tencentcloud.DayuL7RuleV2Args;
    import com.pulumi.tencentcloud.inputs.DayuL7RuleV2RuleArgs;
    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 tencentcloudDayuL7RuleV2 = new DayuL7RuleV2("tencentcloudDayuL7RuleV2", DayuL7RuleV2Args.builder()
                .resourceId("bgpip-000004xe")
                .resourceIp("119.28.217.162")
                .resourceType("bgpip")
                .rule(DayuL7RuleV2RuleArgs.builder()
                    .domain("github.com")
                    .keepEnable(false)
                    .keeptime(0)
                    .lbType(1)
                    .protocol("http")
                    .sourceLists(                
                        DayuL7RuleV2RuleSourceListArgs.builder()
                            .source("1.2.3.5")
                            .weight(100)
                            .build(),
                        DayuL7RuleV2RuleSourceListArgs.builder()
                            .source("1.2.3.6")
                            .weight(100)
                            .build())
                    .sourceType(2)
                    .build())
                .build());
    
        }
    }
    
    resources:
      tencentcloudDayuL7RuleV2:
        type: tencentcloud:DayuL7RuleV2
        properties:
          resourceId: bgpip-000004xe
          resourceIp: 119.28.217.162
          resourceType: bgpip
          rule:
            domain: github.com
            keepEnable: false
            keeptime: 0
            lbType: 1
            protocol: http
            sourceLists:
              - source: 1.2.3.5
                weight: 100
              - source: 1.2.3.6
                weight: 100
            sourceType: 2
    

    Create DayuL7RuleV2 Resource

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

    Constructor syntax

    new DayuL7RuleV2(name: string, args: DayuL7RuleV2Args, opts?: CustomResourceOptions);
    @overload
    def DayuL7RuleV2(resource_name: str,
                     args: DayuL7RuleV2Args,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def DayuL7RuleV2(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     resource_id: Optional[str] = None,
                     resource_ip: Optional[str] = None,
                     resource_type: Optional[str] = None,
                     rule: Optional[DayuL7RuleV2RuleArgs] = None,
                     dayu_l7_rule_v2_id: Optional[str] = None)
    func NewDayuL7RuleV2(ctx *Context, name string, args DayuL7RuleV2Args, opts ...ResourceOption) (*DayuL7RuleV2, error)
    public DayuL7RuleV2(string name, DayuL7RuleV2Args args, CustomResourceOptions? opts = null)
    public DayuL7RuleV2(String name, DayuL7RuleV2Args args)
    public DayuL7RuleV2(String name, DayuL7RuleV2Args args, CustomResourceOptions options)
    
    type: tencentcloud:DayuL7RuleV2
    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 DayuL7RuleV2Args
    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 DayuL7RuleV2Args
    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 DayuL7RuleV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DayuL7RuleV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DayuL7RuleV2Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    ResourceId string
    ID of the resource that the layer 7 rule works for.
    ResourceIp string
    Ip of the resource that the layer 7 rule works for.
    ResourceType string
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    Rule DayuL7RuleV2Rule
    A list of layer 7 rules. Each element contains the following attributes:
    DayuL7RuleV2Id string
    ID of the resource.
    ResourceId string
    ID of the resource that the layer 7 rule works for.
    ResourceIp string
    Ip of the resource that the layer 7 rule works for.
    ResourceType string
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    Rule DayuL7RuleV2RuleArgs
    A list of layer 7 rules. Each element contains the following attributes:
    DayuL7RuleV2Id string
    ID of the resource.
    resourceId String
    ID of the resource that the layer 7 rule works for.
    resourceIp String
    Ip of the resource that the layer 7 rule works for.
    resourceType String
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    rule DayuL7RuleV2Rule
    A list of layer 7 rules. Each element contains the following attributes:
    dayuL7RuleV2Id String
    ID of the resource.
    resourceId string
    ID of the resource that the layer 7 rule works for.
    resourceIp string
    Ip of the resource that the layer 7 rule works for.
    resourceType string
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    rule DayuL7RuleV2Rule
    A list of layer 7 rules. Each element contains the following attributes:
    dayuL7RuleV2Id string
    ID of the resource.
    resource_id str
    ID of the resource that the layer 7 rule works for.
    resource_ip str
    Ip of the resource that the layer 7 rule works for.
    resource_type str
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    rule DayuL7RuleV2RuleArgs
    A list of layer 7 rules. Each element contains the following attributes:
    dayu_l7_rule_v2_id str
    ID of the resource.
    resourceId String
    ID of the resource that the layer 7 rule works for.
    resourceIp String
    Ip of the resource that the layer 7 rule works for.
    resourceType String
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    rule Property Map
    A list of layer 7 rules. Each element contains the following attributes:
    dayuL7RuleV2Id String
    ID of the resource.

    Outputs

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

    Get an existing DayuL7RuleV2 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?: DayuL7RuleV2State, opts?: CustomResourceOptions): DayuL7RuleV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dayu_l7_rule_v2_id: Optional[str] = None,
            resource_id: Optional[str] = None,
            resource_ip: Optional[str] = None,
            resource_type: Optional[str] = None,
            rule: Optional[DayuL7RuleV2RuleArgs] = None) -> DayuL7RuleV2
    func GetDayuL7RuleV2(ctx *Context, name string, id IDInput, state *DayuL7RuleV2State, opts ...ResourceOption) (*DayuL7RuleV2, error)
    public static DayuL7RuleV2 Get(string name, Input<string> id, DayuL7RuleV2State? state, CustomResourceOptions? opts = null)
    public static DayuL7RuleV2 get(String name, Output<String> id, DayuL7RuleV2State state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:DayuL7RuleV2    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:
    DayuL7RuleV2Id string
    ID of the resource.
    ResourceId string
    ID of the resource that the layer 7 rule works for.
    ResourceIp string
    Ip of the resource that the layer 7 rule works for.
    ResourceType string
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    Rule DayuL7RuleV2Rule
    A list of layer 7 rules. Each element contains the following attributes:
    DayuL7RuleV2Id string
    ID of the resource.
    ResourceId string
    ID of the resource that the layer 7 rule works for.
    ResourceIp string
    Ip of the resource that the layer 7 rule works for.
    ResourceType string
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    Rule DayuL7RuleV2RuleArgs
    A list of layer 7 rules. Each element contains the following attributes:
    dayuL7RuleV2Id String
    ID of the resource.
    resourceId String
    ID of the resource that the layer 7 rule works for.
    resourceIp String
    Ip of the resource that the layer 7 rule works for.
    resourceType String
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    rule DayuL7RuleV2Rule
    A list of layer 7 rules. Each element contains the following attributes:
    dayuL7RuleV2Id string
    ID of the resource.
    resourceId string
    ID of the resource that the layer 7 rule works for.
    resourceIp string
    Ip of the resource that the layer 7 rule works for.
    resourceType string
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    rule DayuL7RuleV2Rule
    A list of layer 7 rules. Each element contains the following attributes:
    dayu_l7_rule_v2_id str
    ID of the resource.
    resource_id str
    ID of the resource that the layer 7 rule works for.
    resource_ip str
    Ip of the resource that the layer 7 rule works for.
    resource_type str
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    rule DayuL7RuleV2RuleArgs
    A list of layer 7 rules. Each element contains the following attributes:
    dayuL7RuleV2Id String
    ID of the resource.
    resourceId String
    ID of the resource that the layer 7 rule works for.
    resourceIp String
    Ip of the resource that the layer 7 rule works for.
    resourceType String
    Type of the resource that the layer 7 rule works for, valid value is bgpip.
    rule Property Map
    A list of layer 7 rules. Each element contains the following attributes:

    Supporting Types

    DayuL7RuleV2Rule, DayuL7RuleV2RuleArgs

    Domain string
    Domain of the rule.
    KeepEnable double
    session hold switch.
    Keeptime double
    The keeptime of the layer 4 rule.
    LbType double
    LB type of the rule, 1 for weight cycling and 2 for IP hash.
    Protocol string
    Protocol of the rule.
    SourceLists List<DayuL7RuleV2RuleSourceList>
    SourceType double
    Source type, 1 for source of host, 2 for source of IP.
    CcEnable double
    HTTPS protocol CC protection status, value [0 (off), 1 (on)], defaule is 0.
    CertType double
    The source of the certificate must be filled in when the forwarding protocol is https, the value [2 (Tencent Cloud Hosting Certificate)], and 0 when the forwarding protocol is http.
    HttpsToHttpEnable double
    Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], do not fill in the default is off, defaule is 0.
    SslId string
    When the certificate source is a Tencent Cloud managed certificate, this field must be filled in with the managed certificate ID.
    Domain string
    Domain of the rule.
    KeepEnable float64
    session hold switch.
    Keeptime float64
    The keeptime of the layer 4 rule.
    LbType float64
    LB type of the rule, 1 for weight cycling and 2 for IP hash.
    Protocol string
    Protocol of the rule.
    SourceLists []DayuL7RuleV2RuleSourceList
    SourceType float64
    Source type, 1 for source of host, 2 for source of IP.
    CcEnable float64
    HTTPS protocol CC protection status, value [0 (off), 1 (on)], defaule is 0.
    CertType float64
    The source of the certificate must be filled in when the forwarding protocol is https, the value [2 (Tencent Cloud Hosting Certificate)], and 0 when the forwarding protocol is http.
    HttpsToHttpEnable float64
    Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], do not fill in the default is off, defaule is 0.
    SslId string
    When the certificate source is a Tencent Cloud managed certificate, this field must be filled in with the managed certificate ID.
    domain String
    Domain of the rule.
    keepEnable Double
    session hold switch.
    keeptime Double
    The keeptime of the layer 4 rule.
    lbType Double
    LB type of the rule, 1 for weight cycling and 2 for IP hash.
    protocol String
    Protocol of the rule.
    sourceLists List<DayuL7RuleV2RuleSourceList>
    sourceType Double
    Source type, 1 for source of host, 2 for source of IP.
    ccEnable Double
    HTTPS protocol CC protection status, value [0 (off), 1 (on)], defaule is 0.
    certType Double
    The source of the certificate must be filled in when the forwarding protocol is https, the value [2 (Tencent Cloud Hosting Certificate)], and 0 when the forwarding protocol is http.
    httpsToHttpEnable Double
    Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], do not fill in the default is off, defaule is 0.
    sslId String
    When the certificate source is a Tencent Cloud managed certificate, this field must be filled in with the managed certificate ID.
    domain string
    Domain of the rule.
    keepEnable number
    session hold switch.
    keeptime number
    The keeptime of the layer 4 rule.
    lbType number
    LB type of the rule, 1 for weight cycling and 2 for IP hash.
    protocol string
    Protocol of the rule.
    sourceLists DayuL7RuleV2RuleSourceList[]
    sourceType number
    Source type, 1 for source of host, 2 for source of IP.
    ccEnable number
    HTTPS protocol CC protection status, value [0 (off), 1 (on)], defaule is 0.
    certType number
    The source of the certificate must be filled in when the forwarding protocol is https, the value [2 (Tencent Cloud Hosting Certificate)], and 0 when the forwarding protocol is http.
    httpsToHttpEnable number
    Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], do not fill in the default is off, defaule is 0.
    sslId string
    When the certificate source is a Tencent Cloud managed certificate, this field must be filled in with the managed certificate ID.
    domain str
    Domain of the rule.
    keep_enable float
    session hold switch.
    keeptime float
    The keeptime of the layer 4 rule.
    lb_type float
    LB type of the rule, 1 for weight cycling and 2 for IP hash.
    protocol str
    Protocol of the rule.
    source_lists Sequence[DayuL7RuleV2RuleSourceList]
    source_type float
    Source type, 1 for source of host, 2 for source of IP.
    cc_enable float
    HTTPS protocol CC protection status, value [0 (off), 1 (on)], defaule is 0.
    cert_type float
    The source of the certificate must be filled in when the forwarding protocol is https, the value [2 (Tencent Cloud Hosting Certificate)], and 0 when the forwarding protocol is http.
    https_to_http_enable float
    Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], do not fill in the default is off, defaule is 0.
    ssl_id str
    When the certificate source is a Tencent Cloud managed certificate, this field must be filled in with the managed certificate ID.
    domain String
    Domain of the rule.
    keepEnable Number
    session hold switch.
    keeptime Number
    The keeptime of the layer 4 rule.
    lbType Number
    LB type of the rule, 1 for weight cycling and 2 for IP hash.
    protocol String
    Protocol of the rule.
    sourceLists List<Property Map>
    sourceType Number
    Source type, 1 for source of host, 2 for source of IP.
    ccEnable Number
    HTTPS protocol CC protection status, value [0 (off), 1 (on)], defaule is 0.
    certType Number
    The source of the certificate must be filled in when the forwarding protocol is https, the value [2 (Tencent Cloud Hosting Certificate)], and 0 when the forwarding protocol is http.
    httpsToHttpEnable Number
    Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], do not fill in the default is off, defaule is 0.
    sslId String
    When the certificate source is a Tencent Cloud managed certificate, this field must be filled in with the managed certificate ID.

    DayuL7RuleV2RuleSourceList, DayuL7RuleV2RuleSourceListArgs

    Source string
    Source IP or domain.
    Weight double
    Weight of the source.
    Source string
    Source IP or domain.
    Weight float64
    Weight of the source.
    source String
    Source IP or domain.
    weight Double
    Weight of the source.
    source string
    Source IP or domain.
    weight number
    Weight of the source.
    source str
    Source IP or domain.
    weight float
    Weight of the source.
    source String
    Source IP or domain.
    weight Number
    Weight of the source.

    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