ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud
ibm.getResourceGroup
Explore with Pulumi AI
Retrieve information about an existing IBM resource group as a read-only data source. For more information, about resource group, see managing resource groups.
Example Usage
The following example enables you to import the resource group by name.
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const group = ibm.getResourceGroup({
name: "test",
});
import pulumi
import pulumi_ibm as ibm
group = ibm.get_resource_group(name="test")
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 {
_, err := ibm.LookupResourceGroup(ctx, &ibm.LookupResourceGroupArgs{
Name: pulumi.StringRef("test"),
}, 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 = "test",
});
});
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 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("test")
.build());
}
}
variables:
group:
fn::invoke:
function: ibm:getResourceGroup
arguments:
name: test
Example to import the default resource group
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const group = ibm.getResourceGroup({
isDefault: true,
});
import pulumi
import pulumi_ibm as ibm
group = ibm.get_resource_group(is_default=True)
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 {
_, err := ibm.LookupResourceGroup(ctx, &ibm.LookupResourceGroupArgs{
IsDefault: 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 @group = Ibm.GetResourceGroup.Invoke(new()
{
IsDefault = 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.GetResourceGroupArgs;
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()
.isDefault("true")
.build());
}
}
variables:
group:
fn::invoke:
function: ibm:getResourceGroup
arguments:
isDefault: 'true'
Using getResourceGroup
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 getResourceGroup(args: GetResourceGroupArgs, opts?: InvokeOptions): Promise<GetResourceGroupResult>
function getResourceGroupOutput(args: GetResourceGroupOutputArgs, opts?: InvokeOptions): Output<GetResourceGroupResult>
def get_resource_group(id: Optional[str] = None,
is_default: Optional[bool] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetResourceGroupResult
def get_resource_group_output(id: Optional[pulumi.Input[str]] = None,
is_default: Optional[pulumi.Input[bool]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetResourceGroupResult]
func LookupResourceGroup(ctx *Context, args *LookupResourceGroupArgs, opts ...InvokeOption) (*LookupResourceGroupResult, error)
func LookupResourceGroupOutput(ctx *Context, args *LookupResourceGroupOutputArgs, opts ...InvokeOption) LookupResourceGroupResultOutput
> Note: This function is named LookupResourceGroup
in the Go SDK.
public static class GetResourceGroup
{
public static Task<GetResourceGroupResult> InvokeAsync(GetResourceGroupArgs args, InvokeOptions? opts = null)
public static Output<GetResourceGroupResult> Invoke(GetResourceGroupInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetResourceGroupResult> getResourceGroup(GetResourceGroupArgs args, InvokeOptions options)
public static Output<GetResourceGroupResult> getResourceGroup(GetResourceGroupArgs args, InvokeOptions options)
fn::invoke:
function: ibm:index/getResourceGroup:getResourceGroup
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- (String) The unique identifier of the new resource group.
- Is
Default bool - Specifies whether you want to import default resource group. Note: Conflicts with the
name
. - Name string
- The name of an IBM Cloud resource group. You can retrieve the value by running the
ibmcloud resource groups
command in the IBM Cloud CLI. Note: Conflicts withis_default
.
- Id string
- (String) The unique identifier of the new resource group.
- Is
Default bool - Specifies whether you want to import default resource group. Note: Conflicts with the
name
. - Name string
- The name of an IBM Cloud resource group. You can retrieve the value by running the
ibmcloud resource groups
command in the IBM Cloud CLI. Note: Conflicts withis_default
.
- id String
- (String) The unique identifier of the new resource group.
- is
Default Boolean - Specifies whether you want to import default resource group. Note: Conflicts with the
name
. - name String
- The name of an IBM Cloud resource group. You can retrieve the value by running the
ibmcloud resource groups
command in the IBM Cloud CLI. Note: Conflicts withis_default
.
- id string
- (String) The unique identifier of the new resource group.
- is
Default boolean - Specifies whether you want to import default resource group. Note: Conflicts with the
name
. - name string
- The name of an IBM Cloud resource group. You can retrieve the value by running the
ibmcloud resource groups
command in the IBM Cloud CLI. Note: Conflicts withis_default
.
- id str
- (String) The unique identifier of the new resource group.
- is_
default bool - Specifies whether you want to import default resource group. Note: Conflicts with the
name
. - name str
- The name of an IBM Cloud resource group. You can retrieve the value by running the
ibmcloud resource groups
command in the IBM Cloud CLI. Note: Conflicts withis_default
.
- id String
- (String) The unique identifier of the new resource group.
- is
Default Boolean - Specifies whether you want to import default resource group. Note: Conflicts with the
name
. - name String
- The name of an IBM Cloud resource group. You can retrieve the value by running the
ibmcloud resource groups
command in the IBM Cloud CLI. Note: Conflicts withis_default
.
getResourceGroup Result
The following output properties are available:
- Account
Id string - (String) Account ID.
- Created
At string - (Timestamp) The date when the resource group initially created.
- Crn string
- (String) The full CRN associated with the resource group.
- Id string
- (String) The unique identifier of the new resource group.
- Is
Default bool - Name string
- Payment
Methods stringUrl - (String) The URL to access the payment methods details that is associated with the resource group.
- Quota
Id string - (String) An alpha-numeric value identifying the quota ID associated with the resource group.
- Quota
Url string - (String) The URL to access the quota details that is associated with the resource group.
- Resource
Linkages List<string> - (String) An array of the resources that is linked to the resource group.
- State string
- (String) The state of the resource group.
- Teams
Url string - (String) The URL to access the team details that is associated with the resource group.
- Updated
At string - (Timestamp) The date when the resource group last updated.
- Account
Id string - (String) Account ID.
- Created
At string - (Timestamp) The date when the resource group initially created.
- Crn string
- (String) The full CRN associated with the resource group.
- Id string
- (String) The unique identifier of the new resource group.
- Is
Default bool - Name string
- Payment
Methods stringUrl - (String) The URL to access the payment methods details that is associated with the resource group.
- Quota
Id string - (String) An alpha-numeric value identifying the quota ID associated with the resource group.
- Quota
Url string - (String) The URL to access the quota details that is associated with the resource group.
- Resource
Linkages []string - (String) An array of the resources that is linked to the resource group.
- State string
- (String) The state of the resource group.
- Teams
Url string - (String) The URL to access the team details that is associated with the resource group.
- Updated
At string - (Timestamp) The date when the resource group last updated.
- account
Id String - (String) Account ID.
- created
At String - (Timestamp) The date when the resource group initially created.
- crn String
- (String) The full CRN associated with the resource group.
- id String
- (String) The unique identifier of the new resource group.
- is
Default Boolean - name String
- payment
Methods StringUrl - (String) The URL to access the payment methods details that is associated with the resource group.
- quota
Id String - (String) An alpha-numeric value identifying the quota ID associated with the resource group.
- quota
Url String - (String) The URL to access the quota details that is associated with the resource group.
- resource
Linkages List<String> - (String) An array of the resources that is linked to the resource group.
- state String
- (String) The state of the resource group.
- teams
Url String - (String) The URL to access the team details that is associated with the resource group.
- updated
At String - (Timestamp) The date when the resource group last updated.
- account
Id string - (String) Account ID.
- created
At string - (Timestamp) The date when the resource group initially created.
- crn string
- (String) The full CRN associated with the resource group.
- id string
- (String) The unique identifier of the new resource group.
- is
Default boolean - name string
- payment
Methods stringUrl - (String) The URL to access the payment methods details that is associated with the resource group.
- quota
Id string - (String) An alpha-numeric value identifying the quota ID associated with the resource group.
- quota
Url string - (String) The URL to access the quota details that is associated with the resource group.
- resource
Linkages string[] - (String) An array of the resources that is linked to the resource group.
- state string
- (String) The state of the resource group.
- teams
Url string - (String) The URL to access the team details that is associated with the resource group.
- updated
At string - (Timestamp) The date when the resource group last updated.
- account_
id str - (String) Account ID.
- created_
at str - (Timestamp) The date when the resource group initially created.
- crn str
- (String) The full CRN associated with the resource group.
- id str
- (String) The unique identifier of the new resource group.
- is_
default bool - name str
- payment_
methods_ strurl - (String) The URL to access the payment methods details that is associated with the resource group.
- quota_
id str - (String) An alpha-numeric value identifying the quota ID associated with the resource group.
- quota_
url str - (String) The URL to access the quota details that is associated with the resource group.
- resource_
linkages Sequence[str] - (String) An array of the resources that is linked to the resource group.
- state str
- (String) The state of the resource group.
- teams_
url str - (String) The URL to access the team details that is associated with the resource group.
- updated_
at str - (Timestamp) The date when the resource group last updated.
- account
Id String - (String) Account ID.
- created
At String - (Timestamp) The date when the resource group initially created.
- crn String
- (String) The full CRN associated with the resource group.
- id String
- (String) The unique identifier of the new resource group.
- is
Default Boolean - name String
- payment
Methods StringUrl - (String) The URL to access the payment methods details that is associated with the resource group.
- quota
Id String - (String) An alpha-numeric value identifying the quota ID associated with the resource group.
- quota
Url String - (String) The URL to access the quota details that is associated with the resource group.
- resource
Linkages List<String> - (String) An array of the resources that is linked to the resource group.
- state String
- (String) The state of the resource group.
- teams
Url String - (String) The URL to access the team details that is associated with the resource group.
- updated
At String - (Timestamp) The date when the resource group last updated.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.