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

alicloud.vpc.getPublicIpAddressPoolCidrBlocks

Explore with Pulumi AI

This data source provides the Vpc Public Ip Address Pool Cidr Blocks of the current Alibaba Cloud user.

NOTE: Available in v1.189.0+.

NOTE: Only users who have the required permissions can use the IP address pool feature of Elastic IP Address (EIP). To apply for the required permissions, submit a ticket.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.vpc.getPublicIpAddressPoolCidrBlocks({
    ids: ["example_id"],
    publicIpAddressPoolId: "example_value",
});
export const vpcPublicIpAddressPoolCidrBlockId1 = ids.then(ids => ids.blocks?.[0]?.id);
const cidrBlock = alicloud.vpc.getPublicIpAddressPoolCidrBlocks({
    publicIpAddressPoolId: "example_value",
    cidrBlock: "example_value",
});
export const vpcPublicIpAddressPoolCidrBlockId2 = cidrBlock.then(cidrBlock => cidrBlock.blocks?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.vpc.get_public_ip_address_pool_cidr_blocks(ids=["example_id"],
    public_ip_address_pool_id="example_value")
pulumi.export("vpcPublicIpAddressPoolCidrBlockId1", ids.blocks[0].id)
cidr_block = alicloud.vpc.get_public_ip_address_pool_cidr_blocks(public_ip_address_pool_id="example_value",
    cidr_block="example_value")
pulumi.export("vpcPublicIpAddressPoolCidrBlockId2", cidr_block.blocks[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.GetPublicIpAddressPoolCidrBlocks(ctx, &vpc.GetPublicIpAddressPoolCidrBlocksArgs{
			Ids: []string{
				"example_id",
			},
			PublicIpAddressPoolId: "example_value",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("vpcPublicIpAddressPoolCidrBlockId1", ids.Blocks[0].Id)
		cidrBlock, err := vpc.GetPublicIpAddressPoolCidrBlocks(ctx, &vpc.GetPublicIpAddressPoolCidrBlocksArgs{
			PublicIpAddressPoolId: "example_value",
			CidrBlock:             pulumi.StringRef("example_value"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("vpcPublicIpAddressPoolCidrBlockId2", cidrBlock.Blocks[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.GetPublicIpAddressPoolCidrBlocks.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
        PublicIpAddressPoolId = "example_value",
    });

    var cidrBlock = AliCloud.Vpc.GetPublicIpAddressPoolCidrBlocks.Invoke(new()
    {
        PublicIpAddressPoolId = "example_value",
        CidrBlock = "example_value",
    });

    return new Dictionary<string, object?>
    {
        ["vpcPublicIpAddressPoolCidrBlockId1"] = ids.Apply(getPublicIpAddressPoolCidrBlocksResult => getPublicIpAddressPoolCidrBlocksResult.Blocks[0]?.Id),
        ["vpcPublicIpAddressPoolCidrBlockId2"] = cidrBlock.Apply(getPublicIpAddressPoolCidrBlocksResult => getPublicIpAddressPoolCidrBlocksResult.Blocks[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.GetPublicIpAddressPoolCidrBlocksArgs;
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.getPublicIpAddressPoolCidrBlocks(GetPublicIpAddressPoolCidrBlocksArgs.builder()
            .ids("example_id")
            .publicIpAddressPoolId("example_value")
            .build());

        ctx.export("vpcPublicIpAddressPoolCidrBlockId1", ids.applyValue(getPublicIpAddressPoolCidrBlocksResult -> getPublicIpAddressPoolCidrBlocksResult.blocks()[0].id()));
        final var cidrBlock = VpcFunctions.getPublicIpAddressPoolCidrBlocks(GetPublicIpAddressPoolCidrBlocksArgs.builder()
            .publicIpAddressPoolId("example_value")
            .cidrBlock("example_value")
            .build());

        ctx.export("vpcPublicIpAddressPoolCidrBlockId2", cidrBlock.applyValue(getPublicIpAddressPoolCidrBlocksResult -> getPublicIpAddressPoolCidrBlocksResult.blocks()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:vpc:getPublicIpAddressPoolCidrBlocks
      arguments:
        ids:
          - example_id
        publicIpAddressPoolId: example_value
  cidrBlock:
    fn::invoke:
      function: alicloud:vpc:getPublicIpAddressPoolCidrBlocks
      arguments:
        publicIpAddressPoolId: example_value
        cidrBlock: example_value
outputs:
  vpcPublicIpAddressPoolCidrBlockId1: ${ids.blocks[0].id}
  vpcPublicIpAddressPoolCidrBlockId2: ${cidrBlock.blocks[0].id}
Copy

Using getPublicIpAddressPoolCidrBlocks

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 getPublicIpAddressPoolCidrBlocks(args: GetPublicIpAddressPoolCidrBlocksArgs, opts?: InvokeOptions): Promise<GetPublicIpAddressPoolCidrBlocksResult>
function getPublicIpAddressPoolCidrBlocksOutput(args: GetPublicIpAddressPoolCidrBlocksOutputArgs, opts?: InvokeOptions): Output<GetPublicIpAddressPoolCidrBlocksResult>
Copy
def get_public_ip_address_pool_cidr_blocks(cidr_block: Optional[str] = None,
                                           ids: Optional[Sequence[str]] = None,
                                           output_file: Optional[str] = None,
                                           public_ip_address_pool_id: Optional[str] = None,
                                           status: Optional[str] = None,
                                           opts: Optional[InvokeOptions] = None) -> GetPublicIpAddressPoolCidrBlocksResult
def get_public_ip_address_pool_cidr_blocks_output(cidr_block: Optional[pulumi.Input[str]] = None,
                                           ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                           output_file: Optional[pulumi.Input[str]] = None,
                                           public_ip_address_pool_id: Optional[pulumi.Input[str]] = None,
                                           status: Optional[pulumi.Input[str]] = None,
                                           opts: Optional[InvokeOptions] = None) -> Output[GetPublicIpAddressPoolCidrBlocksResult]
Copy
func GetPublicIpAddressPoolCidrBlocks(ctx *Context, args *GetPublicIpAddressPoolCidrBlocksArgs, opts ...InvokeOption) (*GetPublicIpAddressPoolCidrBlocksResult, error)
func GetPublicIpAddressPoolCidrBlocksOutput(ctx *Context, args *GetPublicIpAddressPoolCidrBlocksOutputArgs, opts ...InvokeOption) GetPublicIpAddressPoolCidrBlocksResultOutput
Copy

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

public static class GetPublicIpAddressPoolCidrBlocks 
{
    public static Task<GetPublicIpAddressPoolCidrBlocksResult> InvokeAsync(GetPublicIpAddressPoolCidrBlocksArgs args, InvokeOptions? opts = null)
    public static Output<GetPublicIpAddressPoolCidrBlocksResult> Invoke(GetPublicIpAddressPoolCidrBlocksInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPublicIpAddressPoolCidrBlocksResult> getPublicIpAddressPoolCidrBlocks(GetPublicIpAddressPoolCidrBlocksArgs args, InvokeOptions options)
public static Output<GetPublicIpAddressPoolCidrBlocksResult> getPublicIpAddressPoolCidrBlocks(GetPublicIpAddressPoolCidrBlocksArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:vpc/getPublicIpAddressPoolCidrBlocks:getPublicIpAddressPoolCidrBlocks
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

PublicIpAddressPoolId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Vpc Public IP address pool.
CidrBlock Changes to this property will trigger replacement. string
The CIDR block.
Ids Changes to this property will trigger replacement. List<string>
A list of Vpc Public Ip Address Pool Cidr Block IDs.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
PublicIpAddressPoolId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Vpc Public IP address pool.
CidrBlock Changes to this property will trigger replacement. string
The CIDR block.
Ids Changes to this property will trigger replacement. []string
A list of Vpc Public Ip Address Pool Cidr Block IDs.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
publicIpAddressPoolId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Vpc Public IP address pool.
cidrBlock Changes to this property will trigger replacement. String
The CIDR block.
ids Changes to this property will trigger replacement. List<String>
A list of Vpc Public Ip Address Pool Cidr Block IDs.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
publicIpAddressPoolId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Vpc Public IP address pool.
cidrBlock Changes to this property will trigger replacement. string
The CIDR block.
ids Changes to this property will trigger replacement. string[]
A list of Vpc Public Ip Address Pool Cidr Block IDs.
outputFile string
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. string
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
public_ip_address_pool_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Vpc Public IP address pool.
cidr_block Changes to this property will trigger replacement. str
The CIDR block.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Vpc Public Ip Address Pool Cidr Block IDs.
output_file str
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. str
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
publicIpAddressPoolId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Vpc Public IP address pool.
cidrBlock Changes to this property will trigger replacement. String
The CIDR block.
ids Changes to this property will trigger replacement. List<String>
A list of Vpc Public Ip Address Pool Cidr Block IDs.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.

getPublicIpAddressPoolCidrBlocks Result

The following output properties are available:

Blocks List<Pulumi.AliCloud.Vpc.Outputs.GetPublicIpAddressPoolCidrBlocksBlock>
A list of Vpc Public Ip Address Pool Cidr Blocks. Each element contains the following attributes:
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
PublicIpAddressPoolId string
The ID of the Vpc Public IP address pool.
CidrBlock string
The CIDR block.
OutputFile string
Status string
The status of the CIDR block in the Vpc Public IP address pool.
Blocks []GetPublicIpAddressPoolCidrBlocksBlock
A list of Vpc Public Ip Address Pool Cidr Blocks. Each element contains the following attributes:
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
PublicIpAddressPoolId string
The ID of the Vpc Public IP address pool.
CidrBlock string
The CIDR block.
OutputFile string
Status string
The status of the CIDR block in the Vpc Public IP address pool.
blocks List<GetPublicIpAddressPoolCidrBlocksBlock>
A list of Vpc Public Ip Address Pool Cidr Blocks. Each element contains the following attributes:
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
publicIpAddressPoolId String
The ID of the Vpc Public IP address pool.
cidrBlock String
The CIDR block.
outputFile String
status String
The status of the CIDR block in the Vpc Public IP address pool.
blocks GetPublicIpAddressPoolCidrBlocksBlock[]
A list of Vpc Public Ip Address Pool Cidr Blocks. Each element contains the following attributes:
id string
The provider-assigned unique ID for this managed resource.
ids string[]
publicIpAddressPoolId string
The ID of the Vpc Public IP address pool.
cidrBlock string
The CIDR block.
outputFile string
status string
The status of the CIDR block in the Vpc Public IP address pool.
blocks Sequence[GetPublicIpAddressPoolCidrBlocksBlock]
A list of Vpc Public Ip Address Pool Cidr Blocks. Each element contains the following attributes:
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
public_ip_address_pool_id str
The ID of the Vpc Public IP address pool.
cidr_block str
The CIDR block.
output_file str
status str
The status of the CIDR block in the Vpc Public IP address pool.
blocks List<Property Map>
A list of Vpc Public Ip Address Pool Cidr Blocks. Each element contains the following attributes:
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
publicIpAddressPoolId String
The ID of the Vpc Public IP address pool.
cidrBlock String
The CIDR block.
outputFile String
status String
The status of the CIDR block in the Vpc Public IP address pool.

Supporting Types

GetPublicIpAddressPoolCidrBlocksBlock

CidrBlock This property is required. string
The CIDR block.
CreateTime This property is required. string
The time when the CIDR block was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
Id This property is required. string
The ID of the Public Ip Address Pool Cidr Block.
PublicIpAddressPoolId This property is required. string
The ID of the Vpc Public IP address pool.
Status This property is required. string
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
TotalIpNum This property is required. int
The number of occupied IP addresses in the CIDR block.
UsedIpNum This property is required. int
The total number of available IP addresses in the CIDR block.
CidrBlock This property is required. string
The CIDR block.
CreateTime This property is required. string
The time when the CIDR block was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
Id This property is required. string
The ID of the Public Ip Address Pool Cidr Block.
PublicIpAddressPoolId This property is required. string
The ID of the Vpc Public IP address pool.
Status This property is required. string
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
TotalIpNum This property is required. int
The number of occupied IP addresses in the CIDR block.
UsedIpNum This property is required. int
The total number of available IP addresses in the CIDR block.
cidrBlock This property is required. String
The CIDR block.
createTime This property is required. String
The time when the CIDR block was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
id This property is required. String
The ID of the Public Ip Address Pool Cidr Block.
publicIpAddressPoolId This property is required. String
The ID of the Vpc Public IP address pool.
status This property is required. String
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
totalIpNum This property is required. Integer
The number of occupied IP addresses in the CIDR block.
usedIpNum This property is required. Integer
The total number of available IP addresses in the CIDR block.
cidrBlock This property is required. string
The CIDR block.
createTime This property is required. string
The time when the CIDR block was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
id This property is required. string
The ID of the Public Ip Address Pool Cidr Block.
publicIpAddressPoolId This property is required. string
The ID of the Vpc Public IP address pool.
status This property is required. string
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
totalIpNum This property is required. number
The number of occupied IP addresses in the CIDR block.
usedIpNum This property is required. number
The total number of available IP addresses in the CIDR block.
cidr_block This property is required. str
The CIDR block.
create_time This property is required. str
The time when the CIDR block was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
id This property is required. str
The ID of the Public Ip Address Pool Cidr Block.
public_ip_address_pool_id This property is required. str
The ID of the Vpc Public IP address pool.
status This property is required. str
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
total_ip_num This property is required. int
The number of occupied IP addresses in the CIDR block.
used_ip_num This property is required. int
The total number of available IP addresses in the CIDR block.
cidrBlock This property is required. String
The CIDR block.
createTime This property is required. String
The time when the CIDR block was created. The time is displayed in YYYY-MM-DDThh:mm:ssZ format.
id This property is required. String
The ID of the Public Ip Address Pool Cidr Block.
publicIpAddressPoolId This property is required. String
The ID of the Vpc Public IP address pool.
status This property is required. String
The status of the CIDR block in the Vpc Public IP address pool. Valid values: Created, Modifying, Deleting.
totalIpNum This property is required. Number
The number of occupied IP addresses in the CIDR block.
usedIpNum This property is required. Number
The total number of available IP addresses in the CIDR block.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.