All Products
Search
Document Center

Resource Orchestration Service:GetStackGroup

Last Updated:Aug 18, 2025

Queries the details of a stack group by its name in an Alibaba Cloud region.

Operation description

This topic provides an example of how to query a stack group named MyStackGroup. The stack group is in the China (Hangzhou) region and uses the self-managed permission mode.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ros:GetStackGroup

get

*StackGroup

acs:ros:{#regionId}:{#accountId}:stackgroup/{#StackGroupName}

None

None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the stack group. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

StackGroupName

string

No

The name of the stack group. The name must be unique within a region. The name can be up to 255 characters in length, and must start with a digit or a letter. It can contain digits, letters, hyphens (-), and underscores (_).

Note

You must specify only one of the StackGroupName and StackGroupId parameters.

MyStackGroup

StackGroupId

string

No

The ID of the stack group.

Note

You must specify only one of the StackGroupName and StackGroupId parameters.

fd0ddef9-9540-4b42-a464-94f77835****

For more information about common request parameters, refer to Common parameters.

Response parameters

Parameter

Type

Description

Example

object

RequestId

string

The request ID.

14A07460-EBE7-47CA-9757-12CC4761D47A

StackGroup

object

The details of the stack group.

StackGroupId

string

The ID of the stack group.

fd0ddef9-9540-4b42-a464-94f77835****

Status

string

The status of the stack group.

Valid values:

  • ACTIVE: The stack group is active.

  • DELETED: The stack group is deleted.

ACTIVE

AdministrationRoleName

string

The name of the RAM administrator role that is assumed by ROS. This parameter is specified when you create a stack group in self-managed permission mode. If you do not specify this parameter, the default value AliyunROSStackGroupAdministrationRole is returned.

AliyunROSStackGroupAdministrationRole

Parameters

array<object>

The list of the parameters of the stack group.

object

ParameterKey

string

The name of the parameter.

Amount

ParameterValue

string

The value of the parameter.

12

Description

string

The description of the stack group.

StackGroup Description

StackGroupName

string

The name of the stack group.

MyStackGroup

ExecutionRoleName

string

The name of the RAM execution role that is assumed by the administrator role AliyunROSStackGroupAdministrationRole. This parameter is specified when you create a stack group in self-managed permission mode. If you do not specify this parameter, the default value AliyunROSStackGroupExecutionRole is returned.

AliyunROSStackGroupExecutionRole

TemplateBody

string

The structure of the template body.

Note

We recommend that you do not use this parameter. Use TemplateContent instead.

{"ROSTemplateFormatVersion": "2015-09-01"}

StackGroupDriftDetectionDetail

object

The details of the last successful drift detection operation on the stack group.

DriftDetectionTime

string

The time when the drift detection operation was performed on the stack group.

2020-02-27T07:47:47

TotalStackInstancesCount

integer

The number of stack instances.

2

FailedStackInstancesCount

integer

The number of stack instances for which the drift detection operation failed.

0

DriftDetectionStatus

string

The drift detection status of the stack group.

Valid values:

  • COMPLETED: The drift detection operation is completed for the stack group. All stack instances have been successfully drift-detected.

  • FAILED: The drift detection operation is completed for the stack group. The number of stack instances that failed the drift detection exceeds the specified threshold.

  • PARTIAL_SUCCESS: The drift detection operation is completed for the stack group. The drift detection operation failed for some stack instances, but the number of failures did not exceed the threshold.

  • IN_PROGRESS: The drift detection operation is in progress for the stack group.

  • STOPPED: The drift detection operation on the stack group was canceled.

COMPLETED

StackGroupDriftStatus

string

The drift status of the stack group.

Valid values:

  • DRIFTED: At least one stack instance has drifted.

  • NOT_CHECKED: No successful drift detection has been performed on the stack group.

  • IN_SYNC: All stack instances are in the IN_SYNC state.

DRIFTED

InProgressStackInstancesCount

integer

The number of stack instances on which a drift detection operation is in progress.

0

InSyncStackInstancesCount

integer

The number of stack instances that are in the IN_SYNC state.

1

CancelledStackInstancesCount

integer

The number of stack instances for which the drift detection operation was canceled.

0

DriftedStackInstancesCount

integer

The number of stack instances that are in the DRIFTED state.

1

ResourceGroupId

string

The ID of the resource group. This value is determined by the resource group ID that you specify when you create the stack group.

rg-acfmxazb4ph6aiy****

PermissionModel

string

The permission model.

Valid values:

  • SELF_MANAGED: self-managed permissions.

  • SERVICE_MANAGED: service-managed permissions.

Note

For more information about the permission models of stack groups, refer to Overview.

SELF_MANAGED

AutoDeployment

object

The information about automatic deployment settings.

Note

This parameter is returned only if PermissionModel is set to SERVICE_MANAGED.

Enabled

boolean

Indicates whether automatic deployment is enabled or disabled.

Valid values:

  • true: Automatic deployment is enabled. If you add a new member account to the folder, the stack group automatically deploys stack instances in the specified region of the new account. If you remove a member account from the folder, the stack group automatically deletes stack instances from the specified region of the account.

  • false: Automatic deployment is disabled. After automatic deployment is disabled, the stack instances remain unchanged when the member accounts in the folder change.

true

RetainStacksOnAccountRemoval

boolean

Indicates whether to retain the stacks in the member account when the member account is removed from the folder.

Valid values:

  • true: retains the stacks.

  • false: deletes the stacks.

Note

This parameter is returned only if Enabled is set to true.

true

RdFolderIds

array

The IDs of the folders in the resource directory. Stack instances are deployed in all the accounts in the folders.

Note

This parameter is returned only if PermissionModel is set to SERVICE_MANAGED.

string

The IDs of the folders in the resource directory. Stack instances are deployed in all the accounts in the folders.

Note

This parameter is returned only if PermissionModel is set to SERVICE_MANAGED.

["fd-4PvlVLOL8v"]

TemplateContent

string

The structure of the template body. The structure is in the JSON format. For more information, refer to Template syntax.

{ "ROSTemplateFormatVersion": "2015-09-01" }

CreateTime

string

The time when the stack group was created.

UpdateTime

string

The time when the stack group was updated.

The action to perform. Set the value to GetStackGroup.

Examples

Success response

JSON format

{
  "RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
  "StackGroup": {
    "StackGroupId": "fd0ddef9-9540-4b42-a464-94f77835****",
    "Status": "ACTIVE",
    "AdministrationRoleName": "AliyunROSStackGroupAdministrationRole",
    "Parameters": [
      {
        "ParameterKey": "Amount",
        "ParameterValue": "12"
      }
    ],
    "Description": "StackGroup Description",
    "StackGroupName": "MyStackGroup",
    "ExecutionRoleName": "AliyunROSStackGroupExecutionRole",
    "TemplateBody": "{\"ROSTemplateFormatVersion\": \"2015-09-01\"}",
    "StackGroupDriftDetectionDetail": {
      "DriftDetectionTime": "2020-02-27T07:47:47",
      "TotalStackInstancesCount": 2,
      "FailedStackInstancesCount": 0,
      "DriftDetectionStatus": "COMPLETED",
      "StackGroupDriftStatus": "DRIFTED",
      "InProgressStackInstancesCount": 0,
      "InSyncStackInstancesCount": 1,
      "CancelledStackInstancesCount": 0,
      "DriftedStackInstancesCount": 1
    },
    "ResourceGroupId": "rg-acfmxazb4ph6aiy****",
    "PermissionModel": "SELF_MANAGED",
    "AutoDeployment": {
      "Enabled": true,
      "RetainStacksOnAccountRemoval": true
    },
    "RdFolderIds": [
      "[\"fd-4PvlVLOL8v\"]"
    ],
    "TemplateContent": "{\n      \"ROSTemplateFormatVersion\": \"2015-09-01\"\n}",
    "CreateTime": "2024-06-14T02:13:50",
    "UpdateTime": "2024-06-15T02:01:00"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.