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

vcd.getResourcePool

Explore with Pulumi AI

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    Provides a data source for a resource pool attached to a vCenter. A resource pool is an essential component of a Provider VDC.

    Note 1: this data source requires System Administrator privileges

    Note 2: you can create or modify a resource pool using vSphere provider

    Supported in provider v3.10+

    Example Usage

    1

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const vcenter1 = vcd.getVcenter({
        name: "vc1",
    });
    const rp1 = vcenter1.then(vcenter1 => vcd.getResourcePool({
        name: "resource-pool-for-vcd-01",
        vcenterId: vcenter1.id,
    }));
    
    import pulumi
    import pulumi_vcd as vcd
    
    vcenter1 = vcd.get_vcenter(name="vc1")
    rp1 = vcd.get_resource_pool(name="resource-pool-for-vcd-01",
        vcenter_id=vcenter1.id)
    
    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 {
    		vcenter1, err := vcd.GetVcenter(ctx, &vcd.GetVcenterArgs{
    			Name: "vc1",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = vcd.GetResourcePool(ctx, &vcd.GetResourcePoolArgs{
    			Name:      "resource-pool-for-vcd-01",
    			VcenterId: vcenter1.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var vcenter1 = Vcd.GetVcenter.Invoke(new()
        {
            Name = "vc1",
        });
    
        var rp1 = Vcd.GetResourcePool.Invoke(new()
        {
            Name = "resource-pool-for-vcd-01",
            VcenterId = vcenter1.Apply(getVcenterResult => getVcenterResult.Id),
        });
    
    });
    
    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.GetVcenterArgs;
    import com.pulumi.vcd.inputs.GetResourcePoolArgs;
    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 vcenter1 = VcdFunctions.getVcenter(GetVcenterArgs.builder()
                .name("vc1")
                .build());
    
            final var rp1 = VcdFunctions.getResourcePool(GetResourcePoolArgs.builder()
                .name("resource-pool-for-vcd-01")
                .vcenterId(vcenter1.applyValue(getVcenterResult -> getVcenterResult.id()))
                .build());
    
        }
    }
    
    variables:
      vcenter1:
        fn::invoke:
          function: vcd:getVcenter
          arguments:
            name: vc1
      rp1:
        fn::invoke:
          function: vcd:getResourcePool
          arguments:
            name: resource-pool-for-vcd-01
            vcenterId: ${vcenter1.id}
    

    2

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const rp1 = vcd.getResourcePool({
        name: "common-name",
        vcenterId: data.vcd_vcenter.vcenter1.id,
    });
    
    import pulumi
    import pulumi_vcd as vcd
    
    rp1 = vcd.get_resource_pool(name="common-name",
        vcenter_id=data["vcd_vcenter"]["vcenter1"]["id"])
    
    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.GetResourcePool(ctx, &vcd.GetResourcePoolArgs{
    			Name:      "common-name",
    			VcenterId: data.Vcd_vcenter.Vcenter1.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var rp1 = Vcd.GetResourcePool.Invoke(new()
        {
            Name = "common-name",
            VcenterId = data.Vcd_vcenter.Vcenter1.Id,
        });
    
    });
    
    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.GetResourcePoolArgs;
    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 rp1 = VcdFunctions.getResourcePool(GetResourcePoolArgs.builder()
                .name("common-name")
                .vcenterId(data.vcd_vcenter().vcenter1().id())
                .build());
    
        }
    }
    
    variables:
      rp1:
        fn::invoke:
          function: vcd:getResourcePool
          arguments:
            name: common-name
            vcenterId: ${data.vcd_vcenter.vcenter1.id}
    

    When you receive such error, you can run the script again, but using the resource pool ID instead of the name.

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const rp1 = vcd.getResourcePool({
        name: "resgroup-241",
        vcenterId: data.vcd_vcenter.vcenter1.id,
    });
    
    import pulumi
    import pulumi_vcd as vcd
    
    rp1 = vcd.get_resource_pool(name="resgroup-241",
        vcenter_id=data["vcd_vcenter"]["vcenter1"]["id"])
    
    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.GetResourcePool(ctx, &vcd.GetResourcePoolArgs{
    			Name:      "resgroup-241",
    			VcenterId: data.Vcd_vcenter.Vcenter1.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var rp1 = Vcd.GetResourcePool.Invoke(new()
        {
            Name = "resgroup-241",
            VcenterId = data.Vcd_vcenter.Vcenter1.Id,
        });
    
    });
    
    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.GetResourcePoolArgs;
    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 rp1 = VcdFunctions.getResourcePool(GetResourcePoolArgs.builder()
                .name("resgroup-241")
                .vcenterId(data.vcd_vcenter().vcenter1().id())
                .build());
    
        }
    }
    
    variables:
      rp1:
        fn::invoke:
          function: vcd:getResourcePool
          arguments:
            name: resgroup-241
            vcenterId: ${data.vcd_vcenter.vcenter1.id}
    

    Using getResourcePool

    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 getResourcePool(args: GetResourcePoolArgs, opts?: InvokeOptions): Promise<GetResourcePoolResult>
    function getResourcePoolOutput(args: GetResourcePoolOutputArgs, opts?: InvokeOptions): Output<GetResourcePoolResult>
    def get_resource_pool(id: Optional[str] = None,
                          name: Optional[str] = None,
                          vcenter_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetResourcePoolResult
    def get_resource_pool_output(id: Optional[pulumi.Input[str]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          vcenter_id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetResourcePoolResult]
    func GetResourcePool(ctx *Context, args *GetResourcePoolArgs, opts ...InvokeOption) (*GetResourcePoolResult, error)
    func GetResourcePoolOutput(ctx *Context, args *GetResourcePoolOutputArgs, opts ...InvokeOption) GetResourcePoolResultOutput

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

    public static class GetResourcePool 
    {
        public static Task<GetResourcePoolResult> InvokeAsync(GetResourcePoolArgs args, InvokeOptions? opts = null)
        public static Output<GetResourcePoolResult> Invoke(GetResourcePoolInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetResourcePoolResult> getResourcePool(GetResourcePoolArgs args, InvokeOptions options)
    public static Output<GetResourcePoolResult> getResourcePool(GetResourcePoolArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getResourcePool:getResourcePool
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    resource pool name. The name may not be unique within the vCenter. If that happens, you will get an error message with the list of IDs for the pools with the same name, and can subsequently enter the resource pool ID instead of the name. (See Example Usage 2)
    VcenterId string
    ID of the vCenter to which this resource pool belongs.
    Id string
    Name string
    resource pool name. The name may not be unique within the vCenter. If that happens, you will get an error message with the list of IDs for the pools with the same name, and can subsequently enter the resource pool ID instead of the name. (See Example Usage 2)
    VcenterId string
    ID of the vCenter to which this resource pool belongs.
    Id string
    name String
    resource pool name. The name may not be unique within the vCenter. If that happens, you will get an error message with the list of IDs for the pools with the same name, and can subsequently enter the resource pool ID instead of the name. (See Example Usage 2)
    vcenterId String
    ID of the vCenter to which this resource pool belongs.
    id String
    name string
    resource pool name. The name may not be unique within the vCenter. If that happens, you will get an error message with the list of IDs for the pools with the same name, and can subsequently enter the resource pool ID instead of the name. (See Example Usage 2)
    vcenterId string
    ID of the vCenter to which this resource pool belongs.
    id string
    name str
    resource pool name. The name may not be unique within the vCenter. If that happens, you will get an error message with the list of IDs for the pools with the same name, and can subsequently enter the resource pool ID instead of the name. (See Example Usage 2)
    vcenter_id str
    ID of the vCenter to which this resource pool belongs.
    id str
    name String
    resource pool name. The name may not be unique within the vCenter. If that happens, you will get an error message with the list of IDs for the pools with the same name, and can subsequently enter the resource pool ID instead of the name. (See Example Usage 2)
    vcenterId String
    ID of the vCenter to which this resource pool belongs.
    id String

    getResourcePool Result

    The following output properties are available:

    ClusterMoref string
    managed object reference of the vCenter cluster that this resource pool is hosted on.
    HardwareVersion string
    default hardware version available to this resource pool.
    Id string
    Name string
    VcenterId string
    ClusterMoref string
    managed object reference of the vCenter cluster that this resource pool is hosted on.
    HardwareVersion string
    default hardware version available to this resource pool.
    Id string
    Name string
    VcenterId string
    clusterMoref String
    managed object reference of the vCenter cluster that this resource pool is hosted on.
    hardwareVersion String
    default hardware version available to this resource pool.
    id String
    name String
    vcenterId String
    clusterMoref string
    managed object reference of the vCenter cluster that this resource pool is hosted on.
    hardwareVersion string
    default hardware version available to this resource pool.
    id string
    name string
    vcenterId string
    cluster_moref str
    managed object reference of the vCenter cluster that this resource pool is hosted on.
    hardware_version str
    default hardware version available to this resource pool.
    id str
    name str
    vcenter_id str
    clusterMoref String
    managed object reference of the vCenter cluster that this resource pool is hosted on.
    hardwareVersion String
    default hardware version available to this resource pool.
    id String
    name String
    vcenterId String

    Package Details

    Repository
    vcd vmware/terraform-provider-vcd
    License
    Notes
    This Pulumi package is based on the vcd Terraform Provider.
    vcd logo
    vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware