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

make scaleIn & scaleOut accessible #45

Open
paulcruseSG opened this issue Oct 4, 2018 · 0 comments
Open

make scaleIn & scaleOut accessible #45

paulcruseSG opened this issue Oct 4, 2018 · 0 comments

Comments

@paulcruseSG
Copy link

paulcruseSG commented Oct 4, 2018

I am trying to set the scaleIn & scaleOut but notice you have them hardcoded to 60.

Is there anyway you can make these optionally configurable? Something like:

capacities:
        -
            table: ExampleTable
            index:
                - secondary1_id
                - secondary2_id
            read:
                minimum: 100
                maximum: 1000
                usage: 0.5
                scaleIn: 30
                scaleOut: 30
            write:
                minimum: 1
                maximum: 1000
                usage: 0.5

Then in your src/plugin.ts:74 pass in our value

private defaults(config: Capacity): Defaults {
    return {
      read: {
        maximum: config.read && config.read.maximum ? config.read.maximum : 200,
        minimum: config.read && config.read.minimum ? config.read.minimum : 5,
        usage: config.read && config.read.usage ? config.read.usage : 0.75,
        scaleIn: config.read && config.read.scaleIn ? config.read.scaleIn : 60,
        scaleOut: config.read && config.read.scaleOut ? config.read.scaleOut : 60
      },
      write: {
        maximum: config.write && config.write.maximum ? config.write.maximum : 200,
        minimum: config.write && config.write.minimum ? config.write.minimum : 5,
        usage: config.write && config.write.usage ? config.write.usage : 0.75,
        scaleIn: config.write && config.write.scaleIn ? config.write.scaleIn : 60,
        scaleOut: config.write && config.write.scaleOut ? config.write.scaleOut : 60
      }
    }
  }

Or in your src/aws/policy.ts:6 default it to 60

constructor (
    options: Options,
    private read: boolean,
    private value: number,
    private scaleIn=60: number,
    private scaleOut=60: number
  ) { super(options) }

This would really make this more generic and allow for more granular control.

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

No branches or pull requests

1 participant