alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.vpc.getPublicIpAddressPools

This data source provides the Vpc Public Ip Address Pools of the current Alibaba Cloud user.

NOTE: Available in v1.186.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.Vpc.GetPublicIpAddressPools.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
    });

    var nameRegex = AliCloud.Vpc.GetPublicIpAddressPools.Invoke(new()
    {
        NameRegex = "example_name",
    });

    return new Dictionary<string, object?>
    {
        ["vpcPublicIpAddressPoolId1"] = ids.Apply(getPublicIpAddressPoolsResult => getPublicIpAddressPoolsResult.Pools[0]?.Id),
        ["vpcPublicIpAddressPoolId2"] = nameRegex.Apply(getPublicIpAddressPoolsResult => getPublicIpAddressPoolsResult.Pools[0]?.Id),
    };
});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := vpc.GetPublicIpAddressPools(ctx, &vpc.GetPublicIpAddressPoolsArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("vpcPublicIpAddressPoolId1", ids.Pools[0].Id)
		nameRegex, err := vpc.GetPublicIpAddressPools(ctx, &vpc.GetPublicIpAddressPoolsArgs{
			NameRegex: pulumi.StringRef("example_name"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("vpcPublicIpAddressPoolId2", nameRegex.Pools[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetPublicIpAddressPoolsArgs;
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 = VpcFunctions.getPublicIpAddressPools(GetPublicIpAddressPoolsArgs.builder()
            .ids("example_id")
            .build());

        ctx.export("vpcPublicIpAddressPoolId1", ids.applyValue(getPublicIpAddressPoolsResult -> getPublicIpAddressPoolsResult.pools()[0].id()));
        final var nameRegex = VpcFunctions.getPublicIpAddressPools(GetPublicIpAddressPoolsArgs.builder()
            .nameRegex("example_name")
            .build());

        ctx.export("vpcPublicIpAddressPoolId2", nameRegex.applyValue(getPublicIpAddressPoolsResult -> getPublicIpAddressPoolsResult.pools()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.vpc.get_public_ip_address_pools(ids=["example_id"])
pulumi.export("vpcPublicIpAddressPoolId1", ids.pools[0].id)
name_regex = alicloud.vpc.get_public_ip_address_pools(name_regex="example_name")
pulumi.export("vpcPublicIpAddressPoolId2", name_regex.pools[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.vpc.getPublicIpAddressPools({
    ids: ["example_id"],
});
export const vpcPublicIpAddressPoolId1 = ids.then(ids => ids.pools?.[0]?.id);
const nameRegex = alicloud.vpc.getPublicIpAddressPools({
    nameRegex: "example_name",
});
export const vpcPublicIpAddressPoolId2 = nameRegex.then(nameRegex => nameRegex.pools?.[0]?.id);
variables:
  ids:
    fn::invoke:
      Function: alicloud:vpc:getPublicIpAddressPools
      Arguments:
        ids:
          - example_id
  nameRegex:
    fn::invoke:
      Function: alicloud:vpc:getPublicIpAddressPools
      Arguments:
        nameRegex: example_name
outputs:
  vpcPublicIpAddressPoolId1: ${ids.pools[0].id}
  vpcPublicIpAddressPoolId2: ${nameRegex.pools[0].id}

Using getPublicIpAddressPools

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 getPublicIpAddressPools(args: GetPublicIpAddressPoolsArgs, opts?: InvokeOptions): Promise<GetPublicIpAddressPoolsResult>
function getPublicIpAddressPoolsOutput(args: GetPublicIpAddressPoolsOutputArgs, opts?: InvokeOptions): Output<GetPublicIpAddressPoolsResult>
def get_public_ip_address_pools(ids: Optional[Sequence[str]] = None,
                                isp: Optional[str] = None,
                                name_regex: Optional[str] = None,
                                output_file: Optional[str] = None,
                                public_ip_address_pool_ids: Optional[Sequence[str]] = None,
                                public_ip_address_pool_name: Optional[str] = None,
                                status: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetPublicIpAddressPoolsResult
def get_public_ip_address_pools_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                isp: Optional[pulumi.Input[str]] = None,
                                name_regex: Optional[pulumi.Input[str]] = None,
                                output_file: Optional[pulumi.Input[str]] = None,
                                public_ip_address_pool_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                public_ip_address_pool_name: Optional[pulumi.Input[str]] = None,
                                status: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetPublicIpAddressPoolsResult]
func GetPublicIpAddressPools(ctx *Context, args *GetPublicIpAddressPoolsArgs, opts ...InvokeOption) (*GetPublicIpAddressPoolsResult, error)
func GetPublicIpAddressPoolsOutput(ctx *Context, args *GetPublicIpAddressPoolsOutputArgs, opts ...InvokeOption) GetPublicIpAddressPoolsResultOutput

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

public static class GetPublicIpAddressPools 
{
    public static Task<GetPublicIpAddressPoolsResult> InvokeAsync(GetPublicIpAddressPoolsArgs args, InvokeOptions? opts = null)
    public static Output<GetPublicIpAddressPoolsResult> Invoke(GetPublicIpAddressPoolsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPublicIpAddressPoolsResult> getPublicIpAddressPools(GetPublicIpAddressPoolsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:vpc/getPublicIpAddressPools:getPublicIpAddressPools
  arguments:
    # arguments dictionary

The following arguments are supported:

Ids List<string>

A list of Vpc Public Ip Address Pool IDs.

Isp string

The Internet service provider.

NameRegex string

A regex string to filter results by Vpc Public Ip Address Pool name.

OutputFile string
PublicIpAddressPoolIds List<string>

The IDs of the Vpc Public IP address pools.

PublicIpAddressPoolName string

The name of the Vpc Public Ip Address Pool.

Status string

The status of the Vpc Public Ip Address Pool.

Ids []string

A list of Vpc Public Ip Address Pool IDs.

Isp string

The Internet service provider.

NameRegex string

A regex string to filter results by Vpc Public Ip Address Pool name.

OutputFile string
PublicIpAddressPoolIds []string

The IDs of the Vpc Public IP address pools.

PublicIpAddressPoolName string

The name of the Vpc Public Ip Address Pool.

Status string

The status of the Vpc Public Ip Address Pool.

ids List<String>

A list of Vpc Public Ip Address Pool IDs.

isp String

The Internet service provider.

nameRegex String

A regex string to filter results by Vpc Public Ip Address Pool name.

outputFile String
publicIpAddressPoolIds List<String>

The IDs of the Vpc Public IP address pools.

publicIpAddressPoolName String

The name of the Vpc Public Ip Address Pool.

status String

The status of the Vpc Public Ip Address Pool.

ids string[]

A list of Vpc Public Ip Address Pool IDs.

isp string

The Internet service provider.

nameRegex string

A regex string to filter results by Vpc Public Ip Address Pool name.

outputFile string
publicIpAddressPoolIds string[]

The IDs of the Vpc Public IP address pools.

publicIpAddressPoolName string

The name of the Vpc Public Ip Address Pool.

status string

The status of the Vpc Public Ip Address Pool.

ids Sequence[str]

A list of Vpc Public Ip Address Pool IDs.

isp str

The Internet service provider.

name_regex str

A regex string to filter results by Vpc Public Ip Address Pool name.

output_file str
public_ip_address_pool_ids Sequence[str]

The IDs of the Vpc Public IP address pools.

public_ip_address_pool_name str

The name of the Vpc Public Ip Address Pool.

status str

The status of the Vpc Public Ip Address Pool.

ids List<String>

A list of Vpc Public Ip Address Pool IDs.

isp String

The Internet service provider.

nameRegex String

A regex string to filter results by Vpc Public Ip Address Pool name.

outputFile String
publicIpAddressPoolIds List<String>

The IDs of the Vpc Public IP address pools.

publicIpAddressPoolName String

The name of the Vpc Public Ip Address Pool.

status String

The status of the Vpc Public Ip Address Pool.

getPublicIpAddressPools Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Names List<string>
Pools List<Pulumi.AliCloud.Vpc.Outputs.GetPublicIpAddressPoolsPool>
Isp string
NameRegex string
OutputFile string
PublicIpAddressPoolIds List<string>
PublicIpAddressPoolName string
Status string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Names []string
Pools []GetPublicIpAddressPoolsPool
Isp string
NameRegex string
OutputFile string
PublicIpAddressPoolIds []string
PublicIpAddressPoolName string
Status string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
pools List<GetPublicIpAddressPoolsPool>
isp String
nameRegex String
outputFile String
publicIpAddressPoolIds List<String>
publicIpAddressPoolName String
status String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
names string[]
pools GetPublicIpAddressPoolsPool[]
isp string
nameRegex string
outputFile string
publicIpAddressPoolIds string[]
publicIpAddressPoolName string
status string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
names Sequence[str]
pools Sequence[GetPublicIpAddressPoolsPool]
isp str
name_regex str
output_file str
public_ip_address_pool_ids Sequence[str]
public_ip_address_pool_name str
status str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
pools List<Property Map>
isp String
nameRegex String
outputFile String
publicIpAddressPoolIds List<String>
publicIpAddressPoolName String
status String

Supporting Types

GetPublicIpAddressPoolsPool

CreateTime string

The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.

Description string

The description of the Vpc Public Ip Address Pool.

Id string

The ID of the Vpc Public Ip Address Pool.

IpAddressRemaining bool

Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.

Isp string

The Internet service provider.

PublicIpAddressPoolId string

The ID of the Vpc Public Ip Address Pool.

PublicIpAddressPoolName string

The name of the Vpc Public Ip Address Pool.

RegionId string

The region ID of the Vpc Public Ip Address Pool.

Status string

The status of the Vpc Public Ip Address Pool.

TotalIpNum int

The total number of IP addresses in the Vpc Public Ip Address Pool.

UsedIpNum int

The number of occupied IP addresses in the Vpc Public Ip Address Pool.

UserType string

The user type.

CreateTime string

The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.

Description string

The description of the Vpc Public Ip Address Pool.

Id string

The ID of the Vpc Public Ip Address Pool.

IpAddressRemaining bool

Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.

Isp string

The Internet service provider.

PublicIpAddressPoolId string

The ID of the Vpc Public Ip Address Pool.

PublicIpAddressPoolName string

The name of the Vpc Public Ip Address Pool.

RegionId string

The region ID of the Vpc Public Ip Address Pool.

Status string

The status of the Vpc Public Ip Address Pool.

TotalIpNum int

The total number of IP addresses in the Vpc Public Ip Address Pool.

UsedIpNum int

The number of occupied IP addresses in the Vpc Public Ip Address Pool.

UserType string

The user type.

createTime String

The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.

description String

The description of the Vpc Public Ip Address Pool.

id String

The ID of the Vpc Public Ip Address Pool.

ipAddressRemaining Boolean

Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.

isp String

The Internet service provider.

publicIpAddressPoolId String

The ID of the Vpc Public Ip Address Pool.

publicIpAddressPoolName String

The name of the Vpc Public Ip Address Pool.

regionId String

The region ID of the Vpc Public Ip Address Pool.

status String

The status of the Vpc Public Ip Address Pool.

totalIpNum Integer

The total number of IP addresses in the Vpc Public Ip Address Pool.

usedIpNum Integer

The number of occupied IP addresses in the Vpc Public Ip Address Pool.

userType String

The user type.

createTime string

The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.

description string

The description of the Vpc Public Ip Address Pool.

id string

The ID of the Vpc Public Ip Address Pool.

ipAddressRemaining boolean

Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.

isp string

The Internet service provider.

publicIpAddressPoolId string

The ID of the Vpc Public Ip Address Pool.

publicIpAddressPoolName string

The name of the Vpc Public Ip Address Pool.

regionId string

The region ID of the Vpc Public Ip Address Pool.

status string

The status of the Vpc Public Ip Address Pool.

totalIpNum number

The total number of IP addresses in the Vpc Public Ip Address Pool.

usedIpNum number

The number of occupied IP addresses in the Vpc Public Ip Address Pool.

userType string

The user type.

create_time str

The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.

description str

The description of the Vpc Public Ip Address Pool.

id str

The ID of the Vpc Public Ip Address Pool.

ip_address_remaining bool

Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.

isp str

The Internet service provider.

public_ip_address_pool_id str

The ID of the Vpc Public Ip Address Pool.

public_ip_address_pool_name str

The name of the Vpc Public Ip Address Pool.

region_id str

The region ID of the Vpc Public Ip Address Pool.

status str

The status of the Vpc Public Ip Address Pool.

total_ip_num int

The total number of IP addresses in the Vpc Public Ip Address Pool.

used_ip_num int

The number of occupied IP addresses in the Vpc Public Ip Address Pool.

user_type str

The user type.

createTime String

The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.

description String

The description of the Vpc Public Ip Address Pool.

id String

The ID of the Vpc Public Ip Address Pool.

ipAddressRemaining Boolean

Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.

isp String

The Internet service provider.

publicIpAddressPoolId String

The ID of the Vpc Public Ip Address Pool.

publicIpAddressPoolName String

The name of the Vpc Public Ip Address Pool.

regionId String

The region ID of the Vpc Public Ip Address Pool.

status String

The status of the Vpc Public Ip Address Pool.

totalIpNum Number

The total number of IP addresses in the Vpc Public Ip Address Pool.

usedIpNum Number

The number of occupied IP addresses in the Vpc Public Ip Address Pool.

userType String

The user type.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.