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

Member must have length less than or equal to 10. #586

Closed
123sumitgo opened this issue Dec 21, 2020 · 3 comments
Closed

Member must have length less than or equal to 10. #586

123sumitgo opened this issue Dec 21, 2020 · 3 comments
Milestone

Comments

@123sumitgo
Copy link

123sumitgo commented Dec 21, 2020

(Thanks for reporting an issue! Please make sure you click the link above to view the issue guidelines, then fill out the blanks below.)

What are the steps to reproduce this issue?

  1. Try fetching more than 10 AWS SSM Parameters.
    ex:
    ssm({
    names: {
    Key: KeyParameterName,
    FUNCTION_SHIELD_TOKEN: functionShieldTokenParameterName,
    QueueName1: QueueNameParameter1,
    QueueName2: QueueNameParameter2,
    Password1: PasswordParameterName,
    TenancyName: TenancyNameParameterName,
    Url: UrlParameterName,
    Username: UsernameParameterName,
    BaseUrl: BaseUrlParameterName,
    ApiKey: ApiKeyParameterName,
    Sender:SenderParameterName
    },
    setToContext: true,
    cache: true,
    cacheExpiryInMillis: 300000
    })

What happens?

…[Failed to get parameters from SSM] 1 validation error detected: Value '[<11 parameters name>]' at 'names' failed to satisfy constraint: Member must have length less than or equal to 10.

What were you expecting to happen?

…To fetch value of all the parameters

Any logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Any other comments?

What versions of software are you using?

Node.js Version: … 10

Middy Version: … 1.5

AWS SDK Version: …1.7

@willfarrell
Copy link
Member

Thanks for reporting.

Function Shield is not supported in node v0.12, so in the near term, removing the token for that will bring you down to the api limit of 10. Additionally, parameters that are not secret could be moved to the process.env scope.

If I recall correctly this is a limitation of the AWS SDK and would require extending the middleware to support pagination making it more complicated. I'm in the early stages of scoping middy v2 which will update the AWS SDK to v3 which supports generators which could solve this.

@willfarrell willfarrell added this to the v2.0.0 milestone Dec 21, 2020
@123sumitgo
Copy link
Author

123sumitgo commented Dec 21, 2020

Hi,
I have updated the node version as we are using node v10 not node v12.
Also all the 11 parameters are secure strings and needed to fetch from parameter store.

@willfarrell
Copy link
Member

I've push what I think ssm will look like for middy v2 here: https://github.com/willfarrell/middy/blob/release/2.x/packages/ssm/index.js

Of course this is still super early in dev and needs a lot of testing, but the idea is there.

If you want this included this fix in middy v1, please open a PR with this functionality added in.

Thanks again for reporting.

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

No branches or pull requests

2 participants