Viewing docs for ibm 2.1.0
published on Tuesday, May 5, 2026 by ibm-cloud
published on Tuesday, May 5, 2026 by ibm-cloud
Viewing docs for ibm 2.1.0
published on Tuesday, May 5, 2026 by ibm-cloud
published on Tuesday, May 5, 2026 by ibm-cloud
Retrieve information of an existing reserved group as a read-only data source.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const reservedcapacityds = ibm.getComputeReservedCapacity({
name: "reservedgroup",
mostRecent: true,
});
import pulumi
import pulumi_ibm as ibm
reservedcapacityds = ibm.get_compute_reserved_capacity(name="reservedgroup",
most_recent=True)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.LookupComputeReservedCapacity(ctx, &ibm.LookupComputeReservedCapacityArgs{
Name: "reservedgroup",
MostRecent: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var reservedcapacityds = Ibm.GetComputeReservedCapacity.Invoke(new()
{
Name = "reservedgroup",
MostRecent = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IbmFunctions;
import com.pulumi.ibm.inputs.GetComputeReservedCapacityArgs;
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 reservedcapacityds = IbmFunctions.getComputeReservedCapacity(GetComputeReservedCapacityArgs.builder()
.name("reservedgroup")
.mostRecent(true)
.build());
}
}
variables:
reservedcapacityds:
fn::invoke:
function: ibm:getComputeReservedCapacity
arguments:
name: reservedgroup
mostRecent: true
Example coming soon!
The following example shows how you can use this data source to reference the reserved group ID in the ibm.ComputeVmInstance resource because the numeric IDs are often unknown.
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const vm1 = new ibm.ComputeVmInstance("vm1", {reservedCapacityId: group.id});
import pulumi
import pulumi_ibm as ibm
vm1 = ibm.ComputeVmInstance("vm1", reserved_capacity_id=group["id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.NewComputeVmInstance(ctx, "vm1", &ibm.ComputeVmInstanceArgs{
ReservedCapacityId: pulumi.Any(group.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var vm1 = new Ibm.ComputeVmInstance("vm1", new()
{
ReservedCapacityId = @group.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.ComputeVmInstance;
import com.pulumi.ibm.ComputeVmInstanceArgs;
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) {
var vm1 = new ComputeVmInstance("vm1", ComputeVmInstanceArgs.builder()
.reservedCapacityId(group.id())
.build());
}
}
resources:
vm1:
type: ibm:ComputeVmInstance
properties:
reservedCapacityId: ${group.id}
Example coming soon!
Using getComputeReservedCapacity
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 getComputeReservedCapacity(args: GetComputeReservedCapacityArgs, opts?: InvokeOptions): Promise<GetComputeReservedCapacityResult>
function getComputeReservedCapacityOutput(args: GetComputeReservedCapacityOutputArgs, opts?: InvokeOptions): Output<GetComputeReservedCapacityResult>def get_compute_reserved_capacity(id: Optional[str] = None,
most_recent: Optional[bool] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetComputeReservedCapacityResult
def get_compute_reserved_capacity_output(id: pulumi.Input[Optional[str]] = None,
most_recent: pulumi.Input[Optional[bool]] = None,
name: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetComputeReservedCapacityResult]func LookupComputeReservedCapacity(ctx *Context, args *LookupComputeReservedCapacityArgs, opts ...InvokeOption) (*LookupComputeReservedCapacityResult, error)
func LookupComputeReservedCapacityOutput(ctx *Context, args *LookupComputeReservedCapacityOutputArgs, opts ...InvokeOption) LookupComputeReservedCapacityResultOutput> Note: This function is named LookupComputeReservedCapacity in the Go SDK.
public static class GetComputeReservedCapacity
{
public static Task<GetComputeReservedCapacityResult> InvokeAsync(GetComputeReservedCapacityArgs args, InvokeOptions? opts = null)
public static Output<GetComputeReservedCapacityResult> Invoke(GetComputeReservedCapacityInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetComputeReservedCapacityResult> getComputeReservedCapacity(GetComputeReservedCapacityArgs args, InvokeOptions options)
public static Output<GetComputeReservedCapacityResult> getComputeReservedCapacity(GetComputeReservedCapacityArgs args, InvokeOptions options)
fn::invoke:
function: ibm:index/getComputeReservedCapacity:getComputeReservedCapacity
arguments:
# arguments dictionarydata "ibm_getcomputereservedcapacity" "name" {
# arguments
}The following arguments are supported:
- Name string
- The name of the reserved capacity.
- Id string
- (String) The ID of the virtual guest.
- Most
Recent bool - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- Name string
- The name of the reserved capacity.
- Id string
- (String) The ID of the virtual guest.
- Most
Recent bool - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- name string
- The name of the reserved capacity.
- id string
- (String) The ID of the virtual guest.
- most_
recent bool - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- name String
- The name of the reserved capacity.
- id String
- (String) The ID of the virtual guest.
- most
Recent Boolean - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- name string
- The name of the reserved capacity.
- id string
- (String) The ID of the virtual guest.
- most
Recent boolean - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- name str
- The name of the reserved capacity.
- id str
- (String) The ID of the virtual guest.
- most_
recent bool - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
- name String
- The name of the reserved capacity.
- id String
- (String) The ID of the virtual guest.
- most
Recent Boolean - For multiple VM instances, you can set this argument to true to import only the most recently created instance.
getComputeReservedCapacity Result
The following output properties are available:
- Datacenter string
- (String) The data center in which reserved capacity resides.
- Flavor string
- Id string
- (String) The ID of the virtual guest.
- Instances double
- (int) Number of VSI instances this capacity reservation can support.
- Name string
- Pod string
- (String) The pod in which reserved capacity resides.
- Virtual
Guests List<GetCompute Reserved Capacity Virtual Guest> - (List of Objects) A nested block describes the VSIs attached to the reserved capacity.
- Most
Recent bool
- Datacenter string
- (String) The data center in which reserved capacity resides.
- Flavor string
- Id string
- (String) The ID of the virtual guest.
- Instances float64
- (int) Number of VSI instances this capacity reservation can support.
- Name string
- Pod string
- (String) The pod in which reserved capacity resides.
- Virtual
Guests []GetCompute Reserved Capacity Virtual Guest - (List of Objects) A nested block describes the VSIs attached to the reserved capacity.
- Most
Recent bool
- datacenter string
- (String) The data center in which reserved capacity resides.
- flavor string
- id string
- (String) The ID of the virtual guest.
- instances number
- (int) Number of VSI instances this capacity reservation can support.
- name string
- pod string
- (String) The pod in which reserved capacity resides.
- virtual_
guests list(object) - (List of Objects) A nested block describes the VSIs attached to the reserved capacity.
- most_
recent bool
- datacenter String
- (String) The data center in which reserved capacity resides.
- flavor String
- id String
- (String) The ID of the virtual guest.
- instances Double
- (int) Number of VSI instances this capacity reservation can support.
- name String
- pod String
- (String) The pod in which reserved capacity resides.
- virtual
Guests List<GetCompute Reserved Capacity Virtual Guest> - (List of Objects) A nested block describes the VSIs attached to the reserved capacity.
- most
Recent Boolean
- datacenter string
- (String) The data center in which reserved capacity resides.
- flavor string
- id string
- (String) The ID of the virtual guest.
- instances number
- (int) Number of VSI instances this capacity reservation can support.
- name string
- pod string
- (String) The pod in which reserved capacity resides.
- virtual
Guests GetCompute Reserved Capacity Virtual Guest[] - (List of Objects) A nested block describes the VSIs attached to the reserved capacity.
- most
Recent boolean
- datacenter str
- (String) The data center in which reserved capacity resides.
- flavor str
- id str
- (String) The ID of the virtual guest.
- instances float
- (int) Number of VSI instances this capacity reservation can support.
- name str
- pod str
- (String) The pod in which reserved capacity resides.
- virtual_
guests Sequence[GetCompute Reserved Capacity Virtual Guest] - (List of Objects) A nested block describes the VSIs attached to the reserved capacity.
- most_
recent bool
- datacenter String
- (String) The data center in which reserved capacity resides.
- flavor String
- id String
- (String) The ID of the virtual guest.
- instances Number
- (int) Number of VSI instances this capacity reservation can support.
- name String
- pod String
- (String) The pod in which reserved capacity resides.
- virtual
Guests List<Property Map> - (List of Objects) A nested block describes the VSIs attached to the reserved capacity.
- most
Recent Boolean
Supporting Types
GetComputeReservedCapacityVirtualGuest
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibmTerraform Provider.
Viewing docs for ibm 2.1.0
published on Tuesday, May 5, 2026 by ibm-cloud
published on Tuesday, May 5, 2026 by ibm-cloud
