Terraform is an open source tool provided by HashiCorp that allows you to preview, configure, and manage cloud infrastructure and resources in a secure and efficient manner.


Terraform is a tool that automates IT infrastructure orchestration. HashiCorp Terraform can use code to manage and maintain IT resources. Terraform allows you to define infrastructure resources such as virtual machines (VMs), storage accounts, and network interfaces in the configuration files that describe cloud resource topologies. The CLI of Terraform provides a simple mechanism to deploy configuration files in Alibaba Cloud or other clouds and version the configuration files. For more information, visit HashiCorp Terraform.

Terraform is a scalable tool that relies on plug-ins called Providers to support new infrastructure. Terraform allows you to use a simple template language to define, preview, and deploy cloud infrastructure in Alibaba Cloud. You can use Terraform to create, modify, and delete cloud resources, such as Elastic Compute Service (ECS), Virtual Private Cloud (VPC), ApsaraDB RDS, and Server Load Balancer (SLB) resources. For more information, see Configuration Syntax.

Alibaba Cloud is the first cloud service provider in China to integrate Terraform with its services. The Alibaba Cloud Provider offers 163 resources and 113 data sources and covers 35 Alibaba Cloud services, including computing, storage, networking, load balancing, Content Distribution Network (CDN), container, middleware, access control, and database services. This Provider is more than capable of meeting the automated cloud deployment requirements of most big customers. For more information, see Alibaba Cloud Provider.

Starting with Terraform 0.12.2, Alibaba Cloud Object Storage Service (OSS) is available as a standard remote state backend that stores state in buckets to improve state security and collaboration efficiency. For more information, see Remote State Backend.

Alibaba Cloud provides to developers a variety of modules and examples out of the box for products in categories such as computing, storage, network, middleware, and database services. Feel free to contribute your own modules. For more information, see Modules and Examples.


  • Multi-cloud infrastructure deployment

    Terraform is suitable for multi-cloud scenarios in which similar infrastructure is deployed on Alibaba Cloud, clouds of other providers, and data centers. Terraform allows developers to use the same tools and similar configuration files to manage infrastructure resources that are built on clouds of different providers.

  • Automated infrastructure management

    Terraform can create configuration file templates to define and provision ECS resources in a repeatable and predictable manner. This reduces human errors during deployment and management. Terraform can deploy the same template multiple times to create identical development, test, and production environments.

  • Infrastructure as code (IaC)

    In Terraform, you can use code to manage and maintain resources. Terraform stores a copy of the current state of your infrastructure. This way, you can track changes made to components in the system (IaC) and share infrastructure configurations with other users.

  • Reduced development costs

    You can use Terraform to create development and deployment environments based on your business requirements and reduce development and deployment costs. In addition, you can evaluate development costs before you make changes to your system.


For information about the scenarios of Terraform, visit the IaC - Terraform Solution page.

Use of Terraform

Terraform allows you to use a simple template language to define, preview, and deploy cloud infrastructure in Alibaba Cloud. For more information, see Configuration Syntax. Before you use Terraform to provision resources in ECS, perform the following steps:

  1. Install and configure Terraform. For more information, see Use Terraform in Cloud Shell or Install and configure Terraform on your computer.
  2. Use Terraform to create one or more ECS instances. For more information, see Create an ECS instance and Batch create ECS instances.
  3. (Optional) Use Terraform to deploy a web cluster. For more information, see Deploy a web cluster.

For more information about how to use Terraform, visit What is Terraform?