一、资源语法
资源通过 resource 块定义,一个 resource 块包含 resource 关键字、资源类型、资源名和资源块体三部分。如下所示:
resource "tencentcloud_vpc" "foo" { name = "ci-temp-test-updated" cidr_block = "10.0.0.0/16" dns_servers = ["119.29.29.29", "8.8.8.8"] is_multicast = false tags = { "test" = "test" } }
二、资源引用
通过该语法格式<资源类型>.<名称>.<属性>引用资源属性。如下所示:
tencentcloud_vpc.foo.name # 实例名ci-temp-test-updated