I have read through the available AWS Cognito docs, but I am not sure if I understand how to best implement a "user search" feature: I want users to be able to search for each other and look at each other's user profiles.
Two specific requirements:
How to best approach this? I suppose I need a proxy API service as e.g. searching by custom attributes is not supported by AWS Cognito. But there are many questions:
Cognito doesn't expose the attributes each user has publicly, so I'm not sure that approach will work directly. To achieve this end with what Cognito supports already, you would have to mirror the attributes stored against a user elsewhere, either by building your own hooks into update calls from the client or via Lambda. Potentially a bit cleaner is to only store those custom attributes that you need searched elsewhere and leveraging what Cognito supports whenever possible.
Update with more specific details, per request:
A rough outline that comes to mind:
1) Client side, once update attributes is called you build in a new hook that will update some remote data store (Elastisearch, Dynamo...etc.).
2) This data store should probably be backed by API gateway, using the Cognito access token as an authentication mechanism around it.
3) Another API to query this data store could be built in to API gateway as well, using the same authentication mechanism.
4) Queries would then go to this API and could be wrapped into whatever language or capabilities the storage has.
With this, it also allows you to build custom logic on who has access to what.