1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dns
  5. getAddressPools
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.dns.getAddressPools

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides the Alidns Address Pools of the current Alibaba Cloud user.

    NOTE: Available in v1.152.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.dns.getAddressPools({
        instanceId: "example_value",
        ids: [
            "example_value-1",
            "example_value-2",
        ],
    });
    export const alidnsAddressPoolId1 = ids.then(ids => ids.pools?.[0]?.id);
    const nameRegex = alicloud.dns.getAddressPools({
        instanceId: "example_value",
        nameRegex: "^my-AddressPool",
    });
    export const alidnsAddressPoolId2 = nameRegex.then(nameRegex => nameRegex.pools?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.dns.get_address_pools(instance_id="example_value",
        ids=[
            "example_value-1",
            "example_value-2",
        ])
    pulumi.export("alidnsAddressPoolId1", ids.pools[0].id)
    name_regex = alicloud.dns.get_address_pools(instance_id="example_value",
        name_regex="^my-AddressPool")
    pulumi.export("alidnsAddressPoolId2", name_regex.pools[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dns"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := dns.GetAddressPools(ctx, &dns.GetAddressPoolsArgs{
    			InstanceId: "example_value",
    			Ids: []string{
    				"example_value-1",
    				"example_value-2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("alidnsAddressPoolId1", ids.Pools[0].Id)
    		nameRegex, err := dns.GetAddressPools(ctx, &dns.GetAddressPoolsArgs{
    			InstanceId: "example_value",
    			NameRegex:  pulumi.StringRef("^my-AddressPool"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("alidnsAddressPoolId2", nameRegex.Pools[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Dns.GetAddressPools.Invoke(new()
        {
            InstanceId = "example_value",
            Ids = new[]
            {
                "example_value-1",
                "example_value-2",
            },
        });
    
        var nameRegex = AliCloud.Dns.GetAddressPools.Invoke(new()
        {
            InstanceId = "example_value",
            NameRegex = "^my-AddressPool",
        });
    
        return new Dictionary<string, object?>
        {
            ["alidnsAddressPoolId1"] = ids.Apply(getAddressPoolsResult => getAddressPoolsResult.Pools[0]?.Id),
            ["alidnsAddressPoolId2"] = nameRegex.Apply(getAddressPoolsResult => getAddressPoolsResult.Pools[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.dns.DnsFunctions;
    import com.pulumi.alicloud.dns.inputs.GetAddressPoolsArgs;
    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 ids = DnsFunctions.getAddressPools(GetAddressPoolsArgs.builder()
                .instanceId("example_value")
                .ids(            
                    "example_value-1",
                    "example_value-2")
                .build());
    
            ctx.export("alidnsAddressPoolId1", ids.applyValue(getAddressPoolsResult -> getAddressPoolsResult.pools()[0].id()));
            final var nameRegex = DnsFunctions.getAddressPools(GetAddressPoolsArgs.builder()
                .instanceId("example_value")
                .nameRegex("^my-AddressPool")
                .build());
    
            ctx.export("alidnsAddressPoolId2", nameRegex.applyValue(getAddressPoolsResult -> getAddressPoolsResult.pools()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:dns:getAddressPools
          Arguments:
            instanceId: example_value
            ids:
              - example_value-1
              - example_value-2
      nameRegex:
        fn::invoke:
          Function: alicloud:dns:getAddressPools
          Arguments:
            instanceId: example_value
            nameRegex: ^my-AddressPool
    outputs:
      alidnsAddressPoolId1: ${ids.pools[0].id}
      alidnsAddressPoolId2: ${nameRegex.pools[0].id}
    

    Using getAddressPools

    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 getAddressPools(args: GetAddressPoolsArgs, opts?: InvokeOptions): Promise<GetAddressPoolsResult>
    function getAddressPoolsOutput(args: GetAddressPoolsOutputArgs, opts?: InvokeOptions): Output<GetAddressPoolsResult>
    def get_address_pools(enable_details: Optional[bool] = None,
                          ids: Optional[Sequence[str]] = None,
                          instance_id: Optional[str] = None,
                          name_regex: Optional[str] = None,
                          output_file: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetAddressPoolsResult
    def get_address_pools_output(enable_details: Optional[pulumi.Input[bool]] = None,
                          ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          instance_id: Optional[pulumi.Input[str]] = None,
                          name_regex: Optional[pulumi.Input[str]] = None,
                          output_file: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetAddressPoolsResult]
    func GetAddressPools(ctx *Context, args *GetAddressPoolsArgs, opts ...InvokeOption) (*GetAddressPoolsResult, error)
    func GetAddressPoolsOutput(ctx *Context, args *GetAddressPoolsOutputArgs, opts ...InvokeOption) GetAddressPoolsResultOutput

    > Note: This function is named GetAddressPools in the Go SDK.

    public static class GetAddressPools 
    {
        public static Task<GetAddressPoolsResult> InvokeAsync(GetAddressPoolsArgs args, InvokeOptions? opts = null)
        public static Output<GetAddressPoolsResult> Invoke(GetAddressPoolsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAddressPoolsResult> getAddressPools(GetAddressPoolsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:dns/getAddressPools:getAddressPools
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The id of the instance.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of Address Pool IDs.
    NameRegex string
    A regex string to filter results by Address Pool name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    InstanceId string
    The id of the instance.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of Address Pool IDs.
    NameRegex string
    A regex string to filter results by Address Pool name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    instanceId String
    The id of the instance.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Address Pool IDs.
    nameRegex String
    A regex string to filter results by Address Pool name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    instanceId string
    The id of the instance.
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of Address Pool IDs.
    nameRegex string
    A regex string to filter results by Address Pool name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    instance_id str
    The id of the instance.
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of Address Pool IDs.
    name_regex str
    A regex string to filter results by Address Pool name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    instanceId String
    The id of the instance.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Address Pool IDs.
    nameRegex String
    A regex string to filter results by Address Pool name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getAddressPools Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    InstanceId string
    Names List<string>
    Pools List<Pulumi.AliCloud.Dns.Outputs.GetAddressPoolsPool>
    EnableDetails bool
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    InstanceId string
    Names []string
    Pools []GetAddressPoolsPool
    EnableDetails bool
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    names List<String>
    pools List<GetAddressPoolsPool>
    enableDetails Boolean
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instanceId string
    names string[]
    pools GetAddressPoolsPool[]
    enableDetails boolean
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instance_id str
    names Sequence[str]
    pools Sequence[GetAddressPoolsPool]
    enable_details bool
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    names List<String>
    pools List<Property Map>
    enableDetails Boolean
    nameRegex String
    outputFile String

    Supporting Types

    GetAddressPoolsPool

    AddressPoolId string
    The first ID of the resource.
    AddressPoolName string
    The name of the address pool.
    Addresses List<Pulumi.AliCloud.Dns.Inputs.GetAddressPoolsPoolAddress>
    The address lists of the Address Pool.
    CreateTime string
    The time when the address pool was created.
    CreateTimestamp string
    The timestamp that indicates when the address pool was created.
    Id string
    The ID of the Address Pool.
    InstanceId string
    The id of the instance.
    LbaStrategy string
    The load balancing policy of the address pool.
    MonitorConfigId string
    The ID of the health check task.
    MonitorStatus string
    Indicates whether health checks are configured.
    Type string
    The type of the address pool.
    UpdateTime string
    The time when the address pool was updated.
    UpdateTimestamp string
    The timestamp that indicates when the address pool was updated.
    AddressPoolId string
    The first ID of the resource.
    AddressPoolName string
    The name of the address pool.
    Addresses []GetAddressPoolsPoolAddress
    The address lists of the Address Pool.
    CreateTime string
    The time when the address pool was created.
    CreateTimestamp string
    The timestamp that indicates when the address pool was created.
    Id string
    The ID of the Address Pool.
    InstanceId string
    The id of the instance.
    LbaStrategy string
    The load balancing policy of the address pool.
    MonitorConfigId string
    The ID of the health check task.
    MonitorStatus string
    Indicates whether health checks are configured.
    Type string
    The type of the address pool.
    UpdateTime string
    The time when the address pool was updated.
    UpdateTimestamp string
    The timestamp that indicates when the address pool was updated.
    addressPoolId String
    The first ID of the resource.
    addressPoolName String
    The name of the address pool.
    addresses List<GetAddressPoolsPoolAddress>
    The address lists of the Address Pool.
    createTime String
    The time when the address pool was created.
    createTimestamp String
    The timestamp that indicates when the address pool was created.
    id String
    The ID of the Address Pool.
    instanceId String
    The id of the instance.
    lbaStrategy String
    The load balancing policy of the address pool.
    monitorConfigId String
    The ID of the health check task.
    monitorStatus String
    Indicates whether health checks are configured.
    type String
    The type of the address pool.
    updateTime String
    The time when the address pool was updated.
    updateTimestamp String
    The timestamp that indicates when the address pool was updated.
    addressPoolId string
    The first ID of the resource.
    addressPoolName string
    The name of the address pool.
    addresses GetAddressPoolsPoolAddress[]
    The address lists of the Address Pool.
    createTime string
    The time when the address pool was created.
    createTimestamp string
    The timestamp that indicates when the address pool was created.
    id string
    The ID of the Address Pool.
    instanceId string
    The id of the instance.
    lbaStrategy string
    The load balancing policy of the address pool.
    monitorConfigId string
    The ID of the health check task.
    monitorStatus string
    Indicates whether health checks are configured.
    type string
    The type of the address pool.
    updateTime string
    The time when the address pool was updated.
    updateTimestamp string
    The timestamp that indicates when the address pool was updated.
    address_pool_id str
    The first ID of the resource.
    address_pool_name str
    The name of the address pool.
    addresses Sequence[GetAddressPoolsPoolAddress]
    The address lists of the Address Pool.
    create_time str
    The time when the address pool was created.
    create_timestamp str
    The timestamp that indicates when the address pool was created.
    id str
    The ID of the Address Pool.
    instance_id str
    The id of the instance.
    lba_strategy str
    The load balancing policy of the address pool.
    monitor_config_id str
    The ID of the health check task.
    monitor_status str
    Indicates whether health checks are configured.
    type str
    The type of the address pool.
    update_time str
    The time when the address pool was updated.
    update_timestamp str
    The timestamp that indicates when the address pool was updated.
    addressPoolId String
    The first ID of the resource.
    addressPoolName String
    The name of the address pool.
    addresses List<Property Map>
    The address lists of the Address Pool.
    createTime String
    The time when the address pool was created.
    createTimestamp String
    The timestamp that indicates when the address pool was created.
    id String
    The ID of the Address Pool.
    instanceId String
    The id of the instance.
    lbaStrategy String
    The load balancing policy of the address pool.
    monitorConfigId String
    The ID of the health check task.
    monitorStatus String
    Indicates whether health checks are configured.
    type String
    The type of the address pool.
    updateTime String
    The time when the address pool was updated.
    updateTimestamp String
    The timestamp that indicates when the address pool was updated.

    GetAddressPoolsPoolAddress

    Address string
    The address that you want to add to the address pool.
    AttributeInfo string
    The source region of the address.
    LbaWeight int
    The weight of the address.
    Mode string
    The type of the address.
    Remark string
    The description of the address.
    Address string
    The address that you want to add to the address pool.
    AttributeInfo string
    The source region of the address.
    LbaWeight int
    The weight of the address.
    Mode string
    The type of the address.
    Remark string
    The description of the address.
    address String
    The address that you want to add to the address pool.
    attributeInfo String
    The source region of the address.
    lbaWeight Integer
    The weight of the address.
    mode String
    The type of the address.
    remark String
    The description of the address.
    address string
    The address that you want to add to the address pool.
    attributeInfo string
    The source region of the address.
    lbaWeight number
    The weight of the address.
    mode string
    The type of the address.
    remark string
    The description of the address.
    address str
    The address that you want to add to the address pool.
    attribute_info str
    The source region of the address.
    lba_weight int
    The weight of the address.
    mode str
    The type of the address.
    remark str
    The description of the address.
    address String
    The address that you want to add to the address pool.
    attributeInfo String
    The source region of the address.
    lbaWeight Number
    The weight of the address.
    mode String
    The type of the address.
    remark String
    The description of the address.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi