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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ updates:
groups:
tooling:
patterns: ["*"]

# Node runtime/dev dependencies in node/package.json.
- package-ecosystem: npm
directory: /node
schedule:
interval: weekly
groups:
node:
patterns: ["*"]
78 changes: 78 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Node CI

# Path-filtered so the Node package is validated independently.
on:
push:
branches:
- main
- "release-*"
paths:
- "node/**"
- ".github/workflows/node.yml"
pull_request:
paths:
- "node/**"
- ".github/workflows/node.yml"

permissions:
contents: read

jobs:
# Load the test matrix from package.json's supportedNodeVersions.
versions:
name: node versions
runs-on: ubuntu-latest
outputs:
data: ${{ steps.set.outputs.data }}
steps:
- name: Check out the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Generate supported versions from package.json
id: set
working-directory: node
run: echo "data=$(npm run --silent list-supported-versions)" >> "$GITHUB_OUTPUT"

test:
name: Node ${{ matrix.node-version }} (${{ matrix.os }})
needs: versions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ${{ fromJson(needs.versions.outputs.data).all }}
defaults:
run:
working-directory: node
steps:
- name: Check out the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: node/package-lock.json

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Check formatting
run: npm run format:check

- name: Typecheck
run: npm run typecheck

- name: Test
run: npm test

- name: Build
run: npm run build

- name: Validate package contents
run: npm pack --dry-run
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
*.iml
.vscode/

# Language-specific ignores live in python/.gitignore and java/.gitignore so
# Language-specific ignores live in python/.gitignore and node/.gitignore so
# each package stays self-contained.
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# Developer Toolkit for ElastiCache

This repository contains tools to work with [Amazon ElastiCache](https://aws.amazon.com/elasticache/).
This repository contains libraries and tools for working 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.
The Python and Node.js libraries support
[IAM authentication](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/auth-iam.html)
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.

## Packages

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

## Quick start

## Quick start (Python)
### Python

```bash
python3 -m pip install developer-toolkit-elasticache
Expand All @@ -34,6 +38,26 @@ 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.

### Node.js

```bash
npm install @aws/developer-toolkit-elasticache
```

```typescript
import { 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](node/README.md) for requirements, the credential and region
chains, the async token provider, and client integration examples.

## Getting help

Please use these community resources for getting help. We use the GitHub issues for
Expand Down
14 changes: 14 additions & 0 deletions node/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Build artifacts
dist/
dist-test/
node_modules/

# npm
*.tgz
npm-debug.log*

# Test / coverage output
coverage/

# OS / editor
.DS_Store
4 changes: 4 additions & 0 deletions node/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
dist-test/
node_modules/
package-lock.json
6 changes: 6 additions & 0 deletions node/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 90,
"proseWrap": "always",
"singleQuote": false,
"trailingComma": "all"
}
16 changes: 16 additions & 0 deletions node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

All notable changes to the Node.js 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/).

## [Unreleased]

### Added

- `generateIamAuthToken()` for signing IAM authentication tokens for Amazon ElastiCache
serverless caches and node-based replication groups.
- `ElastiCacheIAMAuthTokenProvider` for generating fresh tokens when clients connect or
reconnect.
- `ToolkitInputError`, `InvalidParameterError`, and `ConfigurationError`.
- Runnable token-generation and iovalkey integration examples under `examples/`.
Loading