【问题标题】:Add a tag to aws api gateway using aws cli使用 aws cli 向 aws api 网关添加标签
【发布时间】:2020-05-11 00:23:12
【问题描述】:

我正在尝试使用 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 rest


    【解决方案1】:

    你需要使用tag-resource方法而不是update-rest-api

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

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

    编辑:这将更新阶段标签。

    【讨论】:

      猜你喜欢
      • 2020-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-16
      • 2021-12-04
      • 1970-01-01
      • 2019-05-31
      相关资源
      最近更新 更多