Commit 2bde1a0
authored
fix(elasticache-alpha): cannot import Redis 7 serverless cache (#35629)
### Issue # (if applicable)
N/A
### Reason for this change
The `ServerlessCache` class was missing the `CacheEngine.REDIS_7` case in the switch statement that determines the default port for imported caches.
So importing a Redis 7 serverless cache causes an error:
> ValidationError: Unsupported cache engine: redis_7
### Description of changes
* Added missing `CacheEngine.REDIS_7` case** in the `fromServerlessCacheAttributes` method's switch statement to ensure Redis 7 caches use the correct default port.
* Add unit tests for all supported versions.
### Describe any new or updated permissions being added
N/A
### Description of how you validated changes
Add unit tests
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*1 parent 2be0b63 commit 2bde1a0
File tree
2 files changed
+30
-4
lines changed- packages/@aws-cdk/aws-elasticache-alpha
- lib
- test
2 files changed
+30
-4
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
332 | 333 | | |
333 | 334 | | |
334 | 335 | | |
| |||
Lines changed: 29 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
23 | 39 | | |
24 | 40 | | |
25 | 41 | | |
| |||
73 | 89 | | |
74 | 90 | | |
75 | 91 | | |
76 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
77 | 100 | | |
| 101 | + | |
78 | 102 | | |
79 | | - | |
| 103 | + | |
80 | 104 | | |
81 | 105 | | |
82 | 106 | | |
83 | | - | |
84 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
85 | 110 | | |
86 | 111 | | |
87 | 112 | | |
| |||
0 commit comments