Skip to content

Commit 929c56d

Browse files
committed
feat/apigw
1 parent 2bcd58a commit 929c56d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tencentcloud/resource_tc_api_gateway_api_app.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ func resourceTencentCloudAPIGatewayAPIAppUpdate(d *schema.ResourceData, meta int
232232

233233
var (
234234
logId = getLogId(contextNil)
235+
ctx = context.WithValue(context.TODO(), logIdKey, logId)
235236
request = apiGateway.NewModifyApiAppRequest()
236237
apiAppId = d.Id()
237238
err error
@@ -266,6 +267,17 @@ func resourceTencentCloudAPIGatewayAPIAppUpdate(d *schema.ResourceData, meta int
266267
return err
267268
}
268269

270+
if d.HasChange("tags") {
271+
tcClient := meta.(*TencentCloudClient).apiV3Conn
272+
tagService := &TagService{client: tcClient}
273+
oldTags, newTags := d.GetChange("tags")
274+
replaceTags, deleteTags := diffTags(oldTags.(map[string]interface{}), newTags.(map[string]interface{}))
275+
resourceName := BuildTagResourceName("apigateway", "apiAppId", tcClient.Region, apiAppId)
276+
if err := tagService.ModifyTags(ctx, resourceName, replaceTags, deleteTags); err != nil {
277+
return err
278+
}
279+
}
280+
269281
return resourceTencentCloudAPIGatewayAPIAppRead(d, meta)
270282
}
271283

0 commit comments

Comments
 (0)