Skip to content

Conversation

@dollev36
Copy link
Contributor

@dollev36 dollev36 commented May 15, 2024

Proposed Changes

add elasticache serverless support

Related Issues/PRs

Checklist

  • I cleaned up my code.
  • All the tests and checks passed (npm run test).
  • I have added necessary documentation and/or updated existing documentation.
  • I have added or modified tests to cover the changes.

@BohdanPetryshyn
Copy link
Collaborator

Hey @dollev36, thank you for another contribution! Currently, I'm very busy with the university, I will be able to review this PR in about two weeks.

@BohdanPetryshyn BohdanPetryshyn self-requested a review June 16, 2024 10:30
Copy link
Collaborator

@BohdanPetryshyn BohdanPetryshyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! I played a bit with the implementation and have a couple of suggestions:

  1. I noticed that your implementation works with both Redis and Memcached and this is very good! Could you please implement support for both cache engines in this PR? I think this will be beneficial for the public interface quality (CLI arguments and config) as well as for the code quality. I'd suggest the following properties for the public interface:

    1. CLI: --elasticache-redis-serverless-cache, --elasticache-memcached-serverless-cache (in both init and connect)
    2. Config: elasticacheRedisServerlessCache, elasticacheMemcachedServerlessCache.
    3. Interactive output: (Currently, I see indentation problems in the output as well as slight inconsistencies with previously implemented cluster and node targets)
      Elasticache targets:
       Redis serverless caches:
        my-redis-cache
        my-second-redis-cache
       Memcached serverless caches:
        my-memcached-cache - Primary endpoint
        my-memcached-cache - Reader endpoint
        my-second-memcached-cache - Primary endpoint
        my-second-memcached-cache - Primary endpoint
       Redis clusters:
       ...
      
  2. Reader endpoint didn't work for Redis cache and I also can't see it in the AWS Web Console. I think there's no such concept for Redis serverless. The reader endpoint works for Memcached, though.

  3. Please, update the corresponding docs pages: https://github.com/basti-app/basti/blob/main/docs/reference/cli.md, https://github.com/basti-app/basti/blob/main/docs/reference/configuration-file.md

}

export async function getRedisServerlessCache(
Id: string,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use lowercase for function arguments.

securityGroupIds: string[];
cachePreviousSecurityGroups: SecurityGroupMembership[];
}
export interface ModifyServerlessInput {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's continue using Elasticache-specific names here. What about ModifyElasticacheServerlessInput?

export function parseServerlessCacheResponse(
response: ServerlessCache
): AwsElasticacheServerlessCache[] {
return [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use zod validator here.

@iainelder
Copy link

Any updates on this? I just noticed that the serverless option is missing!

As it would help me, I would be willing to finish the job, if you are still taking contributions.

@BohdanPetryshyn
Copy link
Collaborator

Hi @iainelder👋 I would really appreciate it if you could finish this PR!

@iainelder
Copy link

Can't make any promises about when. But if I find some time I'd love to finish this.

@iainelder
Copy link

Just wanted to say that I'm no longer working on a project that uses Elasticache Serverless. Until that changes, I probably won't do this. So if anyone else wants to finish the job, please go ahead.

Basti continues to be a wonderful tool for connecting to RDS, and I'm still using it for that! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants