使用aws cli将标签添加到aws网关

问题描述 投票:0回答:1

我正在尝试使用aws cli将标签添加到现有的restApi。

已尝试

aws apigateway update-rest-api --rest-api-id ${rest_api_id} --patch-operations op=add,path=/tags/keytest,value='testvalue'

并且得到

An error occurred (BadRequestException) when calling the UpdateRestApi operation: Invalid patch path /tags/keytest

提前感谢

amazon-web-services aws-api-gateway aws-cli restapi
1个回答
0
投票

您需要使用tag-resource方法代替update-rest-api

aws apigateway tag-resource --resource-arn your-api-gateway-arn --tags tag-name=tag-value

api网关的arn格式可以找到here

© www.soinside.com 2019 - 2024. All rights reserved.