DATASOURCE::ResourceManager::ResourceGroup

DATASOURCE::ResourceManager::ResourceGroup类型用于查询资源组信息。

语法

{
  "Type": "DATASOURCE::ResourceManager::ResourceGroup",
  "Properties": {
    "IncludeTags": Boolean,
    "ResourceGroupId": String,
    "RefreshOptions": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

IncludeTags

Boolean

是否返回标签信息。

取值:

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

  • true:返回。

ResourceGroupId

String

资源组 ID。

RefreshOptions

String

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

有效值:

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

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

返回值

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"
        ]
      }
    }
  }
}