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

paginate getParameter call when there are more than 10 parameters #2480

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

Amplifiyer
Copy link
Contributor

Problem

when using defineFunction with more than 10 secrets, the SDK call fails to resolve due to a validation on the Names arg

Message: Value '[...]' at 'names' failed to satisfy constraint: 
Member must have length less than or equal to 10
ERROR   Uncaught Exception      {"errorType":"ValidationException","errorMessage":"1 validation error detected: Value '[...]' at 'names' failed to satisfy constraint: Member must have length less than or equal to 10","name":"ValidationException","$fault":"client",...

Issue number, if available: #2413

Changes

Paginate the request to call getParameters with 10 parameters at a time.

Corresponding docs PR, if applicable:

Validation

Unit tests and manual validation

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Amplifiyer Amplifiyer requested a review from a team as a code owner February 4, 2025 16:21
Copy link

changeset-bot bot commented Feb 4, 2025

🦋 Changeset detected

Latest commit: cf70f40

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@aws-amplify/backend-function Patch
@aws-amplify/backend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@rtpascual rtpascual left a comment

Choose a reason for hiding this comment

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

I'm curious how easily we can hit the limit of the Lambda's Init phase of 10 seconds. Would you need to max out the function's env vars to 4KB and have the max amount of extensions added as layers? (This is only a question, not blocking this PR)

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need this file since the code is included and tested for in the shims.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I forgot to remove it earlier. Removed it in new revision

@Amplifiyer
Copy link
Contributor Author

I'm curious how easily we can hit the limit of the Lambda's Init phase of 10 seconds. Would you need to max out the function's env vars to 4KB and have the max amount of extensions added as layers?

I haven't tested what would break the limit of the init phase. If that ever happens, we may need to revisit this feature (adding extensions would likely be extra cost)

@Amplifiyer Amplifiyer merged commit 44c3769 into main Feb 4, 2025
49 checks passed
@Amplifiyer Amplifiyer deleted the 10_secrets branch February 4, 2025 20:06
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