@Override
    public CompletionStage<Credentials> resolve(InetSocketAddress address) {
        if (System.currentTimeMillis() - lastTime > TOKEN_EXPIRY_MS || future == null) {
            try {
                String token = iamAuthTokenRequest.toSignedRequestUri(awsCredentialsProvider.getCredentials());
                future = CompletableFuture.completedFuture(new Credentials(userName, token));
                lastTime = System.currentTimeMillis();
            } catch (URISyntaxException e) {
                throw new IllegalArgumentException(e);
            }
        }
        return future;
    }
Source of implementation <a href="https://redisson.org/articles/how-to-connect-to-redis-using-elasticache-iam-credential-provider.html">
    How to Connect to Redis With the ElastiCache IAM Credential Provider</a>.
storage/src/main/java/com/epam/aidial/core/storage/cache/AwsCredentialsResolver.java