All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::EDAS::Application

Last Updated:Dec 08, 2023

ALIYUN::EDAS::Application is used to create an application in an Elastic Compute Service (ECS) cluster in Enterprise Distributed Application Service (EDAS).

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

ApplicationName

String

Yes

Yes

The application name.

The name must be 1 to 36 characters in length, and can contain digits, letters, hyphens (-), and underscores (_). The name must start with a letter.

HealthCheckURL

String

No

No

The health check URL.

None.

Description

String

No

Yes

The description of the application.

None.

ClusterId

String

Yes

No

The ID of the ECS cluster in which you want to create the application. If you leave this property empty, the application is created in the default ECS cluster.

None.

PackageType

String

No

No

The type of the deployment package of the application.

Valid values:

  • war

  • jar

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

BuildPackId

Integer

No

No

The build package number of EDAS Container.

To obtain the build package number of EDAS Container, you can call the ListBuildPack operation or see the "Build package number" column of the Release notes for EDAS Container topic.

This property must be specified when you create a High-Speed Service Framework (HSF) application.

EcuInfo

String

No

No

The IDs of the Elastic Compute Units (ECUs) that you want to scale out. The ID of an ECU indicates the unique identifier of an ECS instance that is imported to EDAS.

Separate multiple ECU IDs with commas (,).

You can call the ListScaleOutEcu operation to query the ECU IDs.

ComponentIds

String

No

No

The IDs of the application components.

Note

If you use EDAS SDK for Java or EDAS SDK for Python, make sure that the SDK version is V2.57.3 or later when you specify this property. If you do not use EDAS SDK, you can directly specify this property. For example, you can directly specify this property if you use other types of SDKs, such as aliyun-python-sdk-core, aliyun-java-sdk-core, and aliyun cli.

This property must be specified when you create a Dubbo application in the Apache Tomcat runtime by using a WAR package or create a Spring Boot or Spring Cloud application in the standard Java runtime by using a JAR package. Valid values:

  • 4: Apache Tomcat 7.0.91

  • 7: Apache Tomcat 8.5.42

  • 5: OpenJDK 1.8.x

  • 6: OpenJDK 1.7.x

LogicalRegionId

String

No

No

The ID of the microservices namespace to which the application belongs. Example: cn-beijing:prod.

  • This property must be specified when the cluster that you specify does not belong to the default microservices namespace. Otherwise, the application regionId is different with cluster regionId! error message is returned.

  • You can leave this property empty when the cluster that you specify belongs to the default microservices namespace.

The value of this property must be the same as the ID of the microservices namespace to which the cluster belongs. To obtain a microservices namespace ID, perform the following operations: Log on to the EDAS console. Choose Resource Management > Microservice Namespaces. On the page that appears, obtain the namespace ID.

Deployment

Map

No

No

The deployment information about the application.

For more information, see Deployment properties.

Deployment syntax

"Deployment": {
  "ReleaseType": Integer,
  "Batch": Integer,
  "TrafficControlStrategy": String,
  "BatchWaitTime": Integer,
  "PackageVersion": String,
  "Desc": String,
  "Gray": Boolean,
  "WarUrl": String,
  "GroupId": String,
  "AppEnv": String
}

Deployment properties

Property

Type

Required

Editable

Description

Constraint

ReleaseType

Integer

No

No

The mode in which the deployment phases of the application are triggered.

Valid values:

  • 0: The system automatically triggers the next phase.

  • 1: You manually trigger the next phase. To trigger the next phase, you can click Proceed to Next Batch in the EDAS console or call the ContinuePipeline operation. When you call an API operation to deploy the application, we recommend that you choose the automatic mode. For more information, see ContinuePipeline.

Batch

Integer

No

No

The number of phases per instance group.

  • If you specify the ID of an instance group for GroupId, the application is deployed to the specified instance group. The minimum number of phases that you can specify is 1. The maximum number of phases is the maximum number of normal ECS instances in the instance group. The actual value falls in the range of [1, specified number]. The specified number equals to the number of normal ECS instances in the specified instance group.

  • If you set GroupId to all, the application is deployed to all instance groups. The minimum number of phases that you can specify is 1. The maximum number of phases is the number of ECS instances in the instance group that contains the largest number of normal ECS instances.

TrafficControlStrategy

String

No

No

The content of the canary release policy.

None.

BatchWaitTime

Integer

No

No

The wait time between phases.

Unit: minutes.

  • Default value: 0. A value of 0 specifies that no wait time exists between phases.

  • Maximum value: 5.

If a large number of phases exist, we recommend that you specify a small value for this property. Otherwise, the system takes a long period of time to deploy the application.

PackageVersion

String

Yes

No

The version of the deployment package of the application.

The value can be up to 64 characters in length. We recommend that you use a timestamp.

Desc

String

No

No

The description of the application deployment.

None.

Gray

Boolean

No

No

Specifies whether to implement a canary release for the application.

Valid values:

  • true: implements a canary release for the application.

    • If you implement a canary release, you must specify GroupId. In this case, GroupId specifies the ID of the instance group for the canary release.

    • You can implement a canary release for the application in one phase.

    • After the canary release in this phase is complete, the application is released in regular mode. The Batch property specifies the number of phases.

  • false: implements a single-phase release or phased release for the application.

WarUrl

String

Yes

No

The URL of the deployment package of the application. The package can be a WAR or JAR package.

This property must be specified when DeployType is set to url. We recommend that you specify the URL of an application deployment package that is stored in Object Storage Service (OSS).

GroupId

String

No

No

The ID of the instance group to which you want to deploy the application.

None.

AppEnv

String

No

No

The environment variables of the application.

Specify the value of this property in the following format: {"name":"x","value":"y"},{"name":"x2","value":"y2"}. The key must be name or value.

Return values

Fn::GetAtt

  • Port: the port number of the application. Default value: 8080.

  • AppId: the application ID. An application ID uniquely identifies an EDAS application.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ClusterId:
    Type: String
    Description: Cluster ID of ECS application
    Default: '****'
  RegionTag:
    Type: String
    Description: Allowed letters and numbers
    Default: mytest
  ApplicationName:
    Type: String
    Default: mytest
Resources:
  App:
    Type: ALIYUN::EDAS::Application
    Properties:
      ApplicationName:
        Ref: ApplicationName
      LogicalRegionId:
        Fn::Join:
          - ':'
          - - Ref: ALIYUN::Region
            - Ref: RegionTag
      ClusterId:
        Ref: ClusterId
      PackageType: jar
Outputs:
  ClusterName:
    Value:
      Fn::GetAtt:
        - Cluster
        - ClusterName
  IaasProvider:
    Value:
      Fn::GetAtt:
        - Cluster
        - IaasProvider
  ClusterId:
    Value:
      Fn::GetAtt:
        - Cluster
        - ClusterId
  ClusterType:
    Value:
      Fn::GetAtt:
        - Cluster
        - ClusterType
  Port:
    Value:
      Fn::GetAtt:
        - App
        - Port
  AppId:
    Value:
      Fn::GetAtt:
        - App
        - AppId
  GroupName:
    Value:
      Fn::GetAtt:
        - DeployGroup
        - GroupName
  Id:
    Value:
      Fn::GetAtt:
        - DeployGroup
        - Id
  DeployGroupAppId:
    Value:
      Fn::GetAtt:
        - DeployGroup
        - AppId
  BelongRegion:
    Value:
      Fn::GetAtt:
        - LogicalRegion
        - BelongRegion
  DebugEnable:
    Value:
      Fn::GetAtt:
        - LogicalRegion
        - DebugEnable
  UserId:
    Value:
      Fn::GetAtt:
        - LogicalRegion
        - UserId
  LogicalRegionId:
    Value:
      Fn::GetAtt:
        - LogicalRegion
        - Id
  RegionName:
    Value:
      Fn::GetAtt:
        - LogicalRegion
        - RegionName

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ClusterId": {
      "Type": "String",
      "Description": "Cluster ID of ECS application",
      "Default": "****"
    },
    "RegionTag": {
      "Type": "String",
      "Description": "Allowed letters and numbers",
      "Default": "mytest"
    },
    "ApplicationName": {
      "Type": "String",
      "Default": "mytest"
    }
  },
  "Resources": {
    "App": {
      "Type": "ALIYUN::EDAS::Application",
      "Properties": {
        "ApplicationName": {
          "Ref": "ApplicationName"
        },
        "LogicalRegionId": {
          "Fn::Join": [
            ":",
            [
              {
                "Ref": "ALIYUN::Region"
              },
              {
                "Ref": "RegionTag"
              }
            ]
          ]
        },
        "ClusterId": {
          "Ref": "ClusterId"
        },
        "PackageType": "jar"
      }
    }
  },
  "Outputs": {
    "ClusterName": {
      "Value": {
        "Fn::GetAtt": [
          "Cluster",
          "ClusterName"
        ]
      }
    },
    "IaasProvider": {
      "Value": {
        "Fn::GetAtt": [
          "Cluster",
          "IaasProvider"
        ]
      }
    },
    "ClusterId": {
      "Value": {
        "Fn::GetAtt": [
          "Cluster",
          "ClusterId"
        ]
      }
    },
    "ClusterType": {
      "Value": {
        "Fn::GetAtt": [
          "Cluster",
          "ClusterType"
        ]
      }
    },
    "Port": {
      "Value": {
        "Fn::GetAtt": [
          "App",
          "Port"
        ]
      }
    },
    "AppId": {
      "Value": {
        "Fn::GetAtt": [
          "App",
          "AppId"
        ]
      }
    },
    "GroupName": {
      "Value": {
        "Fn::GetAtt": [
          "DeployGroup",
          "GroupName"
        ]
      }
    },
    "Id": {
      "Value": {
        "Fn::GetAtt": [
          "DeployGroup",
          "Id"
        ]
      }
    },
    "DeployGroupAppId": {
      "Value": {
        "Fn::GetAtt": [
          "DeployGroup",
          "AppId"
        ]
      }
    },
    "BelongRegion": {
      "Value": {
        "Fn::GetAtt": [
          "LogicalRegion",
          "BelongRegion"
        ]
      }
    },
    "DebugEnable": {
      "Value": {
        "Fn::GetAtt": [
          "LogicalRegion",
          "DebugEnable"
        ]
      }
    },
    "UserId": {
      "Value": {
        "Fn::GetAtt": [
          "LogicalRegion",
          "UserId"
        ]
      }
    },
    "LogicalRegionId": {
      "Value": {
        "Fn::GetAtt": [
          "LogicalRegion",
          "Id"
        ]
      }
    },
    "RegionName": {
      "Value": {
        "Fn::GetAtt": [
          "LogicalRegion",
          "RegionName"
        ]
      }
    }
  }
}