| layout | post |
|---|---|
| title | Deploy Spreadsheet Server to AWS Lambda |
| description | Learn how to deploy the Syncfusion Spreadsheet Server to AWS Lamda |
| control | How to deploy eploy the Syncfusion Spreadsheet Server to AWS Lamda |
| platform | document-processing |
| documentation | ug |
AWS accountwithIAM credentials- The Spreadsheet
Web APIproject (Check out our detailedblogto set up the web service locally).
Step 1: Server-Side changes
-
Opening the file: The client converts the Excel file to base64 and sends it to the hosted Open endpoint - then simply loads the response into the Syncfusion React Spreadsheet. The AWS Lambda backend decodes the file, processes it with Workbook.Open, and returns spreadsheet-ready JSON for instant rendering on the frontend. You can refer to this documentation to know about the opening the file with AWS Lambda service.
-
Saving the file: The client converts the spreadsheet to JSON using the saveAsJson method and sends it to AWS Lambda via fetch. It then decodes the base64 Excel response and creates a downloadable Excel file using a Blob. Receive the spreadsheet JSON in your Lambda function, convert it to an Excel file using Workbook.Save, and return it as a base64 string for secure client-side download. You can refer to this documentation to know about the saving the file with AWS Lambda service.
Step 2: Deploy ASP.NET Core Spreadsheet Web API Service to AWS Lambda
- Open
WebAPI project → Extensions > Manage Extensions → install AWS Toolkit with Amazon Q. Restart VS. - From Extensions menu, select
Getting Started → enable AWS Toolkit with IAM credentials. - Install the NuGet package:
Amazon.Lambda.AspNetCoreServer.Hosting. - In WebAPI.csproj, add:
<AWSProjectType>Lambda</AWSProjectType>- In program.cs, add:
builder.Services.AddAWSLambdaHosting(LambdaEventSource.RestApi);- In
Solution Explorer → right-click project → Publish to AWS Lambda. - Then enter your AWS credentials, choose your existing Lambda function or create a new function, enter the Handler name that matches your project name, and upload.
- Host your project by creating a REST API in AWS API Gateway.
- Integrate your API with Lambda by editing the integration, selecting your region and function, enabling Lambda Proxy Integration, and saving.
- Deploy your API by selecting the Deploy API option and creating a new stage name. The hosted URL can then be used for open and save fetch requests in your React Spreadsheet sample.