DATASOURCE::ResourceManager::ResourceGroup类型用于查询资源组信息。
语法
{
  "Type": "DATASOURCE::ResourceManager::ResourceGroup",
  "Properties": {
    "IncludeTags": Boolean,
    "ResourceGroupId": String,
    "RefreshOptions": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| IncludeTags | Boolean | 否 | 是 | 是否返回标签信息。 | 取值: 
 | 
| ResourceGroupId | String | 否 | 是 | 资源组 ID。 | 无 | 
| RefreshOptions | String | 否 | 是 | 当资源栈更新时,数据源资源的刷新策略。 | 有效值: 
 | 
返回值
Fn::GetAtt
- Status:资源组状态。 
- RegionStatuses:各个地域的资源组状态。 
- AccountId:资源组所属的阿里云账号 ID。 
- ResourceGroupId:资源组 ID。 
- DisplayName:资源组显示名称。 
- CreateDate:资源组创建时间(UTC 时间)。 
- Tags:标签列表。 
- Name:资源组唯一标识。 
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ResourceGroupId:
    AssociationProperty: ALIYUN::ECS::ResourceGroup::ResourceGroupId
    Type: String
    Description:
      en: The ID of the resource group.
    Required: false
    MinLength: 1
    MaxLength: 50
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::ResourceManager::ResourceGroup
    Properties:
      ResourceGroupId:
        Ref: ResourceGroupId
Outputs:
  Status:
    Description: The status of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Status
  RegionStatuses:
    Description: The status of the resource group in each region.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - RegionStatuses
  AccountId:
    Description: The ID of the Alibaba Cloud account to which the resource group belongs.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - AccountId
  ResourceGroupId:
    Description: The ID of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ResourceGroupId
  DisplayName:
    Description: The display name of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - DisplayName
  CreateDate:
    Description: The time when the resource group was created.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - CreateDate
  Tags:
    Description: The tags of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Tags
  Name:
    Description: The name of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Name
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ResourceGroupId": {
      "AssociationProperty": "ALIYUN::ECS::ResourceGroup::ResourceGroupId",
      "Type": "String",
      "Description": {
        "en": "The ID of the resource group."
      },
      "Required": false,
      "MinLength": 1,
      "MaxLength": 50
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::ResourceManager::ResourceGroup",
      "Properties": {
        "ResourceGroupId": {
          "Ref": "ResourceGroupId"
        }
      }
    }
  },
  "Outputs": {
    "Status": {
      "Description": "The status of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Status"
        ]
      }
    },
    "RegionStatuses": {
      "Description": "The status of the resource group in each region.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "RegionStatuses"
        ]
      }
    },
    "AccountId": {
      "Description": "The ID of the Alibaba Cloud account to which the resource group belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "AccountId"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The ID of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ResourceGroupId"
        ]
      }
    },
    "DisplayName": {
      "Description": "The display name of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "DisplayName"
        ]
      }
    },
    "CreateDate": {
      "Description": "The time when the resource group was created.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CreateDate"
        ]
      }
    },
    "Tags": {
      "Description": "The tags of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Tags"
        ]
      }
    },
    "Name": {
      "Description": "The name of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Name"
        ]
      }
    }
  }
}
                        该文章对您有帮助吗?