Terraform is an open source tool that allows you to preview, configure, and manage cloud infrastructures and resources in a secure and efficient manner. This topic introduces the terms, advantages, and use scenarios of Terraform.
Terms
Terraform is an infrastructure as code (IaC) software tool for cloud resource orchestration.
Terraform allows you to use a simple template language to define, preview, and deploy cloud infrastructure on Alibaba Cloud. For more information, see Configuration Syntax.
Terraform is a tool that is used to deploy, change, and perform versioning on infrastructure and applications in a safe and efficient manner. The tool can be used for multi-level resource management.
The resources that Terraform manages include upper-layer software and the configurations of underlying network and system configurations.
Terraform can be used to create, change, and delete various Alibaba Cloud resources, such as resources of Elastic Compute Service (ECS), Virtual Private Cloud (VPC), Relational Database Service (RDS), and Server Load Balancer (SLB).
For more information about the scenarios of Terraform, see Scenarios.
Terraform resource | Terraform plug-in |
Resources have two types in Terraform.
The following example shows how to use resources and data sources.
For more information about the resources and data sources of Container Service for Kubernetes (ACK), see Use ACK with Terraform. | Terraform provides three types of plug-ins:
For more information about how to download Terraform plug-ins, see Install and configure Terraform in the local PC and Use Terraform in Cloud Shell. |
Alibaba Cloud is the first cloud service provider in China to integrate Terraform with its services. The Alibaba Cloud Provider (terraform-provider-alicloud) provides 163 resources and 113 data sources, and covers 35 Alibaba Cloud services, such as computing, storage, networking, load balancing, CDN, middleware, access control, and database services. This meets the requirements of many big customers in cloud deployment automation.
For more information about how to use Terraform, see Terraform.
Advantages
Multi-cloud infrastructure deployment
Terraform is a popular tool of choice for multi-cloud scenarios in which similar infrastructures are deployed to Alibaba Cloud, third-party clouds, or 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 be used to create configuration file templates to repeatedly define, provision, and configure ECS resources in a predictable manner. This reduces human errors during deployment and management operations. Terraform allows you to deploy a template multiple times to create the same development, testing, and production environments.
Infrastructure as code
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 (infrastructure as code) and share infrastructure configurations with other users.
Reduced development costs
You can use Terraform to create development and deployment environments based on your requirements to reduce costs. In addition, you can evaluate development costs before you make changes to your system.
Use ACK with Terraform
ACK allows you to manage the following resources and data sources by using Terraform.
Table 1. Resources
Name | Description |
Manages ACK edge clusters. | |
Manages node pools. | |
Manages Role-Based Access Control (RBAC) permissions. | |
Manages ACK managed clusters. | |
Manages ACK dedicated clusters. | |
Manage the ACK Serverless cluster. | |
Manages cluster components. |
Table 2. Data Sources
Name | Description |
Activates ACK. | |
Lists all ACK edge clusters. | |
Lists all ACK dedicated clusters. | |
Lists all permissions of specified (Resource Access Management) RAM users. | |
Lists all ACK managed clusters. | |
Lists all ACK Serverless clusters. | |
Lists the metadata of cluster components. | |
Lists available cluster components. | |
Lists information about available Kubernetes versions. |