1

I am trying to untag deleted AWS resources with the resourcegroupstaggingapi.

I am listing my resources with the following command :

aws resourcegroupstaggingapi get-resources --tag-filters Key=special_project --tags-per-page 100

Then, I am trying to untag resources with :

aws resourcegroupstaggingapi untag-resources --resource-arn-list arn:aws:mediaconnect:ap-northeast-1:XXXXXXXXXXX:flow:1-XXXXXXXXXXX-XXXXXXXX:flow-created-by-mr_ --tag-keys special_project

I always got the following error:

{
"FailedResourcesMap": {
    "arn:aws:mediaconnect:ap-northeast-1:XXXXXXXXXXX:flow:1-XXXXXXXXXXX-XXXXXXXX:flow-created-by-mr_": {
        "StatusCode": 400,
        "ErrorCode": "InvalidParameterException",
        "ErrorMessage": "Unrecognized service for tagging"
    }
}}

Here is the example from the AWS doc :

aws resourcegroupstaggingapi untag-resources \
--resource-arn-list arn:aws:s3:::awsexamplebucket \
--tag-keys Environment,CostCenter

I don't understand what I'm doing wrong. Any help would be highly appreciated.

Additional information :

Tagging AWS MediaConnect resources work with the MediaConnect API, but doesn't work with the resourcegroupstaggingapi. On the other hand the resourcegroupstaggingapi can list AWS MediaConnect resources.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
mehdi.r
  • 386
  • 1
  • 4
  • 20
  • The error says `Unrecognized service for tagging`. Are you sure that you can use Resource Group Tagging on this type of resource? How was the tag added? Did you use `aws resourcegroupstaggingapi tag` to create the tag? I would recommend trying that first. – John Rotenstein Nov 11 '19 at 04:54
  • @ John Rotenstein Thanks for your reply. I added the TAG when I created the resource. TAGs were added with the `MediaConnect` & `MediaLive` api. I will try to add TAG with `resourcegroupstaggingapi`. The strange thing is I can list resources with `resourcegroupstaggingapi` – mehdi.r Nov 11 '19 at 04:58
  • @ John Rotenstein Apparently, MediaConnect resources cannot be tag/untag by the resourcegroupstaggingapi . https://docs.aws.amazon.com/ARG/latest/userguide/supported-resources.html#supported-resources-console – mehdi.r Nov 14 '19 at 05:52

0 Answers0