» tencentcloud_vpc

tencentcloud_vpc provides details about a specific VPC.

This resource can prove useful when a module accepts a vpc id as an input variable and needs to, for example, determine the CIDR block of that VPC.

» Example Usage

The following example shows how one might accept a VPC id as a variable and use this data source to obtain the data necessary to create a subnet within it.

variable "vpc_id" {}

data "tencentcloud_vpc" "selected" {
  id = "${var.vpc_id}"
}

resource "tencentcloud_subnet" "main" {
  name              = "my test subnet"
  cidr_block        = "${cidrsubnet(data.tencentcloud_vpc.selected.cidr_block, 4, 1)}"
  availability_zone = "eu-frankfurt-1"
  vpc_id            = "${data.tencentcloud_vpc.selected.id}"
}

» Argument Reference

The following arguments are supported:

» Attributes Reference

All of the argument attributes except filter blocks are also exported as result attributes. This data source will complete the data by populating any fields that are not included in the configuration with the data for the selected VPC.

The following attribute is additionally exported: