1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. WafWhiteblackipRuleV1
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

opentelekomcloud.WafWhiteblackipRuleV1

Explore with Pulumi AI

opentelekomcloud logo
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

    Up-to-date reference of API arguments for WAF white and black ip rule you can get at documentation portal

    Manages a WAF WhiteBlackIP Rule resource within OpenTelekomCloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const policy1 = new opentelekomcloud.WafPolicyV1("policy1", {});
    const rule1 = new opentelekomcloud.WafWhiteblackipRuleV1("rule1", {
        policyId: policy1.wafPolicyV1Id,
        addr: "192.168.0.0/24",
        white: 1,
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    policy1 = opentelekomcloud.WafPolicyV1("policy1")
    rule1 = opentelekomcloud.WafWhiteblackipRuleV1("rule1",
        policy_id=policy1.waf_policy_v1_id,
        addr="192.168.0.0/24",
        white=1)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		policy1, err := opentelekomcloud.NewWafPolicyV1(ctx, "policy1", nil)
    		if err != nil {
    			return err
    		}
    		_, err = opentelekomcloud.NewWafWhiteblackipRuleV1(ctx, "rule1", &opentelekomcloud.WafWhiteblackipRuleV1Args{
    			PolicyId: policy1.WafPolicyV1Id,
    			Addr:     pulumi.String("192.168.0.0/24"),
    			White:    pulumi.Float64(1),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opentelekomcloud = Pulumi.Opentelekomcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var policy1 = new Opentelekomcloud.WafPolicyV1("policy1");
    
        var rule1 = new Opentelekomcloud.WafWhiteblackipRuleV1("rule1", new()
        {
            PolicyId = policy1.WafPolicyV1Id,
            Addr = "192.168.0.0/24",
            White = 1,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.WafPolicyV1;
    import com.pulumi.opentelekomcloud.WafWhiteblackipRuleV1;
    import com.pulumi.opentelekomcloud.WafWhiteblackipRuleV1Args;
    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 policy1 = new WafPolicyV1("policy1");
    
            var rule1 = new WafWhiteblackipRuleV1("rule1", WafWhiteblackipRuleV1Args.builder()
                .policyId(policy1.wafPolicyV1Id())
                .addr("192.168.0.0/24")
                .white(1)
                .build());
    
        }
    }
    
    resources:
      policy1:
        type: opentelekomcloud:WafPolicyV1
      rule1:
        type: opentelekomcloud:WafWhiteblackipRuleV1
        properties:
          policyId: ${policy1.wafPolicyV1Id}
          addr: 192.168.0.0/24
          white: 1
    

    Create WafWhiteblackipRuleV1 Resource

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

    Constructor syntax

    new WafWhiteblackipRuleV1(name: string, args: WafWhiteblackipRuleV1Args, opts?: CustomResourceOptions);
    @overload
    def WafWhiteblackipRuleV1(resource_name: str,
                              args: WafWhiteblackipRuleV1Args,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def WafWhiteblackipRuleV1(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              addr: Optional[str] = None,
                              policy_id: Optional[str] = None,
                              timeouts: Optional[WafWhiteblackipRuleV1TimeoutsArgs] = None,
                              waf_whiteblackip_rule_v1_id: Optional[str] = None,
                              white: Optional[float] = None)
    func NewWafWhiteblackipRuleV1(ctx *Context, name string, args WafWhiteblackipRuleV1Args, opts ...ResourceOption) (*WafWhiteblackipRuleV1, error)
    public WafWhiteblackipRuleV1(string name, WafWhiteblackipRuleV1Args args, CustomResourceOptions? opts = null)
    public WafWhiteblackipRuleV1(String name, WafWhiteblackipRuleV1Args args)
    public WafWhiteblackipRuleV1(String name, WafWhiteblackipRuleV1Args args, CustomResourceOptions options)
    
    type: opentelekomcloud:WafWhiteblackipRuleV1
    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 WafWhiteblackipRuleV1Args
    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 WafWhiteblackipRuleV1Args
    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 WafWhiteblackipRuleV1Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WafWhiteblackipRuleV1Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WafWhiteblackipRuleV1Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var wafWhiteblackipRuleV1Resource = new Opentelekomcloud.WafWhiteblackipRuleV1("wafWhiteblackipRuleV1Resource", new()
    {
        Addr = "string",
        PolicyId = "string",
        Timeouts = new Opentelekomcloud.Inputs.WafWhiteblackipRuleV1TimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
        WafWhiteblackipRuleV1Id = "string",
        White = 0,
    });
    
    example, err := opentelekomcloud.NewWafWhiteblackipRuleV1(ctx, "wafWhiteblackipRuleV1Resource", &opentelekomcloud.WafWhiteblackipRuleV1Args{
    	Addr:     pulumi.String("string"),
    	PolicyId: pulumi.String("string"),
    	Timeouts: &opentelekomcloud.WafWhiteblackipRuleV1TimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    	WafWhiteblackipRuleV1Id: pulumi.String("string"),
    	White:                   pulumi.Float64(0),
    })
    
    var wafWhiteblackipRuleV1Resource = new WafWhiteblackipRuleV1("wafWhiteblackipRuleV1Resource", WafWhiteblackipRuleV1Args.builder()
        .addr("string")
        .policyId("string")
        .timeouts(WafWhiteblackipRuleV1TimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .wafWhiteblackipRuleV1Id("string")
        .white(0)
        .build());
    
    waf_whiteblackip_rule_v1_resource = opentelekomcloud.WafWhiteblackipRuleV1("wafWhiteblackipRuleV1Resource",
        addr="string",
        policy_id="string",
        timeouts={
            "create": "string",
            "delete": "string",
        },
        waf_whiteblackip_rule_v1_id="string",
        white=0)
    
    const wafWhiteblackipRuleV1Resource = new opentelekomcloud.WafWhiteblackipRuleV1("wafWhiteblackipRuleV1Resource", {
        addr: "string",
        policyId: "string",
        timeouts: {
            create: "string",
            "delete": "string",
        },
        wafWhiteblackipRuleV1Id: "string",
        white: 0,
    });
    
    type: opentelekomcloud:WafWhiteblackipRuleV1
    properties:
        addr: string
        policyId: string
        timeouts:
            create: string
            delete: string
        wafWhiteblackipRuleV1Id: string
        white: 0
    

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

    Addr string
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    PolicyId string
    The WAF policy ID. Changing this creates a new rule.
    Timeouts WafWhiteblackipRuleV1Timeouts
    WafWhiteblackipRuleV1Id string
    ID of the rule.
    White double
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    Addr string
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    PolicyId string
    The WAF policy ID. Changing this creates a new rule.
    Timeouts WafWhiteblackipRuleV1TimeoutsArgs
    WafWhiteblackipRuleV1Id string
    ID of the rule.
    White float64
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    addr String
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    policyId String
    The WAF policy ID. Changing this creates a new rule.
    timeouts WafWhiteblackipRuleV1Timeouts
    wafWhiteblackipRuleV1Id String
    ID of the rule.
    white Double
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    addr string
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    policyId string
    The WAF policy ID. Changing this creates a new rule.
    timeouts WafWhiteblackipRuleV1Timeouts
    wafWhiteblackipRuleV1Id string
    ID of the rule.
    white number
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    addr str
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    policy_id str
    The WAF policy ID. Changing this creates a new rule.
    timeouts WafWhiteblackipRuleV1TimeoutsArgs
    waf_whiteblackip_rule_v1_id str
    ID of the rule.
    white float
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    addr String
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    policyId String
    The WAF policy ID. Changing this creates a new rule.
    timeouts Property Map
    wafWhiteblackipRuleV1Id String
    ID of the rule.
    white Number
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.

    Outputs

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

    Get an existing WafWhiteblackipRuleV1 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?: WafWhiteblackipRuleV1State, opts?: CustomResourceOptions): WafWhiteblackipRuleV1
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            addr: Optional[str] = None,
            policy_id: Optional[str] = None,
            timeouts: Optional[WafWhiteblackipRuleV1TimeoutsArgs] = None,
            waf_whiteblackip_rule_v1_id: Optional[str] = None,
            white: Optional[float] = None) -> WafWhiteblackipRuleV1
    func GetWafWhiteblackipRuleV1(ctx *Context, name string, id IDInput, state *WafWhiteblackipRuleV1State, opts ...ResourceOption) (*WafWhiteblackipRuleV1, error)
    public static WafWhiteblackipRuleV1 Get(string name, Input<string> id, WafWhiteblackipRuleV1State? state, CustomResourceOptions? opts = null)
    public static WafWhiteblackipRuleV1 get(String name, Output<String> id, WafWhiteblackipRuleV1State state, CustomResourceOptions options)
    resources:  _:    type: opentelekomcloud:WafWhiteblackipRuleV1    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:
    Addr string
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    PolicyId string
    The WAF policy ID. Changing this creates a new rule.
    Timeouts WafWhiteblackipRuleV1Timeouts
    WafWhiteblackipRuleV1Id string
    ID of the rule.
    White double
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    Addr string
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    PolicyId string
    The WAF policy ID. Changing this creates a new rule.
    Timeouts WafWhiteblackipRuleV1TimeoutsArgs
    WafWhiteblackipRuleV1Id string
    ID of the rule.
    White float64
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    addr String
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    policyId String
    The WAF policy ID. Changing this creates a new rule.
    timeouts WafWhiteblackipRuleV1Timeouts
    wafWhiteblackipRuleV1Id String
    ID of the rule.
    white Double
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    addr string
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    policyId string
    The WAF policy ID. Changing this creates a new rule.
    timeouts WafWhiteblackipRuleV1Timeouts
    wafWhiteblackipRuleV1Id string
    ID of the rule.
    white number
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    addr str
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    policy_id str
    The WAF policy ID. Changing this creates a new rule.
    timeouts WafWhiteblackipRuleV1TimeoutsArgs
    waf_whiteblackip_rule_v1_id str
    ID of the rule.
    white float
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.
    addr String
    Specifies the IP address or range. For example, 192.168.0.125 or 192.168.0.0/24.
    policyId String
    The WAF policy ID. Changing this creates a new rule.
    timeouts Property Map
    wafWhiteblackipRuleV1Id String
    ID of the rule.
    white Number
    Specifies the IP address type. 1: Whitelist, 0: Blacklist. If you do not configure the white parameter, the value is Blacklist by default.

    Supporting Types

    WafWhiteblackipRuleV1Timeouts, WafWhiteblackipRuleV1TimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    Import

    WhiteBlackIP Rules can be imported using policy_id/id, e.g.

    $ pulumi import opentelekomcloud:index/wafWhiteblackipRuleV1:WafWhiteblackipRuleV1 rule_1 ff95e71c8ae74eba9887193ab22c5757/b39f3a5a1b4f447a8030f0b0703f47f5
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
    License
    Notes
    This Pulumi package is based on the opentelekomcloud Terraform Provider.
    opentelekomcloud logo
    opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud