This repository contains libraries and tools for working with Amazon ElastiCache.
The Python, Java, and Node.js libraries offer IAM authentication for ElastiCache. They generate the signed token required to connect with an IAM-enabled user, allowing applications to authenticate to a Valkey or Redis OSS cache with AWS credentials.
| Language | Package | Documentation |
|---|---|---|
| Python | developer-toolkit-elasticache on PyPI |
python/README.md |
| Java | software.amazon.elasticache:developer-toolkit-elasticache |
java/README.md |
| Node.js | @aws/developer-toolkit-elasticache on npm |
node/README.md |
python3 -m pip install developer-toolkit-elasticachefrom developer_toolkit_elasticache import generate_iam_auth_token
token = generate_iam_auth_token(
serverless_cache_name="my-cache", # or replication_group_id="my-group"
user_id="iam-user",
region="us-east-1",
)Use the returned token as the password when connecting to the cache. See the Python README for requirements, the credential chain, the Python command-line tool, and client integration examples.
ElastiCacheIamAuthTokenProvider auth = ElastiCacheIamAuthTokenProvider.builder()
.serverlessCacheName("my-cache")
.userId("iam-user")
.region(Region.US_EAST_1)
.build();
String username = auth.getUserId();
String password = auth.getToken();See the Java README for Maven setup, region and credential resolution, token caching and background refresh, and connection examples.
npm install @aws/developer-toolkit-elasticacheimport { generateIamAuthToken } from "@aws/developer-toolkit-elasticache";
const token = await generateIamAuthToken({
serverlessCacheName: "my-cache", // or replicationGroupId: "my-group"
userId: "iam-user",
region: "us-east-1",
});Use the returned token as the password when connecting to the cache. See the Node.js README for requirements, the credential and region chains, the async token provider, and client integration examples.
Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests.
- Ask a question or open a discussion.
- If you think you may have found a bug, please open an issue.
Contributions are welcome. Open an issue to discuss a change before sending a pull request; all changes are reviewed before merging.
This project is licensed under the Apache-2.0 License. See LICENSE and NOTICE.