DATASOURCE::ResourceManager::ResourceGroups类型用于查询资源组列表。
语法
{
"Type": "DATASOURCE::ResourceManager::ResourceGroups",
"Properties": {
"DisplayName": String,
"IncludeTags": Boolean,
"Name": String,
"ResourceGroupIds": List,
"RefreshOptions": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
DisplayName | String | 否 | 是 | 资源组显示名称。 | 无 |
IncludeTags | Boolean | 否 | 是 | 是否返回标签信息。 | 取值:
说明 当您设置了标签过滤条件后,不论 |
Name | String | 否 | 是 | 资源组唯一标识。 | 无 |
ResourceGroupIds | List | 否 | 是 | 资源组 ID 列表。 | 最多支持设置100个资源组ID。 |
RefreshOptions | String | 否 | 是 | 当资源栈更新时,数据源资源的刷新策略。 | 有效值:
|
返回值
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"
]
}
}
}
}
该文章对您有帮助吗?