Skip to content

@aws-cdk/aws-appsync-alpha: Unable to set BatchSize for Lambda Direct Resolvers #20467

Closed
@andres-sm

Description

Describe the feature

With the introduction of #14079 you are able to configure a Lambda resolver to use BatchInvoke by setting the appropriate request mapping template. However, this is limited to only 5 items per batch by default. CfnResolver, used under the hood exposes the maxBatchSize property to configure this limit.

Use Case

Having the batch size limited to 5 can make some use cases less performance and frustrating to use. Having it configurable should allow for these use cases to consume less resources and be more performant.

Proposed Solution

Add the ability to configure the maxBatchSize property in the created CfnResolver construct created by appsync.Resolver by adding a maxBatchSize property to ResolverProps (docs)

The underlying implementation would just pass this property when creating a CfnResolver (source)

Other Information

If the maxBatchSize property can simply be exposed I'd be willing to create a PR for this. We could also automatically use the correct request mapping if one isn't provided (MappingTemplate.lambdaRequest('$util.toJson($ctx)', 'BatchInvoke')).

If additional work beyond this is required to implement this properly I may not be able to provide an implementation.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

v2.24.0

Environment details (OS name and version, etc.)

Any

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-appsyncRelated to AWS AppSynceffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions