Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.
I'm submitting a ...
What is the current behavior?
If the current behavior is a :beetle:bug:beetle:: Please provide the steps to reproduce
Attempt to create a redis cluster in a vpc. It always tries to use the default VPC/ default subnets, and fails.
https://gist.github.com/insanitybit/b24f2395f52e0953edfd4cec6f80d17b
10/22 | 8:18:14 PM | CREATE_FAILED | AWS::ElastiCache::CacheCluster | grapl-analyzer-executormsgcache/grapl-analyzer-executormsgcache-cluster (graplanalyzerexecutormsgcachegraplanalyzerexecutormsgcacheclusterC6168A8B) Subnet group [default] belongs to a different VPC [vpc-c2786fb7] than [vpc-0c7c33563da6b698b] (Service: AmazonElastiCache; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 32f5347d-988a-11e9-81d8-1be81f3a6e33)
What is the expected behavior (or behavior of feature suggested)?
Using the provided VPC/ subnets for the cache.
What is the motivation / use case for changing the behavior or adding this feature?
This makes elasticache unusable.
Please tell us about your environment:
CDK CLI Version: 0.36.0
Module Version: 0.36.0
OS: Ubuntu 18.04
Language: typescript
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
I have the same issue since 0.36.0
This is a bit of a blocker for me as I already have code that leverages Elasticache. Any way I can help to get this fixed? I'm unfamiliar with the internals of cdk, but when I'm back at my laptop I could run commands or whatever.
@insanitybit If you feel like you can isolate the issue, or even fix it and want to either submit a PR, or leave the specifics here, I am happy to help make sure that goes through.
On our end, we are going to look into it as soon as we can!
I can look into it and see if I can better pinpoint the issue, at the least. I'm unfamiliar with the cdk codebase and how it's structured, so I'm unlikely to be able to fix this.
@insanitybit No worries! Every little bit helps :smile_cat:
A workaround is to explicitly give cacheSubnetGroupName in your elasticache.CfnSubnetGroup.
Thanks @AlexCheema ! I'll give that a shot as soon as I'm home.
I'm not sure what version you did this on, but the problem was that subnetGroup.cacheSubnetGroupName is undefined, and that's because it wasn't supplied (these are copies of the INPUT properties to the subnet group).
The value you were looking for was:
cacheSubnetGroupName: subnetGroup.ref,
Which will return the name of the subnet group AFTER it has been created (potentially with a random name). After doing that it works.
Closing this issue. Please reopen if you feel it was closed in error.
Hello I'm having issues when tryng to create a new elasticache-redis using CDK... I'm following all info on the docs but nothings works:
const rediscache = new elasticache.CfnCacheCluster(this, 'testredis', {
replicationGroupId: "RedisReplGroup",
replicationGroupDescription: "redisReplicaGroup",
numCacheClusters: 1,
cacheNodeType: "cache.t2.small",
engine: "redis",
engineVersion: "5.0.3",
automaticFailoverEnabled: true,
autoMinorVersionUpgrade: true,
snapshotWindow: "05:00-06:00",
preferredMaintenanceWindow: "sun:06:00-sun:09:00",
atRestEncryptionEnabled: false,
transitEncryptionEnabled: false,
});
I'm using "@aws-cdk/aws-elasticache": "^1.10.0",
Error: Argument of type 'this' is not assignable to parameter of type 'Construct'.
Type 'CdkStack' is not assignable to type 'Construct'.
Types of property 'node' are incompatible.
@kiros-sc this error usually means you have multiple versions of the CDK libraries in your dependency closure. Try to remove your node_modules directory, make sure all CDK modules in package.json have the same, latest version (1.10.0 currently), and then try again.
Hope this helps,
Adam
@skinny85 thank you for your answer, I've already tried that and the error still happens.
Type 'CdkStack' is not assignable to type 'Construct'.
Did you declare your stack as:
class CdkStack extends cdk.Stack {
?
Perhaps if you load your VPC and use it, you may get over this. I've successfully deployed a Redis elasticache instance, including creating subnet groups. (there is a bug, see related 4411).
Try loading your VPC first and specifying it. (In python is ec2.Vpc.from_lookup)
Most helpful comment
I'm not sure what version you did this on, but the problem was that
subnetGroup.cacheSubnetGroupNameisundefined, and that's because it wasn't supplied (these are copies of the INPUT properties to the subnet group).The value you were looking for was:
Which will return the name of the subnet group AFTER it has been created (potentially with a random name). After doing that it works.
Closing this issue. Please reopen if you feel it was closed in error.