Hi everyone, I am trying to add redis to my stack....
# help
l
Hi everyone, I am trying to add redis to my stack. Is there a way to get the VPC and subnets that were created and use them for redis. I looked around and cannot find a way to get vpc. Thanks
t
you can also setup elasticache or memorydb (both redis compatible) this way but the documentation is a bit sparse
overall though I've found redis not to be that necessary in serverless architectures, dynamodb guarantees sub 10ms responses which is usually good enough
l
Thanks @thdxr for your help. I have an existing application that needs Redis.
Does the above provide the current vpc that the stack is build on? It seems to be creating a new one.
t
then you can pass it to functions/whatever else needs it
note another thing to be aware of is to be fully serverless you also sort of need to be VPC-less
so make sure you absolutely need the VPC
l
Sorry if my question is not very clear. When building my stack the SST framework is already creating the VPC
lav-checkout-com-payments-app-my-stack/Cluster/vpc
. I am trying to use the same one. Should I use
fromVpcAttributes
to get that? Thanks again
t
hm are you using our RDS construct?
l
yup we have RDS as well
t
Ah ok so our RDS construct will create a VPC for itself since serverless RDS requires it - most people won't ever even need to know it exists because they're using it through the Data API. What you should do is create a new VPC and pass that into the RDS construct so it'll use it instead of making its own. Then you can use this same VPC wherever else you need it. I believe you can pass vpc in under here: https://docs.serverless-stack.com/constructs/v1/RDS#cdkcluster
l
Ok sounds good. I'll give this a try 🙂
a
note another thing to be aware of is to be fully serverless you also sort of need to be VPC-less
In our case, we had to house some of our services within a VPC for a static IP address for 1 of our partners to whitelist our services. Is there a better option for this 🤔 ?
f
Hey @Ash Rhazaly, afaik there isn’t an alternative. I’d say keep the least number of functions in the VPC.
b
@thdxr https://serverless-stack.slack.com/archives/C01JG3B20RY/p1651341112846569?thread_ts=1651340320.228339&cid=C01JG3B20RY Do you think DynamoDB then be a good enough session store implementation?