All Products
Search
Document Center

Resource Orchestration Service:GetStackGroup

Last Updated:Oct 12, 2026

Queries the details of a stack group by name in a region.

Operation description

This topic provides an example to query the information of an existing stack group named MyStackGroup that uses the self-managed permissions model in the China (Hangzhou) region.

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, see Common parameters.

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

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: Active.

  • DELETED: Deleted.

ACTIVE

AdministrationRoleName

string

The name of the RAM administrator role that Resource Orchestration Service (ROS) assumes when you create a stack group that uses the self-managed permissions model. If you do not specify this parameter, the default value AliyunROSStackGroupAdministrationRole is returned.

AliyunROSStackGroupAdministrationRole

Parameters

array<object>

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 the administrator role (AliyunROSStackGroupAdministrationRole) assumes when you create a stack group that uses the self-managed permissions model. If you do not specify this parameter, the default value AliyunROSStackGroupExecutionRole is returned.

AliyunROSStackGroupExecutionRole

TemplateBody

string

The structure of the template body.

Note

This response parameter is not recommended. Use TemplateContent instead.

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

StackGroupDriftDetectionDetail

object

The details of the last successful drift detection for the stack group.

DriftDetectionTime

string

The time when the drift detection was performed on the stack group. The time is in the YYYY-MM-DDThh:mm:ss format.

2020-02-27T07:47:47

TotalStackInstancesCount

integer

The total number of stack instances.

2

FailedStackInstancesCount

integer

The number of stack instances that failed the drift detection.

0

DriftDetectionStatus

string

The drift detection status of the stack group.

Valid values:

  • COMPLETED: The drift detection is complete, and all stack instances have successfully completed the drift detection.

  • FAILED: The drift detection is complete, and the number of stack instances that failed the drift detection exceeds the specified threshold.

  • PARTIAL_SUCCESS: The drift detection is complete, and some stack instances failed the drift detection, but the number of failed instances does not exceed the threshold.

  • IN_PROGRESS: The drift detection is in progress.

  • STOPPED: The drift detection is canceled by the user.

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 sync.

DRIFTED

InProgressStackInstancesCount

integer

The number of stack instances for which drift detection is in progress.

0

InSyncStackInstancesCount

integer

The number of stack instances that are in sync.

1

CancelledStackInstancesCount

integer

The number of stack instances for which drift detection is canceled.

0

DriftedStackInstancesCount

integer

The number of stack instances that have drifted.

1

ResourceGroupId

string

The ID of the resource group. The value depends on the resource group ID specified when the stack group was created.

rg-acfmxazb4ph6aiy****

PermissionModel

string

The permission model.

Valid values:

  • SELF_MANAGED: Self-managed permissions model.

  • SERVICE_MANAGED: Service-managed permissions model.

Note

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

SELF_MANAGED

AutoDeployment

object

The auto-deployment settings.

Note

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

Enabled

boolean

Specifies whether to enable auto-deployment.

Valid values:

  • true: enables auto-deployment. After auto-deployment is enabled, if a member account is added to the target folder, the stack group automatically deploys stack instances to the specified regions of the new account. If an account is removed from the target folder, the stack group deletes the stack instances from the specified regions of the account.

  • false: disables auto-deployment. After auto-deployment is disabled, stack instances do not change when member accounts in the target folder change.

true

RetainStacksOnAccountRemoval

boolean

Specifies whether to retain the stacks in member accounts when member accounts are removed from the target folder.

Valid values:

  • true: retains the stacks.

  • false: deletes the stacks.

Note

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

true

RdFolderIds

array

The list of target folder IDs in the resource directory. Stack instances are deployed to all accounts in the folders.

Note

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

string

The list of target folder IDs in the resource directory. Stack instances are deployed to all accounts in the folders.

Note

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

["fd-4PvlVLOL8v"]

TemplateContent

string

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

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

CreateTime

string

The time when the stack group was created. The time is in the YYYY-MM-DDThh:mm:ss format.

2024-06-14T02:13:50

UpdateTime

string

The time when the stack group was updated. The time is in the YYYY-MM-DDThh:mm:ss format.

2024-06-15T02:01:00

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.