1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dcdn
  5. getWafRules
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

alicloud.dcdn.getWafRules

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

    This data source provides Dcdn Waf Rule available to the user.What is Waf Rule

    NOTE: Available since v1.201.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.dcdn.getWafRules({
        ids: [defaultAlicloudDcdnWafRule.id],
    });
    export const alicloudDcdnWafRuleExampleId = _default.then(_default => _default.wafRules?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.dcdn.get_waf_rules(ids=[default_alicloud_dcdn_waf_rule["id"]])
    pulumi.export("alicloudDcdnWafRuleExampleId", default.waf_rules[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dcdn"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    _default, err := dcdn.GetWafRules(ctx, &dcdn.GetWafRulesArgs{
    Ids: interface{}{
    defaultAlicloudDcdnWafRule.Id,
    },
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("alicloudDcdnWafRuleExampleId", _default.WafRules[0].Id)
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Dcdn.GetWafRules.Invoke(new()
        {
            Ids = new[]
            {
                defaultAlicloudDcdnWafRule.Id,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudDcdnWafRuleExampleId"] = @default.Apply(@default => @default.Apply(getWafRulesResult => getWafRulesResult.WafRules[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.dcdn.DcdnFunctions;
    import com.pulumi.alicloud.dcdn.inputs.GetWafRulesArgs;
    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) {
            final var default = DcdnFunctions.getWafRules(GetWafRulesArgs.builder()
                .ids(defaultAlicloudDcdnWafRule.id())
                .build());
    
            ctx.export("alicloudDcdnWafRuleExampleId", default_.wafRules()[0].id());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:dcdn:getWafRules
          Arguments:
            ids:
              - ${defaultAlicloudDcdnWafRule.id}
    outputs:
      alicloudDcdnWafRuleExampleId: ${default.wafRules[0].id}
    

    Using getWafRules

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getWafRules(args: GetWafRulesArgs, opts?: InvokeOptions): Promise<GetWafRulesResult>
    function getWafRulesOutput(args: GetWafRulesOutputArgs, opts?: InvokeOptions): Output<GetWafRulesResult>
    def get_waf_rules(ids: Optional[Sequence[str]] = None,
                      output_file: Optional[str] = None,
                      page_number: Optional[int] = None,
                      page_size: Optional[int] = None,
                      query_args: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetWafRulesResult
    def get_waf_rules_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      page_number: Optional[pulumi.Input[int]] = None,
                      page_size: Optional[pulumi.Input[int]] = None,
                      query_args: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetWafRulesResult]
    func GetWafRules(ctx *Context, args *GetWafRulesArgs, opts ...InvokeOption) (*GetWafRulesResult, error)
    func GetWafRulesOutput(ctx *Context, args *GetWafRulesOutputArgs, opts ...InvokeOption) GetWafRulesResultOutput

    > Note: This function is named GetWafRules in the Go SDK.

    public static class GetWafRules 
    {
        public static Task<GetWafRulesResult> InvokeAsync(GetWafRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetWafRulesResult> Invoke(GetWafRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetWafRulesResult> getWafRules(GetWafRulesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:dcdn/getWafRules:getWafRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Waf Rule IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    QueryArgs string
    The query conditions. The value is a string in the JSON format.
    Ids []string
    A list of Waf Rule IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    QueryArgs string
    The query conditions. The value is a string in the JSON format.
    ids List<String>
    A list of Waf Rule IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    queryArgs String
    The query conditions. The value is a string in the JSON format.
    ids string[]
    A list of Waf Rule IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    queryArgs string
    The query conditions. The value is a string in the JSON format.
    ids Sequence[str]
    A list of Waf Rule IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    query_args str
    The query conditions. The value is a string in the JSON format.
    ids List<String>
    A list of Waf Rule IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number
    queryArgs String
    The query conditions. The value is a string in the JSON format.

    getWafRules Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    WafRules List<Pulumi.AliCloud.Dcdn.Outputs.GetWafRulesWafRule>
    A list of Waf Rule Entries. Each element contains the following attributes:
    OutputFile string
    PageNumber int
    PageSize int
    QueryArgs string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    WafRules []GetWafRulesWafRule
    A list of Waf Rule Entries. Each element contains the following attributes:
    OutputFile string
    PageNumber int
    PageSize int
    QueryArgs string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    wafRules List<GetWafRulesWafRule>
    A list of Waf Rule Entries. Each element contains the following attributes:
    outputFile String
    pageNumber Integer
    pageSize Integer
    queryArgs String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    wafRules GetWafRulesWafRule[]
    A list of Waf Rule Entries. Each element contains the following attributes:
    outputFile string
    pageNumber number
    pageSize number
    queryArgs string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    waf_rules Sequence[GetWafRulesWafRule]
    A list of Waf Rule Entries. Each element contains the following attributes:
    output_file str
    page_number int
    page_size int
    query_args str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    wafRules List<Property Map>
    A list of Waf Rule Entries. Each element contains the following attributes:
    outputFile String
    pageNumber Number
    pageSize Number
    queryArgs String

    Supporting Types

    GetWafRulesWafRule

    Action string
    Specifies the action of the rule.
    CcStatus string
    Whether to turn on Frequency Control, on/off
    CnRegionList string
    The blocked regions in the Chinese mainland, separated by commas (,).
    Conditions List<Pulumi.AliCloud.Dcdn.Inputs.GetWafRulesWafRuleCondition>
    The trigger condition of the rule.
    DefenseScene string
    The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
    Effect string
    The effective range of the frequency control blacklist.
    GmtModified string
    Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
    Id string
    The ID of the Waf Rule.
    OtherRegionList string
    The effective range of the frequency control blacklist.
    PolicyId string
    The protection policy ID.
    RateLimits List<Pulumi.AliCloud.Dcdn.Inputs.GetWafRulesWafRuleRateLimit>
    The rules of rate limiting.
    RegularRules List<string>
    The regular expression.
    RegularTypes List<string>
    The type of the regular expression. If the value of the tags field contains waf_group, you can specify this field.
    RemoteAddrs List<string>
    Filter by IP address.
    RuleName string
    The name of the protection rule.
    Scenes List<string>
    List of protection scenarios
    Status string
    The information about the HTTP status code.
    WafGroupIds string
    The id of the waf rule group.
    WafRuleId string
    The first ID of the resource
    Action string
    Specifies the action of the rule.
    CcStatus string
    Whether to turn on Frequency Control, on/off
    CnRegionList string
    The blocked regions in the Chinese mainland, separated by commas (,).
    Conditions []GetWafRulesWafRuleCondition
    The trigger condition of the rule.
    DefenseScene string
    The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
    Effect string
    The effective range of the frequency control blacklist.
    GmtModified string
    Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
    Id string
    The ID of the Waf Rule.
    OtherRegionList string
    The effective range of the frequency control blacklist.
    PolicyId string
    The protection policy ID.
    RateLimits []GetWafRulesWafRuleRateLimit
    The rules of rate limiting.
    RegularRules []string
    The regular expression.
    RegularTypes []string
    The type of the regular expression. If the value of the tags field contains waf_group, you can specify this field.
    RemoteAddrs []string
    Filter by IP address.
    RuleName string
    The name of the protection rule.
    Scenes []string
    List of protection scenarios
    Status string
    The information about the HTTP status code.
    WafGroupIds string
    The id of the waf rule group.
    WafRuleId string
    The first ID of the resource
    action String
    Specifies the action of the rule.
    ccStatus String
    Whether to turn on Frequency Control, on/off
    cnRegionList String
    The blocked regions in the Chinese mainland, separated by commas (,).
    conditions List<GetWafRulesWafRuleCondition>
    The trigger condition of the rule.
    defenseScene String
    The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
    effect String
    The effective range of the frequency control blacklist.
    gmtModified String
    Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
    id String
    The ID of the Waf Rule.
    otherRegionList String
    The effective range of the frequency control blacklist.
    policyId String
    The protection policy ID.
    rateLimits List<GetWafRulesWafRuleRateLimit>
    The rules of rate limiting.
    regularRules List<String>
    The regular expression.
    regularTypes List<String>
    The type of the regular expression. If the value of the tags field contains waf_group, you can specify this field.
    remoteAddrs List<String>
    Filter by IP address.
    ruleName String
    The name of the protection rule.
    scenes List<String>
    List of protection scenarios
    status String
    The information about the HTTP status code.
    wafGroupIds String
    The id of the waf rule group.
    wafRuleId String
    The first ID of the resource
    action string
    Specifies the action of the rule.
    ccStatus string
    Whether to turn on Frequency Control, on/off
    cnRegionList string
    The blocked regions in the Chinese mainland, separated by commas (,).
    conditions GetWafRulesWafRuleCondition[]
    The trigger condition of the rule.
    defenseScene string
    The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
    effect string
    The effective range of the frequency control blacklist.
    gmtModified string
    Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
    id string
    The ID of the Waf Rule.
    otherRegionList string
    The effective range of the frequency control blacklist.
    policyId string
    The protection policy ID.
    rateLimits GetWafRulesWafRuleRateLimit[]
    The rules of rate limiting.
    regularRules string[]
    The regular expression.
    regularTypes string[]
    The type of the regular expression. If the value of the tags field contains waf_group, you can specify this field.
    remoteAddrs string[]
    Filter by IP address.
    ruleName string
    The name of the protection rule.
    scenes string[]
    List of protection scenarios
    status string
    The information about the HTTP status code.
    wafGroupIds string
    The id of the waf rule group.
    wafRuleId string
    The first ID of the resource
    action str
    Specifies the action of the rule.
    cc_status str
    Whether to turn on Frequency Control, on/off
    cn_region_list str
    The blocked regions in the Chinese mainland, separated by commas (,).
    conditions Sequence[GetWafRulesWafRuleCondition]
    The trigger condition of the rule.
    defense_scene str
    The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
    effect str
    The effective range of the frequency control blacklist.
    gmt_modified str
    Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
    id str
    The ID of the Waf Rule.
    other_region_list str
    The effective range of the frequency control blacklist.
    policy_id str
    The protection policy ID.
    rate_limits Sequence[GetWafRulesWafRuleRateLimit]
    The rules of rate limiting.
    regular_rules Sequence[str]
    The regular expression.
    regular_types Sequence[str]
    The type of the regular expression. If the value of the tags field contains waf_group, you can specify this field.
    remote_addrs Sequence[str]
    Filter by IP address.
    rule_name str
    The name of the protection rule.
    scenes Sequence[str]
    List of protection scenarios
    status str
    The information about the HTTP status code.
    waf_group_ids str
    The id of the waf rule group.
    waf_rule_id str
    The first ID of the resource
    action String
    Specifies the action of the rule.
    ccStatus String
    Whether to turn on Frequency Control, on/off
    cnRegionList String
    The blocked regions in the Chinese mainland, separated by commas (,).
    conditions List<Property Map>
    The trigger condition of the rule.
    defenseScene String
    The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
    effect String
    The effective range of the frequency control blacklist.
    gmtModified String
    Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
    id String
    The ID of the Waf Rule.
    otherRegionList String
    The effective range of the frequency control blacklist.
    policyId String
    The protection policy ID.
    rateLimits List<Property Map>
    The rules of rate limiting.
    regularRules List<String>
    The regular expression.
    regularTypes List<String>
    The type of the regular expression. If the value of the tags field contains waf_group, you can specify this field.
    remoteAddrs List<String>
    Filter by IP address.
    ruleName String
    The name of the protection rule.
    scenes List<String>
    List of protection scenarios
    status String
    The information about the HTTP status code.
    wafGroupIds String
    The id of the waf rule group.
    wafRuleId String
    The first ID of the resource

    GetWafRulesWafRuleCondition

    Key string
    The match field.
    OpValue string
    The logical symbol.
    SubKey string
    The subfield of the target field.
    Values string
    The match content. Separate multiple values with commas (,).
    Key string
    The match field.
    OpValue string
    The logical symbol.
    SubKey string
    The subfield of the target field.
    Values string
    The match content. Separate multiple values with commas (,).
    key String
    The match field.
    opValue String
    The logical symbol.
    subKey String
    The subfield of the target field.
    values String
    The match content. Separate multiple values with commas (,).
    key string
    The match field.
    opValue string
    The logical symbol.
    subKey string
    The subfield of the target field.
    values string
    The match content. Separate multiple values with commas (,).
    key str
    The match field.
    op_value str
    The logical symbol.
    sub_key str
    The subfield of the target field.
    values str
    The match content. Separate multiple values with commas (,).
    key String
    The match field.
    opValue String
    The logical symbol.
    subKey String
    The subfield of the target field.
    values String
    The match content. Separate multiple values with commas (,).

    GetWafRulesWafRuleRateLimit

    Interval int
    The statistical interval. Valid values: 5 to 1800. Unit: seconds.
    Statuses List<Pulumi.AliCloud.Dcdn.Inputs.GetWafRulesWafRuleRateLimitStatus>
    The information about the HTTP status code.
    SubKey string
    The subfield of the target field.
    Target string
    The statistical field for frequency control.
    Threshold int
    The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
    Ttl int
    The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
    Interval int
    The statistical interval. Valid values: 5 to 1800. Unit: seconds.
    Statuses []GetWafRulesWafRuleRateLimitStatus
    The information about the HTTP status code.
    SubKey string
    The subfield of the target field.
    Target string
    The statistical field for frequency control.
    Threshold int
    The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
    Ttl int
    The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
    interval Integer
    The statistical interval. Valid values: 5 to 1800. Unit: seconds.
    statuses List<GetWafRulesWafRuleRateLimitStatus>
    The information about the HTTP status code.
    subKey String
    The subfield of the target field.
    target String
    The statistical field for frequency control.
    threshold Integer
    The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
    ttl Integer
    The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
    interval number
    The statistical interval. Valid values: 5 to 1800. Unit: seconds.
    statuses GetWafRulesWafRuleRateLimitStatus[]
    The information about the HTTP status code.
    subKey string
    The subfield of the target field.
    target string
    The statistical field for frequency control.
    threshold number
    The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
    ttl number
    The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
    interval int
    The statistical interval. Valid values: 5 to 1800. Unit: seconds.
    statuses Sequence[GetWafRulesWafRuleRateLimitStatus]
    The information about the HTTP status code.
    sub_key str
    The subfield of the target field.
    target str
    The statistical field for frequency control.
    threshold int
    The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
    ttl int
    The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
    interval Number
    The statistical interval. Valid values: 5 to 1800. Unit: seconds.
    statuses List<Property Map>
    The information about the HTTP status code.
    subKey String
    The subfield of the target field.
    target String
    The statistical field for frequency control.
    threshold Number
    The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
    ttl Number
    The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.

    GetWafRulesWafRuleRateLimitStatus

    Code string
    The HTTP status code returned.
    Count int
    The number of times that the HTTP status code that was returned.
    Ratio int
    The percentage of HTTP status codes.
    Code string
    The HTTP status code returned.
    Count int
    The number of times that the HTTP status code that was returned.
    Ratio int
    The percentage of HTTP status codes.
    code String
    The HTTP status code returned.
    count Integer
    The number of times that the HTTP status code that was returned.
    ratio Integer
    The percentage of HTTP status codes.
    code string
    The HTTP status code returned.
    count number
    The number of times that the HTTP status code that was returned.
    ratio number
    The percentage of HTTP status codes.
    code str
    The HTTP status code returned.
    count int
    The number of times that the HTTP status code that was returned.
    ratio int
    The percentage of HTTP status codes.
    code String
    The HTTP status code returned.
    count Number
    The number of times that the HTTP status code that was returned.
    ratio Number
    The percentage of HTTP status codes.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi