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,
"AssociateEip": Boolean,
"AcrInstanceId": String,
"OssAkId": String,
"ProgrammingLanguage": String,
"OssAkSecret": String,
"Python": String,
"BaseAppId": String,
"EnableEbpf": String,
"PhpArmsConfigLocation": String,
"PhpConfig": String,
"MicroRegistrationConfig": String,
"TerminationGracePeriodSeconds": Integer,
"ConfigMapMountDesc": String,
"PvtzDiscoverySvc": String,
"AcrAssumeRoleArn": String,
"TomcatConfig": String,
"AppSource": String,
"PythonModules": String,
"NasConfigs": String,
"MicroRegistration": String,
"ServiceTags": String,
"ImagePullSecrets": String,
"AutoConfig": Boolean,
"KafkaConfigs": String,
"Php": String,
"OssMountDescs": List,
"PhpConfigLocation": String,
"SaeVersion": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
Timezone | String | No | Yes | The time zone. | 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 File Storage NAS (NAS) file system that you want to mount to the application. | None. |
NasId | String | No | Yes | The ID of the NAS file system that you want to mount to the application. | The NAS file system must have an available mount target, or have a mount target on the vSwitch in the virtual private cloud (VPC) where the application resides. If you leave this property empty but specify MountDesc, a NAS file system is purchased and mounted to the vSwitch in the VPC. |
WarStartOptions | String | No | Yes | The startup options of the WAR package of the application. | The default startup command of the application is |
Liveness | String | No | Yes | The configurations of the liveness health check of the container. A container that fails the health check is restarted. | The health check can be performed only by sending commands in a container. Example: |
Memory | Integer | Yes | No | The memory size that is required for each application instance. Only instances of fixed specifications are supported. | A single value of Memory corresponds to one or more fixed values of Cpu. Valid values of Memory:
Unit: MB. |
WebContainer | String | No | Yes | The version of the Tomcat container on which the deployment package of the application depends. | This property is not supported when you use an image to deploy the application. |
SlsConfigs | String | No | Yes | The configurations of the file log collection feature. | None. |
Cpu | Integer | Yes | No | The CPU millicores that are required for each application instance. Only instances of fixed specifications are supported. | Valid values:
Unit: millicores. |
Deploy | Boolean | No | No | Specifies whether the deployment immediately takes effect. | Valid values:
|
Tags | List | No | Yes | The tags. | You can add up to 20 tags. For more information, see Tags syntax and Tags properties. |
PackageVersion | String | No | Yes | The version of the deployment package. | You must specify this property when PackageType is set to War or FatJar. |
AppName | String | Yes | No | The application name. | The name can be up to 36 characters, and must start with a letter. It can contain letters, digits, and hyphens (-). |
Jdk | String | No | Yes | The version of the Java Development Kit (JDK) on which the deployment package of the application depends. | This property is not supported when you use an image to deploy the application. |
JarStartArgs | String | No | Yes | The startup parameters of the JAR package of the application. | The default startup command of the application is |
PreStop | String | No | Yes | The script that is run immediately before the container is stopped. | Example: |
Readiness | String | No | Yes | The configurations of the readiness health check of the container. | Example: A container that fails the health 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 deployment package of the application. | Valid values:
|
CommandArgs | String | No | Yes | The parameters of the image startup command. | None. |
Envs | String | No | Yes | The environment variables of the container. | Specify the value in the
|
VSwitchId | String | No | No | The ID of the vSwitch to which the elastic network interface (ENI) of the application instance is connected. | The vSwitch must reside in the specified VPC. The vSwitch is associated with a namespace in Enterprise Distributed Application Service (EDAS). If you leave this property empty, the ID of the vSwitch that is associated with the specified namespace is used. |
ImageUrl | String | No | Yes | The address of the image. | You can specify this property only when PackageType is set to Image. |
PostStart | String | No | Yes | The script that is run immediately after the container is started. | Specify the value in the {"exec":{"command":"cat","/etc/group"}} format. |
JarStartOptions | String | No | Yes | The startup options of the JAR package of the application. | The default startup command of the application is |
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 mapping between the hostname and IP address in the container. | Specify the value in the
|
VpcId | String | No | No | The ID of the VPC that you want to associate with the SAE namespace. | In SAE, a namespace can correspond to only one VPC. After a VPC and a namespace are associated, you cannot change the VPC to another VPC. The first time you create an SAE application in a namespace, you must specify a VPC. Then, the specified VPC is associated with the namespace. Multiple namespaces can correspond to the same VPC. If you leave this property empty, the ID of the VPC that is associated with the specified namespace is used. |
SecurityGroupId | String | No | No | The ID of the security group. | None. |
Command | String | No | Yes | The startup command of the image. | The command must be an executable object that exists in the container. Example: sleep. If you specify 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 takes effect only when PackageType is set 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. |
AssociateEip | Boolean | No | No | Specifies whether to associate an elastic IP address (EIP) with the application. | Valid values:
|
AcrInstanceId | String | No | No | The ID of the Container Registry Enterprise Edition instance. | None. |
OssAkId | String | No | No | The AccessKey ID that is used to read data from and write data to Object Storage Service (OSS). | None. |
ProgrammingLanguage | String | No | No | The programming language that you want to use to create the application. | Valid values:
|
OssAkSecret | String | No | No | The AccessKey secret that is used to read data from and write data to OSS. | None. |
Python | String | No | No | The Python environment. | Python 3.9.15 is supported. |
BaseAppId | String | No | No | The ID of the base application. | None. |
EnableEbpf | String | No | No | Specifies whether to enable application monitoring for non-Java applications based on the extended Berkeley Packet Filter (eBPF) technology. | Valid values:
|
PhpArmsConfigLocation | String | No | No | The path to which the PHP configuration file for application monitoring is mounted. You must make sure that the PHP server loads the configuration file. | SAE automatically renders the valid configuration file. You do not need to manage the content of the configuration file. |
PhpConfig | String | No | No | The content of the PHP configuration file. | None. |
MicroRegistrationConfig | String | No | No | The configurations of the registry. | None. |
TerminationGracePeriodSeconds | Integer | No | No | The timeout period of the graceful shutdown. | Default value: 30. Unit: seconds. Valid values: 1 to 300. |
ConfigMapMountDesc | String | No | No | The description of the ConfigMap that you want to mount to the application. | A ConfigMap created on the ConfigMaps page of a namespace is used to inject configurations into containers. This property involves the following fields:
Note You can specify |
PvtzDiscoverySvc | String | No | No | The configurations of Kubernetes Service-based service registration and discovery. | This property involves the following fields:
|
AcrAssumeRoleArn | String | No | No | The Alibaba Cloud Resource Name (ARN) of the Resource Access Management (RAM) role that is used to pull images across accounts. | For more information, see Grant permissions to a RAM role. |
TomcatConfig | String | No | No | The configurations of the Tomcat file. | You can leave this property empty or set this property to {} to delete the configurations. This property involves the following fields:
|
AppSource | String | No | No | The microservices application. | Set the value to micro_service. |
PythonModules | String | No | No | The custom module dependencies that you want to install. | By default, the dependencies defined by the requirements.txt file in the root directory are installed. If no software package is configured or customized, you can specify dependencies based on your business requirements. |
NasConfigs | String | No | No | The configurations of the NAS file system that you want to mount to the application. | This property involves the following fields:
|
MicroRegistration | String | No | No | The type of the Nacos registry. | Valid values:
|
ServiceTags | String | No | No | The canary tags of the application. | None. |
ImagePullSecrets | String | No | No | The ID of the corresponding Secret. | None. |
AutoConfig | Boolean | No | No | Specifies whether to automatically configure the network environment when you create the application. | Valid values:
Note If you set this property to true, the value of NamespaceId is ignored. |
KafkaConfigs | String | No | No | The logging configurations of ApsaraMQ for Kafka. | This property involves the following fields:
|
Php | String | No | No | The PHP version on which the PHP deployment package depends. | None. |
OssMountDescs | List | No | No | The configurations of the OSS bucket that you want to mount. | This property involves the following fields:
|
PhpConfigLocation | String | No | No | The path to which the PHP configuration file for application startup is mounted. | You must make sure that the PHP server loads the configuration file. |
SaeVersion | String | No | No | The SAE version. | Valid values:
|
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 |
Value | String | No | No | The tag value. | The tag value can be up to 128 characters in length, and cannot contain |
Return values
Fn::GetAtt
AppId: the application ID.
ChangeOrderId: the ID of the release order that is used to query the task execution status.
Examples
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: {}
{
"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": {
}
}
For more examples, visit sae.yml. In the examples, the following resource types are used: ALIYUN::SAE::Namespace, ALIYUN::SAE::Application, and ALIYUN::SAE::SlbBinding.