tencent cloud

Feedback

DataSource

Last updated: 2023-03-07 10:35:48

    Data sources allow Terraform to use information defined outside of Terraform, defined by another separate Terraform configuration, or modified by functions.

    Using a data source

    A data source is accessed via a special kind of resource known as a data resource, declared using a data block as shown below:

    data "tencentcloud_availability_zones" "my_favourite_zone" {
      name = "ap-guangzhou-3"
    }
    

    Referencing a data source

    The syntax for referencing data from a data source is data.<type>.<name>.<attribute> as shown below:

    resource "tencentcloud_subnet" "app" {
      ...
      availability_zone = data.tencentcloud_availability_zones.default.zones.0.name
      ...
    }
    

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support