@@ -95,6 +95,11 @@ func resourceTencentCloudVpcInstance() *schema.Resource {
95
95
Computed : true ,
96
96
Description : "Creation time of VPC." ,
97
97
},
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
+ },
98
103
},
99
104
}
100
105
}
@@ -186,6 +191,20 @@ func resourceTencentCloudVpcInstanceRead(d *schema.ResourceData, meta interface{
186
191
return resource .NonRetryableError (errRet )
187
192
}
188
193
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
+
189
208
tags := make (map [string ]string , len (info .tags ))
190
209
for _ , tag := range info .tags {
191
210
if tag .Key == nil {
@@ -198,6 +217,7 @@ func resourceTencentCloudVpcInstanceRead(d *schema.ResourceData, meta interface{
198
217
tags [* tag .Key ] = * tag .Value
199
218
}
200
219
220
+
201
221
_ = d .Set ("name" , info .name )
202
222
_ = d .Set ("cidr_block" , info .cidr )
203
223
_ = d .Set ("dns_servers" , info .dnsServers )
0 commit comments