Skip to content

Commit 66bb3c8

Browse files
mazyu36go-to-kmoltar
authored
feat(aws-elasticache): support cache usage limits (#73)
* chore(deps): upgrade cdk version (#72) * wip * unit test * add integ * wip * update * feat!: adds Node.js subpath exports (#75) * feat: get a list of solutions * feat: generate main barrel * feat: adds exports * chore: projen synth * feat: add root export * chore: projen synth * refactor: use libdir * refactor: into a component * docs: use cases * refactor: solutions prop * refactor: generateBarrel * refactor: generateSubPathExports * docs: Construct Bootstrap * refactor: rename for clarity * refactor: rename for clarity * update * fix * fix render method * fix any * fix validation * fix default labels Signed-off-by: Yuki Matsuda <13781813+mazyu36@users.noreply.github.com> * rebuild --------- Signed-off-by: Yuki Matsuda <13781813+mazyu36@users.noreply.github.com> Co-authored-by: Kenta Goto (k.goto) <24818752+go-to-k@users.noreply.github.com> Co-authored-by: Roman <491247+moltar@users.noreply.github.com>
1 parent 1523384 commit 66bb3c8

File tree

17 files changed

+20732
-23152
lines changed

17 files changed

+20732
-23152
lines changed

API.md

Lines changed: 317 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/aws-elasticache/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,28 @@ const endpointAddress = serverlessCache.endpointAddress;
259259
const endpointPort = serverlessCache.endpointPort;
260260
```
261261

262+
### Cache usage limits
263+
264+
You can choose to configure a maximum usage on both cache data storage and ECPU/second for your cache to control cache costs.
265+
Doing so will ensure that your cache usage never exceeds the configured maximum.
266+
267+
For more infomation, see [Setting scaling limits to manage costs](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Scaling.html#Pre-Scaling).
268+
269+
```ts
270+
declare const vpc: ec2.Vpc;
271+
272+
const serverlessCache = new ServerlessCache(this, 'ServerlessCache', {
273+
engine: Engine.VALKEY,
274+
vpc,
275+
cacheUsageLimits: {
276+
// cache data storage limits (GB)
277+
dataStorage: DataStorage.gb({ minimum: 1, maximum: 5000 }), // minimum: 1GB, maximum: 5000GB
278+
// ECPU limits (ECPU/second)
279+
ecpuPerSecond: ECPUPerSecond.of({ minimum: 1000, maximum: 15000000 }), // minimum: 1000, maximum: 15000000
280+
},
281+
});
282+
```
283+
262284
### Snapshots and restore
263285

264286
You can enable automatic backups for serverless cache.

0 commit comments

Comments
 (0)