Application

class Application : KotlinCustomResource

Provides a Serverless App Engine (SAE) Application resource. For information about Serverless App Engine (SAE) Application and how to use it, see What is Application.

NOTE: Available since v1.161.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetRegionsArgs;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.sae.Namespace;
import com.pulumi.alicloud.sae.NamespaceArgs;
import com.pulumi.alicloud.sae.Application;
import com.pulumi.alicloud.sae.ApplicationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example");
final var defaultRegions = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
.current(true)
.build());
var defaultRandomInteger = new RandomInteger("defaultRandomInteger", RandomIntegerArgs.builder()
.max(99999)
.min(10000)
.build());
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("10.4.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.cidrBlock("10.4.0.0/24")
.vpcId(defaultNetwork.id())
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.vpcId(defaultNetwork.id())
.build());
var defaultNamespace = new Namespace("defaultNamespace", NamespaceArgs.builder()
.namespaceId(defaultRandomInteger.result().applyValue(result -> String.format("%s:example%s", defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()),result)))
.namespaceName(name)
.namespaceDescription(name)
.enableMicroRegistration(false)
.build());
var defaultApplication = new Application("defaultApplication", ApplicationArgs.builder()
.appDescription(name)
.appName(name)
.namespaceId(defaultNamespace.id())
.imageUrl(String.format("registry-vpc.%s.aliyuncs.com/sae-demo-image/consumer:1.0", defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id())))
.packageType("Image")
.securityGroupId(defaultSecurityGroup.id())
.vpcId(defaultNetwork.id())
.vswitchId(defaultSwitch.id())
.timezone("Asia/Beijing")
.replicas("5")
.cpu("500")
.memory("2048")
.build());
}
}

Import

Serverless App Engine (SAE) Application can be imported using the id, e.g.

$ pulumi import alicloud:sae/application:Application example <id>

Properties

Link copied to clipboard
val acrAssumeRoleArn: Output<String>?

The ARN of the RAM role required when pulling images across accounts. Only necessary if the image_url is pointing to an ACR EE instance.

Link copied to clipboard
val acrInstanceId: Output<String>?

The ID of the ACR EE instance. Only necessary if the image_url is pointing to an ACR EE instance.

Link copied to clipboard
val appDescription: Output<String>?

Application description information. No more than 1024 characters.

Link copied to clipboard
val appName: Output<String>

Application Name. Combinations of numbers, letters, and dashes (-) are allowed. It must start with a letter and the maximum length is 36 characters.

Link copied to clipboard
val autoConfig: Output<Boolean>?

The auto config. Valid values: false, true.

Link copied to clipboard

The auto enable application scaling rule. Valid values: false, true.

Link copied to clipboard
val batchWaitTime: Output<Int>

The batch wait time.

Link copied to clipboard
val changeOrderDesc: Output<String>

The change order desc.

Link copied to clipboard
val command: Output<String>?

Mirror start command. The command must be an executable object in the container. For example: sleep. Setting this command will cause the original startup command of the mirror to become invalid.

Link copied to clipboard
val commandArgs: Output<String>?

Mirror startup command parameters. The parameters required for the above start command. For example: 1d.

Link copied to clipboard

ConfigMap mount description.

Link copied to clipboard
val cpu: Output<Int>?

The CPU required for each instance, in millicores, cannot be 0. Valid values: 1000, 16000, 2000, 32000, 4000, 500, 8000.

Link copied to clipboard
val customHostAlias: Output<String>

Custom host mapping in the container. For example: {`hostName`:`samplehost`,`ip`:`127.0.0.1`}.

Link copied to clipboard
val deploy: Output<Boolean>?

The deploy. Valid values: false, true.

Link copied to clipboard

The operating environment used by the Pandora application.

Link copied to clipboard
val enableAhas: Output<String>

The enable ahas.

Link copied to clipboard

The enable grey tag route.

Link copied to clipboard
val envs: Output<String>

Container environment variable parameters. For example,[{"name":"envtmp","value":"0"}]. The value description is as follows:

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val imageUrl: Output<String>?

Mirror address. Only Image type applications can configure the mirror address.

Link copied to clipboard
val jarStartArgs: Output<String>?

The JAR package starts application parameters. Application default startup command: $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs.

Link copied to clipboard
val jarStartOptions: Output<String>?

The JAR package starts the application option. Application default startup command: $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs.

Link copied to clipboard
val jdk: Output<String>?

The JDK version that the deployment package depends on. Image type applications are not supported.

Link copied to clipboard
val liveness: Output<String>?

Container health check. Containers that fail the health check will be shut down and restored. Currently, only the method of issuing commands in the container is supported.

Link copied to clipboard
val memory: Output<Int>?

The memory required for each instance, in MB, cannot be 0. One-to-one correspondence with CPU. Valid values: 1024, 131072, 16384, 2048, 32768, 4096, 65536, 8192.

Link copied to clipboard

Select the Nacos registry. Valid values: 0, 1, 2.

Link copied to clipboard

Minimum Survival Instance Percentage. NOTE: When min_ready_instances and min_ready_instance_ratio are passed at the same time, and the value of min_ready_instance_ratio is not -1, the min_ready_instance_ratio parameter shall prevail. Assuming that min_ready_instances is 5 and min_ready_instance_ratio is 50, 50 is used to calculate the minimum number of surviving instances.The value description is as follows:

Link copied to clipboard
val minReadyInstances: Output<Int>

The Minimum Available Instance. On the Change Had Promised during the Available Number of Instances to Be.

Link copied to clipboard
val mountDesc: Output<String>?

Mount description.

Link copied to clipboard
val mountHost: Output<String>?

Mount point of NAS in application VPC.

Link copied to clipboard
val namespaceId: Output<String>?

SAE namespace ID. Only namespaces whose names are lowercase letters and dashes (-) are supported, and must start with a letter. The namespace can be obtained by calling the DescribeNamespaceList interface.

Link copied to clipboard
val nasId: Output<String>?

ID of the mounted NAS, Must be in the same region as the cluster. It must have an available mount point creation quota, or its mount point must be on a switch in the VPC. If it is not filled in and the mountDescs field is present, a NAS will be automatically purchased and mounted on the switch in the VPC by default.

Link copied to clipboard
val ossAkId: Output<String>?

OSS AccessKey ID.

Link copied to clipboard
val ossAkSecret: Output<String>?

OSS AccessKey Secret.

Link copied to clipboard
val ossMountDescs: Output<String>?

OSS mount description information.

Link copied to clipboard
val packageType: Output<String>

Application package type. Support FatJar, War and Image. Valid values: FatJar, Image, War.

Link copied to clipboard
val packageUrl: Output<String>?

Deployment package address. Only FatJar or War type applications can configure the deployment package address.

Link copied to clipboard
val packageVersion: Output<String>

The version number of the deployment package. Required when the Package Type is War and FatJar.

Link copied to clipboard

The PHP application monitors the mount path, and you need to ensure that the PHP server will load the configuration file of this path. You don't need to pay attention to the configuration content, SAE will automatically render the correct configuration file.

Link copied to clipboard
val phpConfig: Output<String>?

PHP configuration file content.

Link copied to clipboard

PHP application startup configuration mount path, you need to ensure that the PHP server will start using this configuration file.

Link copied to clipboard
val postStart: Output<String>?

Execute the script after startup, the format is like: {exec:{command:`cat`,"/etc/group"}}.

Link copied to clipboard
val preStop: Output<String>?

Execute the script before stopping, the format is like: {exec:{command:`cat`,"/etc/group"}}.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val readiness: Output<String>?

Application startup status checks, containers that fail multiple health checks will be shut down and restarted. Containers that do not pass the health check will not receive SLB traffic. For example: {exec:{command:`sh`,"-c","cat /home/admin/start.sh"},initialDelaySeconds:30,periodSeconds:30,"timeoutSeconds ":2}. Valid values: command, initialDelaySeconds, periodSeconds, timeoutSeconds.

Link copied to clipboard
val replicas: Output<Int>

Initial number of instances.

Link copied to clipboard
val securityGroupId: Output<String>

Security group ID.

Link copied to clipboard
val slsConfigs: Output<String>?

SLS configuration.

Link copied to clipboard
val status: Output<String>

The status of the resource. Valid values: RUNNING, STOPPED.

Link copied to clipboard
val tags: Output<Map<String, Any>>?

A mapping of tags to assign to the resource.

Link copied to clipboard

Graceful offline timeout, the default is 30, the unit is seconds. The value range is 1~60. Valid values: 1,60.

Link copied to clipboard
val timezone: Output<String>

Time zone, the default value is Asia/Shanghai.

Link copied to clipboard
val tomcatConfig: Output<String>?

Tomcat file configuration, set to "{}" means to delete the configuration: useDefaultConfig: Whether to use a custom configuration, if it is true, it means that the custom configuration is not used; if it is false, it means that the custom configuration is used. If you do not use custom configuration, the following parameter configuration will not take effect. contextInputType: Select the access path of the application. war: No need to fill in the custom path, the access path of the application is the WAR package name. root: No need to fill in the custom path, the access path of the application is /. custom: You need to fill in the custom path in the custom path below. contextPath: custom path, this parameter only needs to be configured when the contextInputType type is custom. httpPort: The port range is 1024~65535. Ports less than 1024 need Root permission to operate. Because the container is configured with Admin permissions, please fill in a port greater than 1024. If not configured, the default is 8080. maxThreads: Configure the number of connections in the connection pool, the default size is 400. uriEncoding: Tomcat encoding format, including UTF-8, ISO-8859-1, GBK and GB2312. If not set, the default is ISO-8859-1. useBodyEncoding: Whether to use BodyEncoding for URL. Valid values: contextInputType, contextPath, httpPort, maxThreads, uriEncoding, useBodyEncoding, useDefaultConfig.

Link copied to clipboard
val updateStrategy: Output<String>

The update strategy.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val versionId: Output<String>?

Application version id.

Link copied to clipboard
val vpcId: Output<String>?

The vpc id.

Link copied to clipboard
val vswitchId: Output<String>?

The vswitch id.

Link copied to clipboard
val warStartOptions: Output<String>?

WAR package launch application option. Application default startup command: java $JAVA_OPTS $CATALINA_OPTS -Options org.apache.catalina.startup.Bootstrap "$@" start.

Link copied to clipboard
val webContainer: Output<String>?

The version of tomcat that the deployment package depends on. Image type applications are not supported.