cdk-redisdb-0.0.22
توضیحات
Simple & featureful Redis on AWS - Elasticache Replication Group & MemoryDB with a unified API
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | cdk-redisdb-0.0.22 |
| نام | cdk-redisdb |
| نسخه کتابخانه | 0.0.22 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Timothy Downs<timothydowns@gmail.com> |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/forkfork/cdk-redisdb.git |
| آدرس اینترنتی | https://pypi.org/project/cdk-redisdb/ |
| مجوز | Apache-2.0 |
# cdk-redisdb
An AWS CDK construct which spins up an Elasticache Replication Group, or a MemoryDB Cluster.
## Usage (TypeScript/JavaScript)
Install via npm:
```shell
$ npm i cdk-redisdb
```
Add an Elasticache Replication Group to your CDK stack:
```python
import { RedisDB } from 'cdk-redisdb'
new RedisDB(this, 'redisdb-repl-group', {
nodes: 1,
nodeType: 'cache.m6g.large',
engineVersion: '6.2',
})
```
Add a MemoryDB Cluster to your CDK stack:
```python
import { MemoryDB } from 'cdk-redisdb'
new MemoryDB(this, 'memorydb-repl-group', {
nodes: 1,
nodeType: 'db.t4g.small',
engineVersion: '6.2',
})
```
Specify a VPC rather than having a VPC auto-created for you:
```python
import { MemoryDB } from 'cdk-redisdb'
let vpc = new ec2.Vpc(this, 'Vpc', {
subnetConfiguration: [
{
cidrMask: 24,
name: 'public1',
subnetType: ec2.SubnetType.PUBLIC,
},
{
cidrMask: 24,
name: 'isolated1',
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
},
],
})
new RedisDB(this, 'redis-use-existing-vpc', {
existingVpc: vpc,
})
```
Add 2 replicas per node, and add shards to cluster when memory exceeds 60%.
```python
import { RedisDB } from 'cdk-redisdb'
new RedisDB(this, 'redisdb-repl-group', {
nodes: 1,
replicas: 2, // 2 replicas per node
nodeType: 'cache.m6g.large',
memoryAutoscalingTarget: 60,
// nodesCpuAutoscalingTarget
})
```
```python
import { RedisDB } from 'cdk-redisdb'
let vpc = new ec2.Vpc(this, 'Vpc', {
subnetConfiguration: [
{
cidrMask: 24,
name: 'public1',
subnetType: ec2.SubnetType.PUBLIC,
},
{
cidrMask: 24,
name: 'isolated1',
subnetType: ec2.SubnetType.PRIVATE,
},
],
})
const ecSecurityGroup = new ec2.SecurityGroup(this, 'elasticache-sg', {
vpc: vpc,
description: 'SecurityGroup associated with the ElastiCache Redis Cluster',
allowAllOutbound: false,
});
new RedisDB(this, 'redisdb-repl-group', {
nodes: 1,
nodeType: 'cache.m6g.large',
nodesCpuAutoscalingTarget: 50,
existingVpc: vpc,
existingSecurityGroup: ecSecurityGroup,
})
```
Features in progress:
* MemoryDB ACLs (commented out to avoid default bad practices, read comments to understand the CloudFormation)
Features to come:
* Replication Groups with cluster mode disabled (for those using multiple databases)
* Improved API - sane choice of props
نیازمندی
| مقدار | نام |
|---|---|
| <3.0.0,>=2.76.0 | aws-cdk-lib |
| <11.0.0,>=10.0.5 | constructs |
| <2.0.0,>=1.80.0 | jsii |
| >=0.0.3 | publication |
| ~=2.13.3 | typeguard |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| ~=3.7 | Python |
نحوه نصب
نصب پکیج whl cdk-redisdb-0.0.22:
pip install cdk-redisdb-0.0.22.whl
نصب پکیج tar.gz cdk-redisdb-0.0.22:
pip install cdk-redisdb-0.0.22.tar.gz