Try AWS Native preview for resources not in the classic version.
aws.ec2.getVpcIpamPool
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
aws.ec2.VpcIpamPool provides details about an IPAM pool.
This resource can prove useful when an ipam pool was created in another root module and you need the pool’s id as an input variable. For example, pools can be shared via RAM and used to create vpcs with CIDRs from that pool.
Example Usage
The following example shows an account that has only 1 pool, perhaps shared via RAM, and using that pool id to create a VPC with a CIDR derived from AWS IPAM.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = aws.ec2.getVpcIpamPool({
    filters: [
        {
            name: "description",
            values: ["*test*"],
        },
        {
            name: "address-family",
            values: ["ipv4"],
        },
    ],
});
const testVpc = new aws.ec2.Vpc("test", {
    ipv4IpamPoolId: test.then(test => test.id),
    ipv4NetmaskLength: 28,
});
import pulumi
import pulumi_aws as aws
test = aws.ec2.get_vpc_ipam_pool(filters=[
    {
        "name": "description",
        "values": ["*test*"],
    },
    {
        "name": "address-family",
        "values": ["ipv4"],
    },
])
test_vpc = aws.ec2.Vpc("test",
    ipv4_ipam_pool_id=test.id,
    ipv4_netmask_length=28)
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 {
		test, err := ec2.LookupVpcIpamPool(ctx, &ec2.LookupVpcIpamPoolArgs{
			Filters: []ec2.GetVpcIpamPoolFilter{
				{
					Name: "description",
					Values: []string{
						"*test*",
					},
				},
				{
					Name: "address-family",
					Values: []string{
						"ipv4",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = ec2.NewVpc(ctx, "test", &ec2.VpcArgs{
			Ipv4IpamPoolId:    pulumi.String(test.Id),
			Ipv4NetmaskLength: pulumi.Int(28),
		})
		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 test = Aws.Ec2.GetVpcIpamPool.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2.Inputs.GetVpcIpamPoolFilterInputArgs
            {
                Name = "description",
                Values = new[]
                {
                    "*test*",
                },
            },
            new Aws.Ec2.Inputs.GetVpcIpamPoolFilterInputArgs
            {
                Name = "address-family",
                Values = new[]
                {
                    "ipv4",
                },
            },
        },
    });
    var testVpc = new Aws.Ec2.Vpc("test", new()
    {
        Ipv4IpamPoolId = test.Apply(getVpcIpamPoolResult => getVpcIpamPoolResult.Id),
        Ipv4NetmaskLength = 28,
    });
});
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.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
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 test = Ec2Functions.getVpcIpamPool(GetVpcIpamPoolArgs.builder()
            .filters(            
                GetVpcIpamPoolFilterArgs.builder()
                    .name("description")
                    .values("*test*")
                    .build(),
                GetVpcIpamPoolFilterArgs.builder()
                    .name("address-family")
                    .values("ipv4")
                    .build())
            .build());
        var testVpc = new Vpc("testVpc", VpcArgs.builder()
            .ipv4IpamPoolId(test.applyValue(getVpcIpamPoolResult -> getVpcIpamPoolResult.id()))
            .ipv4NetmaskLength(28)
            .build());
    }
}
resources:
  testVpc:
    type: aws:ec2:Vpc
    name: test
    properties:
      ipv4IpamPoolId: ${test.id}
      ipv4NetmaskLength: 28
variables:
  test:
    fn::invoke:
      Function: aws:ec2:getVpcIpamPool
      Arguments:
        filters:
          - name: description
            values:
              - '*test*'
          - name: address-family
            values:
              - ipv4
Using getVpcIpamPool
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 getVpcIpamPool(args: GetVpcIpamPoolArgs, opts?: InvokeOptions): Promise<GetVpcIpamPoolResult>
function getVpcIpamPoolOutput(args: GetVpcIpamPoolOutputArgs, opts?: InvokeOptions): Output<GetVpcIpamPoolResult>def get_vpc_ipam_pool(allocation_resource_tags: Optional[Mapping[str, str]] = None,
                      filters: Optional[Sequence[GetVpcIpamPoolFilter]] = None,
                      id: Optional[str] = None,
                      ipam_pool_id: Optional[str] = None,
                      tags: Optional[Mapping[str, str]] = None,
                      opts: Optional[InvokeOptions] = None) -> GetVpcIpamPoolResult
def get_vpc_ipam_pool_output(allocation_resource_tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                      filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcIpamPoolFilterArgs]]]] = None,
                      id: Optional[pulumi.Input[str]] = None,
                      ipam_pool_id: Optional[pulumi.Input[str]] = None,
                      tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetVpcIpamPoolResult]func LookupVpcIpamPool(ctx *Context, args *LookupVpcIpamPoolArgs, opts ...InvokeOption) (*LookupVpcIpamPoolResult, error)
func LookupVpcIpamPoolOutput(ctx *Context, args *LookupVpcIpamPoolOutputArgs, opts ...InvokeOption) LookupVpcIpamPoolResultOutput> Note: This function is named LookupVpcIpamPool in the Go SDK.
public static class GetVpcIpamPool 
{
    public static Task<GetVpcIpamPoolResult> InvokeAsync(GetVpcIpamPoolArgs args, InvokeOptions? opts = null)
    public static Output<GetVpcIpamPoolResult> Invoke(GetVpcIpamPoolInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcIpamPoolResult> getVpcIpamPool(GetVpcIpamPoolArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: aws:ec2/getVpcIpamPool:getVpcIpamPool
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Dictionary<string, string>
- Tags that are required to create resources in using this pool.
- Filters
List<GetVpc Ipam Pool Filter> 
- Custom filter block as described below.
- Id string
- ID of the IPAM pool.
- IpamPool stringId 
- ID of the IPAM pool you would like information on.
- Dictionary<string, string>
- Map of tags to assigned to the resource.
- map[string]string
- Tags that are required to create resources in using this pool.
- Filters
[]GetVpc Ipam Pool Filter 
- Custom filter block as described below.
- Id string
- ID of the IPAM pool.
- IpamPool stringId 
- ID of the IPAM pool you would like information on.
- map[string]string
- Map of tags to assigned to the resource.
- Map<String,String>
- Tags that are required to create resources in using this pool.
- filters
List<GetVpc Ipam Pool Filter> 
- Custom filter block as described below.
- id String
- ID of the IPAM pool.
- ipamPool StringId 
- ID of the IPAM pool you would like information on.
- Map<String,String>
- Map of tags to assigned to the resource.
- {[key: string]: string}
- Tags that are required to create resources in using this pool.
- filters
GetVpc Ipam Pool Filter[] 
- Custom filter block as described below.
- id string
- ID of the IPAM pool.
- ipamPool stringId 
- ID of the IPAM pool you would like information on.
- {[key: string]: string}
- Map of tags to assigned to the resource.
- Mapping[str, str]
- Tags that are required to create resources in using this pool.
- filters
Sequence[GetVpc Ipam Pool Filter] 
- Custom filter block as described below.
- id str
- ID of the IPAM pool.
- ipam_pool_ strid 
- ID of the IPAM pool you would like information on.
- Mapping[str, str]
- Map of tags to assigned to the resource.
- Map<String>
- Tags that are required to create resources in using this pool.
- filters List<Property Map>
- Custom filter block as described below.
- id String
- ID of the IPAM pool.
- ipamPool StringId 
- ID of the IPAM pool you would like information on.
- Map<String>
- Map of tags to assigned to the resource.
getVpcIpamPool Result
The following output properties are available:
- AddressFamily string
- IP protocol assigned to this pool.
- AllocationDefault intNetmask Length 
- A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8and you enter 16 here, new allocations will default to10.0.0.0/16.
- AllocationMax intNetmask Length 
- The maximum netmask length that will be required for CIDR allocations in this pool.
- AllocationMin intNetmask Length 
- The minimum netmask length that will be required for CIDR allocations in this pool.
- Dictionary<string, string>
- Tags that are required to create resources in using this pool.
- Arn string
- ARN of the pool
- AutoImport bool
- If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.
- AwsService string
- Limits which service in AWS that the pool can be used in. ec2for example, allows users to use space for Elastic IP addresses and VPCs.
- Description string
- Description for the IPAM pool.
- IpamScope stringId 
- ID of the scope the pool belongs to.
- IpamScope stringType 
- Locale string
- Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region.
- PoolDepth int
- PubliclyAdvertisable bool
- Defines whether or not IPv6 pool space is publicly advertisable over the internet.
- SourceIpam stringPool Id 
- ID of the source IPAM pool.
- State string
- Dictionary<string, string>
- Map of tags to assigned to the resource.
- Filters
List<GetVpc Ipam Pool Filter> 
- Id string
- ID of the IPAM pool.
- IpamPool stringId 
- AddressFamily string
- IP protocol assigned to this pool.
- AllocationDefault intNetmask Length 
- A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8and you enter 16 here, new allocations will default to10.0.0.0/16.
- AllocationMax intNetmask Length 
- The maximum netmask length that will be required for CIDR allocations in this pool.
- AllocationMin intNetmask Length 
- The minimum netmask length that will be required for CIDR allocations in this pool.
- map[string]string
- Tags that are required to create resources in using this pool.
- Arn string
- ARN of the pool
- AutoImport bool
- If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.
- AwsService string
- Limits which service in AWS that the pool can be used in. ec2for example, allows users to use space for Elastic IP addresses and VPCs.
- Description string
- Description for the IPAM pool.
- IpamScope stringId 
- ID of the scope the pool belongs to.
- IpamScope stringType 
- Locale string
- Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region.
- PoolDepth int
- PubliclyAdvertisable bool
- Defines whether or not IPv6 pool space is publicly advertisable over the internet.
- SourceIpam stringPool Id 
- ID of the source IPAM pool.
- State string
- map[string]string
- Map of tags to assigned to the resource.
- Filters
[]GetVpc Ipam Pool Filter 
- Id string
- ID of the IPAM pool.
- IpamPool stringId 
- addressFamily String
- IP protocol assigned to this pool.
- allocationDefault IntegerNetmask Length 
- A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8and you enter 16 here, new allocations will default to10.0.0.0/16.
- allocationMax IntegerNetmask Length 
- The maximum netmask length that will be required for CIDR allocations in this pool.
- allocationMin IntegerNetmask Length 
- The minimum netmask length that will be required for CIDR allocations in this pool.
- Map<String,String>
- Tags that are required to create resources in using this pool.
- arn String
- ARN of the pool
- autoImport Boolean
- If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.
- awsService String
- Limits which service in AWS that the pool can be used in. ec2for example, allows users to use space for Elastic IP addresses and VPCs.
- description String
- Description for the IPAM pool.
- ipamScope StringId 
- ID of the scope the pool belongs to.
- ipamScope StringType 
- locale String
- Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region.
- poolDepth Integer
- publiclyAdvertisable Boolean
- Defines whether or not IPv6 pool space is publicly advertisable over the internet.
- sourceIpam StringPool Id 
- ID of the source IPAM pool.
- state String
- Map<String,String>
- Map of tags to assigned to the resource.
- filters
List<GetVpc Ipam Pool Filter> 
- id String
- ID of the IPAM pool.
- ipamPool StringId 
- addressFamily string
- IP protocol assigned to this pool.
- allocationDefault numberNetmask Length 
- A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8and you enter 16 here, new allocations will default to10.0.0.0/16.
- allocationMax numberNetmask Length 
- The maximum netmask length that will be required for CIDR allocations in this pool.
- allocationMin numberNetmask Length 
- The minimum netmask length that will be required for CIDR allocations in this pool.
- {[key: string]: string}
- Tags that are required to create resources in using this pool.
- arn string
- ARN of the pool
- autoImport boolean
- If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.
- awsService string
- Limits which service in AWS that the pool can be used in. ec2for example, allows users to use space for Elastic IP addresses and VPCs.
- description string
- Description for the IPAM pool.
- ipamScope stringId 
- ID of the scope the pool belongs to.
- ipamScope stringType 
- locale string
- Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region.
- poolDepth number
- publiclyAdvertisable boolean
- Defines whether or not IPv6 pool space is publicly advertisable over the internet.
- sourceIpam stringPool Id 
- ID of the source IPAM pool.
- state string
- {[key: string]: string}
- Map of tags to assigned to the resource.
- filters
GetVpc Ipam Pool Filter[] 
- id string
- ID of the IPAM pool.
- ipamPool stringId 
- address_family str
- IP protocol assigned to this pool.
- allocation_default_ intnetmask_ length 
- A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8and you enter 16 here, new allocations will default to10.0.0.0/16.
- allocation_max_ intnetmask_ length 
- The maximum netmask length that will be required for CIDR allocations in this pool.
- allocation_min_ intnetmask_ length 
- The minimum netmask length that will be required for CIDR allocations in this pool.
- Mapping[str, str]
- Tags that are required to create resources in using this pool.
- arn str
- ARN of the pool
- auto_import bool
- If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.
- aws_service str
- Limits which service in AWS that the pool can be used in. ec2for example, allows users to use space for Elastic IP addresses and VPCs.
- description str
- Description for the IPAM pool.
- ipam_scope_ strid 
- ID of the scope the pool belongs to.
- ipam_scope_ strtype 
- locale str
- Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region.
- pool_depth int
- publicly_advertisable bool
- Defines whether or not IPv6 pool space is publicly advertisable over the internet.
- source_ipam_ strpool_ id 
- ID of the source IPAM pool.
- state str
- Mapping[str, str]
- Map of tags to assigned to the resource.
- filters
Sequence[GetVpc Ipam Pool Filter] 
- id str
- ID of the IPAM pool.
- ipam_pool_ strid 
- addressFamily String
- IP protocol assigned to this pool.
- allocationDefault NumberNetmask Length 
- A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8and you enter 16 here, new allocations will default to10.0.0.0/16.
- allocationMax NumberNetmask Length 
- The maximum netmask length that will be required for CIDR allocations in this pool.
- allocationMin NumberNetmask Length 
- The minimum netmask length that will be required for CIDR allocations in this pool.
- Map<String>
- Tags that are required to create resources in using this pool.
- arn String
- ARN of the pool
- autoImport Boolean
- If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.
- awsService String
- Limits which service in AWS that the pool can be used in. ec2for example, allows users to use space for Elastic IP addresses and VPCs.
- description String
- Description for the IPAM pool.
- ipamScope StringId 
- ID of the scope the pool belongs to.
- ipamScope StringType 
- locale String
- Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region.
- poolDepth Number
- publiclyAdvertisable Boolean
- Defines whether or not IPv6 pool space is publicly advertisable over the internet.
- sourceIpam StringPool Id 
- ID of the source IPAM pool.
- state String
- Map<String>
- Map of tags to assigned to the resource.
- filters List<Property Map>
- id String
- ID of the IPAM pool.
- ipamPool StringId 
Supporting Types
GetVpcIpamPoolFilter    
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.
Try AWS Native preview for resources not in the classic version.