DATASOURCE::ResourceManager::ResourceGroups

DATASOURCE::ResourceManager::ResourceGroups类型用于查询资源组列表。

语法

{
  "Type": "DATASOURCE::ResourceManager::ResourceGroups",
  "Properties": {
    "DisplayName": String,
    "IncludeTags": Boolean,
    "Name": String,
    "ResourceGroupIds": List,
    "RefreshOptions": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

DisplayName

String

资源组显示名称。

IncludeTags

Boolean

是否返回标签信息。

取值:

  • false(默认值):不返回。

  • true:返回。

说明

当您设置了标签过滤条件后,不论IncludeTags为何值,都会返回标签信息。

Name

String

资源组唯一标识。

ResourceGroupIds

List

资源组 ID 列表。

最多支持设置100个资源组ID。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

返回值

Fn::GetAtt

  • ResourceGroupIds:资源组 ID 列表。

  • ResourceGroups:资源组详情列表。

属性名称

类型

描述

约束

ResourceGroupIds

List

资源组 ID 列表。

ResourceGroups

List

资源组详情列表。

Status

string

资源组状态。

AccountId

string

资源组所属的阿里云账号 ID。

DisplayName

string

资源组显示名称。

ResourceGroupId

string

资源组 ID。

Name

string

资源组唯一标识。

CreateDate

string

资源组创建时间(UTC 时间)。

Tags

string

标签列表。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Name:
    Type: String
    Description:
      en: The identifier of the resource group. This parameter specifies a filter condition for the query. Fuzzy match is supported. The identifier can be a maximum of 50 characters in length and can contain letters, digits, and hyphens (-).
    Required: false
    MinLength: 1
    MaxLength: 50
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::ResourceManager::ResourceGroups
    Properties:
      Name:
        Ref: Name
Outputs:
  ResourceGroupIds:
    Description: The IDs of the resource groups.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ResourceGroupIds
  ResourceGroups:
    Description: The list of the resource groups.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ResourceGroups
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Name": {
      "Type": "String",
      "Description": {
        "en": "The identifier of the resource group. This parameter specifies a filter condition for the query. Fuzzy match is supported. The identifier can be a maximum of 50 characters in length and can contain letters, digits, and hyphens (-)."
      },
      "Required": false,
      "MinLength": 1,
      "MaxLength": 50
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::ResourceManager::ResourceGroups",
      "Properties": {
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Outputs": {
    "ResourceGroupIds": {
      "Description": "The IDs of the resource groups.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ResourceGroupIds"
        ]
      }
    },
    "ResourceGroups": {
      "Description": "The list of the resource groups.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ResourceGroups"
        ]
      }
    }
  }
}