1. Packages
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. wafv3
  6. AddressBook
Viewing docs for Alibaba Cloud v3.105.0
published on Thursday, Jul 16, 2026 by Pulumi
alicloud logo
Viewing docs for Alibaba Cloud v3.105.0
published on Thursday, Jul 16, 2026 by Pulumi

    Provides a WAFV3 Address Book resource.

    An Address Book is a named collection of IP/CIDR entries that can be referenced from WAFV3 protection rules.

    For information about WAFV3 Address Book and how to use it, see What is Address Book.

    NOTE: Available since v1.283.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = alicloud.wafv3.getInstances({});
    const defaultAddressBook = new alicloud.wafv3.AddressBook("default", {
        description: "example",
        instanceId: _default.then(_default => _default.ids?.[0]),
        addressBookName: name,
        addressLists: [
            "100.100.100.100/32",
            "101.101.101.101/32",
            "102.102.102.102/32",
        ],
        addressBookType: "ip",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.wafv3.get_instances()
    default_address_book = alicloud.wafv3.AddressBook("default",
        description="example",
        instance_id=default.ids[0],
        address_book_name=name,
        address_lists=[
            "100.100.100.100/32",
            "101.101.101.101/32",
            "102.102.102.102/32",
        ],
        address_book_type="ip")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/wafv3"
    	"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 := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := wafv3.GetInstances(ctx, &wafv3.GetInstancesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = wafv3.NewAddressBook(ctx, "default", &wafv3.AddressBookArgs{
    			Description:     pulumi.String("example"),
    			InstanceId:      pulumi.String(_default.Ids[0]),
    			AddressBookName: pulumi.String(name),
    			AddressLists: pulumi.StringArray{
    				pulumi.String("100.100.100.100/32"),
    				pulumi.String("101.101.101.101/32"),
    				pulumi.String("102.102.102.102/32"),
    			},
    			AddressBookType: pulumi.String("ip"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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") ?? "terraform-example";
        var @default = AliCloud.Wafv3.GetInstances.Invoke();
    
        var defaultAddressBook = new AliCloud.Wafv3.AddressBook("default", new()
        {
            Description = "example",
            InstanceId = @default.Apply(@default => @default.Apply(getInstancesResult => getInstancesResult.Ids[0])),
            AddressBookName = name,
            AddressLists = new[]
            {
                "100.100.100.100/32",
                "101.101.101.101/32",
                "102.102.102.102/32",
            },
            AddressBookType = "ip",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.wafv3.Wafv3Functions;
    import com.pulumi.alicloud.wafv3.inputs.GetInstancesArgs;
    import com.pulumi.alicloud.wafv3.AddressBook;
    import com.pulumi.alicloud.wafv3.AddressBookArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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("terraform-example");
            final var default = Wafv3Functions.getInstances(GetInstancesArgs.builder()
                .build());
    
            var defaultAddressBook = new AddressBook("defaultAddressBook", AddressBookArgs.builder()
                .description("example")
                .instanceId(default_.ids()[0])
                .addressBookName(name)
                .addressLists(            
                    "100.100.100.100/32",
                    "101.101.101.101/32",
                    "102.102.102.102/32")
                .addressBookType("ip")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultAddressBook:
        type: alicloud:wafv3:AddressBook
        name: default
        properties:
          description: example
          instanceId: ${default.ids[0]}
          addressBookName: ${name}
          addressLists:
            - 100.100.100.100/32
            - 101.101.101.101/32
            - 102.102.102.102/32
          addressBookType: ip
    variables:
      default:
        fn::invoke:
          function: alicloud:wafv3:getInstances
          arguments: {}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    data "alicloud_wafv3_getinstances" "default" {
    }
    
    resource "alicloud_wafv3_addressbook" "default" {
      description       = "example"
      instance_id       = data.alicloud_wafv3_getinstances.default.ids[0]
      address_book_name = var.name
      address_lists     = ["100.100.100.100/32", "101.101.101.101/32", "102.102.102.102/32"]
      address_book_type = "ip"
    }
    variable "name" {
      type    = string
      default = "terraform-example"
    }
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create AddressBook Resource

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

    Constructor syntax

    new AddressBook(name: string, args: AddressBookArgs, opts?: CustomResourceOptions);
    @overload
    def AddressBook(resource_name: str,
                    args: AddressBookArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def AddressBook(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    address_book_type: Optional[str] = None,
                    instance_id: Optional[str] = None,
                    address_book_name: Optional[str] = None,
                    address_lists: Optional[Sequence[str]] = None,
                    description: Optional[str] = None)
    func NewAddressBook(ctx *Context, name string, args AddressBookArgs, opts ...ResourceOption) (*AddressBook, error)
    public AddressBook(string name, AddressBookArgs args, CustomResourceOptions? opts = null)
    public AddressBook(String name, AddressBookArgs args)
    public AddressBook(String name, AddressBookArgs args, CustomResourceOptions options)
    
    type: alicloud:wafv3:AddressBook
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "alicloud_wafv3_address_book" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args AddressBookArgs
    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 AddressBookArgs
    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 AddressBookArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AddressBookArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AddressBookArgs
    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 alicloudAddressBookResource = new AliCloud.Wafv3.AddressBook("alicloudAddressBookResource", new()
    {
        AddressBookType = "string",
        InstanceId = "string",
        AddressBookName = "string",
        AddressLists = new[]
        {
            "string",
        },
        Description = "string",
    });
    
    example, err := wafv3.NewAddressBook(ctx, "alicloudAddressBookResource", &wafv3.AddressBookArgs{
    	AddressBookType: pulumi.String("string"),
    	InstanceId:      pulumi.String("string"),
    	AddressBookName: pulumi.String("string"),
    	AddressLists: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    })
    
    resource "alicloud_wafv3_address_book" "alicloudAddressBookResource" {
      lifecycle {
        create_before_destroy = true
      }
      address_book_type = "string"
      instance_id       = "string"
      address_book_name = "string"
      address_lists     = ["string"]
      description       = "string"
    }
    
    var alicloudAddressBookResource = new com.pulumi.alicloud.wafv3.AddressBook("alicloudAddressBookResource", com.pulumi.alicloud.wafv3.AddressBookArgs.builder()
        .addressBookType("string")
        .instanceId("string")
        .addressBookName("string")
        .addressLists("string")
        .description("string")
        .build());
    
    alicloud_address_book_resource = alicloud.wafv3.AddressBook("alicloudAddressBookResource",
        address_book_type="string",
        instance_id="string",
        address_book_name="string",
        address_lists=["string"],
        description="string")
    
    const alicloudAddressBookResource = new alicloud.wafv3.AddressBook("alicloudAddressBookResource", {
        addressBookType: "string",
        instanceId: "string",
        addressBookName: "string",
        addressLists: ["string"],
        description: "string",
    });
    
    type: alicloud:wafv3:AddressBook
    properties:
        addressBookName: string
        addressBookType: string
        addressLists:
            - string
        description: string
        instanceId: string
    

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

    AddressBookType string
    The type of the Address Book. Valid values: ip.
    InstanceId string

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    AddressBookName string
    The name of the Address Book.
    AddressLists List<string>
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    Description string
    The description of the Address Book.
    AddressBookType string
    The type of the Address Book. Valid values: ip.
    InstanceId string

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    AddressBookName string
    The name of the Address Book.
    AddressLists []string
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    Description string
    The description of the Address Book.
    address_book_type string
    The type of the Address Book. Valid values: ip.
    instance_id string

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    address_book_name string
    The name of the Address Book.
    address_lists list(string)
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description string
    The description of the Address Book.
    addressBookType String
    The type of the Address Book. Valid values: ip.
    instanceId String

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    addressBookName String
    The name of the Address Book.
    addressLists List<String>
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description String
    The description of the Address Book.
    addressBookType string
    The type of the Address Book. Valid values: ip.
    instanceId string

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    addressBookName string
    The name of the Address Book.
    addressLists string[]
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description string
    The description of the Address Book.
    address_book_type str
    The type of the Address Book. Valid values: ip.
    instance_id str

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    address_book_name str
    The name of the Address Book.
    address_lists Sequence[str]
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description str
    The description of the Address Book.
    addressBookType String
    The type of the Address Book. Valid values: ip.
    instanceId String

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    addressBookName String
    The name of the Address Book.
    addressLists List<String>
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description String
    The description of the Address Book.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AddressBook resource produces the following output properties:

    AddressBookId string
    The ID of the Address Book.
    Id string
    The provider-assigned unique ID for this managed resource.
    AddressBookId string
    The ID of the Address Book.
    Id string
    The provider-assigned unique ID for this managed resource.
    address_book_id string
    The ID of the Address Book.
    id string
    The provider-assigned unique ID for this managed resource.
    addressBookId String
    The ID of the Address Book.
    id String
    The provider-assigned unique ID for this managed resource.
    addressBookId string
    The ID of the Address Book.
    id string
    The provider-assigned unique ID for this managed resource.
    address_book_id str
    The ID of the Address Book.
    id str
    The provider-assigned unique ID for this managed resource.
    addressBookId String
    The ID of the Address Book.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing AddressBook Resource

    Get an existing AddressBook 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?: AddressBookState, opts?: CustomResourceOptions): AddressBook
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            address_book_id: Optional[str] = None,
            address_book_name: Optional[str] = None,
            address_book_type: Optional[str] = None,
            address_lists: Optional[Sequence[str]] = None,
            description: Optional[str] = None,
            instance_id: Optional[str] = None) -> AddressBook
    func GetAddressBook(ctx *Context, name string, id IDInput, state *AddressBookState, opts ...ResourceOption) (*AddressBook, error)
    public static AddressBook Get(string name, Input<string> id, AddressBookState? state, CustomResourceOptions? opts = null)
    public static AddressBook get(String name, Output<String> id, AddressBookState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:wafv3:AddressBook    get:      id: ${id}
    import {
      to = alicloud_wafv3_address_book.example
      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:
    AddressBookId string
    The ID of the Address Book.
    AddressBookName string
    The name of the Address Book.
    AddressBookType string
    The type of the Address Book. Valid values: ip.
    AddressLists List<string>
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    Description string
    The description of the Address Book.
    InstanceId string

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    AddressBookId string
    The ID of the Address Book.
    AddressBookName string
    The name of the Address Book.
    AddressBookType string
    The type of the Address Book. Valid values: ip.
    AddressLists []string
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    Description string
    The description of the Address Book.
    InstanceId string

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    address_book_id string
    The ID of the Address Book.
    address_book_name string
    The name of the Address Book.
    address_book_type string
    The type of the Address Book. Valid values: ip.
    address_lists list(string)
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description string
    The description of the Address Book.
    instance_id string

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    addressBookId String
    The ID of the Address Book.
    addressBookName String
    The name of the Address Book.
    addressBookType String
    The type of the Address Book. Valid values: ip.
    addressLists List<String>
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description String
    The description of the Address Book.
    instanceId String

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    addressBookId string
    The ID of the Address Book.
    addressBookName string
    The name of the Address Book.
    addressBookType string
    The type of the Address Book. Valid values: ip.
    addressLists string[]
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description string
    The description of the Address Book.
    instanceId string

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    address_book_id str
    The ID of the Address Book.
    address_book_name str
    The name of the Address Book.
    address_book_type str
    The type of the Address Book. Valid values: ip.
    address_lists Sequence[str]
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description str
    The description of the Address Book.
    instance_id str

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    addressBookId String
    The ID of the Address Book.
    addressBookName String
    The name of the Address Book.
    addressBookType String
    The type of the Address Book. Valid values: ip.
    addressLists List<String>
    The address list of the Address Book. Each entry is a single IP address or a CIDR block, IPv4 or IPv6.
    description String
    The description of the Address Book.
    instanceId String

    The ID of the WAF instance.

    NOTE: You can call DescribeInstance to view the ID of the current WAF instance.

    Import

    WAFV3 Address Book can be imported using the id, e.g.

    $ pulumi import alicloud:wafv3/addressBook:AddressBook example <instance_id>:<address_book_id>
    

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

    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
    Viewing docs for Alibaba Cloud v3.105.0
    published on Thursday, Jul 16, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial