ibm 1.86.0 published on Wednesday, Dec 3, 2025 by ibm-cloud
ibm 1.86.0 published on Wednesday, Dec 3, 2025 by ibm-cloud
Retrieve information about existing IBM resource groups as a read-only data source. For more information, about resource groups, see managing resource groups.
Example Usage
The following example retrieves all resource groups in the account.
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const groups = ibm.getResourceGroups({});
import pulumi
import pulumi_ibm as ibm
groups = ibm.get_resource_groups()
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.GetResourceGroups(ctx, &ibm.GetResourceGroupsArgs{}, 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 groups = Ibm.GetResourceGroups.Invoke();
});
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.GetResourceGroupsArgs;
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 groups = IbmFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.build());
}
}
variables:
groups:
fn::invoke:
function: ibm:getResourceGroups
arguments: {}
Example to retrieve resource groups by name
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const groups = ibm.getResourceGroups({
name: "test",
});
import pulumi
import pulumi_ibm as ibm
groups = ibm.get_resource_groups(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.GetResourceGroups(ctx, &ibm.GetResourceGroupsArgs{
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 groups = Ibm.GetResourceGroups.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.GetResourceGroupsArgs;
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 groups = IbmFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.name("test")
.build());
}
}
variables:
groups:
fn::invoke:
function: ibm:getResourceGroups
arguments:
name: test
Example to retrieve default resource groups
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const groups = ibm.getResourceGroups({
isDefault: true,
});
import pulumi
import pulumi_ibm as ibm
groups = ibm.get_resource_groups(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.GetResourceGroups(ctx, &ibm.GetResourceGroupsArgs{
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 groups = Ibm.GetResourceGroups.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.GetResourceGroupsArgs;
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 groups = IbmFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.isDefault(true)
.build());
}
}
variables:
groups:
fn::invoke:
function: ibm:getResourceGroups
arguments:
isDefault: true
Example to include deleted resource groups
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const groups = ibm.getResourceGroups({
includeDeleted: true,
});
import pulumi
import pulumi_ibm as ibm
groups = ibm.get_resource_groups(include_deleted=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.GetResourceGroups(ctx, &ibm.GetResourceGroupsArgs{
IncludeDeleted: 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 groups = Ibm.GetResourceGroups.Invoke(new()
{
IncludeDeleted = 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.GetResourceGroupsArgs;
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 groups = IbmFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.includeDeleted(true)
.build());
}
}
variables:
groups:
fn::invoke:
function: ibm:getResourceGroups
arguments:
includeDeleted: true
Example to filter resource groups by date
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const groups = ibm.getResourceGroups({
date: "2024-01",
});
import pulumi
import pulumi_ibm as ibm
groups = ibm.get_resource_groups(date="2024-01")
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.GetResourceGroups(ctx, &ibm.GetResourceGroupsArgs{
Date: pulumi.StringRef("2024-01"),
}, 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 groups = Ibm.GetResourceGroups.Invoke(new()
{
Date = "2024-01",
});
});
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.GetResourceGroupsArgs;
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 groups = IbmFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.date("2024-01")
.build());
}
}
variables:
groups:
fn::invoke:
function: ibm:getResourceGroups
arguments:
date: 2024-01
Usage notes
- When no filters are specified, the data source returns all resource groups in the account.
- The
dateparameter is useful for retrieving historical resource group information and excludes resource groups deleted before the specified month. - The
include_deletedparameter allows you to retrieve resource groups that have been soft-deleted from the account. - The data source returns a list of resource groups, even when filtering by name or default status, as these filters could potentially match multiple resource groups.
Using getResourceGroups
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 getResourceGroups(args: GetResourceGroupsArgs, opts?: InvokeOptions): Promise<GetResourceGroupsResult>
function getResourceGroupsOutput(args: GetResourceGroupsOutputArgs, opts?: InvokeOptions): Output<GetResourceGroupsResult>def get_resource_groups(date: Optional[str] = None,
id: Optional[str] = None,
include_deleted: Optional[bool] = None,
is_default: Optional[bool] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetResourceGroupsResult
def get_resource_groups_output(date: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
include_deleted: Optional[pulumi.Input[bool]] = None,
is_default: Optional[pulumi.Input[bool]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetResourceGroupsResult]func GetResourceGroups(ctx *Context, args *GetResourceGroupsArgs, opts ...InvokeOption) (*GetResourceGroupsResult, error)
func GetResourceGroupsOutput(ctx *Context, args *GetResourceGroupsOutputArgs, opts ...InvokeOption) GetResourceGroupsResultOutput> Note: This function is named GetResourceGroups in the Go SDK.
public static class GetResourceGroups
{
public static Task<GetResourceGroupsResult> InvokeAsync(GetResourceGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetResourceGroupsResult> Invoke(GetResourceGroupsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetResourceGroupsResult> getResourceGroups(GetResourceGroupsArgs args, InvokeOptions options)
public static Output<GetResourceGroupsResult> getResourceGroups(GetResourceGroupsArgs args, InvokeOptions options)
fn::invoke:
function: ibm:index/getResourceGroups:getResourceGroups
arguments:
# arguments dictionaryThe following arguments are supported:
- Date string
- The date in YYYY-MM format to filter resource groups. Deleted resource groups are excluded before this month.
- Id string
- (String) The unique identifier of the resource group.
- Include
Deleted bool - Specifies whether to include deleted resource groups in the results.
- Is
Default bool - Specifies whether to filter for default resource groups.
- Name string
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI.
- Date string
- The date in YYYY-MM format to filter resource groups. Deleted resource groups are excluded before this month.
- Id string
- (String) The unique identifier of the resource group.
- Include
Deleted bool - Specifies whether to include deleted resource groups in the results.
- Is
Default bool - Specifies whether to filter for default resource groups.
- Name string
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI.
- date String
- The date in YYYY-MM format to filter resource groups. Deleted resource groups are excluded before this month.
- id String
- (String) The unique identifier of the resource group.
- include
Deleted Boolean - Specifies whether to include deleted resource groups in the results.
- is
Default Boolean - Specifies whether to filter for default resource groups.
- name String
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI.
- date string
- The date in YYYY-MM format to filter resource groups. Deleted resource groups are excluded before this month.
- id string
- (String) The unique identifier of the resource group.
- include
Deleted boolean - Specifies whether to include deleted resource groups in the results.
- is
Default boolean - Specifies whether to filter for default resource groups.
- name string
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI.
- date str
- The date in YYYY-MM format to filter resource groups. Deleted resource groups are excluded before this month.
- id str
- (String) The unique identifier of the resource group.
- include_
deleted bool - Specifies whether to include deleted resource groups in the results.
- is_
default bool - Specifies whether to filter for default resource groups.
- name str
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI.
- date String
- The date in YYYY-MM format to filter resource groups. Deleted resource groups are excluded before this month.
- id String
- (String) The unique identifier of the resource group.
- include
Deleted Boolean - Specifies whether to include deleted resource groups in the results.
- is
Default Boolean - Specifies whether to filter for default resource groups.
- name String
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI.
getResourceGroups Result
The following output properties are available:
- Id string
- (String) The unique identifier of the resource group.
- Resource
Groups List<GetResource Groups Resource Group> - (List of Objects) A list of resource groups matching the specified filters. Each resource group in the list has the following attributes:
- Date string
- Include
Deleted bool - Is
Default bool - (Bool) Indicates whether this is the default resource group for the account.
- Name string
- (String) The human-readable name of the resource group.
- Id string
- (String) The unique identifier of the resource group.
- Resource
Groups []GetResource Groups Resource Group - (List of Objects) A list of resource groups matching the specified filters. Each resource group in the list has the following attributes:
- Date string
- Include
Deleted bool - Is
Default bool - (Bool) Indicates whether this is the default resource group for the account.
- Name string
- (String) The human-readable name of the resource group.
- id String
- (String) The unique identifier of the resource group.
- resource
Groups List<GetResource Groups Resource Group> - (List of Objects) A list of resource groups matching the specified filters. Each resource group in the list has the following attributes:
- date String
- include
Deleted Boolean - is
Default Boolean - (Bool) Indicates whether this is the default resource group for the account.
- name String
- (String) The human-readable name of the resource group.
- id string
- (String) The unique identifier of the resource group.
- resource
Groups GetResource Groups Resource Group[] - (List of Objects) A list of resource groups matching the specified filters. Each resource group in the list has the following attributes:
- date string
- include
Deleted boolean - is
Default boolean - (Bool) Indicates whether this is the default resource group for the account.
- name string
- (String) The human-readable name of the resource group.
- id str
- (String) The unique identifier of the resource group.
- resource_
groups Sequence[GetResource Groups Resource Group] - (List of Objects) A list of resource groups matching the specified filters. Each resource group in the list has the following attributes:
- date str
- include_
deleted bool - is_
default bool - (Bool) Indicates whether this is the default resource group for the account.
- name str
- (String) The human-readable name of the resource group.
- id String
- (String) The unique identifier of the resource group.
- resource
Groups List<Property Map> - (List of Objects) A list of resource groups matching the specified filters. Each resource group in the list has the following attributes:
- date String
- include
Deleted Boolean - is
Default Boolean - (Bool) Indicates whether this is the default resource group for the account.
- name String
- (String) The human-readable name of the resource group.
Supporting Types
GetResourceGroupsResourceGroup
- Account
Id string - (String) The account ID that the resource group belongs to.
- Created
At string - (String) The date and time when the resource group was initially created.
- Crn string
- (String) The full CRN (Cloud Resource Name) associated with the resource group.
- Id string
- (String) The unique identifier of the resource group.
- Is
Default bool - Specifies whether to filter for default resource groups.
- Name string
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI. - Payment
Methods stringUrl - (String) The URL to access the payment methods details 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 associated with the resource group.
- Resource
Linkages List<string> - (List of Strings) An array of resource CRNs that are linked to the resource group.
- State string
- (String) The state of the resource group (e.g., ACTIVE, SUSPENDED).
- Teams
Url string - (String) The URL to access the team details associated with the resource group.
- Updated
At string - (String) The date and time when the resource group was last updated.
- Account
Id string - (String) The account ID that the resource group belongs to.
- Created
At string - (String) The date and time when the resource group was initially created.
- Crn string
- (String) The full CRN (Cloud Resource Name) associated with the resource group.
- Id string
- (String) The unique identifier of the resource group.
- Is
Default bool - Specifies whether to filter for default resource groups.
- Name string
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI. - Payment
Methods stringUrl - (String) The URL to access the payment methods details 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 associated with the resource group.
- Resource
Linkages []string - (List of Strings) An array of resource CRNs that are linked to the resource group.
- State string
- (String) The state of the resource group (e.g., ACTIVE, SUSPENDED).
- Teams
Url string - (String) The URL to access the team details associated with the resource group.
- Updated
At string - (String) The date and time when the resource group was last updated.
- account
Id String - (String) The account ID that the resource group belongs to.
- created
At String - (String) The date and time when the resource group was initially created.
- crn String
- (String) The full CRN (Cloud Resource Name) associated with the resource group.
- id String
- (String) The unique identifier of the resource group.
- is
Default Boolean - Specifies whether to filter for default resource groups.
- name String
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI. - payment
Methods StringUrl - (String) The URL to access the payment methods details 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 associated with the resource group.
- resource
Linkages List<String> - (List of Strings) An array of resource CRNs that are linked to the resource group.
- state String
- (String) The state of the resource group (e.g., ACTIVE, SUSPENDED).
- teams
Url String - (String) The URL to access the team details associated with the resource group.
- updated
At String - (String) The date and time when the resource group was last updated.
- account
Id string - (String) The account ID that the resource group belongs to.
- created
At string - (String) The date and time when the resource group was initially created.
- crn string
- (String) The full CRN (Cloud Resource Name) associated with the resource group.
- id string
- (String) The unique identifier of the resource group.
- is
Default boolean - Specifies whether to filter for default resource groups.
- name string
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI. - payment
Methods stringUrl - (String) The URL to access the payment methods details 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 associated with the resource group.
- resource
Linkages string[] - (List of Strings) An array of resource CRNs that are linked to the resource group.
- state string
- (String) The state of the resource group (e.g., ACTIVE, SUSPENDED).
- teams
Url string - (String) The URL to access the team details associated with the resource group.
- updated
At string - (String) The date and time when the resource group was last updated.
- account_
id str - (String) The account ID that the resource group belongs to.
- created_
at str - (String) The date and time when the resource group was initially created.
- crn str
- (String) The full CRN (Cloud Resource Name) associated with the resource group.
- id str
- (String) The unique identifier of the resource group.
- is_
default bool - Specifies whether to filter for default resource groups.
- name str
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI. - payment_
methods_ strurl - (String) The URL to access the payment methods details 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 associated with the resource group.
- resource_
linkages Sequence[str] - (List of Strings) An array of resource CRNs that are linked to the resource group.
- state str
- (String) The state of the resource group (e.g., ACTIVE, SUSPENDED).
- teams_
url str - (String) The URL to access the team details associated with the resource group.
- updated_
at str - (String) The date and time when the resource group was last updated.
- account
Id String - (String) The account ID that the resource group belongs to.
- created
At String - (String) The date and time when the resource group was initially created.
- crn String
- (String) The full CRN (Cloud Resource Name) associated with the resource group.
- id String
- (String) The unique identifier of the resource group.
- is
Default Boolean - Specifies whether to filter for default resource groups.
- name String
- The name of an IBM Cloud resource group to filter by. You can retrieve the value by running the
ibmcloud resource groupscommand in the IBM Cloud CLI. - payment
Methods StringUrl - (String) The URL to access the payment methods details 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 associated with the resource group.
- resource
Linkages List<String> - (List of Strings) An array of resource CRNs that are linked to the resource group.
- state String
- (String) The state of the resource group (e.g., ACTIVE, SUSPENDED).
- teams
Url String - (String) The URL to access the team details associated with the resource group.
- updated
At String - (String) The date and time when the resource group was last updated.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibmTerraform Provider.
ibm 1.86.0 published on Wednesday, Dec 3, 2025 by ibm-cloud
