ALIYUN::EDAS::Application类型用于创建ECS集群的应用。

语法

{
  "Type": "ALIYUN::EDAS::Application",
  "Properties": {
    "ApplicationName": String,
    "HealthCheckURL": String,
    "Description": String,
    "ClusterId": String,
    "PackageType": String,
    "BuildPackId": Integer,
    "EcuInfo": String,
    "ComponentIds": String,
    "LogicalRegionId": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
ApplicationName String 应用名称 必须以字母开头,可包含数字、英文字母、短横线(-)和下划线(_),长度为1~36个字符。
HealthCheckURL String 健康检查URL
Description String 描述信息
ClusterId String 向指定集群ID的ECS集群创建应用,不指定则向默认ECS集群创建应用。
PackageType String 应用包格式 取值范围:
  • war
  • jar
BuildPackId Integer EDAS-Container构建包号。

您可以通过容器版本列表接口ListBuildPack或者根据容器版本说明 中的构建包序号列查询EDAS-Container构建包号。

当创建HSF应用时,必须指定该参数。
EcuInfo String 需要扩容机器的ecu_id(导入EDAS的 ECS实例在EDAS中的唯一身份) 多个ecu_id用“,”分开。

您可以通过ListScaleOutEcu接口查询ecu_id。

ComponentIds String 应用组件ID。
说明 设置该参数需要将Java或者Python SDK版本更新到2.57.3及以上。未使用EDAS提供的SDK的用户可直接设置该参数。例如:用户在使用aliyun-python-sdk-core、aliyun-java-sdk-core、aliyun cli等SDK时可以直接设置该参数。
当创建的应用运行环境使用Apache Tomcat(war包格式的 Dubbo应用使用)或者标准Java应用(jar包格式的Spring Boot/Spring Cloud应用使用)运行环境时需要指定。常用的应用组件 ID 及含义如下:
  • 4:Apache Tomcat 7.0.91
  • 7:Apache Tomcat 8.5.42
  • 5:OpenJDK 1.8.x
  • 6:OpenJDK 1.7.x
LogicalRegionId String 命名空间ID,示例值:cn-beijing:prod
  • 如果指定的集群不在默认命名空间下,则需要指定该参数,否则会遇到错误提示application regionId is different with cluster regionId!
  • 如果在默认命名空间下,则不需要指定该参数。
该参数需要与指定的集群ID所在的命名空间保持一致。您可以登录EDAS控制台,选择应用管理>命名空间,找到命名空间对应的命名空间ID。

返回值

Fn::GetAtt

  • Port:创建成功的应用端口号,默认值:8080。
  • AppId:应用ID,EDAS应用的唯一标识符。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "Application": {
      "Type": "ALIYUN::EDAS::Application",
      "Properties": {
        "ApplicationName": {
          "Ref": "ApplicationName"
        },
        "HealthCheckURL": {
          "Ref": "HealthCheckURL"
        },
        "Description": {
          "Ref": "Description"
        },
        "ClusterId": {
          "Ref": "ClusterId"
        },
        "PackageType": {
          "Ref": "PackageType"
        },
        "BuildPackId": {
          "Ref": "BuildPackId"
        },
        "EcuInfo": {
          "Ref": "EcuInfo"
        },
        "ComponentIds": {
          "Ref": "ComponentIds"
        },
        "LogicalRegionId": {
          "Ref": "LogicalRegionId"
        }
      }
    }
  },
  "Parameters": {
    "ApplicationName": {
      "MinLength": 1,
      "Type": "String",
      "Description": "The application name (only allow the use of numbers, letters, -, _, up to 36 characters)",
      "MaxLength": 36
    },
    "HealthCheckURL": {
      "Type": "String",
      "Description": "Application Health Check URL"
    },
    "Description": {
      "Type": "String",
      "Description": "Descriptive information"
    },
    "ClusterId": {
      "Type": "String",
      "Description": "Cluster ID of ECS application"
    },
    "PackageType": {
      "Default": "war",
      "Type": "String",
      "Description": "Application packet format, possible values: war or jar",
      "AllowedValues": [
        "war",
        "jar"
      ]
    },
    "BuildPackId": {
      "Type": "Number",
      "Description": "EDAS-Container construct a packet number (available version list acquired through the ListBuildPack API (ConfigId of response) or \"container version\" table \"Building packet number\" column acquisition). When creating HSF application, this parameter must be specified"
    },
    "EcuInfo": {
      "Type": "String",
      "Description": "Machine capacity is needed ecu_id (ECS Examples introducing another unique identity EDAS EDAS), the plurality of \",\" separated (by querying ListScaleOutEcu wherein ecu_id\nInterface to obtain)."
    },
    "ComponentIds": {
      "Type": "String",
      "Description": "Application component ID (available through the query interface to obtain a list of components to the interface ListComponents), when creating the application runtime environment using Apache Tomcat (war packet format Dubbo\nApplication required) or standard Java application (jar package format Spring Boot / Spring Cloud applications require) you need to specify when the operating environment. Commonly used application component ID and meaning:\n4 represents Apache Tomcat 7.0.91,7 represented Apache Tomcat 8.5.42,5 represented OpenJDK 1.8.x, 6 represents OpenJDK\n1.7.x"
    },
    "LogicalRegionId": {
      "Type": "String",
      "Description": "Namespace ID"
    }
  },
  "Outputs": {
    "Port": {
      "Description": "Application port",
      "Value": {
        "Fn::GetAtt": [
          "Application",
          "Port"
        ]
      }
    },
    "AppId": {
      "Description": "Application Id, a unique identifier EDAS application",
      "Value": {
        "Fn::GetAtt": [
          "Application",
          "AppId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  Application:
    Type: 'ALIYUN::EDAS::Application'
    Properties:
      ApplicationName:
        Ref: ApplicationName
      HealthCheckURL:
        Ref: HealthCheckURL
      Description:
        Ref: Description
      ClusterId:
        Ref: ClusterId
      PackageType:
        Ref: PackageType
      BuildPackId:
        Ref: BuildPackId
      EcuInfo:
        Ref: EcuInfo
      ComponentIds:
        Ref: ComponentIds
      LogicalRegionId:
        Ref: LogicalRegionId
Parameters:
  ApplicationName:
    MinLength: 1
    Type: String
    Description: >-
      The application name (only allow the use of numbers, letters, -, _, up to
      36 characters)
    MaxLength: 36
  HealthCheckURL:
    Type: String
    Description: Application Health Check URL
  Description:
    Type: String
    Description: Descriptive information
  ClusterId:
    Type: String
    Description: Cluster ID of ECS application
  PackageType:
    Default: war
    Type: String
    Description: 'Application packet format, possible values: war or jar'
    AllowedValues:
      - war
      - jar
  BuildPackId:
    Type: Number
    Description: >-
      EDAS-Container construct a packet number (available version list acquired
      through the ListBuildPack API (ConfigId of response) or "container
      version" table "Building packet number" column acquisition). When creating
      HSF application, this parameter must be specified
  EcuInfo:
    Type: String
    Description: >-
      Machine capacity is needed ecu_id (ECS Examples introducing another unique
      identity EDAS EDAS), the plurality of "," separated (by querying
      ListScaleOutEcu wherein ecu_id

      Interface to obtain).
  ComponentIds:
    Type: String
    Description: >-
      Application component ID (available through the query interface to obtain
      a list of components to the interface ListComponents), when creating the
      application runtime environment using Apache Tomcat (war packet format
      Dubbo

      Application required) or standard Java application (jar package format
      Spring Boot / Spring Cloud applications require) you need to specify when
      the operating environment. Commonly used application component ID and
      meaning:

      4 represents Apache Tomcat 7.0.91,7 represented Apache Tomcat 8.5.42,5
      represented OpenJDK 1.8.x, 6 represents OpenJDK

      1.7.x
  LogicalRegionId:
    Type: String
    Description: Namespace ID
Outputs:
  Port:
    Description: Application port
    Value:
      'Fn::GetAtt':
        - Application
        - Port
  AppId:
    Description: 'Application Id, a unique identifier EDAS application'
    Value:
      'Fn::GetAtt':
        - Application
        - AppId