alicloud_sae_application

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.

Example Usage

Basic Usage

provider "alicloud" {
  region = var.region
}

variable "region" {
  default = "cn-hangzhou"
}

variable "name" {
  default = "tf-example"
}

resource "random_integer" "default" {
  max = 99999
  min = 10000
}

data "alicloud_regions" "default" {
  current = true
}

data "alicloud_zones" "default" {
  available_resource_creation = "VSwitch"
}

resource "alicloud_vpc" "default" {
  vpc_name   = var.name
  cidr_block = "10.4.0.0/16"
}

resource "alicloud_vswitch" "default" {
  vswitch_name = var.name
  cidr_block   = "10.4.0.0/24"
  vpc_id       = alicloud_vpc.default.id
  zone_id      = data.alicloud_zones.default.zones.0.id
}

resource "alicloud_security_group" "default" {
  vpc_id = alicloud_vpc.default.id
}

resource "alicloud_sae_namespace" "default" {
  namespace_id              = "${data.alicloud_regions.default.regions.0.id}:example${random_integer.default.result}"
  namespace_name            = var.name
  namespace_description     = var.name
  enable_micro_registration = false
}

resource "alicloud_sae_application" "default" {
  app_description   = var.name
  app_name          = "${var.name}-${random_integer.default.result}"
  namespace_id      = alicloud_sae_namespace.default.id
  image_url         = "registry-vpc.${data.alicloud_regions.default.regions.0.id}.aliyuncs.com/sae-demo-image/consumer:1.0"
  package_type      = "Image"
  security_group_id = alicloud_security_group.default.id
  vpc_id            = alicloud_vpc.default.id
  vswitch_id        = alicloud_vswitch.default.id
  timezone          = "Asia/Beijing"
  replicas          = "5"
  cpu               = "500"
  memory            = "2048"
}

Argument Reference

The following arguments are supported:

custom_host_alias_v2

The custom_host_alias_v2 supports the following:

oss_mount_descs_v2

The oss_mount_descs_v2 supports the following:

config_map_mount_desc_v2

The config_map_mount_desc_v2 supports the following:

liveness_v2

The liveness_v2 supports the following:

liveness_v2-exec

The exec supports the following:

liveness_v2-tcp_socket

The tcp_socket supports the following:

liveness_v2-http_get

The http_get supports the following:

readiness_v2

The readiness_v2 supports the following:

readiness_v2-exec

The exec supports the following:

readiness_v2-tcp_socket

The tcp_socket supports the following:

readiness_v2-http_get

The http_get supports the following:

post_start_v2

The post_start_v2 supports the following:

post_start_v2-exec

The exec supports the following:

pre_stop_v2

The pre_stop_v2 supports the following:

pre_stop_v2-exec

The exec supports the following:

tomcat_config_v2

The tomcat_config_v2 supports the following:

update_strategy_v2

The update_strategy_v2 supports the following:

update_strategy_v2-batch_update

The batch_update supports the following:

nas_configs

The nas_configs supports the following:

kafka_configs

The kafka_configs supports the following:

kafka_configs-kafka_configs

The kafka_configs supports the following:

pvtz_discovery_svc

The pvtz_discovery_svc supports the following:

pvtz_discovery_svc-port_protocols

The port_protocols supports the following:

Attributes Reference

The following attributes are exported:

Import

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

$ terraform import alicloud_sae_application.example <id>