1

I am trying to add a tag to an existing restApi with aws cli.

Have tried

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

and getting

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

Thanks in advance

Ersoy
  • 8,816
  • 6
  • 34
  • 48
zyrahjane
  • 349
  • 3
  • 13

1 Answers1

3

You need to use tag-resource method instead of update-rest-api

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

The arn format of api gateway can be found here

Edit: this will update the stage tag.

Ersoy
  • 8,816
  • 6
  • 34
  • 48