1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. getVpcIamPoolCidrs
AWS v6 v6.83.2 published on Thursday, Nov 20, 2025 by Pulumi
aws-v6 logo
AWS v6 v6.83.2 published on Thursday, Nov 20, 2025 by Pulumi
    Deprecated: aws.ec2/getvpciampoolcidrs.getVpcIamPoolCidrs has been deprecated in favor of aws.ec2/getvpcipampoolcidrs.getVpcIpamPoolCidrs

    aws.ec2.getVpcIpamPoolCidrs provides details about an IPAM pool.

    This resource can prove useful when an ipam pool was shared to your account and you want to know all (or a filtered list) of the CIDRs that are provisioned into the pool.

    Example Usage

    Basic usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const p = aws.ec2.getVpcIpamPool({
        filters: [
            {
                name: "description",
                values: ["*mypool*"],
            },
            {
                name: "address-family",
                values: ["ipv4"],
            },
        ],
    });
    const c = p.then(p => aws.ec2.getVpcIpamPoolCidrs({
        ipamPoolId: p.id,
    }));
    
    import pulumi
    import pulumi_aws as aws
    
    p = aws.ec2.get_vpc_ipam_pool(filters=[
        {
            "name": "description",
            "values": ["*mypool*"],
        },
        {
            "name": "address-family",
            "values": ["ipv4"],
        },
    ])
    c = aws.ec2.get_vpc_ipam_pool_cidrs(ipam_pool_id=p.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		p, err := ec2.LookupVpcIpamPool(ctx, &ec2.LookupVpcIpamPoolArgs{
    			Filters: []ec2.GetVpcIpamPoolFilter{
    				{
    					Name: "description",
    					Values: []string{
    						"*mypool*",
    					},
    				},
    				{
    					Name: "address-family",
    					Values: []string{
    						"ipv4",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ec2.GetVpcIpamPoolCidrs(ctx, &ec2.GetVpcIpamPoolCidrsArgs{
    			IpamPoolId: p.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var p = Aws.Ec2.GetVpcIpamPool.Invoke(new()
        {
            Filters = new[]
            {
                new Aws.Ec2.Inputs.GetVpcIpamPoolFilterInputArgs
                {
                    Name = "description",
                    Values = new[]
                    {
                        "*mypool*",
                    },
                },
                new Aws.Ec2.Inputs.GetVpcIpamPoolFilterInputArgs
                {
                    Name = "address-family",
                    Values = new[]
                    {
                        "ipv4",
                    },
                },
            },
        });
    
        var c = Aws.Ec2.GetVpcIpamPoolCidrs.Invoke(new()
        {
            IpamPoolId = p.Apply(getVpcIpamPoolResult => getVpcIpamPoolResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.Ec2Functions;
    import com.pulumi.aws.ec2.inputs.GetVpcIpamPoolArgs;
    import com.pulumi.aws.ec2.inputs.GetVpcIpamPoolCidrsArgs;
    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 p = Ec2Functions.getVpcIpamPool(GetVpcIpamPoolArgs.builder()
                .filters(            
                    GetVpcIpamPoolFilterArgs.builder()
                        .name("description")
                        .values("*mypool*")
                        .build(),
                    GetVpcIpamPoolFilterArgs.builder()
                        .name("address-family")
                        .values("ipv4")
                        .build())
                .build());
    
            final var c = Ec2Functions.getVpcIpamPoolCidrs(GetVpcIpamPoolCidrsArgs.builder()
                .ipamPoolId(p.id())
                .build());
    
        }
    }
    
    variables:
      c:
        fn::invoke:
          function: aws:ec2:getVpcIpamPoolCidrs
          arguments:
            ipamPoolId: ${p.id}
      p:
        fn::invoke:
          function: aws:ec2:getVpcIpamPool
          arguments:
            filters:
              - name: description
                values:
                  - '*mypool*'
              - name: address-family
                values:
                  - ipv4
    

    Filtering:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const c = aws.ec2.getVpcIpamPoolCidrs({
        ipamPoolId: "ipam-pool-123",
        filters: [{
            name: "cidr",
            values: ["10.*"],
        }],
    });
    const mycidrs = c.then(c => .filter(cidr => cidr.state == "provisioned").map(cidr => (cidr.cidr)));
    const pls = new aws.ec2.ManagedPrefixList("pls", {
        entries: mycidrs.map((v, k) => ({key: k, value: v})).apply(entries => entries.map(entry => ({
            cidr: entry.value,
            description: entry.value,
        }))),
        name: `IPAM Pool (${test.id}) Cidrs`,
        addressFamily: "IPv4",
        maxEntries: mycidrs.length,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    c = aws.ec2.get_vpc_ipam_pool_cidrs(ipam_pool_id="ipam-pool-123",
        filters=[{
            "name": "cidr",
            "values": ["10.*"],
        }])
    mycidrs = [cidr.cidr for cidr in c.ipam_pool_cidrs if cidr.state == "provisioned"]
    pls = aws.ec2.ManagedPrefixList("pls",
        entries=[{"key": k, "value": v} for k, v in mycidrs].apply(lambda entries: [{
            "cidr": entry["value"],
            "description": entry["value"],
        } for entry in entries]),
        name=f"IPAM Pool ({test['id']}) Cidrs",
        address_family="IPv4",
        max_entries=len(mycidrs))
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var c = Aws.Ec2.GetVpcIpamPoolCidrs.Invoke(new()
        {
            IpamPoolId = "ipam-pool-123",
            Filters = new[]
            {
                new Aws.Ec2.Inputs.GetVpcIpamPoolCidrsFilterInputArgs
                {
                    Name = "cidr",
                    Values = new[]
                    {
                        "10.*",
                    },
                },
            },
        });
    
        var mycidrs = .Where(cidr => cidr.State == "provisioned").Select(cidr => 
        {
            return cidr.Cidr;
        }).ToList();
    
        var pls = new Aws.Ec2.ManagedPrefixList("pls", new()
        {
            Entries = mycidrs.Select((v, k) => new { Key = k, Value = v }).Apply(entries => entries.Select(entry => 
            {
                return 
                {
                    { "cidr", entry.Value },
                    { "description", entry.Value },
                };
            }).ToList()),
            Name = $"IPAM Pool ({test.Id}) Cidrs",
            AddressFamily = "IPv4",
            MaxEntries = mycidrs.Length,
        });
    
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Using getVpcIamPoolCidrs

    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 getVpcIamPoolCidrs(args: GetVpcIamPoolCidrsArgs, opts?: InvokeOptions): Promise<GetVpcIamPoolCidrsResult>
    function getVpcIamPoolCidrsOutput(args: GetVpcIamPoolCidrsOutputArgs, opts?: InvokeOptions): Output<GetVpcIamPoolCidrsResult>
    def get_vpc_iam_pool_cidrs(filters: Optional[Sequence[GetVpcIamPoolCidrsFilter]] = None,
                               ipam_pool_id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetVpcIamPoolCidrsResult
    def get_vpc_iam_pool_cidrs_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcIamPoolCidrsFilterArgs]]]] = None,
                               ipam_pool_id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetVpcIamPoolCidrsResult]
    func GetVpcIamPoolCidrs(ctx *Context, args *GetVpcIamPoolCidrsArgs, opts ...InvokeOption) (*GetVpcIamPoolCidrsResult, error)
    func GetVpcIamPoolCidrsOutput(ctx *Context, args *GetVpcIamPoolCidrsOutputArgs, opts ...InvokeOption) GetVpcIamPoolCidrsResultOutput

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

    public static class GetVpcIamPoolCidrs 
    {
        public static Task<GetVpcIamPoolCidrsResult> InvokeAsync(GetVpcIamPoolCidrsArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcIamPoolCidrsResult> Invoke(GetVpcIamPoolCidrsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcIamPoolCidrsResult> getVpcIamPoolCidrs(GetVpcIamPoolCidrsArgs args, InvokeOptions options)
    public static Output<GetVpcIamPoolCidrsResult> getVpcIamPoolCidrs(GetVpcIamPoolCidrsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:ec2/getVpcIamPoolCidrs:getVpcIamPoolCidrs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    IpamPoolId string
    ID of the IPAM pool you would like the list of provisioned CIDRs.
    Filters List<GetVpcIamPoolCidrsFilter>
    Custom filter block as described below.
    IpamPoolId string
    ID of the IPAM pool you would like the list of provisioned CIDRs.
    Filters []GetVpcIamPoolCidrsFilter
    Custom filter block as described below.
    ipamPoolId String
    ID of the IPAM pool you would like the list of provisioned CIDRs.
    filters List<GetVpcIamPoolCidrsFilter>
    Custom filter block as described below.
    ipamPoolId string
    ID of the IPAM pool you would like the list of provisioned CIDRs.
    filters GetVpcIamPoolCidrsFilter[]
    Custom filter block as described below.
    ipam_pool_id str
    ID of the IPAM pool you would like the list of provisioned CIDRs.
    filters Sequence[GetVpcIamPoolCidrsFilter]
    Custom filter block as described below.
    ipamPoolId String
    ID of the IPAM pool you would like the list of provisioned CIDRs.
    filters List<Property Map>
    Custom filter block as described below.

    getVpcIamPoolCidrs Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    IpamPoolCidrs List<GetVpcIamPoolCidrsIpamPoolCidr>
    The CIDRs provisioned into the IPAM pool, described below.
    IpamPoolId string
    Filters List<GetVpcIamPoolCidrsFilter>
    Id string
    The provider-assigned unique ID for this managed resource.
    IpamPoolCidrs []GetVpcIamPoolCidrsIpamPoolCidr
    The CIDRs provisioned into the IPAM pool, described below.
    IpamPoolId string
    Filters []GetVpcIamPoolCidrsFilter
    id String
    The provider-assigned unique ID for this managed resource.
    ipamPoolCidrs List<GetVpcIamPoolCidrsIpamPoolCidr>
    The CIDRs provisioned into the IPAM pool, described below.
    ipamPoolId String
    filters List<GetVpcIamPoolCidrsFilter>
    id string
    The provider-assigned unique ID for this managed resource.
    ipamPoolCidrs GetVpcIamPoolCidrsIpamPoolCidr[]
    The CIDRs provisioned into the IPAM pool, described below.
    ipamPoolId string
    filters GetVpcIamPoolCidrsFilter[]
    id str
    The provider-assigned unique ID for this managed resource.
    ipam_pool_cidrs Sequence[GetVpcIamPoolCidrsIpamPoolCidr]
    The CIDRs provisioned into the IPAM pool, described below.
    ipam_pool_id str
    filters Sequence[GetVpcIamPoolCidrsFilter]
    id String
    The provider-assigned unique ID for this managed resource.
    ipamPoolCidrs List<Property Map>
    The CIDRs provisioned into the IPAM pool, described below.
    ipamPoolId String
    filters List<Property Map>

    Supporting Types

    GetVpcIamPoolCidrsFilter

    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values List<string>
    Set of values that are accepted for the given field.
    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values []string
    Set of values that are accepted for the given field.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    values List<String>
    Set of values that are accepted for the given field.
    name string
    Name of the field to filter by, as defined by the underlying AWS API.
    values string[]
    Set of values that are accepted for the given field.
    name str
    Name of the field to filter by, as defined by the underlying AWS API.
    values Sequence[str]
    Set of values that are accepted for the given field.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    values List<String>
    Set of values that are accepted for the given field.

    GetVpcIamPoolCidrsIpamPoolCidr

    Cidr string
    A network CIDR.
    State string
    The provisioning state of that CIDR.
    Cidr string
    A network CIDR.
    State string
    The provisioning state of that CIDR.
    cidr String
    A network CIDR.
    state String
    The provisioning state of that CIDR.
    cidr string
    A network CIDR.
    state string
    The provisioning state of that CIDR.
    cidr str
    A network CIDR.
    state str
    The provisioning state of that CIDR.
    cidr String
    A network CIDR.
    state String
    The provisioning state of that CIDR.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws-v6 logo
    AWS v6 v6.83.2 published on Thursday, Nov 20, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate