Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.cloudfirewall.getAddressBooks
Explore with Pulumi AI
This data source provides the Cloud Firewall Address Books of the current Alibaba Cloud user.
NOTE: Available since v1.178.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") || "tf-example";
const _default = new alicloud.cloudfirewall.AddressBook("default", {
groupName: name,
groupType: "ip",
description: "tf-description",
autoAddTagEcs: 0,
addressLists: [
"10.21.0.0/16",
"10.168.0.0/16",
],
});
const ids = alicloud.cloudfirewall.getAddressBooksOutput({
ids: [_default.id],
});
export const cloudFirewallAddressBookId1 = ids.apply(ids => ids.books?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default = alicloud.cloudfirewall.AddressBook("default",
group_name=name,
group_type="ip",
description="tf-description",
auto_add_tag_ecs=0,
address_lists=[
"10.21.0.0/16",
"10.168.0.0/16",
])
ids = alicloud.cloudfirewall.get_address_books_output(ids=[default.id])
pulumi.export("cloudFirewallAddressBookId1", ids.books[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudfirewall"
"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 := cloudfirewall.NewAddressBook(ctx, "default", &cloudfirewall.AddressBookArgs{
GroupName: pulumi.String(name),
GroupType: pulumi.String("ip"),
Description: pulumi.String("tf-description"),
AutoAddTagEcs: pulumi.Int(0),
AddressLists: pulumi.StringArray{
pulumi.String("10.21.0.0/16"),
pulumi.String("10.168.0.0/16"),
},
})
if err != nil {
return err
}
ids := cloudfirewall.GetAddressBooksOutput(ctx, cloudfirewall.GetAddressBooksOutputArgs{
Ids: pulumi.StringArray{
_default.ID(),
},
}, nil)
ctx.Export("cloudFirewallAddressBookId1", ids.ApplyT(func(ids cloudfirewall.GetAddressBooksResult) (*string, error) {
return &ids.Books[0].Id, nil
}).(pulumi.StringPtrOutput))
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") ?? "tf-example";
var @default = new AliCloud.CloudFirewall.AddressBook("default", new()
{
GroupName = name,
GroupType = "ip",
Description = "tf-description",
AutoAddTagEcs = 0,
AddressLists = new[]
{
"10.21.0.0/16",
"10.168.0.0/16",
},
});
var ids = AliCloud.CloudFirewall.GetAddressBooks.Invoke(new()
{
Ids = new[]
{
@default.Id,
},
});
return new Dictionary<string, object?>
{
["cloudFirewallAddressBookId1"] = ids.Apply(getAddressBooksResult => getAddressBooksResult.Books[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cloudfirewall.AddressBook;
import com.pulumi.alicloud.cloudfirewall.AddressBookArgs;
import com.pulumi.alicloud.cloudfirewall.CloudfirewallFunctions;
import com.pulumi.alicloud.cloudfirewall.inputs.GetAddressBooksArgs;
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 default_ = new AddressBook("default", AddressBookArgs.builder()
.groupName(name)
.groupType("ip")
.description("tf-description")
.autoAddTagEcs(0)
.addressLists(
"10.21.0.0/16",
"10.168.0.0/16")
.build());
final var ids = CloudfirewallFunctions.getAddressBooks(GetAddressBooksArgs.builder()
.ids(default_.id())
.build());
ctx.export("cloudFirewallAddressBookId1", ids.applyValue(getAddressBooksResult -> getAddressBooksResult).applyValue(ids -> ids.applyValue(getAddressBooksResult -> getAddressBooksResult.books()[0].id())));
}
}
configuration:
name:
type: string
default: tf-example
resources:
default:
type: alicloud:cloudfirewall:AddressBook
properties:
groupName: ${name}
groupType: ip
description: tf-description
autoAddTagEcs: 0
addressLists:
- 10.21.0.0/16
- 10.168.0.0/16
variables:
ids:
fn::invoke:
Function: alicloud:cloudfirewall:getAddressBooks
Arguments:
ids:
- ${default.id}
outputs:
cloudFirewallAddressBookId1: ${ids.books[0].id}
Using getAddressBooks
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 getAddressBooks(args: GetAddressBooksArgs, opts?: InvokeOptions): Promise<GetAddressBooksResult>
function getAddressBooksOutput(args: GetAddressBooksOutputArgs, opts?: InvokeOptions): Output<GetAddressBooksResult>
def get_address_books(group_type: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAddressBooksResult
def get_address_books_output(group_type: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAddressBooksResult]
func GetAddressBooks(ctx *Context, args *GetAddressBooksArgs, opts ...InvokeOption) (*GetAddressBooksResult, error)
func GetAddressBooksOutput(ctx *Context, args *GetAddressBooksOutputArgs, opts ...InvokeOption) GetAddressBooksResultOutput
> Note: This function is named GetAddressBooks
in the Go SDK.
public static class GetAddressBooks
{
public static Task<GetAddressBooksResult> InvokeAsync(GetAddressBooksArgs args, InvokeOptions? opts = null)
public static Output<GetAddressBooksResult> Invoke(GetAddressBooksInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAddressBooksResult> getAddressBooks(GetAddressBooksArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:cloudfirewall/getAddressBooks:getAddressBooks
arguments:
# arguments dictionary
The following arguments are supported:
- Group
Type string - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - Ids List<string>
- A list of Address Book IDs.
- Name
Regex string - A regex string to filter results Address Book name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Group
Type string - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - Ids []string
- A list of Address Book IDs.
- Name
Regex string - A regex string to filter results Address Book name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- group
Type String - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - ids List<String>
- A list of Address Book IDs.
- name
Regex String - A regex string to filter results Address Book name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- group
Type string - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - ids string[]
- A list of Address Book IDs.
- name
Regex string - A regex string to filter results Address Book name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- group_
type str - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - ids Sequence[str]
- A list of Address Book IDs.
- name_
regex str - A regex string to filter results Address Book name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- group
Type String - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - ids List<String>
- A list of Address Book IDs.
- name
Regex String - A regex string to filter results Address Book name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getAddressBooks Result
The following output properties are available:
- Books
List<Pulumi.
Ali Cloud. Cloud Firewall. Outputs. Get Address Books Book> - A list of Cloud Firewall Address Books. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- A list of Address Book names.
- Group
Type string - The type of the Address Book.
- Name
Regex string - Output
File string
- Books
[]Get
Address Books Book - A list of Cloud Firewall Address Books. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- A list of Address Book names.
- Group
Type string - The type of the Address Book.
- Name
Regex string - Output
File string
- books
List<Get
Address Books Book> - A list of Cloud Firewall Address Books. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Address Book names.
- group
Type String - The type of the Address Book.
- name
Regex String - output
File String
- books
Get
Address Books Book[] - A list of Cloud Firewall Address Books. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- A list of Address Book names.
- group
Type string - The type of the Address Book.
- name
Regex string - output
File string
- books
Sequence[Get
Address Books Book] - A list of Cloud Firewall Address Books. Each element contains the following attributes:
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- A list of Address Book names.
- group_
type str - The type of the Address Book.
- name_
regex str - output_
file str
- books List<Property Map>
- A list of Cloud Firewall Address Books. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Address Book names.
- group
Type String - The type of the Address Book.
- name
Regex String - output
File String
Supporting Types
GetAddressBooksBook
- Address
Lists List<string> - The addresses in the Address Book.
- Auto
Add intTag Ecs - Whether you want to automatically add new matching tags of the ECS IP address to the Address Book.
- Description string
- The description of the Address Book.
- List<Pulumi.
Ali Cloud. Cloud Firewall. Inputs. Get Address Books Book Ecs Tag> - The logical relation among the ECS tags that to be matchedh.
- Group
Name string - The name of the Address Book.
- Group
Type string - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - Group
Uuid string - The ID of the Address Book.
- Id string
- The ID of the Address Book.
- Tag
Relation string - One or more tags for the relationship between.
- Address
Lists []string - The addresses in the Address Book.
- Auto
Add intTag Ecs - Whether you want to automatically add new matching tags of the ECS IP address to the Address Book.
- Description string
- The description of the Address Book.
- []Get
Address Books Book Ecs Tag - The logical relation among the ECS tags that to be matchedh.
- Group
Name string - The name of the Address Book.
- Group
Type string - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - Group
Uuid string - The ID of the Address Book.
- Id string
- The ID of the Address Book.
- Tag
Relation string - One or more tags for the relationship between.
- address
Lists List<String> - The addresses in the Address Book.
- auto
Add IntegerTag Ecs - Whether you want to automatically add new matching tags of the ECS IP address to the Address Book.
- description String
- The description of the Address Book.
- List<Get
Address Books Book Ecs Tag> - The logical relation among the ECS tags that to be matchedh.
- group
Name String - The name of the Address Book.
- group
Type String - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - group
Uuid String - The ID of the Address Book.
- id String
- The ID of the Address Book.
- tag
Relation String - One or more tags for the relationship between.
- address
Lists string[] - The addresses in the Address Book.
- auto
Add numberTag Ecs - Whether you want to automatically add new matching tags of the ECS IP address to the Address Book.
- description string
- The description of the Address Book.
- Get
Address Books Book Ecs Tag[] - The logical relation among the ECS tags that to be matchedh.
- group
Name string - The name of the Address Book.
- group
Type string - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - group
Uuid string - The ID of the Address Book.
- id string
- The ID of the Address Book.
- tag
Relation string - One or more tags for the relationship between.
- address_
lists Sequence[str] - The addresses in the Address Book.
- auto_
add_ inttag_ ecs - Whether you want to automatically add new matching tags of the ECS IP address to the Address Book.
- description str
- The description of the Address Book.
- Sequence[Get
Address Books Book Ecs Tag] - The logical relation among the ECS tags that to be matchedh.
- group_
name str - The name of the Address Book.
- group_
type str - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - group_
uuid str - The ID of the Address Book.
- id str
- The ID of the Address Book.
- tag_
relation str - One or more tags for the relationship between.
- address
Lists List<String> - The addresses in the Address Book.
- auto
Add NumberTag Ecs - Whether you want to automatically add new matching tags of the ECS IP address to the Address Book.
- description String
- The description of the Address Book.
- List<Property Map>
- The logical relation among the ECS tags that to be matchedh.
- group
Name String - The name of the Address Book.
- group
Type String - The type of the Address Book. Valid values:
ip
,ipv6
,domain
,port
,tag
. NOTE: From version 1.213.1,group_type
can be set toipv6
,domain
,port
. - group
Uuid String - The ID of the Address Book.
- id String
- The ID of the Address Book.
- tag
Relation String - One or more tags for the relationship between.
GetAddressBooksBookEcsTag
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.