Credential Providers

coredis.recipes.credentials

Elasticache IAM Credential Provider

The implementation is based on the Elasticache IAM provider described in redis docs

The ElastiCacheIAMProvider implements the AbstractCredentialProvider interface. It uses aiobotocore to generate a short-lived authentication token which can be used to authenticate with an IAM enabled Elasticache cluster. The token is cached for its lifetime of 15 minutes to reduce the number of unnecessary requests.

See https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/auth-iam.html for more details on using IAM to authenticate with Elasticache.

class ElastiCacheIAMProvider(user: str, cluster_name: str, region: str = 'us-east-1')[source]

Credential provider that uses IAM authentication to connect to an Elasticache instance.

async get_credentials() UserPass[source]

Returns a short-lived token that can be used to connect to an IAM enabled Elasticache instance. The token will be cached for its lifetime (15 minutes) to avoid unnecessary requests.