全部产品
Search
文档中心

资源编排:DATASOURCE::ARMS::Environments

更新时间:May 06, 2026

DATASOURCE::ARMS::Environments类型用于查询环境列表。

语法

{
  "Type": "DATASOURCE::ARMS::Environments",
  "Properties": {
    "BindResourceId": String,
    "EnvironmentType": String,
    "ResourceGroupId": String,
    "RefreshOptions": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

BindResourceId

String

否

是

绑定的资源 ID。

无

EnvironmentType

String

否

是

环境的类型。

取值:

  • CS:容器服务。

  • ECS:ECS服务。

  • Cloud:云服务。

RefreshOptions

String

否

是

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

取值:

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

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

ResourceGroupId

String

否

是

资源组ID。

无

返回值

Fn::GetAtt

  • Environments:环境列表。

  • EnvironmentIds:环境ID列表。

属性名称

类型

描述

约束

EnvironmentIds

List

环境ID列表。

无

Environments

List

环境列表。

无

ManagedType

String

托管类型。

无

EnvironmentName

String

环境名称。

无

BindVpcCidr

String

绑定 VPC 的网段。

无

EnvironmentId

String

环境实例 ID。

无

Tags

List

环境资源标签。

无

UserId

String

用户 ID。

无

PrometheusInstanceId

String

绑定的 Prometheus 实例 ID。

无

ResourceGroupId

String

资源组 ID。

无

GrafanaFolderUid

String

Grafana 目录唯一 ID。

无

BindResourceId

String

绑定的资源 ID。

无

BindResourceType

String

绑定的资源类型。

无

GrafanaDatasourceUid

String

Grafana 数据源唯一 ID。

无

EnvironmentType

String

环境类型。

无

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ResourceGroupId:
    Type: String
    Description:
      en: The ID of the resource group.
    AssociationProperty: ALIYUN::ECS::ResourceGroup::ResourceGroupId
    Default: Null
    Required: false
  EnvironmentType:
    Type: String
    Description:
      en: Type of environment.
    AllowedValues:
      - ECS
      - CS
      - Cloud
    Default: Null
    Required: false
  BindResourceId:
    Type: String
    Description:
      en: The bound resource ID.
    Default: Null
    Required: false
  RefreshOptions:
    Type: String
    Description:
      en: |-
        The refresh strategy for the datasource resource when the stack is updated. Valid values:
        - Never: Never refresh the datasource resource when the stack is updated.
        - Always: Always refresh the datasource resource when the stack is updated.
        Default is Never.
    AllowedValues:
      - Always
      - Never
    Default: Never
    Required: false
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::ARMS::Environments
    Properties:
      ResourceGroupId:
        Ref: ResourceGroupId
      EnvironmentType:
        Ref: EnvironmentType
      BindResourceId:
        Ref: BindResourceId
      RefreshOptions:
        Ref: RefreshOptions
Outputs:
  Environments:
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Environments
    Description: The list of environments.
  EnvironmentIds:
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - EnvironmentIds
    Description: The list of environment IDs.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ResourceGroupId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the resource group."
      },
      "AssociationProperty": "ALIYUN::ECS::ResourceGroup::ResourceGroupId",
      "Default": null,
      "Required": false
    },
    "EnvironmentType": {
      "Type": "String",
      "Description": {
        "en": "Type of environment."
      },
      "AllowedValues": [
        "ECS",
        "CS",
        "Cloud"
      ],
      "Default": null,
      "Required": false
    },
    "BindResourceId": {
      "Type": "String",
      "Description": {
        "en": "The bound resource ID."
      },
      "Default": null,
      "Required": false
    },
    "RefreshOptions": {
      "Type": "String",
      "Description": {
        "en": "The refresh strategy for the datasource resource when the stack is updated. Valid values:\n- Never: Never refresh the datasource resource when the stack is updated.\n- Always: Always refresh the datasource resource when the stack is updated.\nDefault is Never."
      },
      "AllowedValues": [
        "Always",
        "Never"
      ],
      "Default": "Never",
      "Required": false
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::ARMS::Environments",
      "Properties": {
        "ResourceGroupId": {
          "Ref": "ResourceGroupId"
        },
        "EnvironmentType": {
          "Ref": "EnvironmentType"
        },
        "BindResourceId": {
          "Ref": "BindResourceId"
        },
        "RefreshOptions": {
          "Ref": "RefreshOptions"
        }
      }
    }
  },
  "Outputs": {
    "Environments": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Environments"
        ]
      },
      "Description": "The list of environments."
    },
    "EnvironmentIds": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "EnvironmentIds"
        ]
      },
      "Description": "The list of environment IDs."
    }
  }
}