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.
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:
Unit: millicores. |
Deploy | Boolean | No | No | Specifies whether the deployment immediately takes effect. | Default value: false. Valid values:
|
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:
|
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.
|
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.
|
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
JSON
format{ "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.