aws / aws/aws-cdk

aws-elasticache: In-transit encryption is not supported for Redis?

Open
#27,379 13 comments 7 reactions 0 assignees View on GitHub
@aws-cdk/aws-elasticache bug p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

When attempting to create a Redis elasticache cluster that enables in-transit encryption, we receive the following error:

```
Encryption feature is not supported for engine REDIS. (Service: AmazonElastiCache; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 34376205-8f3f-43e6-8fff-c7ca185ad835; Proxy: null
```

This doesn't make any sense though, as the public documentation clearly states that encryption *is* supported:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticache-cache-cluster.html#cfn-elasticache-cachecluster-transitencryptionenabled

> This parameter is valid only if the Engine parameter is `redis`,

In addition, we are using VPC, per the documentation.

Here's our code that should enable easy reproduction:

```ts
const redisSubnetGroup = new CfnSubnetGroup(this, 'APICacheSubnetGroup', {
description: 'Subnet group for API cache',
subnetIds: props.vpc.privateSubnets.map((subnet) => subnet.subnetId),
})

const redisSecurityGroup = new SecurityGroup(this, 'APICacheSecurityGroup', {
vpc: props.vpc,
description: 'Security group for API cache',
})

const redis = new CfnCacheCluster(this, 'APICache', {
numCacheNodes: 1,
engine: 'redis',
// https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html
// https://aws.amazon.com/elasticache/pricing/
cacheNodeType: 'cache.m7g.large',
cacheSubnetGroupName: redisSubnetGroup.ref,
vpcSecurityGroupIds: [redisSecurityGroup.securityGroupId],
transitEncryptionEnabled: true,
})

```

### Expected Behavior

I am able to create a Redis Elasticache instance with transit encryption enabled.

### Current Behavior

An error occurs (see description)

### Reproduction Steps

Use the CDK code in the description to deploy a Redis cluster.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.92.0 (build bf62e55)

### Framework Version

_No response_

### Node.js Version

18

### OS

Linux

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the CfnCacheCluster configuration and CDK CLI version shown in the report. Determine whether the rejection comes from the CDK resource definition or Amazon ElastiCache, then inspect the relevant generated resource behavior and add a regression test if the CDK is responsible. Done means Redis transit encryption can be enabled or the limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, redis, typescript
Domain
cloud, databases, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.