ALIYUN::SAE::Application is used to create an application in Serverless App Engine (SAE).

Syntax

{
  "Type": "ALIYUN::SAE::Application",
  "Properties": {
    "Timezone": String,
    "AppDescription": String,
    "MountDesc": String,
    "NasId": String,
    "WarStartOptions": String,
    "Liveness": String,
    "Memory": Integer,
    "WebContainer": String,
    "SlsConfigs": String,
    "Cpu": Integer,
    "Deploy": Boolean,
    "PackageVersion": String,
    "AppName": String,
    "Jdk": String,
    "JarStartArgs": String,
    "PreStop": String,
    "Readiness": String,
    "PackageType": String,
    "CommandArgs": String,
    "Envs": String,
    "VSwitchId": String,
    "ImageUrl": String,
    "PostStart": String,
    "JarStartOptions": String,
    "MountHost": String,
    "Replicas": Integer,
    "CustomHostAlias": String,
    "VpcId": String,
    "Tags": List,
    "SecurityGroupId": String,
    "Command": String,
    "EdasContainerVersion": String,
    "PackageUrl": String,
    "NamespaceId": String
  }
}

Properties

Property Type Required Editable Description Constraint
Timezone String No Yes The time zone in which you want to create the application. Default value: Asia/Shanghai.
AppDescription String No No The description of the application. The description can be up to 1,024 characters in length.
MountDesc String No Yes The description of the mount target. None
NasId String No Yes The ID of the Network Attached Storage (NAS) file system that you want to mount to the application. The NAS file system must have an available mount target or a mount target on a vSwitch in the VPC in which the application is located. If you do not set this property but set the MountDesc property, a NAS file system is automatically purchased and mounted to the vSwitch in the VPC.
WarStartOptions String No Yes The option settings that are used to deploy a web application archive (WAR) package. The default startup command to deploy the package is java $JAVA_OPTS $CATALINA_OPTS -Options org.apache.catalina.startup.Bootstrap "$@" start.
Liveness String No Yes The health check of the container. A container that fails this health check is restarted. The health check can be performed only by sending commands in a container. Example: {"exec":{"command":["sleep","5s"]},"initialDelaySeconds":10,"timeoutSeconds":11}.
Memory Integer Yes No The memory capacity that is required for each application instance. Only instance types with fixed specifications are supported. Set the value of this property based on the Cpu property.
  • If you set the value of the Cpu parameter to 500, set the value of this property to 1024.
  • Set the value to 2048 when Cpu is set to 500 or 1000.
  • Set the value to 4096 when Cpu is set to 1000 or 2000.
  • Set the value to 8192 when Cpu is set to 2000 or 4000.
  • Set the value to 16384 when Cpu is set to 4000 or 8000.
  • Set the value to 32768 when Cpu is set to 16000.
  • Set the value to 65536 when Cpu is set to 8000, 16000, or 32000.
  • Set the value to 131072 when Cpu is set to 32000.

Unit: MB.

WebContainer String No Yes The version of the Tomcat container on which the deployment package of the application depends. If you use an image to deploy the application, this property is not supported.
SlsConfigs String No Yes The log collection configurations. None
Cpu Integer Yes No The CPU resources that are required for each application instance. Only instance types with fixed specifications are supported. Valid values:
  • 500
  • 1000
  • 2000
  • 4000
  • 8000
  • 16000
  • 32000

Unit: millicores.

Deploy Boolean No No Specifies whether the deployment immediately takes effect. Default value: false. Valid values:
  • true: The deployment immediately takes effect.
  • false: The deployment does not immediately take effect.
Tags List No Yes The tags of the application. You can specify up to 20 tags.

For more information, see Tags syntax and Tags properties.

PackageVersion String No Yes The version of the deployment package. If you set the PackageType property to War or FatJar, you must configure this property.
AppName String Yes No The name of the application. The name can be up to 36 characters in length and can contain letters, digits, and hyphens (-). The name must start with a letter.
Jdk String No Yes The version of the Java development kit (JDK) on which the deployment package of the application depends. If you use an image to deploy the application, this property is not supported.
JarStartArgs String No Yes The arguments that are used to deploy a Java Archive (JAR) package. The default startup command to deploy the package is $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs.
PreStop String No Yes The script that you want to run before the deployment is stopped. Example: {"exec":{"command":"cat","/etc/group"}}.
Readiness String No Yes The readiness check of the container. Example: {"exec":{"command":["sleep","6s"]},"initialDelaySeconds":15,"timeoutSeconds":12}.

A container that fails this readiness check multiple times is restarted. Containers that fail health checks do not receive traffic from Server Load Balancer (SLB) instances.

PackageType String Yes No The type of the application deployment package. Valid values:
  • FatJar
  • War
  • Image
CommandArgs String No Yes The arguments of the image startup command. None
Envs String No Yes The environment variables and their corresponding values. Specify the value in the [{"name":"envtmp","value":"0"}] format.
  • name specifies the name of the environment variable.
  • value specifies the value or reference of the environment variable.
VSwitchId String No No The ID of the vSwitch to which the elastic network interface (ENI) belongs. The vSwitch must be located in the specified VPC. The vSwitch is bound to a namespace in Enterprise Distributed Application Service (EDAS). If you do not set this property, the ID of the vSwitch that is bound to the namespace is used.
ImageUrl String No Yes The URL of the image. This property is available only if you set the PackageType property to Image.
PostStart String No Yes The script that you want to run after the deployment is started. Specify the value in the {"exec":{"command":"cat","/etc/group"}} format.
JarStartOptions String No Yes The option settings that are used to deploy a JAR package. The default startup command to deploy the package is $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs.
MountHost String No Yes The mount target of the NAS file system in the VPC. None
Replicas Integer Yes No The number of application instances that you want to create. None
CustomHostAlias String No Yes The custom alias of a host in the container. Specify the value in the [{"hostName":"samplehost","ip":"127.0.XX.XX"}] format.
  • hostName specifies the domain name or hostname.
  • ip specifies the IP address.
VpcId String No No The ID of the VPC that corresponds to the EDAS namespace. In SAE, a namespace can correspond to only one VPC. You cannot modify a VPC after you configure it. The namespace is bound to the SAE application when the application is first created within the namespace. Multiple namespaces can correspond to the same VPC. If you do not set this property, the ID of the VPC that is bound to the namespace is used.
SecurityGroupId String No No The ID of the security group. None
Command String No Yes The command that is used to start the image. The command must be an existing executable object in the container. Example: sleep.

If you set this property, the original startup command of the image becomes invalid.

EdasContainerVersion String No Yes The version of EDAS Pandora. None
PackageUrl String No Yes The URL of the deployment package. This property is available only if you set the PackageType property to War or FatJar.
NamespaceId String Yes No The ID of the EDAS namespace. The ID can contain only lowercase letters and hyphens (-). It must start with a lowercase letter.

Tags syntax

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

Tags properties

Property Type Required Editable Description Constraint
Key String Yes No The tag key. The tag key must be 1 to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.
Value String No No The tag value. The tag value must be 0 to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with acs: or aliyun.

Return values

Fn::GetAtt

  • AppId: the ID of the application.
  • ChangeOrderId: the ID of the release order that is used to query the task execution status.

Examples

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      NamespaceId:
        Type: String
        Description: |-
          EDAS namespace corresponding to ID. Canada supports only the name of the scribe lowercase namespace must begin with a letter.
          Namespace can interface to obtain from DescribeNamespaceList.
      VpcId:
        Type: String
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
      VSwitchId:
        Type: String
        AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
      SecurityGroupId:
        Type: String
        AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
    Resources:
      Application:
        Type: ALIYUN::SAE::Application
        Properties:
          AppName: TestApp
          NamespaceId:
            Ref: NamespaceId
          VpcId:
            Ref: VpcId
          VSwitchId:
            Ref: VSwitchId
          SecurityGroupId:
            Ref: SecurityGroupId
          Cpu: 500
          Memory: 1024
          Replicas: 2
          PackageType: War
          Deploy: true
          Timezone: Asia/Shanghai
    Outputs: {}
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "NamespaceId": {
          "Type": "String",
          "Description": "EDAS namespace corresponding to ID. Canada supports only the name of the scribe lowercase namespace must begin with a letter.\nNamespace can interface to obtain from DescribeNamespaceList."
        },
        "VpcId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
        },
        "VSwitchId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}"
          }
        },
        "SecurityGroupId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}"
          }
        }
      },
      "Resources": {
        "Application": {
          "Type": "ALIYUN::SAE::Application",
          "Properties": {
            "AppName": "TestApp",
            "NamespaceId": {
              "Ref": "NamespaceId"
            },
            "VpcId": {
              "Ref": "VpcId"
            },
            "VSwitchId": {
              "Ref": "VSwitchId"
            },
            "SecurityGroupId": {
              "Ref": "SecurityGroupId"
            },
            "Cpu": 500,
            "Memory": 1024,
            "Replicas": 2,
            "PackageType": "War",
            "Deploy": true,
            "Timezone": "Asia/Shanghai"
          }
        }
      },
      "Outputs": {
      }
    }

To view more examples, visit SAE.json and SAE.yml. In the examples, the ALIYUN::ACM::Namespace, ALIYUN::SAE::Application, and ALIYUN::SAE::SlbBinding resource types are used.