aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.55k stars 3.87k forks source link

fix(cli): hotswapping appsync functions fails when API does not return function on the first page #31406

Closed dpilch closed 1 week ago

dpilch commented 2 weeks ago

Issue # (if applicable)

https://github.com/aws-amplify/amplify-category-api/issues/2307

Reason for this change

Hotswap for AppSync functions sometimes fails with Deployment failed: MissingRequiredParameter: Missing required key 'functionId' in params. This is because the SDK list function only retrieves the first page. In APIs where there are many functions it is possible for the hotswapped function to not be contained in the first page. This results in the previously mentioned error because the functionId is never retrieved.

Description of changes

List all AppSync functions for a given API by iterating through the pages with the nextToken. The change was modeled after a similar request here.

Description of how you validated changes

Checklist


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

aws-cdk-automation commented 1 week ago

:arrow_right: PR build request submitted to test-main-pipeline :arrow_left:

A maintainer must now check the pipeline and add the pr-linter/cli-integ-tested label once the pipeline succeeds.

aws-cdk-automation commented 1 week ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

mergify[bot] commented 1 week ago

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

github-actions[bot] commented 1 week ago

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.