The ALIYUN::SAE::Application type 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,
"NewSaeVersion": String,
"EnableNewArms": Boolean,
"EnableSidecarResourceIsolated": Boolean,
"SidecarContainersConfig": List,
"InitContainersConfig": List
}
}Properties
Property | Type | Required | Editable | Description | Constraint |
AppName | String | Yes | No | The application name. | The name can be up to 36 characters in length. It must start with a letter and can contain letters, digits, and hyphens (-). |
Cpu | Integer | Yes | No | The number of CPU cores required for each instance. Only instances with defined specifications are supported. | Valid values:
Unit: millicores. |
Memory | Integer | Yes | No | The memory size required for each instance. Only instances with defined specifications are supported. | The memory size is coupled with the CPU cores. The following specifications are supported:
Unit: MB. |
Replicas | Integer | Yes | No | The initial number of instances. | None |
PackageType | String | Yes | No | The type of the application package. | Valid values:
|
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 mount description. | None |
NasId | String | No | Yes | The ID of the NAS file system to mount. | The NAS file system must have an available mount target quota, or its mount target must be on a vSwitch in the VPC. If you do not specify this parameter but specify the MountDesc parameter, a NAS file system is automatically purchased and mounted to a vSwitch in the VPC. |
WarStartOptions | String | No | Yes | The startup options for the WAR package. | The default startup command is: |
Liveness | String | No | Yes | The container health check. A container that fails the health check is restarted. | Currently, only commands can be run in a container to perform health checks. Example: |
WebContainer | String | No | Yes | The version of the Tomcat container that the deployment package depends on. | This parameter is not supported for images. |
SlsConfigs | String | No | Yes | The file log collection configuration. | None |
Deploy | Boolean | No | No | Specifies whether to deploy the application immediately. | 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 number of the deployment package. | This parameter is required when PackageType is set to War or FatJar. |
Jdk | String | No | Yes | The version of the JDK that the deployment package depends on. | This parameter is not supported for images. |
JarStartArgs | String | No | Yes | The startup arguments for the JAR package. | The default startup command is: |
PreStop | String | No | Yes | The script to run before the container is stopped. | The script to run before the container is stopped. Example: |
Readiness | String | No | Yes | The script for the readiness check. | The script for the readiness check. Example: A container that fails the health check multiple times is restarted. A container that does not pass the health check does not receive traffic from SLB. |
CommandArgs | String | No | Yes | The arguments for the image startup command. | None |
Envs | String | No | Yes | The environment variables for the container. | The format for the environment variables is:
|
VSwitchId | String | No | No | The vSwitch where the ENI of the application instance is located. | The vSwitch must be in the specified VPC. The vSwitch is bound to the EDAS namespace. If you do not specify this parameter, the VSwitchId bound to the namespace is used. |
ImageUrl | String | No | Yes | The address of the image. | You can configure an image address only for applications of the Image type. |
PostStart | String | No | Yes | The script to run after the container starts. | The script to run after the container starts. Example: |
JarStartOptions | String | No | Yes | The startup options for the JAR package. | The default startup command is: |
MountHost | String | No | Yes | The mount target of the NAS file system in the VPC. | None |
CustomHostAlias | String | No | Yes | The custom host mapping in the container. | The format for the custom host mapping is:
|
VpcId | String | No | No | The VPC corresponding to the SAE namespace. | In SAE, a namespace can correspond to only one VPC and cannot be changed. The first time you create an SAE application in a namespace, a binding relationship is formed. Multiple namespaces can correspond to one VPC. If you do not fill in this parameter, the VpcId bound to the namespace is used by default. |
SecurityGroupId | String | No | No | The security group ID. | None |
Command | String | No | Yes | The startup command for the image. | The command must be an executable object that exists in the container. For example: sleep. Setting this command will override the original startup command of the image. |
EdasContainerVersion | String | No | Yes | The runtime environment used by the EDAS Pandora application. | None |
PackageUrl | String | No | Yes | The address of the deployment package. | This parameter is valid when PackageType is set to War or FatJar. |
NamespaceId | String | Yes | No | The ID of the EDAS namespace. | Only namespaces whose names consist of lowercase letters and hyphens (-) are supported. The name must start with a lowercase letter. |
AssociateEip | Boolean | No | No | Specifies whether to bind an EIP. | Valid values:
|
AcrInstanceId | String | No | Yes | The ID of the ACR Enterprise instance. | None |
OssAkId | String | No | No | The AccessKey ID for reading from and writing to OSS. | None |
ProgrammingLanguage | String | No | No | The technology stack language for creating the application. | Valid values:
|
OssAkSecret | String | No | No | The AccessKey secret for reading from and writing 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 | Enables application monitoring for non-Java applications based on eBPF technology. | Valid values:
|
PhpArmsConfigLocation | String | No | No | The mount path for PHP application monitoring. Ensure that the PHP server loads the configuration file from this path. | You do not need to manage the configuration content. SAE automatically renders the correct configuration file. |
PhpConfig | String | No | No | The content of the PHP configuration file. | None |
MicroRegistrationConfig | String | No | No | The configuration information for the registry. | None |
TerminationGracePeriodSeconds | Integer | No | No | The timeout period for graceful shutdown. | The default value is 30. Unit: seconds. The value must be in the range of 1 to 300. |
ConfigMapMountDesc | String | No | No | The description of the ConfigMap mount. | Use the configuration items created on the namespace configuration page to inject configuration information into the container. The parameters are as follows:
Note You can pass the |
PvtzDiscoverySvc | String | No | No | Enables K8s Service registration and discovery. | The parameters are as follows:
|
AcrAssumeRoleArn | String | No | No | The ARN of the RAM role required to pull images across accounts. | For more information, see Grant permissions to a RAM role. |
TomcatConfig | String | No | No | The Tomcat file configuration. | Set to "" or "{}" to delete the configuration:
|
AppSource | String | No | No | The microservice application. | Valid value:
|
PythonModules | String | No | No | The custom installation module dependencies. | By default, dependencies defined in the requirements.txt file in the root directory are installed. If no package is configured or customized, you can specify the dependencies to install. |
NasConfigs | String | No | No | The configuration for mounting NAS. | The parameters are as follows:
|
MicroRegistration | String | No | No | Select the Nacos registry. | Valid values:
|
ServiceTags | String | No | No | The grayscale tags configured for the application. | None |
ImagePullSecrets | String | No | No | The corresponding secret ID. | None |
AutoConfig | Boolean | No | No | Specifies whether to automatically configure the network environment. | Valid values:
Note If you select true, other passed NamespaceId values are ignored. |
KafkaConfigs | String | No | No | The summary of configurations for collecting logs to Kafka. | The parameters are as follows:
|
Php | String | No | No | The PHP version that the PHP deployment package depends on. | None. |
OssMountDescs | List | No | No | The OSS mount description. | The parameters are as follows:
|
PhpConfigLocation | String | No | No | The mount path for the PHP application startup configuration. | Ensure that the PHP server uses this configuration file to start. |
SaeVersion | String | No | No | The SAE version. | Supported versions:
|
NewSaeVersion | String | No | No | The new SAE version. | Valid values:
|
EnableNewArms | Boolean | No | No | Specifies whether to enable the new Arms feature. | Valid values:
|
EnableSidecarResourceIsolated | Boolean | No | Yes | Specifies whether to enable resource isolation for sidecar containers. | Valid values:
|
SidecarContainersConfig | List | No | Yes | The configurations of the sidecar containers. | For more information, see SidecarContainersConfig properties. |
InitContainersConfig | List | No | Yes | The configurations of the init containers. | For more information, see InitContainersConfig properties. |
SidecarContainersConfig syntax
"SidecarContainersConfig": [
{
"CommandArgs": String,
"AcrInstanceId": String,
"Memory": Integer,
"Name": String,
"EmptyDirDesc": String,
"Command": String,
"ImageUrl": String,
"Cpu": Integer,
"Envs": String,
"ConfigMapMountDesc": String
}
] SidecarContainersConfig properties
Property | Type | Required | Editable | Description | Constraint |
CommandArgs | String | No | Yes | The parameters for the command run in the init container. | None |
AcrInstanceId | String | No | Yes | The ID of the ACR instance. | None |
Memory | Integer | Yes | Yes | The amount of memory allocated to the sidecar container. | None |
Name | String | Yes | Yes | The name of the sidecar container. | None |
EmptyDirDesc | String | No | Yes | The description of the emptyDir volume mount. | None |
Command | String | No | Yes | The command to be run in the init container. | None |
ImageUrl | String | No | Yes | The address of the image. | You can configure an image address only for applications of the Image type. |
Cpu | Integer | Yes | Yes | The number of CPU cores allocated to the sidecar container. | None |
Envs | String | No | Yes | The environment variables of the container. | Example: |
ConfigMapMountDesc | String | No | Yes | The description of the ConfigMap mount. | None |
InitContainersConfig syntax
"InitContainersConfig": [
{
"Command": String,
"ConfigMapMountDesc": String,
"ImageUrl": String,
"CommandArgs": String,
"Envs": String,
"Name": String
}
] InitContainersConfig properties
Property | Type | Required | Allow Updates | Description | Constraint |
Command | String | No | Yes | The command to run in the init container. | None |
ConfigMapMountDesc | String | No | No | The description of the ConfigMap mount. | None |
ImageUrl | String | No | Yes | The address of the image. | You can configure an image address only for applications of the Image type. |
CommandArgs | String | No | Yes | The arguments of the command to run in the init container. | None |
Envs | String | No | Yes | The environment variables of the container. | Example: |
Name | String | Yes | Yes | The name of the init container. | None |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
] Tags properties
Property | Type | Required | Allow Updates | Description | Constraint |
Key | String | Yes | No | The tag key. | The key must be 1 to 128 characters in length. It cannot start with |
Value | String | No | No | The tag value. | The value must be 0 to 128 characters in length. It cannot start with |
Return values
Fn::GetAtt
AppId: The application ID.
ChangeOrderId: The ID of the release order. You can use this ID to query the task execution status.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
NamespaceId:
Type: String
Description: |-
The ID of the EDAS namespace. The name of the namespace can contain only lowercase letters and hyphens (-), and must start with a letter.
You can obtain the namespace ID from the response of the DescribeNamespaceList operation.
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": "The ID of the EDAS namespace. The name of the namespace can contain only lowercase letters and hyphens (-), and must start with a letter.\nYou can obtain the namespace ID from the response of the DescribeNamespaceList operation."
},
"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 an example of how to create a namespace, create an SAE application, and bind an SLB instance, see YAML example.