Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 1.02 KB

File metadata and controls

20 lines (14 loc) · 1.02 KB

Idempotency

This project contains an example of Lambda function using the idempotency module of Powertools for AWS Lambda (Java). For more information on this module, please refer to the documentation. The example exposes a HTTP POST endpoint. When the user sends the address of a webpage to it, the endpoint fetches the contents of the URL and returns them to the user:

 curl -X POST https://[REST-API-ID].execute-api.[REGION].amazonaws.com/Prod/helloidem/ -H "Content-Type: application/json" -d '{"address": "https://checkip.amazonaws.com"}'

this should return the contents of the webpage, for instance:

{ "message": "hello world", "location": "123.123.123.1" }

Check out App.java to see how it works!

Deploy the sample application

This sample is based on Serverless Application Model (SAM). To deploy it, check out the instructions for getting started with SAM in the examples directory