1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. dcdn
  5. getWafPolicies
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.dcdn.getWafPolicies

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Dcdn Waf Policies of the current Alibaba Cloud user.

    NOTE: Available in v1.184.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.dcdn.getWafPolicies({});
    export const dcdnWafPolicyId1 = ids.then(ids => ids.policies?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.dcdn.get_waf_policies()
    pulumi.export("dcdnWafPolicyId1", ids.policies[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 {
    		ids, err := dcdn.GetWafPolicies(ctx, &dcdn.GetWafPoliciesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("dcdnWafPolicyId1", ids.Policies[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Dcdn.GetWafPolicies.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["dcdnWafPolicyId1"] = ids.Apply(getWafPoliciesResult => getWafPoliciesResult.Policies[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.GetWafPoliciesArgs;
    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 ids = DcdnFunctions.getWafPolicies();
    
            ctx.export("dcdnWafPolicyId1", ids.applyValue(getWafPoliciesResult -> getWafPoliciesResult.policies()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:dcdn:getWafPolicies
          Arguments: {}
    outputs:
      dcdnWafPolicyId1: ${ids.policies[0].id}
    

    Using getWafPolicies

    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 getWafPolicies(args: GetWafPoliciesArgs, opts?: InvokeOptions): Promise<GetWafPoliciesResult>
    function getWafPoliciesOutput(args: GetWafPoliciesOutputArgs, opts?: InvokeOptions): Output<GetWafPoliciesResult>
    def get_waf_policies(ids: Optional[Sequence[str]] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         query_args: Optional[str] = None,
                         status: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetWafPoliciesResult
    def get_waf_policies_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         name_regex: Optional[pulumi.Input[str]] = None,
                         output_file: Optional[pulumi.Input[str]] = None,
                         query_args: Optional[pulumi.Input[str]] = None,
                         status: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetWafPoliciesResult]
    func GetWafPolicies(ctx *Context, args *GetWafPoliciesArgs, opts ...InvokeOption) (*GetWafPoliciesResult, error)
    func GetWafPoliciesOutput(ctx *Context, args *GetWafPoliciesOutputArgs, opts ...InvokeOption) GetWafPoliciesResultOutput

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

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

    The following arguments are supported:

    Ids List<string>
    A list of Waf Policy IDs.
    NameRegex string
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    QueryArgs string
    The query conditions. The value is a string in the JSON format. Format: {"PolicyIds":"The ID of the proteuleIds":"Thection policy","R range of protection rule IDs","PolicyNameLike":"The name of the protection policy","DomainNames":"The protected domain names","PolicyType":"default","DefenseScenes":"waf_group","PolicyStatus":"on","OrderBy":"GmtModified","Desc":"false"}.
    Status string
    The status of the resource. Valid values: on, off.
    Ids []string
    A list of Waf Policy IDs.
    NameRegex string
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    QueryArgs string
    The query conditions. The value is a string in the JSON format. Format: {"PolicyIds":"The ID of the proteuleIds":"Thection policy","R range of protection rule IDs","PolicyNameLike":"The name of the protection policy","DomainNames":"The protected domain names","PolicyType":"default","DefenseScenes":"waf_group","PolicyStatus":"on","OrderBy":"GmtModified","Desc":"false"}.
    Status string
    The status of the resource. Valid values: on, off.
    ids List<String>
    A list of Waf Policy IDs.
    nameRegex String
    outputFile String
    File name where to save data source results (after running pulumi preview).
    queryArgs String
    The query conditions. The value is a string in the JSON format. Format: {"PolicyIds":"The ID of the proteuleIds":"Thection policy","R range of protection rule IDs","PolicyNameLike":"The name of the protection policy","DomainNames":"The protected domain names","PolicyType":"default","DefenseScenes":"waf_group","PolicyStatus":"on","OrderBy":"GmtModified","Desc":"false"}.
    status String
    The status of the resource. Valid values: on, off.
    ids string[]
    A list of Waf Policy IDs.
    nameRegex string
    outputFile string
    File name where to save data source results (after running pulumi preview).
    queryArgs string
    The query conditions. The value is a string in the JSON format. Format: {"PolicyIds":"The ID of the proteuleIds":"Thection policy","R range of protection rule IDs","PolicyNameLike":"The name of the protection policy","DomainNames":"The protected domain names","PolicyType":"default","DefenseScenes":"waf_group","PolicyStatus":"on","OrderBy":"GmtModified","Desc":"false"}.
    status string
    The status of the resource. Valid values: on, off.
    ids Sequence[str]
    A list of Waf Policy IDs.
    name_regex str
    output_file str
    File name where to save data source results (after running pulumi preview).
    query_args str
    The query conditions. The value is a string in the JSON format. Format: {"PolicyIds":"The ID of the proteuleIds":"Thection policy","R range of protection rule IDs","PolicyNameLike":"The name of the protection policy","DomainNames":"The protected domain names","PolicyType":"default","DefenseScenes":"waf_group","PolicyStatus":"on","OrderBy":"GmtModified","Desc":"false"}.
    status str
    The status of the resource. Valid values: on, off.
    ids List<String>
    A list of Waf Policy IDs.
    nameRegex String
    outputFile String
    File name where to save data source results (after running pulumi preview).
    queryArgs String
    The query conditions. The value is a string in the JSON format. Format: {"PolicyIds":"The ID of the proteuleIds":"Thection policy","R range of protection rule IDs","PolicyNameLike":"The name of the protection policy","DomainNames":"The protected domain names","PolicyType":"default","DefenseScenes":"waf_group","PolicyStatus":"on","OrderBy":"GmtModified","Desc":"false"}.
    status String
    The status of the resource. Valid values: on, off.

    getWafPolicies Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Policies List<Pulumi.AliCloud.Dcdn.Outputs.GetWafPoliciesPolicy>
    NameRegex string
    OutputFile string
    QueryArgs string
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Policies []GetWafPoliciesPolicy
    NameRegex string
    OutputFile string
    QueryArgs string
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    policies List<GetWafPoliciesPolicy>
    nameRegex String
    outputFile String
    queryArgs String
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    policies GetWafPoliciesPolicy[]
    nameRegex string
    outputFile string
    queryArgs string
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    policies Sequence[GetWafPoliciesPolicy]
    name_regex str
    output_file str
    query_args str
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    policies List<Property Map>
    nameRegex String
    outputFile String
    queryArgs String
    status String

    Supporting Types

    GetWafPoliciesPolicy

    DcdnWafPolicyId string
    The first ID of the resource.
    DefenseScene string
    The type of protection policy.
    DomainCount int
    The number of domain names that use this protection policy.
    GmtModified string
    The time when the protection policy was modified.
    Id string
    The ID of the Waf Policy.
    PolicyName string
    The name of the protection policy.
    PolicyType string
    The type of the protection policy.
    RuleCount string
    The number of protection rules in this protection policy.
    Status string
    The status of the resource.
    DcdnWafPolicyId string
    The first ID of the resource.
    DefenseScene string
    The type of protection policy.
    DomainCount int
    The number of domain names that use this protection policy.
    GmtModified string
    The time when the protection policy was modified.
    Id string
    The ID of the Waf Policy.
    PolicyName string
    The name of the protection policy.
    PolicyType string
    The type of the protection policy.
    RuleCount string
    The number of protection rules in this protection policy.
    Status string
    The status of the resource.
    dcdnWafPolicyId String
    The first ID of the resource.
    defenseScene String
    The type of protection policy.
    domainCount Integer
    The number of domain names that use this protection policy.
    gmtModified String
    The time when the protection policy was modified.
    id String
    The ID of the Waf Policy.
    policyName String
    The name of the protection policy.
    policyType String
    The type of the protection policy.
    ruleCount String
    The number of protection rules in this protection policy.
    status String
    The status of the resource.
    dcdnWafPolicyId string
    The first ID of the resource.
    defenseScene string
    The type of protection policy.
    domainCount number
    The number of domain names that use this protection policy.
    gmtModified string
    The time when the protection policy was modified.
    id string
    The ID of the Waf Policy.
    policyName string
    The name of the protection policy.
    policyType string
    The type of the protection policy.
    ruleCount string
    The number of protection rules in this protection policy.
    status string
    The status of the resource.
    dcdn_waf_policy_id str
    The first ID of the resource.
    defense_scene str
    The type of protection policy.
    domain_count int
    The number of domain names that use this protection policy.
    gmt_modified str
    The time when the protection policy was modified.
    id str
    The ID of the Waf Policy.
    policy_name str
    The name of the protection policy.
    policy_type str
    The type of the protection policy.
    rule_count str
    The number of protection rules in this protection policy.
    status str
    The status of the resource.
    dcdnWafPolicyId String
    The first ID of the resource.
    defenseScene String
    The type of protection policy.
    domainCount Number
    The number of domain names that use this protection policy.
    gmtModified String
    The time when the protection policy was modified.
    id String
    The ID of the Waf Policy.
    policyName String
    The name of the protection policy.
    policyType String
    The type of the protection policy.
    ruleCount String
    The number of protection rules in this protection policy.
    status String
    The status of the resource.

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi