aws-samples / aws-samples/sample-Elasticache-iam-authentication-python-demo-application

Add documentation and examples for ElastiCache Serverless support in IAM authentication

Ouverte
#2 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
2
Forks
1
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

## Summary
The current README and code examples do not mention ElastiCache Serverless cache support, but the IAM authentication token generator (`iam_authtoken_generator_app.py`) works with serverless caches when using the serverless cache name as the replication group ID.

## Current State
- Documentation only mentions non-serverless ElastiCache clusters
- Code examples use replication groups
- No mention of serverless cache compatibility

## What I Tested
I successfully generated a valid IAM authentication token for an ElastiCache Serverless cache as follows:

**Environment:**
- ElastiCache engine: Valkey
- ElastiCache user name: `user-1`
- Region: `ap-northeast-1`
- Python version: `Python 3.9.24`
- valkey-cli: 8.0.6

**Steps:**
1. Created an ElastiCache Serverless for Valkey cache

2. Ran the script: python `iam_authtoken_generator_app.py`
```bash
$ TOKEN=$(python3 ./iam_authtoken_generator_app.py --user-id user-a --replication-group-id --region ap-northeast-1)
```

3. Authenticated using `valkey-cli`

```bash
$ valkey-cli -h -p 6379 --tls --user user-a --pass "$TOKEN"
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
:6379> info
# Server
redis_version:7.2
server_name:valkey
valkey_version:8.1
redis_mode:cluster
```

**Key Finding:**
The existing code (`iam_authtoken_generator_app.py`) works with serverless caches without modification - just use the serverless cache name where you would normally use a replication group ID.

## Requested Changes
1. **Update README.md** to include ElastiCache Serverless as a supported cache type
2. **Add code example** showing how to use serverless cache names
3. **Clarify parameter usage** - document that serverless cache names can be used as `replication_group_id`
4. **Add serverless-specific example** in the code or documentation

## Benefits
- Helps users understand that this tool works with both non-serverless and serverless ElastiCache
- Reduces confusion about parameter usage for serverless caches
- Makes the repository more comprehensive and up-to-date with current AWS offerings

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par README.md et iam_authtoken_generator_app.py, puis examinez les exemples de commandes existants ainsi que l’invocation serverless testée dans cette issue. Documentez la prise en charge d’ElastiCache Serverless, expliquez que le nom du cache serverless est fourni comme replication_group_id, et ajoutez un exemple spécifique à serverless montrant les paramètres pertinents.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, python
Domaine
documentation
Type d'issue
Documentation
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.