Skip to content
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

feat: add elasticache serverless support #101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

@@ -17,6 +18,10 @@ export interface ModifyElasticacheInput {
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.

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.

2 participants