我正在尝试使用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
提前感谢
您需要使用tag-resource
方法代替update-rest-api
aws apigateway tag-resource --resource-arn your-api-gateway-arn --tags tag-name=tag-value
api网关的arn格式可以找到here