How to use the @aws-cdk/aws-elasticache.CfnCacheCluster function in @aws-cdk/aws-elasticache

To help you get started, we’ve selected a few @aws-cdk/aws-elasticache examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-samples / aws-cdk-changelogs-demo / custom-constructs / redis.js View on Github external
description: `List of subnets used for redis cache ${id}`,
      subnetIds: {
        return subnet.subnetId;

    // The security group that defines network level access to the cluster
    this.securityGroup = new ec2.SecurityGroup(this, `${id}-security-group`, { vpc: targetVpc });

    this.connections = new ec2.Connections({
      securityGroups: [this.securityGroup],
      defaultPortRange: new ec2.TcpPort(6379)

    // The cluster resource itself.
    this.cluster = new elasticache.CfnCacheCluster(this, `${id}-cluster`, {
      cacheNodeType: 'cache.t2.micro',
      engine: 'redis',
      numCacheNodes: 1,
      autoMinorVersionUpgrade: true,
      cacheSubnetGroupName: subnetGroup.subnetGroupName,
      vpcSecurityGroupIds: [


The CDK Construct Library for AWS::ElastiCache

Latest version published 10 months ago

Package Health Score

65 / 100
Full package analysis