1. Packages
  2. Vcd Provider
  3. API Docs
  4. getIpSpaceIpAllocation
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getIpSpaceIpAllocation

Explore with Pulumi AI

Provides a data source to read IP Allocations within IP Spaces. It supports both - Floating IPs (IPs from IP Ranges) and IP Prefix (subnet) allocations with manual and automatic reservations.

IP Spaces require VCD 10.4.1+ with NSX-T.

Example Usage

IP Space IP Prefix Allocation)

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

const ip_prefix = vcd.getIpSpaceIpAllocation({
    orgId: data.vcd_org.org1.id,
    ipSpaceId: vcd_ip_space.space1.id,
    type: "IP_PREFIX",
    ipAddress: "192.168.1.1/24",
});
Copy
import pulumi
import pulumi_vcd as vcd

ip_prefix = vcd.get_ip_space_ip_allocation(org_id=data["vcd_org"]["org1"]["id"],
    ip_space_id=vcd_ip_space["space1"]["id"],
    type="IP_PREFIX",
    ip_address="192.168.1.1/24")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vcd.LookupIpSpaceIpAllocation(ctx, &vcd.LookupIpSpaceIpAllocationArgs{
			OrgId:     data.Vcd_org.Org1.Id,
			IpSpaceId: vcd_ip_space.Space1.Id,
			Type:      "IP_PREFIX",
			IpAddress: "192.168.1.1/24",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vcd = Pulumi.Vcd;

return await Deployment.RunAsync(() => 
{
    var ip_prefix = Vcd.GetIpSpaceIpAllocation.Invoke(new()
    {
        OrgId = data.Vcd_org.Org1.Id,
        IpSpaceId = vcd_ip_space.Space1.Id,
        Type = "IP_PREFIX",
        IpAddress = "192.168.1.1/24",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vcd.VcdFunctions;
import com.pulumi.vcd.inputs.GetIpSpaceIpAllocationArgs;
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 ip-prefix = VcdFunctions.getIpSpaceIpAllocation(GetIpSpaceIpAllocationArgs.builder()
            .orgId(data.vcd_org().org1().id())
            .ipSpaceId(vcd_ip_space.space1().id())
            .type("IP_PREFIX")
            .ipAddress("192.168.1.1/24")
            .build());

    }
}
Copy
variables:
  ip-prefix:
    fn::invoke:
      function: vcd:getIpSpaceIpAllocation
      arguments:
        orgId: ${data.vcd_org.org1.id}
        ipSpaceId: ${vcd_ip_space.space1.id}
        type: IP_PREFIX
        ipAddress: 192.168.1.1/24
Copy

IP Space Floating IP Allocation)

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

const floating_ip = vcd.getIpSpaceIpAllocation({
    orgId: data.vcd_org.org1.id,
    ipSpaceId: vcd_ip_space.space1.id,
    type: "FLOATING_IP",
    ipAddress: "192.168.1.1",
});
Copy
import pulumi
import pulumi_vcd as vcd

floating_ip = vcd.get_ip_space_ip_allocation(org_id=data["vcd_org"]["org1"]["id"],
    ip_space_id=vcd_ip_space["space1"]["id"],
    type="FLOATING_IP",
    ip_address="192.168.1.1")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vcd.LookupIpSpaceIpAllocation(ctx, &vcd.LookupIpSpaceIpAllocationArgs{
			OrgId:     data.Vcd_org.Org1.Id,
			IpSpaceId: vcd_ip_space.Space1.Id,
			Type:      "FLOATING_IP",
			IpAddress: "192.168.1.1",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vcd = Pulumi.Vcd;

return await Deployment.RunAsync(() => 
{
    var floating_ip = Vcd.GetIpSpaceIpAllocation.Invoke(new()
    {
        OrgId = data.Vcd_org.Org1.Id,
        IpSpaceId = vcd_ip_space.Space1.Id,
        Type = "FLOATING_IP",
        IpAddress = "192.168.1.1",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vcd.VcdFunctions;
import com.pulumi.vcd.inputs.GetIpSpaceIpAllocationArgs;
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 floating-ip = VcdFunctions.getIpSpaceIpAllocation(GetIpSpaceIpAllocationArgs.builder()
            .orgId(data.vcd_org().org1().id())
            .ipSpaceId(vcd_ip_space.space1().id())
            .type("FLOATING_IP")
            .ipAddress("192.168.1.1")
            .build());

    }
}
Copy
variables:
  floating-ip:
    fn::invoke:
      function: vcd:getIpSpaceIpAllocation
      arguments:
        orgId: ${data.vcd_org.org1.id}
        ipSpaceId: ${vcd_ip_space.space1.id}
        type: FLOATING_IP
        ipAddress: 192.168.1.1
Copy

Using getIpSpaceIpAllocation

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 getIpSpaceIpAllocation(args: GetIpSpaceIpAllocationArgs, opts?: InvokeOptions): Promise<GetIpSpaceIpAllocationResult>
function getIpSpaceIpAllocationOutput(args: GetIpSpaceIpAllocationOutputArgs, opts?: InvokeOptions): Output<GetIpSpaceIpAllocationResult>
Copy
def get_ip_space_ip_allocation(description: Optional[str] = None,
                               id: Optional[str] = None,
                               ip_address: Optional[str] = None,
                               ip_space_id: Optional[str] = None,
                               org_id: Optional[str] = None,
                               type: Optional[str] = None,
                               usage_state: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetIpSpaceIpAllocationResult
def get_ip_space_ip_allocation_output(description: Optional[pulumi.Input[str]] = None,
                               id: Optional[pulumi.Input[str]] = None,
                               ip_address: Optional[pulumi.Input[str]] = None,
                               ip_space_id: Optional[pulumi.Input[str]] = None,
                               org_id: Optional[pulumi.Input[str]] = None,
                               type: Optional[pulumi.Input[str]] = None,
                               usage_state: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetIpSpaceIpAllocationResult]
Copy
func LookupIpSpaceIpAllocation(ctx *Context, args *LookupIpSpaceIpAllocationArgs, opts ...InvokeOption) (*LookupIpSpaceIpAllocationResult, error)
func LookupIpSpaceIpAllocationOutput(ctx *Context, args *LookupIpSpaceIpAllocationOutputArgs, opts ...InvokeOption) LookupIpSpaceIpAllocationResultOutput
Copy

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

public static class GetIpSpaceIpAllocation 
{
    public static Task<GetIpSpaceIpAllocationResult> InvokeAsync(GetIpSpaceIpAllocationArgs args, InvokeOptions? opts = null)
    public static Output<GetIpSpaceIpAllocationResult> Invoke(GetIpSpaceIpAllocationInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetIpSpaceIpAllocationResult> getIpSpaceIpAllocation(GetIpSpaceIpAllocationArgs args, InvokeOptions options)
public static Output<GetIpSpaceIpAllocationResult> getIpSpaceIpAllocation(GetIpSpaceIpAllocationArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vcd:index/getIpSpaceIpAllocation:getIpSpaceIpAllocation
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

IpAddress This property is required. string
IP Address or CIDR of IP allocation (e.g. "192.168.1.1/24", "192.168.1.1")
IpSpaceId This property is required. string
Parent IP Space ID of IP Allocation
OrgId This property is required. string
Parent Org ID of IP Allocation
Type This property is required. string
Type of IP Allocation. One of FLOATING_IP or IP_PREFIX
Description string
Id string
UsageState string
IpAddress This property is required. string
IP Address or CIDR of IP allocation (e.g. "192.168.1.1/24", "192.168.1.1")
IpSpaceId This property is required. string
Parent IP Space ID of IP Allocation
OrgId This property is required. string
Parent Org ID of IP Allocation
Type This property is required. string
Type of IP Allocation. One of FLOATING_IP or IP_PREFIX
Description string
Id string
UsageState string
ipAddress This property is required. String
IP Address or CIDR of IP allocation (e.g. "192.168.1.1/24", "192.168.1.1")
ipSpaceId This property is required. String
Parent IP Space ID of IP Allocation
orgId This property is required. String
Parent Org ID of IP Allocation
type This property is required. String
Type of IP Allocation. One of FLOATING_IP or IP_PREFIX
description String
id String
usageState String
ipAddress This property is required. string
IP Address or CIDR of IP allocation (e.g. "192.168.1.1/24", "192.168.1.1")
ipSpaceId This property is required. string
Parent IP Space ID of IP Allocation
orgId This property is required. string
Parent Org ID of IP Allocation
type This property is required. string
Type of IP Allocation. One of FLOATING_IP or IP_PREFIX
description string
id string
usageState string
ip_address This property is required. str
IP Address or CIDR of IP allocation (e.g. "192.168.1.1/24", "192.168.1.1")
ip_space_id This property is required. str
Parent IP Space ID of IP Allocation
org_id This property is required. str
Parent Org ID of IP Allocation
type This property is required. str
Type of IP Allocation. One of FLOATING_IP or IP_PREFIX
description str
id str
usage_state str
ipAddress This property is required. String
IP Address or CIDR of IP allocation (e.g. "192.168.1.1/24", "192.168.1.1")
ipSpaceId This property is required. String
Parent IP Space ID of IP Allocation
orgId This property is required. String
Parent Org ID of IP Allocation
type This property is required. String
Type of IP Allocation. One of FLOATING_IP or IP_PREFIX
description String
id String
usageState String

getIpSpaceIpAllocation Result

The following output properties are available:

AllocationDate string
Description string
Id string
Ip string
IpAddress string
IpSpaceId string
OrgId string
PrefixLength string
Type string
UsageState string
UsedById string
AllocationDate string
Description string
Id string
Ip string
IpAddress string
IpSpaceId string
OrgId string
PrefixLength string
Type string
UsageState string
UsedById string
allocationDate String
description String
id String
ip String
ipAddress String
ipSpaceId String
orgId String
prefixLength String
type String
usageState String
usedById String
allocationDate string
description string
id string
ip string
ipAddress string
ipSpaceId string
orgId string
prefixLength string
type string
usageState string
usedById string
allocationDate String
description String
id String
ip String
ipAddress String
ipSpaceId String
orgId String
prefixLength String
type String
usageState String
usedById String

Package Details

Repository
vcd vmware/terraform-provider-vcd
License
Notes
This Pulumi package is based on the vcd Terraform Provider.