You can use this python-based application which uses the Redis-py client to demo the IAM based Authentication to access your Elasticache/MemoryDB for Redis/Valkey ...
Beta: This SDK is supported for production use cases, but we do expect future releases to have some interface changes; see Interface stability. We are keen to hear feedback from you on these SDKs.