This resource use an orchestration template to define and deploy a multi-container application. An application is created by using an orchestration template. Each application can contain one or more services.
NOTE: Application orchestration template must be a valid Docker Compose YAML template.
NOTE: At present, this resource only support swarm cluster.
Basic Usage
resource "alicloud_cs_application" "app" {
cluster_name = "my-first-swarm"
name = "wordpress"
version = "1.2"
template = "${file("wordpress.yml")}"
latest_image = true
environment = {
EXTERNAL_URL = "123.123.123.123:8080"
}
}
The following arguments are supported:
cluster_name - (Required, Force new resource) The swarm cluster's name. name - (Required, Force new resource) The application name. It should be 1-64 characters long, and can contain numbers, English letters and hyphens, but cannot start with hyphens. description - The description of application. version - The application deploying version. Each updating, it must be different with current. Default to "1.0" template - The application deployment template and it must be Docker Compose format. environment - A key/value map used to replace the variable parameter in the Compose template. latest_image - Whether to use latest docker image while each updating application. Default to false. blue_green - Wherther to use "Blue Green" method when release a new version. Default to false. blue_green_confirm - Whether to confirm a "Blue Green" application. Default to false. It will be ignored when blue_green is false. NOTE: Each update of
template,environment,latest_imageandblue_green, it requires a newversion. Otherwise, the update will be ignored.
NOTE: If you want to rollback a "Blue Green" application, just set
blue_greenas false.
The following attributes are exported:
id - The ID of the container application. It's formate is cluster_name - The name of the container cluster. name - The application name. description - The application description. template - The application deploying template. environment - The application environment variables. services - List of services in the application. It contains several attributes to Block Nodes. default_domain - The application default domain and it can be used to configure routing service. id - ID of the service. name - Service name. status - The current status of service. version - The current version of service. Swarm application can be imported using the id, e.g.
$ terraform import alicloud_cs_application.app my-first-swarm:wordpress
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/alicloud/r/cs_application.html