aws-samples / aws-samples/serverless-patterns

New pattern submission - appsync-lambda-s3-presigned-urls-pipeline-resolver

Open
#2,860 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.8k
Forks
1.1k
Avg merge
7d 14h
Merged PRs (30d)
6

Description

To submit a template to the Serverless Patterns Collection, submit an issue with the following information.

**IMPORTANT**
Patterns are intended to be primarily IaC-focused implementations of 2-4 AWS services, with minimum custom code. They should be commonly used combinations that help developers get started quickly. If you have a utility, demo, or application, submit these to the [Serverless Repos Collection](https://serverlessland.com/repos) instead.

**ONLY SUBMIT ONE PATTERN CHANGE PER PR**. Multiple patterns or files spanning multiple pattern directories will be automatically rejected.

Patterns may take up to 4-6 weeks to review, test, and merge but there is no SLA and can take significantly longer due to other work the team has.

**To learn more about submitting a pattern, read the [publishing guidelines page](https://github.com/aws-samples/serverless-patterns/blob/main/PUBLISHING.md).**

1. Use the model template located at https://github.com/aws-samples/serverless-patterns/tree/main/_pattern-model to set up a README, template and any associated code.

2. THIS PROCESS HAS BEEN SIMPLIFIED. All the information below must be provided in the "example-pattern.json" file cloned from the model **

Note the following information for the model:
- Description (intro.text) should be a 300-500 word explanation of how the pattern works.
This sample project demonstrates how AWS AppSync pipeline resolvers orchestrate multiple data sources within a single GraphQL operation, integrating AppSync with Lambda, DynamoDB, and S3 to create a notes API with secure file attachments. When a note is created via the saveNote mutation, the pipeline resolver invokes a Lambda function to generate a presigned S3 upload URL and then stores the note metadata—including the attachment key and upload URL—in DynamoDB, allowing the client to receive both the note data and a temporary upload URL in one response for immediate file upload. When retrieving a note through the getNote query, the resolver first reads the note from DynamoDB and then conditionally calls Lambda to generate a presigned download URL if an attachment exists, showcasing how pipeline resolvers execute conditional logic and pass data between stages using $ctx.prev.result. The pattern deploys a single AppSync GraphQL API, one Lambda function, one DynamoDB table, and one S3 bucket with proper CORS configuration.

- Resources should like to AWS documentation and AWS blogs related to the post (1-5 maximum).
AWS AppSync Pipeline Resolvers - https://docs.aws.amazon.com/appsync/latest/devguide/pipeline-resolvers.html
Amazon S3 Presigned URLs - https://docs.aws.amazon.com/AmazonS3/latest/userguide/PresignedUrlUploadObject.html
AWS AppSync - Build data-driven apps with fully managed GraphQL APIs - https://aws.amazon.com/appsync/
VTL Mapping Templates for AppSync - https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference.html

- Author bio may include a LinkedIn and/or Twitter reference and a 1-sentence bio.
Cloud Engineer @ Elixirr Digital, LinkedIn - https://www.linkedin.com/in/matiarasetina/
You must ensure that the sections of the model README.md are completed in full.

## GitHub PR for template: #2859

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.