{"id":18808658,"url":"https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency","last_synced_at":"2026-01-09T22:30:46.482Z","repository":{"id":213769325,"uuid":"733699356","full_name":"gabrielleandro0801/typescript-aws-lambda-native-idempotency","owner":"gabrielleandro0801","description":"Repository with an example of AWS Lambda using its native idempotency validation in Typescript using Localstack","archived":false,"fork":false,"pushed_at":"2024-05-02T23:10:11.000Z","size":1169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-29T22:32:05.415Z","etag":null,"topics":["aws-lambda","aws-powertools","idempotency","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielleandro0801.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-19T23:28:39.000Z","updated_at":"2024-05-02T23:10:14.000Z","dependencies_parsed_at":"2023-12-23T01:27:44.922Z","dependency_job_id":"cdf518d2-6a6e-4953-8968-186632a864a6","html_url":"https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency","commit_stats":null,"previous_names":["gabrielleandro0801/typescript-aws-lambda-native-idempotency"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielleandro0801%2Ftypescript-aws-lambda-native-idempotency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielleandro0801%2Ftypescript-aws-lambda-native-idempotency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielleandro0801%2Ftypescript-aws-lambda-native-idempotency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielleandro0801%2Ftypescript-aws-lambda-native-idempotency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielleandro0801","download_url":"https://codeload.github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239742548,"owners_count":19689327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","aws-powertools","idempotency","nodejs","typescript"],"created_at":"2024-11-07T23:13:43.291Z","updated_at":"2026-01-09T22:30:41.131Z","avatar_url":"https://github.com/gabrielleandro0801.png","language":"TypeScript","readme":"# Typescript AWS Lambda Native Idempotency\nRepository with examples of AWS Lambdas using its native idempotency validation in Typescript\n\n## Setup\n1. In order to run Localstack, you will need to have *Docker* installed in your machine. \nYou can follow this [link](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04-pt) to install.\n2. Then, you will need to install Localstack itself. \nThis [link](https://github.com/localstack/localstack) may help you.\n3. After this, you should install *awscli-local* by following this [link](https://pypi.org/project/awscli-local/) or just running this command:\n\n``` shell\npip3 install awscli-local\n```\n\n## Running :computer:\n1. Start Localstack\n``` shell\nLAMBDA_REMOTE_DOCKER=0 DEBUG=1 localstack start\n```\n\n2. Create the DynamoDB idempotency table\n``` shell\nawslocal dynamodb create-table \\\n    --table-name idempotency \\\n    --attribute-definitions \\\n        AttributeName=identifier,AttributeType=S \\\n        AttributeName=idempotency_hash,AttributeType=S \\\n    --key-schema \\\n        AttributeName=identifier,KeyType=HASH \\\n        AttributeName=idempotency_hash,KeyType=RANGE \\\n    --billing-mode PAY_PER_REQUEST \\\n    --region us-east-1\n```\n\n3. Run the **package.json** scripts\n\n4. After running each of them, scan the DynamoDB table to check the idempotency records.\n``` shell\nawslocal dynamodb scan \\\n    --table-name idempotency\n```\n\nIn case you want to delete the table to create it again, run the following command:\n``` shell\nawslocal dynamodb delete-table \\\n    --table-name idempotency\n```\n\n## Function Wrapper\n\n### SQS\n\n#### SQS Full Event idempotent\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-full-event.png)\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-full-event-data.png)\n\n#### SQS Message Body idempotent\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-body.png)\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-body-data.jpeg)\n\n#### SQS Message Body field idempotent\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-body-field.png)\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-body-field-data.png)\n\n#### SQS Message Body multiple fields idempotent\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-body-multiple-fields.png)\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-body-multiple-fields-data.png)\n\n#### SQS Message ID idempotent\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-id.png)\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-id-data.png)\n\n#### SQS Message Attribute idempotent\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-attribute.png)\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/sqs/sqs-message-attribute-data.png)\n\n### API Gateway\n\n#### API Gateway Full Path idempotent\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/api-gateway/api-gw-full-path-1.png)\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/api-gateway/api-gw-full-path-2.png)\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/api-gateway/api-gw-full-path-data-1.png)\n![Image](https://github.com/gabrielleandro0801/typescript-aws-lambda-native-idempotency/blob/master/images/fn-wrapper/api-gateway/api-gw-full-path-data-2.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielleandro0801%2Ftypescript-aws-lambda-native-idempotency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielleandro0801%2Ftypescript-aws-lambda-native-idempotency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielleandro0801%2Ftypescript-aws-lambda-native-idempotency/lists"}