1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. dcdn
  5. getWafPolicies
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

alicloud.dcdn.getWafPolicies

Explore with Pulumi AI

Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

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

NOTE: Available since 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);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.dcdn.get_waf_policies()
pulumi.export("dcdnWafPolicyId1", ids.policies[0].id)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:dcdn:getWafPolicies
      arguments: {}
outputs:
  dcdnWafPolicyId1: ${ids.policies[0].id}
Copy

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>
Copy
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]
Copy
func GetWafPolicies(ctx *Context, args *GetWafPoliciesArgs, opts ...InvokeOption) (*GetWafPoliciesResult, error)
func GetWafPoliciesOutput(ctx *Context, args *GetWafPoliciesOutputArgs, opts ...InvokeOption) GetWafPoliciesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetWafPoliciesResult> getWafPolicies(GetWafPoliciesArgs args, InvokeOptions options)
public static Output<GetWafPoliciesResult> getWafPolicies(GetWafPoliciesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:dcdn/getWafPolicies:getWafPolicies
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The status of the resource. Valid values: on, off.
Ids Changes to this property will trigger replacement. []string
A list of Waf Policy IDs.
NameRegex string
OutputFile string
File name where to save data source results (after running pulumi preview).
QueryArgs Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The status of the resource. Valid values: on, off.
ids Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The status of the resource. Valid values: on, off.
ids Changes to this property will trigger replacement. string[]
A list of Waf Policy IDs.
nameRegex string
outputFile string
File name where to save data source results (after running pulumi preview).
queryArgs Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The status of the resource. Valid values: on, off.
ids Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The status of the resource. Valid values: on, off.
ids Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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>
A list of Dcdn Waf Policies. Each element contains the following attributes:
NameRegex string
OutputFile string
QueryArgs string
Status string
The status of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
Policies []GetWafPoliciesPolicy
A list of Dcdn Waf Policies. Each element contains the following attributes:
NameRegex string
OutputFile string
QueryArgs string
Status string
The status of the resource.
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
policies List<GetWafPoliciesPolicy>
A list of Dcdn Waf Policies. Each element contains the following attributes:
nameRegex String
outputFile String
queryArgs String
status String
The status of the resource.
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
policies GetWafPoliciesPolicy[]
A list of Dcdn Waf Policies. Each element contains the following attributes:
nameRegex string
outputFile string
queryArgs string
status string
The status of the resource.
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
policies Sequence[GetWafPoliciesPolicy]
A list of Dcdn Waf Policies. Each element contains the following attributes:
name_regex str
output_file str
query_args str
status str
The status of the resource.
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
policies List<Property Map>
A list of Dcdn Waf Policies. Each element contains the following attributes:
nameRegex String
outputFile String
queryArgs String
status String
The status of the resource.

Supporting Types

GetWafPoliciesPolicy

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

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi