-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(platform): serverless aws redis #6219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
vimtor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the contribution @omercnet
i've tested this branch and left some comments on the issues i found
| * } | ||
| * ``` | ||
| */ | ||
| dataStorage?: Input<{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we keep the interface consistent with other SST interfaces so it looks like this:
storage: { maximum: "10 GB" },also it would be nice if we added the minimum to both storage and ecpuPerSeconds
|
|
||
| const vpc = normalizeVpc(); | ||
| const serverless = normalizeServerless(); | ||
| if (serverless.enabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since normalizeServerless returns an Output, the if (serverless.enabled) expression always evalutates to true, thus always creating a serverless cluster
| }; | ||
| }, | ||
| async run() { | ||
| // Serverless Redis doesn't require NAT Gateways |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even though serverless redis doesn't require a NAT gateway, in my testings i had to add it otherwise the lambda function wasn't accesible while sst gave this warning:
Warning: One or more functions are deployed in the "vpc-04554314d7b657e92" VPC, which does not have a NAT gateway. As a result, these functions cannot access the internet. If your functions need int ernet access, enable it by setting the "nat" prop on the "Vpc" component.
| checkServerIdentity: () => undefined, | ||
| }, | ||
| username: Resource.MyRedis.username, | ||
| password: Resource.MyRedis.password, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the code when creating a serverless redis we don't generate a password, i don't know if this is on purpose but this line gives the error: Property password does not exist on type
| this.cluster = cluster; | ||
| this._authToken = authToken; | ||
|
|
||
| function reference() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't see any code for handling the case of sst.aws.Redis.get for the serverless case
This pull request introduces support for deploying an AWS ElastiCache Serverless Redis instance using the SST framework. It adds a new
serverlessoption to the Redis component, enabling automatic scaling and pay-per-use pricing, and updates documentation and example code to demonstrate usage. The changes include updates to the Redis component API, resource creation logic, and a new example project.fixes #6160
Serverless Redis feature:
serverlessoption to theRedisArgsinterface inplatform/src/components/aws/redis.ts, allowing users to enable ElastiCache Serverless Redis and configure usage-based limits for data storage and ECPU per second.Rediscomponent implementation to create a serverless Redis cache when theserverlessoption is enabled, including logic for resource creation, references, and output properties such ashostandport. [1] [2] [3] [4] [5] [6]Example project and documentation:
examples/aws-redis-serverlesswith configuration, handler code, and documentation showing how to deploy and use serverless Redis with SST. [1] [2] [3] [4]