This module returns the ID for the name of a resource group. It can also create a group from a name and return the ID. The module will return the ID of the default resource group if no name is passed, or if the string "Default" or "default" is passed (even if that is not the name of the actual default resource group in the account).
Create new Resource group:
module "resource_group" {
source = "terraform-ibm-modules/resource-group/ibm"
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
resource_group_name = "new-resource-group"
}Return ID of an existing Resource group:
module "resource_group" {
source = "terraform-ibm-modules/resource-group/ibm"
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
existing_resource_group_name = "existing-resource-group"
}Return ID of the default Resource group by passing no name:
module "resource_group" {
source = "terraform-ibm-modules/resource-group/ibm"
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
}Return ID of the default Resource group by the string "Default":
module "resource_group" {
source = "terraform-ibm-modules/resource-group/ibm"
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
existing_resource_group_name = "Default"
}Return ID of the default Resource group by the string "default":
module "resource_group" {
source = "terraform-ibm-modules/resource-group/ibm"
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
existing_resource_group_name = "default"
}You need the following permissions to run this module.
- Account Management
- All Account Management Services service
Administratorplatform access
- All Account Management Services service
| Name | Version |
|---|---|
| terraform | >= 1.9.0 |
| ibm | >= 1.79.0, < 2.0.0 |
No modules.
| Name | Type |
|---|---|
| ibm_resource_group.resource_group | resource |
| ibm_resource_group.default | data source |
| ibm_resource_group.existing_resource_group | data source |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| existing_resource_group_name | Name of an existing resource group. When set to null, default or Default the accounts default resource group is returned. |
string |
null |
no |
| resource_group_name | Name of the resource group to create. Required if not using existing resource group | string |
null |
no |
| Name | Description |
|---|---|
| resource_group_id | Resource group ID |
| resource_group_name | Resource group name |
You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.
To set up your local development environment, see Local development setup in the project documentation.