Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,54 @@
# developer-toolkit-elasticache
# Developer Toolkit for ElastiCache

This repository contains tools to work with [Amazon ElastiCache](https://aws.amazon.com/elasticache/).

The Python library offers [IAM authentication](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/auth-iam.html)
for ElastiCache: generates a signed token that ElastiCache requires for connection
with an IAM-enabled user, so applications can authenticate to a Valkey or
Redis OSS cache with AWS credentials.

## Packages

| Language | Package | Documentation |
|---|---|---|
| Python | [`developer-toolkit-elasticache`](https://pypi.org/project/developer-toolkit-elasticache/) on PyPI | [python/README.md](python/README.md) |


## Quick start (Python)

```bash
python3 -m pip install developer-toolkit-elasticache
```

```python
from 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](python/README.md) for requirements, the credential chain, the Python
command-line tool, and client integration examples.

## Getting help

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](https://github.com/aws/developer-toolkit-elasticache/discussions).
- If you think you may have found a bug, please [open an issue](https://github.com/aws/developer-toolkit-elasticache/issues/new).


## Contributing

Contributions are welcome. Open an issue to discuss a change before sending a pull
request; all changes are reviewed before merging.

## License

This project is licensed under the Apache-2.0 License. See [LICENSE](LICENSE) and
[NOTICE](NOTICE).
24 changes: 24 additions & 0 deletions python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

All notable changes to the Python package are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the package uses
[Semantic Versioning](https://semver.org/).

## [1.0.0] - Unreleased

Initial release.

### Added

- `generate_iam_auth_token()` — signs an IAM authentication token for an Amazon
ElastiCache serverless cache or node-based replication group using the default AWS
credential chain.
- `ElastiCacheIAMAuthTokenProvider` — signs a fresh token on each `get_token()` call,
for clients that re-authenticate on reconnect.
- `developer-toolkit-elasticache generate_iam_auth_token` command-line interface.
- `InvalidParameterError` and `ConfigurationError` (both `ToolkitInputError`) for
invalid arguments and unresolvable region or credentials. Error messages never echo
caller-provided values.
- Examples for redis-py and valkey-py under `examples/`.

[1.0.0]: https://github.com/aws/developer-toolkit-elasticache/releases/tag/python-v1.0.0
14 changes: 9 additions & 5 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ connection password for an IAM-enabled user.

## Installation

Requires Python 3.10–3.14, `pip`, and `git`. Install from the source repository:
Requires Python 3.10–3.14 and `pip`. Install from PyPI:

```bash
git clone https://github.com/aws/developer-toolkit-elasticache.git
cd developer-toolkit-elasticache/python
python3 -m pip install .
python3 -m pip install developer-toolkit-elasticache
```

This installs the library and the `developer-toolkit-elasticache` command.
If you don't have [`pip`](https://pip.pypa.io) installed, this
[Python installation guide](https://docs.python-guide.org/starting/installation/) can
guide you through the process.

This installs the library and the `developer-toolkit-elasticache` command. To install
from source instead, clone the repository and run `python3 -m pip install .` from the
`python/` directory.

## Usage

Expand Down
7 changes: 2 additions & 5 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ build-backend = "setuptools.build_meta"

[project]
name = "developer-toolkit-elasticache"
version = "0.1.0.dev0"
version = "1.0.0"
description = "Developer toolkit for Amazon ElastiCache"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.10"
dependencies = [
"botocore>=1.43.0",
]
# NOTE: This project is in active development and is NOT ready to publish.
# The "Private :: Do Not Upload" classifier makes PyPI reject any upload of
# this package. Do not remove it until we have explicitly decided to publish.
classifiers = [
"Private :: Do Not Upload",
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
Expand Down
12 changes: 5 additions & 7 deletions scripts/python_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Python task runner — one entry point for every Python CI/CD step, run locally or
from the workflows. Requires Python 3.11+ (tomllib) for `verify` and `versions`
from the workflows. Requires Python 3.11+ (tomllib) for `verify` and `list-supported-versions`.

./python_dev.py setup # install the package + all dev tooling
./python_dev.py lint # ruff check + format --check
Expand All @@ -13,8 +13,8 @@
./python_dev.py smoke [VERSION] # install from PyPI + assert version + run CLI
./python_dev.py ci # setup + lint + test + package (pre-flight)

lint/test/build run inside a .venv the runner creates and reuses, so there is no
manual `python -m venv` step; delete .venv to rebuild it against a different
lint/test/package run inside a .venv the runner creates and reuses, so there is no
manual `python -m venv` step; delete python/.venv to rebuild it against a different
interpreter.
"""

Expand Down Expand Up @@ -58,7 +58,7 @@ def run(*args: object) -> None:
def venv_python() -> str:
"""Create the managed .venv on first use and return its Python interpreter.

Lets the runner own an isolated environment, so `./dev.py test` works with no
Lets the runner own an isolated environment, so `./python_dev.py test` works with no
manual `python -m venv`. In CI each job is a fresh runner, so the .venv is built
from that job's interpreter — honouring the matrix version.
"""
Expand Down Expand Up @@ -239,9 +239,7 @@ def ci(args: argparse.Namespace) -> int:


def main() -> int:
parser = argparse.ArgumentParser(
prog="dev.py", description="Developer/CI task runner."
)
parser = argparse.ArgumentParser(description="Python task runner.")
subparsers = parser.add_subparsers(dest="command", required=True)
for name, arg in _COMMANDS.items():
subparser = subparsers.add_parser(name)
Expand Down