All Products
Search
Document Center

Resource Management:CreateResourceGroup

Last Updated:Jun 05, 2024

Creates a resource group.

Operation description

Note A maximum of 30 resource groups can be created within an Alibaba Cloud account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ram:CreateResourceGroupWrite
  • ResourceGroup
    acs:ram:*:{#accountId}:resourcegroup/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NamestringYes

The unique identifier of the resource group.

The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.

my-project
DisplayNamestringYes

The display name of the resource group.

The name must be 1 to 50 characters in length.

my-project
Tagobject []No

The tags.

KeystringNo

The key of the tag.

The tag key can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

k1
ValuestringNo

The value of the tag.

The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

v1

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

04F0F334-1335-436C-A1D7-6C044FE73368
ResourceGroupobject

The information of the resource group.

DisplayNamestring

The display name of the resource group.

my-project
Statusstring

The status of the resource group. Valid values:

  • Creating: The resource group is being created.
  • OK: The resource group is created.
Creating
RegionStatusesobject []

The status of the resource group in all regions.

Statusstring

The status of the resource group. Valid values:

  • Creating: The resource group is being created.
  • OK: The resource group is created.
Creating
RegionIdstring

The region ID.

cn-qingdao
AccountIdstring

The ID of the Alibaba Cloud account to which the resource group belongs.

151266687691****
Namestring

The unique identifier of the resource group.

my-project
CreateDatestring

The time when the resource group was created. The time is displayed in UTC.

2021-06-05T14:39:13+08:00
Idstring

The ID of the resource group.

rg-9gLOoK****

Examples

Sample success responses

JSONformat

{
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
  "ResourceGroup": {
    "DisplayName": "my-project",
    "Status": "Creating",
    "RegionStatuses": {
      "RegionStatus": [
        {
          "Status": "Creating",
          "RegionId": "cn-qingdao"
        }
      ]
    },
    "AccountId": "151266687691****",
    "Name": "my-project",
    "CreateDate": "2021-06-05T14:39:13+08:00",
    "Id": "rg-9gLOoK****"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameter.Name.InvalidCharsThe Name is invalid.The Name is invalid.
400InvalidParameter.Name.LengthThe maximum length of Name is exceeded.The maximum length of Name is exceeded.
400InvalidParameter.DisplayName.LengthThe maximum length of DisplayName is exceeded.The maximum length of DisplayName is exceeded.
400MissingParameter.DisplayNameYou must specify DisplayName.You must specify the parameter DisplayName.
400InvalidParameter.DisplayNameThe DisplayName is invalid.The DisplayName is invalid.
409LimitExceeded.ResourceGroupThe count of resource groups beyond the current limits.The maximum number of resource group is exceeded.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-14The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 409
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Tag