https://pulumi.com logo
Title
a

acceptable-stone-35112

03/29/2021, 7:32 AM
Trying to create Elasticahe redis, I always get this error.
* error creating ElastiCache Cache Cluster: CacheSubnetGroupNotFoundFault: Cache Subnet Group redis-subnet-group-ec90733 does not exist.
        status code: 400
adding dependencies explicitly doesn't help
const subnetGroup = new SubnetGroup("redis-subnet-group", { subnetIds: sids.ids })

                const nsg = new SecurityGroup("sgredis", {
                    vpcId: vpc.id,
                    ingress: [{
                        fromPort: redisConfig.port,
                        toPort: redisConfig.port,
                        protocol: "tcp",
                        cidrBlocks: [vpc.cidrBlock]
                    }]
                })

                const cluster = new elasticache.Cluster("redis-cluster", {
                    preferredAvailabilityZones: redisConfig.availabilityZones,
                    nodeType: redisConfig.nodeType,
                    numCacheNodes: 1,
                    subnetGroupName: subnetGroup.name,
                    engine: "redis",
                    securityGroupIds: [nsg.id]
                }, { dependsOn: [subnetGroup, nsg] })
👀 1
b

brave-planet-10645

03/29/2021, 9:40 AM
Can you make sure that the
SubnetGroup
you're using is an
Elasticache
one? Quite a few other modules also contain SubnetGroup resources but they're all different:
a

acceptable-stone-35112

03/29/2021, 5:12 PM
You're totally right! I imported aws:dax:SubnetGroup instead 🤦‍♂️
b

brave-planet-10645

03/29/2021, 5:21 PM
I'll be honest it completely threw me for a while.. it's very easy to do. Glad we got it sorted