1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpc
  5. getPublicIpAddressPools
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.vpc.getPublicIpAddressPools

Explore with Pulumi AI

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

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);
Copy
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)
Copy
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
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
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),
    };
});
Copy
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()));
    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetPublicIpAddressPools(ctx *Context, args *GetPublicIpAddressPoolsArgs, opts ...InvokeOption) (*GetPublicIpAddressPoolsResult, error)
func GetPublicIpAddressPoolsOutput(ctx *Context, args *GetPublicIpAddressPoolsOutputArgs, opts ...InvokeOption) GetPublicIpAddressPoolsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetPublicIpAddressPoolsResult> getPublicIpAddressPools(GetPublicIpAddressPoolsArgs args, InvokeOptions options)
public static Output<GetPublicIpAddressPoolsResult> getPublicIpAddressPools(GetPublicIpAddressPoolsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:vpc/getPublicIpAddressPools:getPublicIpAddressPools
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Vpc Public Ip Address Pool IDs.
Isp Changes to this property will trigger replacement. string
The Internet service provider. Valid values: BGP, BGP_PRO, ChinaTelecom, ChinaUnicom, ChinaMobile, ChinaTelecom_L2, ChinaUnicom_L2, ChinaMobile_L2, BGP_FinanceCloud.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Vpc Public Ip Address Pool name.
OutputFile string
File name where to save data source results (after running pulumi preview).
PublicIpAddressPoolIds Changes to this property will trigger replacement. List<string>
The IDs of the Vpc Public IP address pools.
PublicIpAddressPoolName Changes to this property will trigger replacement. string
The name of the VPC Public IP address pool.
Status Changes to this property will trigger replacement. string
The status of the Vpc Public Ip Address Pool. Valid values: Created, Deleting, Modifying.
Ids Changes to this property will trigger replacement. []string
A list of Vpc Public Ip Address Pool IDs.
Isp Changes to this property will trigger replacement. string
The Internet service provider. Valid values: BGP, BGP_PRO, ChinaTelecom, ChinaUnicom, ChinaMobile, ChinaTelecom_L2, ChinaUnicom_L2, ChinaMobile_L2, BGP_FinanceCloud.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Vpc Public Ip Address Pool name.
OutputFile string
File name where to save data source results (after running pulumi preview).
PublicIpAddressPoolIds Changes to this property will trigger replacement. []string
The IDs of the Vpc Public IP address pools.
PublicIpAddressPoolName Changes to this property will trigger replacement. string
The name of the VPC Public IP address pool.
Status Changes to this property will trigger replacement. string
The status of the Vpc Public Ip Address Pool. Valid values: Created, Deleting, Modifying.
ids Changes to this property will trigger replacement. List<String>
A list of Vpc Public Ip Address Pool IDs.
isp Changes to this property will trigger replacement. String
The Internet service provider. Valid values: BGP, BGP_PRO, ChinaTelecom, ChinaUnicom, ChinaMobile, ChinaTelecom_L2, ChinaUnicom_L2, ChinaMobile_L2, BGP_FinanceCloud.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Vpc Public Ip Address Pool name.
outputFile String
File name where to save data source results (after running pulumi preview).
publicIpAddressPoolIds Changes to this property will trigger replacement. List<String>
The IDs of the Vpc Public IP address pools.
publicIpAddressPoolName Changes to this property will trigger replacement. String
The name of the VPC Public IP address pool.
status Changes to this property will trigger replacement. String
The status of the Vpc Public Ip Address Pool. Valid values: Created, Deleting, Modifying.
ids Changes to this property will trigger replacement. string[]
A list of Vpc Public Ip Address Pool IDs.
isp Changes to this property will trigger replacement. string
The Internet service provider. Valid values: BGP, BGP_PRO, ChinaTelecom, ChinaUnicom, ChinaMobile, ChinaTelecom_L2, ChinaUnicom_L2, ChinaMobile_L2, BGP_FinanceCloud.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Vpc Public Ip Address Pool name.
outputFile string
File name where to save data source results (after running pulumi preview).
publicIpAddressPoolIds Changes to this property will trigger replacement. string[]
The IDs of the Vpc Public IP address pools.
publicIpAddressPoolName Changes to this property will trigger replacement. string
The name of the VPC Public IP address pool.
status Changes to this property will trigger replacement. string
The status of the Vpc Public Ip Address Pool. Valid values: Created, Deleting, Modifying.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Vpc Public Ip Address Pool IDs.
isp Changes to this property will trigger replacement. str
The Internet service provider. Valid values: BGP, BGP_PRO, ChinaTelecom, ChinaUnicom, ChinaMobile, ChinaTelecom_L2, ChinaUnicom_L2, ChinaMobile_L2, BGP_FinanceCloud.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Vpc Public Ip Address Pool name.
output_file str
File name where to save data source results (after running pulumi preview).
public_ip_address_pool_ids Changes to this property will trigger replacement. Sequence[str]
The IDs of the Vpc Public IP address pools.
public_ip_address_pool_name Changes to this property will trigger replacement. str
The name of the VPC Public IP address pool.
status Changes to this property will trigger replacement. str
The status of the Vpc Public Ip Address Pool. Valid values: Created, Deleting, Modifying.
ids Changes to this property will trigger replacement. List<String>
A list of Vpc Public Ip Address Pool IDs.
isp Changes to this property will trigger replacement. String
The Internet service provider. Valid values: BGP, BGP_PRO, ChinaTelecom, ChinaUnicom, ChinaMobile, ChinaTelecom_L2, ChinaUnicom_L2, ChinaMobile_L2, BGP_FinanceCloud.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Vpc Public Ip Address Pool name.
outputFile String
File name where to save data source results (after running pulumi preview).
publicIpAddressPoolIds Changes to this property will trigger replacement. List<String>
The IDs of the Vpc Public IP address pools.
publicIpAddressPoolName Changes to this property will trigger replacement. String
The name of the VPC Public IP address pool.
status Changes to this property will trigger replacement. String
The status of the Vpc Public Ip Address Pool. Valid values: Created, Deleting, Modifying.

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 This property is required. string
The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
Description This property is required. string
The description of the Vpc Public Ip Address Pool.
Id This property is required. string
The ID of the Vpc Public Ip Address Pool.
IpAddressRemaining This property is required. bool
Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.
Isp This property is required. string
The Internet service provider.
PublicIpAddressPoolId This property is required. string
The ID of the Vpc Public Ip Address Pool.
PublicIpAddressPoolName This property is required. string
The name of the Vpc Public Ip Address Pool.
RegionId This property is required. string
The region ID of the Vpc Public Ip Address Pool.
Status This property is required. string
The status of the Vpc Public Ip Address Pool.
TotalIpNum This property is required. int
The total number of IP addresses in the Vpc Public Ip Address Pool.
UsedIpNum This property is required. int
The number of occupied IP addresses in the Vpc Public Ip Address Pool.
UserType This property is required. string
The user type.
CreateTime This property is required. string
The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
Description This property is required. string
The description of the Vpc Public Ip Address Pool.
Id This property is required. string
The ID of the Vpc Public Ip Address Pool.
IpAddressRemaining This property is required. bool
Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.
Isp This property is required. string
The Internet service provider.
PublicIpAddressPoolId This property is required. string
The ID of the Vpc Public Ip Address Pool.
PublicIpAddressPoolName This property is required. string
The name of the Vpc Public Ip Address Pool.
RegionId This property is required. string
The region ID of the Vpc Public Ip Address Pool.
Status This property is required. string
The status of the Vpc Public Ip Address Pool.
TotalIpNum This property is required. int
The total number of IP addresses in the Vpc Public Ip Address Pool.
UsedIpNum This property is required. int
The number of occupied IP addresses in the Vpc Public Ip Address Pool.
UserType This property is required. string
The user type.
createTime This property is required. String
The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
description This property is required. String
The description of the Vpc Public Ip Address Pool.
id This property is required. String
The ID of the Vpc Public Ip Address Pool.
ipAddressRemaining This property is required. Boolean
Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.
isp This property is required. String
The Internet service provider.
publicIpAddressPoolId This property is required. String
The ID of the Vpc Public Ip Address Pool.
publicIpAddressPoolName This property is required. String
The name of the Vpc Public Ip Address Pool.
regionId This property is required. String
The region ID of the Vpc Public Ip Address Pool.
status This property is required. String
The status of the Vpc Public Ip Address Pool.
totalIpNum This property is required. Integer
The total number of IP addresses in the Vpc Public Ip Address Pool.
usedIpNum This property is required. Integer
The number of occupied IP addresses in the Vpc Public Ip Address Pool.
userType This property is required. String
The user type.
createTime This property is required. string
The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
description This property is required. string
The description of the Vpc Public Ip Address Pool.
id This property is required. string
The ID of the Vpc Public Ip Address Pool.
ipAddressRemaining This property is required. boolean
Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.
isp This property is required. string
The Internet service provider.
publicIpAddressPoolId This property is required. string
The ID of the Vpc Public Ip Address Pool.
publicIpAddressPoolName This property is required. string
The name of the Vpc Public Ip Address Pool.
regionId This property is required. string
The region ID of the Vpc Public Ip Address Pool.
status This property is required. string
The status of the Vpc Public Ip Address Pool.
totalIpNum This property is required. number
The total number of IP addresses in the Vpc Public Ip Address Pool.
usedIpNum This property is required. number
The number of occupied IP addresses in the Vpc Public Ip Address Pool.
userType This property is required. string
The user type.
create_time This property is required. str
The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
description This property is required. str
The description of the Vpc Public Ip Address Pool.
id This property is required. str
The ID of the Vpc Public Ip Address Pool.
ip_address_remaining This property is required. bool
Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.
isp This property is required. str
The Internet service provider.
public_ip_address_pool_id This property is required. str
The ID of the Vpc Public Ip Address Pool.
public_ip_address_pool_name This property is required. str
The name of the Vpc Public Ip Address Pool.
region_id This property is required. str
The region ID of the Vpc Public Ip Address Pool.
status This property is required. str
The status of the Vpc Public Ip Address Pool.
total_ip_num This property is required. int
The total number of IP addresses in the Vpc Public Ip Address Pool.
used_ip_num This property is required. int
The number of occupied IP addresses in the Vpc Public Ip Address Pool.
user_type This property is required. str
The user type.
createTime This property is required. String
The time when the Vpc Public Ip Address Pool was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
description This property is required. String
The description of the Vpc Public Ip Address Pool.
id This property is required. String
The ID of the Vpc Public Ip Address Pool.
ipAddressRemaining This property is required. Boolean
Indicates whether the Vpc Public Ip Address Pool has idle IP addresses.
isp This property is required. String
The Internet service provider.
publicIpAddressPoolId This property is required. String
The ID of the Vpc Public Ip Address Pool.
publicIpAddressPoolName This property is required. String
The name of the Vpc Public Ip Address Pool.
regionId This property is required. String
The region ID of the Vpc Public Ip Address Pool.
status This property is required. String
The status of the Vpc Public Ip Address Pool.
totalIpNum This property is required. Number
The total number of IP addresses in the Vpc Public Ip Address Pool.
usedIpNum This property is required. Number
The number of occupied IP addresses in the Vpc Public Ip Address Pool.
userType This property is required. 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.