{"id":26063907,"url":"https://github.com/inqnuam/local-aws-sqs","last_synced_at":"2026-03-07T17:33:13.649Z","repository":{"id":235193138,"uuid":"788918512","full_name":"Inqnuam/local-aws-sqs","owner":"Inqnuam","description":"Run AWS SQS locally without dependency.","archived":false,"fork":false,"pushed_at":"2025-02-27T19:13:33.000Z","size":227,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T06:44:22.702Z","etag":null,"topics":[],"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/Inqnuam.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,"zenodo":null}},"created_at":"2024-04-19T10:48:43.000Z","updated_at":"2025-02-27T19:13:37.000Z","dependencies_parsed_at":"2024-04-22T16:36:42.905Z","dependency_job_id":"0d74291e-1d77-42f8-9d29-16d5b0ac70e2","html_url":"https://github.com/Inqnuam/local-aws-sqs","commit_stats":null,"previous_names":["inqnuam/local-aws-sqs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Inqnuam/local-aws-sqs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inqnuam%2Flocal-aws-sqs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inqnuam%2Flocal-aws-sqs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inqnuam%2Flocal-aws-sqs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inqnuam%2Flocal-aws-sqs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Inqnuam","download_url":"https://codeload.github.com/Inqnuam/local-aws-sqs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inqnuam%2Flocal-aws-sqs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263059658,"owners_count":23407392,"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":[],"created_at":"2025-03-08T17:57:40.068Z","updated_at":"2026-03-07T17:33:13.612Z","avatar_url":"https://github.com/Inqnuam.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Local AWS SQS\n\n\u003e Run AWS SQS locally without dependency.  \n\u003e Supports both AWS Query and JSON (x-amz-json-1.0) protocols.\n\n## Install\n\n```bash\nnpm i local-aws-sqs --save-dev\n# yarn add -D local-aws-sqs\n```\n\n## Usage\n\n```js\nimport { createSqsServer } from \"local-aws-sqs\";\n// const { createSqsServer } = require(\"local-aws-sqs\");\n\nconst server = await createSqsServer({ port: 5432 });\n```\n\n### Options\n\n| name                          | default      | description                                                                                                                                                                                                             |\n| ----------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| port                          |              | port for NodeJS http createServer                                                                                                                                                                                       |\n| hostname                      | localhost    | hostname for NodeJS http createServer                                                                                                                                                                                   |\n| baseUrl                       | /            | base url to prefix Queue URLs                                                                                                                                                                                           |\n| region                        | us-east-1    | (cosmetic) AWS Region used in Queue ARN                                                                                                                                                                                 |\n| accountId                     | 123456789012 | (cosmetic) AWS Account Id used in Queue ARN and URL                                                                                                                                                                     |\n| validateDlqDestination        | true         | DLQ defined in RedrivePolicy must exist.                                                                                                                                                                                |\n| emulateQueueCreationLifecycle | true         | AWS behaviour: If you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.                                                                                                     |\n| emulateLazyQueues             | false        | AWS behaviour: After you create a queue, you must wait at least one second after the queue is created to be able to use the queue.                                                                                      |\n| queues                        | [ ]          | an array of Queue to be created when the server starts. Same Schema as [CreateQueueCommandInput](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sqs/Interface/CreateQueueCommandInput/) |\n\n## Integration\n\nAWS provides a feature called [Service-specific endpoints](https://docs.aws.amazon.com/sdkref/latest/guide/feature-ss-endpoints.html) which allows you to redirect all you AWS SQS API requests to a specific endoint.\n\nIf your app already runs with some AWS Credentials and Region, you can simply set the `AWS_ENDPOINT_URL_SQS` env variable to redirect all SQS requests to Local AWS SQS.\n\n```bash\nAWS_ENDPOINT_URL_SQS=http://localhost:5432 node ./myApp.js\n```\n\nSetup based on AWS Profile:\ninside `~/.aws/config` file\n\n```\n[profile local]\naws_access_key_id=fake\naws_secret_access_key=fake\nregion=us-east-1\nservices = local-services\n\n[services local-services]\nsqs =\n  endpoint_url = http://localhost:5432\n```\n\n### Using with AWS SDK\n\nwith `AWS_PROFILE=local` (or `AWS_ENDPOINT_URL_SQS`) env variable\n\n```js\nimport { SQSClient, CreateQueueCommand } from \"@aws-sdk/client-sqs\";\n\nconst client = new SQSClient({});\n\nconst cmd = new CreateQueueCommand({ QueueName: \"MyFirstLocalQueue\" });\n\nconst res = await client.send(cmd);\n\nconsole.log(res.QueueUrl);\n// http://localhost:5432/123456789012/MyFirstLocalQueue\n```\n\nwithout `AWS_PROFILE=local`\n\n```js\nimport { SQSClient } from \"@aws-sdk/client-sqs\";\n\nconst client = new SQSClient({\n  region: \"us-east-1\",\n  endpoint: `http://localhost:5432`,\n  credentials: {\n    accessKeyId: \"fake\",\n    secretAccessKey: \"fake\",\n  },\n});\n```\n\n### Using with AWS CLI\n\nwith `AWS_PROFILE=local` or `aws --profile local`\n\n```bash\naws --profile local sqs create-queue --queue-name MyFirstLocalQueue\n\n# output\n{\n    \"QueueUrl\": \"http://localhost:5432/123456789012/MyFirstLocalQueue\"\n}\n```\n\nwithout `AWS_PROFILE`\n\n```bash\naws --region us-east-1 --endpoint-url http://localhost:5432 sqs create-queue --queue-name MyFirstLocalQueue\n\n# output\n{\n    \"QueueUrl\": \"http://localhost:5432/123456789012/MyFirstLocalQueue\"\n}\n```\n\n### Using with Terraform\n\n```hcl\nterraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~\u003e 5.46.0\"\n    }\n\n  }\n}\n\n# Without AWS_PROFILE\n\n# provider \"aws\" {\n#   region                      = \"us-east-1\"\n#   access_key                  = \"fake\"\n#   secret_key                  = \"fake\"\n#   skip_credentials_validation = true\n#   skip_requesting_account_id  = true\n#   endpoints {\n#     sqs = \"http://localhost:5432\"\n#   }\n# }\n\n\n# With AWS Profile\n\nprovider \"aws\" {\n  profile = \"local\"\n  skip_credentials_validation = true\n  skip_requesting_account_id  = true\n}\n\n\nresource \"aws_sqs_queue\" \"queue\" {\n  name = \"MyFirstLocalQueue\"\n}\n```\n\n### Using with Jest\n\njest.config.js\n\n```js\n/** @type {import('jest').Config} */\nconst config = {\n  globalSetup: \"./setup-sqs.js\",\n  globalTeardown: \"./teardown-sqs.js\",\n};\n\nmodule.exports = config;\n```\n\nsetup-sqs.js\n\n```js\n// @ts-check\nconst { createSqsServer } = require(\"local-aws-sqs\");\n\nmodule.exports = async () =\u003e {\n  global.__SQS_SERVER__ = await createSqsServer({ port: 5432, queues: [{ QueueName: \"MyFirstLocalQueue\" }] });\n};\n```\n\nteardown-sqs.js\n\n```js\nmodule.exports = async () =\u003e {\n  global.__SQS_SERVER__.close();\n};\n```\n\n### Using with Vitest\n\nvitest.config.ts\n\n```ts\nimport { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    globalSetup: [\"sqs.config.ts\"],\n  },\n});\n```\n\nsqs.config.ts\n\n```ts\nimport { createSqsServer } from \"local-aws-sqs\";\nimport type { Server } from \"http\";\n\nlet server: Server;\n\nexport const setup = async () =\u003e {\n  server = await createSqsServer({ port: 5432, queues: [{ QueueName: \"MyFirstLocalQueue\" }] });\n};\n\nexport const teardown = () =\u003e {\n  server.close();\n};\n```\n\n## Supported Commands\n\n| command name                 | support |\n| ---------------------------- | ------- |\n| AddPermission                | ✅      |\n| CancelMessageMoveTask        | ✅      |\n| ChangeMessageVisibility      | ✅      |\n| ChangeMessageVisibilityBatch | ✅      |\n| CreateQueue                  | ✅      |\n| DeleteMessage                | ✅      |\n| DeleteMessageBatch           | ✅      |\n| DeleteQueue                  | ✅      |\n| GetQueueAttributes           | ✅      |\n| GetQueueUrl                  | ✅      |\n| ListDeadLetterSourceQueues   | ✅      |\n| ListMessageMoveTasks         | ✅      |\n| ListQueues                   | ✅      |\n| ListQueueTags                | ✅      |\n| PurgeQueue                   | ✅      |\n| ReceiveMessage               | ✅      |\n| RemovePermission             | ✅      |\n| SendMessage                  | ✅      |\n| SendMessageBatch             | ✅      |\n| SetQueueAttributes           | ✅      |\n| StartMessageMoveTask         | ✅      |\n| TagQueue                     | ✅      |\n| UntagQueue                   | ✅      |\n\n## Notes\n\nAs this tool is only for local development some behiavours are itentionally ignored.\n\n- No permission checks when calling the API (Access Key, Policy, KMS, etc.)\n- Bad region dont throw error\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finqnuam%2Flocal-aws-sqs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finqnuam%2Flocal-aws-sqs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finqnuam%2Flocal-aws-sqs/lists"}