@@ -12,8 +12,23 @@ resource "tencentcloud_vpc_bandwidth_package" "bandwidth_package" {
1212 "createdBy" = "terraform"
1313 }
1414}
15-
1615```
16+
17+ PrePaid Bandwidth Package
18+
19+ ```hcl
20+ resource "tencentcloud_vpc_bandwidth_package" "bandwidth_package" {
21+ network_type = "BGP"
22+ charge_type = "FIXED_PREPAID_BY_MONTH"
23+ bandwidth_package_name = "test-001"
24+ time_span = 3
25+ internet_max_bandwidth = 100
26+ tags = {
27+ "createdBy" = "terraform"
28+ }
29+ }
30+ ````
31+
1732Import
1833
1934vpc bandwidth_package can be imported using the id, e.g.
@@ -76,6 +91,12 @@ func resourceTencentCloudVpcBandwidthPackage() *schema.Resource {
7691 Optional : true ,
7792 Description : "Tag description list." ,
7893 },
94+
95+ "time_span" : {
96+ Type : schema .TypeInt ,
97+ Optional : true ,
98+ Description : "The purchase duration of the prepaid monthly bandwidth package, unit: month, value range: 1~60." ,
99+ },
79100 },
80101 }
81102}
@@ -117,6 +138,10 @@ func resourceTencentCloudVpcBandwidthPackageCreate(d *schema.ResourceData, meta
117138 }
118139 }
119140
141+ if v , ok := d .GetOkExists ("time_span" ); ok {
142+ request .TimeSpan = helper .IntUint64 (v .(int ))
143+ }
144+
120145 err := resource .Retry (writeRetryTimeout , func () * resource.RetryError {
121146 result , e := meta .(* TencentCloudClient ).apiV3Conn .UseVpcClient ().CreateBandwidthPackage (request )
122147 if e != nil {
@@ -255,6 +280,10 @@ func resourceTencentCloudVpcBandwidthPackageUpdate(d *schema.ResourceData, meta
255280 return fmt .Errorf ("`internet_max_bandwidth` do not support change now." )
256281 }
257282
283+ if d .HasChange ("time_span" ) {
284+ return fmt .Errorf ("`time_span` do not support change now." )
285+ }
286+
258287 if d .HasChange ("charge_type" ) {
259288 if v , ok := d .GetOk ("charge_type" ); ok {
260289 request .ChargeType = helper .String (v .(string ))
0 commit comments