全部产品
Search
文档中心

资源编排:ALIYUN::ARMS::Environment

更新时间:Sep 18, 2024

ALIYUN::ARMS::Environment类型用于创建环境实例。

语法

{
  "Type": "ALIYUN::ARMS::Environment",
  "Properties": {
    "BindResourceId": String,
    "DeletePromInstance": Boolean,
    "EnvironmentSubType": String,
    "EnvironmentType": String,
    "EnvironmentName": String,
    "FeePackage": String,
    "GrafanaWorkspaceId": String,
    "ManagedType": String,
    "PrometheusInstanceId": String,
    "ResourceGroupId": String,
    "Tags": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

BindResourceId

String

环境绑定的资源实例 ID。

包括容器实例 ID 或 VpcId。 对于 Cloud 类型的环境,当前字段值为 RegionId。

EnvironmentSubType

String

环境的子类型。

取值:

  • CS:目前支持 ACK、One 子类型。

  • ECS :目前支持 ECS 子类型。

  • Cloud :目前支持 Cloud 子类型。

EnvironmentType

String

环境类型。

取值:

  • CS:容器服务。

  • ECS:ECS。

  • Cloud:云服务。

EnvironmentName

String

环境名称。

DeletePromInstance

Boolean

是否级联删除 prometheus 实例。

FeePackage

String

付费套餐。

说明
  • EnvironmentType 为 CS 时:可以指定为 CS_Basic(默认值)或 CS_Pro。

  • EnvironmentType 为其它值时,请输入空值。

GrafanaWorkspaceId

String

环境绑定的 grafana 工作区 id。

传空时,表示使用默认的共享 grafana。

ManagedType

String

托管类型。

取值:

  • none: 非托管。ACK 集群的默认值。

  • agent:托管 agent(含 ksm)。ASK、ACS、AckOne 集群的默认值。

  • agent-exporter: 托管 agent 和 exporter。云服务类型的默认值。

PrometheusInstanceId

String

环境绑定的 prom 实例 id。

如果未提供,请调用 InitEnvironment 接口完成存储实例的初始化。

ResourceGroupId

String

资源组 Id。

Tags

List

标签。

最多支持添加20个标签。

更多信息,请参见Tags属性。

Tags语法

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

Value

String

标签值。

返回值

Fn::GetAtt

  • ManagedType:托管类型。

  • EnvironmentId:环境 id

  • EnvironmentSubType:环境的子类型。

  • EnvironmentType:环境类型。

  • ResourceGroupId:资源组 Id。

  • EnvironmentName:环境名称。

  • GrafanaWorkspaceId:环境绑定的 grafana 工作区 id。

  • PrometheusInstanceId:环境绑定的 prom 实例 id。

  • FeePackage:付费套餐。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  EnvironmentSubType:
    Type: String
    Description:
      en: |-
        The subtype of the environment. Valid values:
        One: CS type environment
        ACK: CS type environment
        ECS: ECS type environment
        Cloud: cloud service
    AllowedValues:
      - ACK
      - ECS
      - One
      - Cloud
    Required: true
  EnvironmentType:
    Type: String
    Description:
      en: |-
        The type of the environment. Valid values:
        CS: ACK
        ECS: ECS
        Cloud: cloud service
    AllowedValues:
      - CS
      - ECS
      - Cloud
    Required: true
  EnvironmentName:
    Type: String
    Description:
      en: The name of the environment.
    Required: true
  BindResourceId:
    Type: String
    Description:
      en: The ID of the resource bound to the environment, such as the container ID or VPC ID. For a Cloud environment, specify the region ID.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::ARMS::Environment
    Properties:
      EnvironmentSubType:
        Ref: EnvironmentSubType
      EnvironmentType:
        Ref: EnvironmentType
      EnvironmentName:
        Ref: EnvironmentName
      BindResourceId:
        Ref: BindResourceId
Outputs:
  ManagedType:
    Description: Specifies whether agents or exporters are managed.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ManagedType
  EnvironmentId:
    Description: The id of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentId
  EnvironmentSubType:
    Description: The subtype of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentSubType
  EnvironmentType:
    Description: The type of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentType
  ResourceGroupId:
    Description: The ID of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ResourceGroupId
  EnvironmentName:
    Description: The name of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentName
  GrafanaWorkspaceId:
    Description: The ID of the grafana workspace bound to the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GrafanaWorkspaceId
  PrometheusInstanceId:
    Description: The ID of the Prometheus instance.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - PrometheusInstanceId
  FeePackage:
    Description: The payable resource plan.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - FeePackage

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EnvironmentSubType": {
      "Type": "String",
      "Description": {
        "en": "The subtype of the environment. Valid values:\nOne: CS type environment\nACK: CS type environment\nECS: ECS type environment\nCloud: cloud service"
      },
      "AllowedValues": [
        "ACK",
        "ECS",
        "One",
        "Cloud"
      ],
      "Required": true
    },
    "EnvironmentType": {
      "Type": "String",
      "Description": {
        "en": "The type of the environment. Valid values:\nCS: ACK\nECS: ECS\nCloud: cloud service"
      },
      "AllowedValues": [
        "CS",
        "ECS",
        "Cloud"
      ],
      "Required": true
    },
    "EnvironmentName": {
      "Type": "String",
      "Description": {
        "en": "The name of the environment."
      },
      "Required": true
    },
    "BindResourceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the resource bound to the environment, such as the container ID or VPC ID. For a Cloud environment, specify the region ID."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ARMS::Environment",
      "Properties": {
        "EnvironmentSubType": {
          "Ref": "EnvironmentSubType"
        },
        "EnvironmentType": {
          "Ref": "EnvironmentType"
        },
        "EnvironmentName": {
          "Ref": "EnvironmentName"
        },
        "BindResourceId": {
          "Ref": "BindResourceId"
        }
      }
    }
  },
  "Outputs": {
    "ManagedType": {
      "Description": "Specifies whether agents or exporters are managed.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ManagedType"
        ]
      }
    },
    "EnvironmentId": {
      "Description": "The id of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentId"
        ]
      }
    },
    "EnvironmentSubType": {
      "Description": "The subtype of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentSubType"
        ]
      }
    },
    "EnvironmentType": {
      "Description": "The type of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentType"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The ID of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ResourceGroupId"
        ]
      }
    },
    "EnvironmentName": {
      "Description": "The name of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentName"
        ]
      }
    },
    "GrafanaWorkspaceId": {
      "Description": "The ID of the grafana workspace bound to the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GrafanaWorkspaceId"
        ]
      }
    },
    "PrometheusInstanceId": {
      "Description": "The ID of the Prometheus instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PrometheusInstanceId"
        ]
      }
    },
    "FeePackage": {
      "Description": "The payable resource plan.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "FeePackage"
        ]
      }
    }
  }
}