amazon-web-servicesamazon-s3searchtagsaws-sdk

AWS S3 filter by tags. search by tags


We have our bucket with new AWS SDK API on AWS S3. We uploaded and tagged lots of files and folders with tags.

How can we filter on key-value tag, or only one of them? I'd like to find all the objects with key = "temp", or key = "temp" and value = "lol".


Solution

  • I also hoped that AWS will eventually support "search files by tags" because that would open up possibilities like e.g. having a photo storage with the names, descriptions, location stored in tags so I wouldn't need a separate database.

    But, apparently AWS explicitly is not supporting this, and will probably never do so. Quoting from their storage service white paper:

    Amazon S3 doesn’t suit all storage situations. [...] some storage needs for which you should consider other AWS storage options [...]

    Amazon S3 doesn’t offer query capabilities to retrieve specific objects. When you use Amazon S3 you need to know the exact bucket name and key for the files you want to retrieve from the service. Amazon S3 can’t be used as a database or search engine by itself.

    Instead, you can pair Amazon S3 with Amazon DynamoDB, Amazon CloudSearch, or Amazon Relational Database Service (Amazon RDS) to index and query metadata about Amazon S3 buckets and objects.

    AWS suggests using DynamoDB, RDS or CloudSearch instead.