DATASOURCE::ARMS::Environments

更新时间:
复制 MD 格式

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