.tf
extension. You can view the parameter definitions of EdgeOne site resources on the Terraform Provider documentation page.
Below is the tencent_teo.tf
sample configuration file:terraform {required_providers {tencentcloud = {source = "tencentcloudstack/tencentcloud"version = ">= 1.78.5"}}}provider "tencentcloud" {secret_id = "<your-secret-id>"secret_key = "<your-secret-key>"region = "ap-guangzhou"}resource "tencentcloud_teo_zone" "example" {zone_name = "example.com"plan_type = "<your-plan-type>"tags = {"createdBy" = "terraform"}}
terraform init
command to initialize the configuration.
In this step, Terraform will automatically check the provider
field in the configuration file and download the latest module and plugin.
If the following message is printed, the initialization is successful.Initializing the backend...Initializing provider plugins...- Finding tencentcloudstack/tencentcloud versions matching ">= 1.78.5"...- Installing tencentcloudstack/tencentcloud v1.78.5...- Installed tencentcloudstack/tencentcloud v1.78.5 (signed by a HashiCorp partner, key ID 84F69E1C1BECF459)Partner and community providers are signed by their developers.If you'd like to know more about provider signing, you can read about it here:https://www.terraform.io/docs/cli/plugins/signing.htmlTerraform has created a lock file .terraform.lock.hcl to record the providerselections it made above. Include this file in your version control repositoryso that Terraform can guarantee to make the same selections by default whenyou run "terraform init" in the future.Terraform has been successfully initialized!
terraform plan
command to preview the configuration and verify whether it is correct.PS tf-doc> terraform.exe planTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:+ createTerraform will perform the following actions:# tencentcloud_teo_zone.example will be created+ resource "tencentcloud_teo_zone" "example" {+ area = (known after apply)+ cname_speed_up = (known after apply)+ cname_status = (known after apply)+ created_on = (known after apply)+ id = (known after apply)+ modified_on = (known after apply)+ name_servers = (known after apply)+ original_name_servers = (known after apply)+ paused = (known after apply)+ plan_type = "ent"+ resources = (known after apply)+ status = (known after apply)+ tags = {+ "createdBy" = "terraform"}+ type = (known after apply)+ vanity_name_servers_ips = (known after apply)+ zone_id = (known after apply)+ zone_name = "example.com"}Plan: 1 to add, 0 to change, 0 to destroy.───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
terraform apply
to add an EdgeOne node.
After the terraform apply
command is executed, Terraform will ask you to confirm the actions to be executed. After confirming that everything is correct, enter yes
. Then, wait for the command to complete.PS tf-doc> terraform applyTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:+ createTerraform will perform the following actions:# tencentcloud_teo_zone.example will be created+ resource "tencentcloud_teo_zone" "example" {+ area = (known after apply)+ cname_speed_up = (known after apply)+ cname_status = (known after apply)+ created_on = (known after apply)+ id = (known after apply)+ modified_on = (known after apply)+ name_servers = (known after apply)+ original_name_servers = (known after apply)+ paused = (known after apply)+ plan_type = "ent"+ resources = (known after apply)+ status = (known after apply)+ tags = {+ "createdBy" = "terraform"}+ type = (known after apply)+ vanity_name_servers_ips = (known after apply)+ zone_id = (known after apply)+ zone_name = "example.com"}Plan: 1 to add, 0 to change, 0 to destroy.Do you want to perform these actions?Terraform will perform the actions described above.Only 'yes' will be accepted to approve.Enter a value: yestencentcloud_teo_zone.example: Creating...tencentcloud_teo_zone.example: Creation complete after 6s [id=zone-2ag9gej58j36]Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
terraform refresh
. Then, run terraform show
to check whether the site has taken effect.
If NS access is used, the value of the status
field should be active
after the site takes effect. If CNAME access is used, the value of the cname_status
field should be finished
after the site takes effect.PS tf-doc> terraform refreshtencentcloud_teo_zone.example: Refreshing state... [id=zone-2ag9gej58j36]PS tf-doc> terraform show# tencentcloud_teo_zone.example:resource "tencentcloud_teo_zone" "example" {area = "overseas"cname_speed_up = "enabled"cname_status = "pending"...original_name_servers = []paused = falseplan_type = "ent"status = "active"tags = {"createdBy" = "terraform"}type = "full"vanity_name_servers_ips = []zone_id = "zone-2ag9gej58j36"zone_name = "example.com"}
Was this page helpful?