You need to enable JavaScript to run this app.
Copy page
Download PDF
Configuration guide
Provider
Copy page
Download PDF
Provider
A Terraform configuration file ends with .tf and consists of providers, Resources, Data Sources, and variables.​
A provider is used for specifying a service provider. You can declare a provider using the keyword "provider."​
Specifying a source and a version​
For Terraform 0.13 or later, you can use required_providers to specify the source and version of providers. Example:​
​
terraform {​
required_providers {​
volcengine = {​
source = "volcengine/volcengine"​
version = "1.0.0"​
}​
}​
required_version = ">= 0.13"​
}​
​
Creating provider blocks​
You can use provider blocks to create multiple configurations. The default block is unique and uses the identifier "provider" while non-default blocks use the identifier "alias." To manage resources in different Regions, you must declare multiple provider blocks. The following example demonstrates how to declare the BytePlus providers of the China (Beijing) (cn-beijing) and China (Shanghai) (cn-nantong) Regions and how to add an alias for the provider of the China (Shanghai) Region:​
​
provider "volcengine" {​
region = "cn-beijing"​
...​
}​
​
provider "volcengine" {​
alias = "ntcc"​
region = "cn-nantong"​
...​
}​
​
Selecting a provider block​
When you select a non-default block, the format is <provider name>.<alias>. As shown in the following example, the selected provider is volcengine.ntcc:​
​
resource "volcengine_vpc" "foo" {​
provider = volcengine.ntcc​
vpc_name = "tf-test-2"​
cidr_block = "172.16.0.0/16"​
​
​
Last updated: 2025.06.26 17:44:37