In the CloudHealth Assets console, it's very easy to use the Smart Filters to only show resources that have a particular tag key (and optionally a specific value). I haven't been able to emulate the same filtering with the Assets API. There is a tags field for most AWS resources but the docs aren't clear on whether you can filter down by a specific tag. I can filter all S3 buckets down to the ones that have no tags whatsoever with this query:
curl -H 'Authorization: Bearer my-token' "https://chapi.cloudhealthtech.com/api/search?&name=AwsS3Bucket&api_version=2&query=tags=''"
But how would I get all S3 buckets that have an Environment tag, for example? Or show all buckets that do not have a particular tag?
In the CloudHealth Assets console, it's very easy to use the Smart Filters to only show resources that have a particular tag key (and optionally a specific value). I haven't been able to emulate the same filtering with the Assets API. There is a
tagsfield for most AWS resources but the docs aren't clear on whether you can filter down by a specific tag. I can filter all S3 buckets down to the ones that have no tags whatsoever with this query:curl -H 'Authorization: Bearer my-token' "https://chapi.cloudhealthtech.com/api/search?&name=AwsS3Bucket&api_version=2&query=tags=''"
But how would I get all S3 buckets that have an
Environmenttag, for example? Or show all buckets that do not have a particular tag?