Skip to content

Commit 5cdc0f9

Browse files
authored
fix(vpc): [117602221] add computed route_item_id (#2732)
* add route item id * add computed attr * add changelog
1 parent a923112 commit 5cdc0f9

6 files changed

+21
-2
lines changed

.changelog/2732.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_route_table_entry: add computed `route_item_id`
3+
```

tencentcloud/services/vpc/resource_tc_route_table_entry.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ func ResourceTencentCloudVpcRouteEntry() *schema.Resource {
6666
ForceNew: true,
6767
Description: "Description of the routing table entry.",
6868
},
69+
"route_item_id": {
70+
Type: schema.TypeString,
71+
Computed: true,
72+
Description: "ID of route table entry.",
73+
},
6974
},
7075
}
7176
}
@@ -173,7 +178,7 @@ func resourceTencentCloudVpcRouteEntryRead(d *schema.ResourceData, meta interfac
173178
_ = d.Set("destination_cidr_block", v.destinationCidr)
174179
_ = d.Set("next_type", v.nextType)
175180
_ = d.Set("next_hub", v.nextBub)
176-
181+
_ = d.Set("route_item_id", v.routeItemId)
177182
_ = d.Set("disabled", !v.enabled)
178183
return nil
179184
}

tencentcloud/services/vpc/resource_tc_route_table_entry.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ resource "tencentcloud_route_table_entry" "instance" {
3232
next_hub = "0"
3333
description = "ci-test-route-table-entry"
3434
}
35+
36+
output "item_id" {
37+
value = tencentcloud_route_table_entry.instance.route_item_id
38+
}
3539
```
3640

3741
Import

tencentcloud/services/vpc/resource_tc_vpc_notify_routes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func ResourceTencentCloudVpcNotifyRoutes() *schema.Resource {
6767
Required: true,
6868
ForceNew: true,
6969
Type: schema.TypeSet,
70+
MaxItems: 1,
7071
Elem: &schema.Schema{
7172
Type: schema.TypeString,
7273
},

tencentcloud/services/vpc/service_tencentcloud_vpc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ type VpcRouteEntryBasicInfo struct {
9191
description string
9292
entryType string
9393
enabled bool
94+
routeItemId string
9495
}
9596

9697
func (info VpcRouteEntryBasicInfo) RouteEntryId() int64 {
@@ -957,6 +958,7 @@ getMoreData:
957958
entry.routeEntryId = int64(*v.RouteId)
958959
entry.entryType = *v.RouteType
959960
entry.enabled = *v.Enabled
961+
entry.routeItemId = *v.RouteItemId
960962
basicInfo.entryInfos = append(basicInfo.entryInfos, entry)
961963
}
962964
if hasTableMap[basicInfo.routeTableId] {

website/docs/r/route_table_entry.html.markdown

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ resource "tencentcloud_route_table_entry" "instance" {
4343
next_hub = "0"
4444
description = "ci-test-route-table-entry"
4545
}
46+
47+
output "item_id" {
48+
value = tencentcloud_route_table_entry.instance.route_item_id
49+
}
4650
```
4751

4852
## Argument Reference
@@ -61,7 +65,7 @@ The following arguments are supported:
6165
In addition to all arguments above, the following attributes are exported:
6266

6367
* `id` - ID of the resource.
64-
68+
* `route_item_id` - ID of route table entry.
6569

6670

6771
## Import

0 commit comments

Comments
 (0)