1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dcdn
  5. WafPolicy
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

alicloud.dcdn.WafPolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

    Provides a DCDN Waf Policy resource.

    For information about DCDN Waf Policy and how to use it, see What is Waf Policy.

    NOTE: Available since v1.184.0.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf_example";
        var example = new AliCloud.Dcdn.WafPolicy("example", new()
        {
            DefenseScene = "waf_group",
            PolicyName = name,
            PolicyType = "custom",
            Status = "on",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dcdn"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := dcdn.NewWafPolicy(ctx, "example", &dcdn.WafPolicyArgs{
    			DefenseScene: pulumi.String("waf_group"),
    			PolicyName:   pulumi.String(name),
    			PolicyType:   pulumi.String("custom"),
    			Status:       pulumi.String("on"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.dcdn.WafPolicy;
    import com.pulumi.alicloud.dcdn.WafPolicyArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tf_example");
            var example = new WafPolicy("example", WafPolicyArgs.builder()        
                .defenseScene("waf_group")
                .policyName(name)
                .policyType("custom")
                .status("on")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf_example"
    example = alicloud.dcdn.WafPolicy("example",
        defense_scene="waf_group",
        policy_name=name,
        policy_type="custom",
        status="on")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf_example";
    const example = new alicloud.dcdn.WafPolicy("example", {
        defenseScene: "waf_group",
        policyName: name,
        policyType: "custom",
        status: "on",
    });
    
    configuration:
      name:
        type: string
        default: tf_example
    resources:
      example:
        type: alicloud:dcdn:WafPolicy
        properties:
          defenseScene: waf_group
          policyName: ${name}
          policyType: custom
          status: on
    

    Create WafPolicy Resource

    new WafPolicy(name: string, args: WafPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def WafPolicy(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  defense_scene: Optional[str] = None,
                  policy_name: Optional[str] = None,
                  policy_type: Optional[str] = None,
                  status: Optional[str] = None)
    @overload
    def WafPolicy(resource_name: str,
                  args: WafPolicyArgs,
                  opts: Optional[ResourceOptions] = None)
    func NewWafPolicy(ctx *Context, name string, args WafPolicyArgs, opts ...ResourceOption) (*WafPolicy, error)
    public WafPolicy(string name, WafPolicyArgs args, CustomResourceOptions? opts = null)
    public WafPolicy(String name, WafPolicyArgs args)
    public WafPolicy(String name, WafPolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:dcdn:WafPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args WafPolicyArgs
    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 WafPolicyArgs
    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 WafPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WafPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WafPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    WafPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The WafPolicy resource accepts the following input properties:

    DefenseScene string

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    PolicyName string

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    PolicyType string

    The type of the protection policy. Valid values: default, custom.

    Status string

    The status of the resource. Valid values: on, off.

    DefenseScene string

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    PolicyName string

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    PolicyType string

    The type of the protection policy. Valid values: default, custom.

    Status string

    The status of the resource. Valid values: on, off.

    defenseScene String

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    policyName String

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    policyType String

    The type of the protection policy. Valid values: default, custom.

    status String

    The status of the resource. Valid values: on, off.

    defenseScene string

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    policyName string

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    policyType string

    The type of the protection policy. Valid values: default, custom.

    status string

    The status of the resource. Valid values: on, off.

    defense_scene str

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    policy_name str

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    policy_type str

    The type of the protection policy. Valid values: default, custom.

    status str

    The status of the resource. Valid values: on, off.

    defenseScene String

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    policyName String

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    policyType String

    The type of the protection policy. Valid values: default, custom.

    status String

    The status of the resource. Valid values: on, off.

    Outputs

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

    Get an existing WafPolicy 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?: WafPolicyState, opts?: CustomResourceOptions): WafPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            defense_scene: Optional[str] = None,
            policy_name: Optional[str] = None,
            policy_type: Optional[str] = None,
            status: Optional[str] = None) -> WafPolicy
    func GetWafPolicy(ctx *Context, name string, id IDInput, state *WafPolicyState, opts ...ResourceOption) (*WafPolicy, error)
    public static WafPolicy Get(string name, Input<string> id, WafPolicyState? state, CustomResourceOptions? opts = null)
    public static WafPolicy get(String name, Output<String> id, WafPolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    DefenseScene string

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    PolicyName string

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    PolicyType string

    The type of the protection policy. Valid values: default, custom.

    Status string

    The status of the resource. Valid values: on, off.

    DefenseScene string

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    PolicyName string

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    PolicyType string

    The type of the protection policy. Valid values: default, custom.

    Status string

    The status of the resource. Valid values: on, off.

    defenseScene String

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    policyName String

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    policyType String

    The type of the protection policy. Valid values: default, custom.

    status String

    The status of the resource. Valid values: on, off.

    defenseScene string

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    policyName string

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    policyType string

    The type of the protection policy. Valid values: default, custom.

    status string

    The status of the resource. Valid values: on, off.

    defense_scene str

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    policy_name str

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    policy_type str

    The type of the protection policy. Valid values: default, custom.

    status str

    The status of the resource. Valid values: on, off.

    defenseScene String

    The type of protection policy. Valid values: waf_group, custom_acl, whitelist, ip_blacklist, region_block.

    policyName String

    The name of the protection policy. The name must be 1 to 64 characters in length, and can contain letters, digits,and underscores (_).

    policyType String

    The type of the protection policy. Valid values: default, custom.

    status String

    The status of the resource. Valid values: on, off.

    Import

    DCDN Waf Policy can be imported using the id, e.g.

     $ pulumi import alicloud:dcdn/wafPolicy:WafPolicy example <id>
    

    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.45.0 published on Monday, Nov 27, 2023 by Pulumi