published on Thursday, Jul 16, 2026 by Pulumi
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:
- Address
Book stringType - 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 stringName - 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.
- Address
Book stringType - 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 stringName - The name of the Address Book.
- Address
Lists []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_ stringtype - 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_ stringname - 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.
- address
Book StringType - 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 StringName - 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.
- address
Book stringType - 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 stringName - The name of the Address Book.
- address
Lists 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_ strtype - 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_ strname - 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.
- address
Book StringType - 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 StringName - 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the AddressBook resource produces the following output properties:
- Address
Book stringId - The ID of the Address Book.
- Id string
- The provider-assigned unique ID for this managed resource.
- Address
Book stringId - The ID of the Address Book.
- Id string
- The provider-assigned unique ID for this managed resource.
- address_
book_ stringid - The ID of the Address Book.
- id string
- The provider-assigned unique ID for this managed resource.
- address
Book StringId - The ID of the Address Book.
- id String
- The provider-assigned unique ID for this managed resource.
- address
Book stringId - The ID of the Address Book.
- id string
- The provider-assigned unique ID for this managed resource.
- address_
book_ strid - The ID of the Address Book.
- id str
- The provider-assigned unique ID for this managed resource.
- address
Book StringId - 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) -> AddressBookfunc 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.
- Address
Book stringId - The ID of the Address Book.
- Address
Book stringName - The name of the Address Book.
- Address
Book stringType - 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.
- Address
Book stringId - The ID of the Address Book.
- Address
Book stringName - The name of the Address Book.
- Address
Book stringType - The type of the Address Book. Valid values:
ip. - Address
Lists []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.
- address_
book_ stringid - The ID of the Address Book.
- address_
book_ stringname - The name of the Address Book.
- address_
book_ stringtype - 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.
- address
Book StringId - The ID of the Address Book.
- address
Book StringName - The name of the Address Book.
- address
Book StringType - 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.
- address
Book stringId - The ID of the Address Book.
- address
Book stringName - The name of the Address Book.
- address
Book stringType - The type of the Address Book. Valid values:
ip. - address
Lists 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.
- address_
book_ strid - The ID of the Address Book.
- address_
book_ strname - The name of the Address Book.
- address_
book_ strtype - 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.
- address
Book StringId - The ID of the Address Book.
- address
Book StringName - The name of the Address Book.
- address
Book StringType - 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.
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
alicloudTerraform Provider.
published on Thursday, Jul 16, 2026 by Pulumi