ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud
ibm.getResourceInstance
Explore with Pulumi AI
Retrieve information about an existing IBM resource instance from IBM Cloud as a read-only data source. For more information, about resource instance, see ibmcloud resource service-instance.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const group = ibm.getResourceGroup({
name: "default",
});
const testaccDsResourceInstance = group.then(group => ibm.getResourceInstance({
name: "myobjectstore",
location: "global",
resourceGroupId: group.id,
service: "cloud-object-storage",
}));
const testaccDsResourceInstanceIdentifier = ibm.getResourceInstance({
identifier: ibm_resource_instance.instance.id,
});
import pulumi
import pulumi_ibm as ibm
group = ibm.get_resource_group(name="default")
testacc_ds_resource_instance = ibm.get_resource_instance(name="myobjectstore",
location="global",
resource_group_id=group.id,
service="cloud-object-storage")
testacc_ds_resource_instance_identifier = ibm.get_resource_instance(identifier=ibm_resource_instance["instance"]["id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
group, err := ibm.LookupResourceGroup(ctx, &ibm.LookupResourceGroupArgs{
Name: pulumi.StringRef("default"),
}, nil)
if err != nil {
return err
}
_, err = ibm.LookupResourceInstance(ctx, &ibm.LookupResourceInstanceArgs{
Name: pulumi.StringRef("myobjectstore"),
Location: pulumi.StringRef("global"),
ResourceGroupId: pulumi.StringRef(group.Id),
Service: pulumi.StringRef("cloud-object-storage"),
}, nil)
if err != nil {
return err
}
_, err = ibm.LookupResourceInstance(ctx, &ibm.LookupResourceInstanceArgs{
Identifier: pulumi.StringRef(ibm_resource_instance.Instance.Id),
}, 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 @group = Ibm.GetResourceGroup.Invoke(new()
{
Name = "default",
});
var testaccDsResourceInstance = Ibm.GetResourceInstance.Invoke(new()
{
Name = "myobjectstore",
Location = "global",
ResourceGroupId = @group.Apply(getResourceGroupResult => getResourceGroupResult.Id),
Service = "cloud-object-storage",
});
var testaccDsResourceInstanceIdentifier = Ibm.GetResourceInstance.Invoke(new()
{
Identifier = ibm_resource_instance.Instance.Id,
});
});
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.GetResourceGroupArgs;
import com.pulumi.ibm.inputs.GetResourceInstanceArgs;
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 group = IbmFunctions.getResourceGroup(GetResourceGroupArgs.builder()
.name("default")
.build());
final var testaccDsResourceInstance = IbmFunctions.getResourceInstance(GetResourceInstanceArgs.builder()
.name("myobjectstore")
.location("global")
.resourceGroupId(group.applyValue(getResourceGroupResult -> getResourceGroupResult.id()))
.service("cloud-object-storage")
.build());
final var testaccDsResourceInstanceIdentifier = IbmFunctions.getResourceInstance(GetResourceInstanceArgs.builder()
.identifier(ibm_resource_instance.instance().id())
.build());
}
}
variables:
group:
fn::invoke:
function: ibm:getResourceGroup
arguments:
name: default
testaccDsResourceInstance:
fn::invoke:
function: ibm:getResourceInstance
arguments:
name: myobjectstore
location: global
resourceGroupId: ${group.id}
service: cloud-object-storage
testaccDsResourceInstanceIdentifier:
fn::invoke:
function: ibm:getResourceInstance
arguments:
identifier: ${ibm_resource_instance.instance.id}
Using getResourceInstance
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 getResourceInstance(args: GetResourceInstanceArgs, opts?: InvokeOptions): Promise<GetResourceInstanceResult>
function getResourceInstanceOutput(args: GetResourceInstanceOutputArgs, opts?: InvokeOptions): Output<GetResourceInstanceResult>
def get_resource_instance(id: Optional[str] = None,
identifier: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
resource_group_id: Optional[str] = None,
service: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetResourceInstanceResult
def get_resource_instance_output(id: Optional[pulumi.Input[str]] = None,
identifier: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
resource_group_id: Optional[pulumi.Input[str]] = None,
service: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetResourceInstanceResult]
func LookupResourceInstance(ctx *Context, args *LookupResourceInstanceArgs, opts ...InvokeOption) (*LookupResourceInstanceResult, error)
func LookupResourceInstanceOutput(ctx *Context, args *LookupResourceInstanceOutputArgs, opts ...InvokeOption) LookupResourceInstanceResultOutput
> Note: This function is named LookupResourceInstance
in the Go SDK.
public static class GetResourceInstance
{
public static Task<GetResourceInstanceResult> InvokeAsync(GetResourceInstanceArgs args, InvokeOptions? opts = null)
public static Output<GetResourceInstanceResult> Invoke(GetResourceInstanceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetResourceInstanceResult> getResourceInstance(GetResourceInstanceArgs args, InvokeOptions options)
public static Output<GetResourceInstanceResult> getResourceInstance(GetResourceInstanceArgs args, InvokeOptions options)
fn::invoke:
function: ibm:index/getResourceInstance:getResourceInstance
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- (String) The unique identifier of the resource instance.
- Identifier string
- The GUID of the resource instance. Conflicts with other arguments.
- Location string
- The location or the environment in which the instance exists.
- Name string
- The name of the resource instance.
- Resource
Group stringId - The ID of the resource group where the resource instance exists. If not provided it takes the default resource group.
- Service string
- The service type of the instance. You can retrieve the value by executing the
ibmcloud catalog service-marketplace
oribmcloud catalog search
command in the IBM Cloud CLI.
- Id string
- (String) The unique identifier of the resource instance.
- Identifier string
- The GUID of the resource instance. Conflicts with other arguments.
- Location string
- The location or the environment in which the instance exists.
- Name string
- The name of the resource instance.
- Resource
Group stringId - The ID of the resource group where the resource instance exists. If not provided it takes the default resource group.
- Service string
- The service type of the instance. You can retrieve the value by executing the
ibmcloud catalog service-marketplace
oribmcloud catalog search
command in the IBM Cloud CLI.
- id String
- (String) The unique identifier of the resource instance.
- identifier String
- The GUID of the resource instance. Conflicts with other arguments.
- location String
- The location or the environment in which the instance exists.
- name String
- The name of the resource instance.
- resource
Group StringId - The ID of the resource group where the resource instance exists. If not provided it takes the default resource group.
- service String
- The service type of the instance. You can retrieve the value by executing the
ibmcloud catalog service-marketplace
oribmcloud catalog search
command in the IBM Cloud CLI.
- id string
- (String) The unique identifier of the resource instance.
- identifier string
- The GUID of the resource instance. Conflicts with other arguments.
- location string
- The location or the environment in which the instance exists.
- name string
- The name of the resource instance.
- resource
Group stringId - The ID of the resource group where the resource instance exists. If not provided it takes the default resource group.
- service string
- The service type of the instance. You can retrieve the value by executing the
ibmcloud catalog service-marketplace
oribmcloud catalog search
command in the IBM Cloud CLI.
- id str
- (String) The unique identifier of the resource instance.
- identifier str
- The GUID of the resource instance. Conflicts with other arguments.
- location str
- The location or the environment in which the instance exists.
- name str
- The name of the resource instance.
- resource_
group_ strid - The ID of the resource group where the resource instance exists. If not provided it takes the default resource group.
- service str
- The service type of the instance. You can retrieve the value by executing the
ibmcloud catalog service-marketplace
oribmcloud catalog search
command in the IBM Cloud CLI.
- id String
- (String) The unique identifier of the resource instance.
- identifier String
- The GUID of the resource instance. Conflicts with other arguments.
- location String
- The location or the environment in which the instance exists.
- name String
- The name of the resource instance.
- resource
Group StringId - The ID of the resource group where the resource instance exists. If not provided it takes the default resource group.
- service String
- The service type of the instance. You can retrieve the value by executing the
ibmcloud catalog service-marketplace
oribmcloud catalog search
command in the IBM Cloud CLI.
getResourceInstance Result
The following output properties are available:
- Crn string
- Extensions Dictionary<string, string>
- (String) The extended metadata as a map associated with the resource instance.
- Guid string
- (String) The GUID of the resource instance.
- Id string
- (String) The unique identifier of the resource instance.
- Location string
- Name string
- Onetime
Credentials bool - (Bool) A boolean that dictates if the onetime_credentials is true or false.
- Parameters
Json string - (String) The parameters associated with the instance in json format.
- Plan string
- (String) The plan for the service offering used by this resource instance.
- Resource
Controller stringUrl - Resource
Crn string - Resource
Group stringId - Resource
Group stringName - Resource
Name string - Resource
Status string - Service string
- Status string
- (String) The status of resource instance.
- List<string>
- Identifier string
- Crn string
- Extensions map[string]string
- (String) The extended metadata as a map associated with the resource instance.
- Guid string
- (String) The GUID of the resource instance.
- Id string
- (String) The unique identifier of the resource instance.
- Location string
- Name string
- Onetime
Credentials bool - (Bool) A boolean that dictates if the onetime_credentials is true or false.
- Parameters
Json string - (String) The parameters associated with the instance in json format.
- Plan string
- (String) The plan for the service offering used by this resource instance.
- Resource
Controller stringUrl - Resource
Crn string - Resource
Group stringId - Resource
Group stringName - Resource
Name string - Resource
Status string - Service string
- Status string
- (String) The status of resource instance.
- []string
- Identifier string
- crn String
- extensions Map<String,String>
- (String) The extended metadata as a map associated with the resource instance.
- guid String
- (String) The GUID of the resource instance.
- id String
- (String) The unique identifier of the resource instance.
- location String
- name String
- onetime
Credentials Boolean - (Bool) A boolean that dictates if the onetime_credentials is true or false.
- parameters
Json String - (String) The parameters associated with the instance in json format.
- plan String
- (String) The plan for the service offering used by this resource instance.
- resource
Controller StringUrl - resource
Crn String - resource
Group StringId - resource
Group StringName - resource
Name String - resource
Status String - service String
- status String
- (String) The status of resource instance.
- List<String>
- identifier String
- crn string
- extensions {[key: string]: string}
- (String) The extended metadata as a map associated with the resource instance.
- guid string
- (String) The GUID of the resource instance.
- id string
- (String) The unique identifier of the resource instance.
- location string
- name string
- onetime
Credentials boolean - (Bool) A boolean that dictates if the onetime_credentials is true or false.
- parameters
Json string - (String) The parameters associated with the instance in json format.
- plan string
- (String) The plan for the service offering used by this resource instance.
- resource
Controller stringUrl - resource
Crn string - resource
Group stringId - resource
Group stringName - resource
Name string - resource
Status string - service string
- status string
- (String) The status of resource instance.
- string[]
- identifier string
- crn str
- extensions Mapping[str, str]
- (String) The extended metadata as a map associated with the resource instance.
- guid str
- (String) The GUID of the resource instance.
- id str
- (String) The unique identifier of the resource instance.
- location str
- name str
- onetime_
credentials bool - (Bool) A boolean that dictates if the onetime_credentials is true or false.
- parameters_
json str - (String) The parameters associated with the instance in json format.
- plan str
- (String) The plan for the service offering used by this resource instance.
- resource_
controller_ strurl - resource_
crn str - resource_
group_ strid - resource_
group_ strname - resource_
name str - resource_
status str - service str
- status str
- (String) The status of resource instance.
- Sequence[str]
- identifier str
- crn String
- extensions Map<String>
- (String) The extended metadata as a map associated with the resource instance.
- guid String
- (String) The GUID of the resource instance.
- id String
- (String) The unique identifier of the resource instance.
- location String
- name String
- onetime
Credentials Boolean - (Bool) A boolean that dictates if the onetime_credentials is true or false.
- parameters
Json String - (String) The parameters associated with the instance in json format.
- plan String
- (String) The plan for the service offering used by this resource instance.
- resource
Controller StringUrl - resource
Crn String - resource
Group StringId - resource
Group StringName - resource
Name String - resource
Status String - service String
- status String
- (String) The status of resource instance.
- List<String>
- identifier String
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.