@@ -126,13 +126,23 @@ func resourceTencentCloudVpcBandwidthPackageCreate(d *schema.ResourceData, meta
126126 d .SetId (bandwidthPackageId )
127127
128128 ctx := context .WithValue (context .TODO (), logIdKey , logId )
129+
130+ if tags := helper .GetTags (d , "tags" ); len (tags ) > 0 {
131+ tagService := TagService {client : meta .(* TencentCloudClient ).apiV3Conn }
132+ region := meta .(* TencentCloudClient ).apiV3Conn .Region
133+ resourceName := fmt .Sprintf ("qcs::vpc:%s:uin/:bandwidthPackage/%s" , region , bandwidthPackageId )
134+ if err := tagService .ModifyTags (ctx , resourceName , tags , nil ); err != nil {
135+ return err
136+ }
137+ }
138+
129139 service := VpcService {client : meta .(* TencentCloudClient ).apiV3Conn }
130140 err = resource .Retry (3 * readRetryTimeout , func () * resource.RetryError {
131141 instance , errRet := service .DescribeVpcBandwidthPackage (ctx , bandwidthPackageId )
132142 if errRet != nil {
133143 return retryError (errRet , InternalError )
134144 }
135- if * instance .Status == "CREATED" {
145+ if instance != nil && * instance .Status == "CREATED" {
136146 return nil
137147 }
138148 return resource .RetryableError (fmt .Errorf ("tmpInstance status is %v, retry..." , * instance .Status ))
@@ -141,14 +151,6 @@ func resourceTencentCloudVpcBandwidthPackageCreate(d *schema.ResourceData, meta
141151 return err
142152 }
143153
144- if tags := helper .GetTags (d , "tags" ); len (tags ) > 0 {
145- tagService := TagService {client : meta .(* TencentCloudClient ).apiV3Conn }
146- region := meta .(* TencentCloudClient ).apiV3Conn .Region
147- resourceName := fmt .Sprintf ("qcs::vpc:%s:uin/:bandwidthPackage/%s" , region , bandwidthPackageId )
148- if err := tagService .ModifyTags (ctx , resourceName , tags , nil ); err != nil {
149- return err
150- }
151- }
152154 return resourceTencentCloudVpcBandwidthPackageRead (d , meta )
153155}
154156
@@ -211,27 +213,19 @@ func resourceTencentCloudVpcBandwidthPackageUpdate(d *schema.ResourceData, meta
211213 request .BandwidthPackageId = & bandwidthPackageId
212214
213215 if d .HasChange ("network_type" ) {
214-
215216 return fmt .Errorf ("`network_type` do not support change now." )
216-
217217 }
218218
219219 if d .HasChange ("bandwidth_package_count" ) {
220-
221220 return fmt .Errorf ("`bandwidth_package_count` do not support change now." )
222-
223221 }
224222
225223 if d .HasChange ("internet_max_bandwidth" ) {
226-
227224 return fmt .Errorf ("`internet_max_bandwidth` do not support change now." )
228-
229225 }
230226
231227 if d .HasChange ("protocol" ) {
232-
233228 return fmt .Errorf ("`protocol` do not support change now." )
234-
235229 }
236230
237231 if d .HasChange ("charge_type" ) {
0 commit comments