@@ -95,6 +95,11 @@ func resourceTencentCloudVpcInstance() *schema.Resource {
9595 Computed : true ,
9696 Description : "Creation time of VPC." ,
9797 },
98+ "default_route_table_id" : {
99+ Type : schema .TypeString ,
100+ Computed : true ,
101+ Description : "Default route table id, which created automatically after VPC create." ,
102+ },
98103 },
99104 }
100105}
@@ -186,6 +191,20 @@ func resourceTencentCloudVpcInstanceRead(d *schema.ResourceData, meta interface{
186191 return resource .NonRetryableError (errRet )
187192 }
188193
194+ routeTables , err := service .DescribeRouteTables (ctx , "" , "" , d .Id (), nil , helper .Bool (true ), "" )
195+
196+ if err != nil {
197+ log .Printf ("[WARN] Describe default Route Table error: %s" , err .Error ())
198+ }
199+
200+ for i := range routeTables {
201+ routeTable := routeTables [i ]
202+ if routeTable .isDefault {
203+ _ = d .Set ("default_route_table_id" , routeTable .routeTableId )
204+ break
205+ }
206+ }
207+
189208 tags := make (map [string ]string , len (info .tags ))
190209 for _ , tag := range info .tags {
191210 if tag .Key == nil {
@@ -198,6 +217,7 @@ func resourceTencentCloudVpcInstanceRead(d *schema.ResourceData, meta interface{
198217 tags [* tag .Key ] = * tag .Value
199218 }
200219
220+
201221 _ = d .Set ("name" , info .name )
202222 _ = d .Set ("cidr_block" , info .cidr )
203223 _ = d .Set ("dns_servers" , info .dnsServers )
0 commit comments