{"id":16365868,"url":"https://github.com/harshcasper/sns-sqs-subscription-lambda-pulumi","last_synced_at":"2026-04-16T19:39:36.253Z","repository":{"id":216264046,"uuid":"740548624","full_name":"HarshCasper/sns-sqs-subscription-lambda-pulumi","owner":"HarshCasper","description":"Pulumi Sample to showcase SNS, SQS, and Lambda integration with LocalStack and GitHub Codespaces","archived":false,"fork":false,"pushed_at":"2024-01-09T07:45:31.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-27T00:44:56.971Z","etag":null,"topics":["aws","lambda","localstack","pulumi","pulumi-localstack","sns","sqs"],"latest_commit_sha":null,"homepage":"https://docs.localstack.cloud/user-guide/integrations/pulumi/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HarshCasper.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":"2024-01-08T15:14:13.000Z","updated_at":"2024-04-05T01:49:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"93f20ce5-e565-43d4-a1e7-0ed7597f5d94","html_url":"https://github.com/HarshCasper/sns-sqs-subscription-lambda-pulumi","commit_stats":null,"previous_names":["harshcasper/sns-sqs-subscription-lambda-pulumi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HarshCasper/sns-sqs-subscription-lambda-pulumi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshCasper%2Fsns-sqs-subscription-lambda-pulumi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshCasper%2Fsns-sqs-subscription-lambda-pulumi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshCasper%2Fsns-sqs-subscription-lambda-pulumi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshCasper%2Fsns-sqs-subscription-lambda-pulumi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HarshCasper","download_url":"https://codeload.github.com/HarshCasper/sns-sqs-subscription-lambda-pulumi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshCasper%2Fsns-sqs-subscription-lambda-pulumi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273658579,"owners_count":25145305,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","localstack","pulumi","pulumi-localstack","sns","sqs"],"created_at":"2024-10-11T02:44:43.923Z","updated_at":"2026-04-16T19:39:31.201Z","avatar_url":"https://github.com/HarshCasper.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LocalStack \u0026 Pulumi Sample to showcase SNS, SQS, and Lambda integration\n\nThis example demonstrates the delivery from SNS to SQS queues through subscriptions, triggering Lambda functions via SQS event source mappings, and accessing resources from within a Lambda function. The sample is deployed using **LocalStack** on your local machine and on a CI pipeline without accessing any real cloud resources.\n\nThe basic pipeline is:\n\n- Publish to SNS Topic, initiated by user input.\n- Transfer from SNS Topic to SQS queue, facilitated by an SNS subscription.\n- SQS Queue triggers a Lambda invocation, configured through a Lambda event source mapping.\n- Lambda function interacts with SQS using the AWS SDK for Python (`boto3`), executed within the Lambda.\n- SQS queue message reception, activated by user input.\n\n![Architecture](./images/architecture.png)\n\n## Prerequisites\n\n- [LocalStack \u0026 `localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli)\n- [Pulumi (`pulumi`) CLI](https://www.pulumi.com/docs/install/)\n- Docker\n- AWS CLI \u0026 [`awslocal` wrapper script](https://docs.localstack.cloud/user-guide/integrations/aws-cli/#localstack-aws-cli-awslocal)\n\n## Instructions\n\n### Start LocalStack\n\nTo start LocalStack, execute:\n\n```bash\nlocalstack start -d\n```\n\n### Configure Pulumi\n\nYou can use a local backend for Pulumi, which will store the state in a local file. Run the following command to configure the local backend:\n\n```bash\npulumi login --local\n```\n\nConfigure the Pulumi stack `dev` using the following command:\n\n```bash\npulumi stack init dev\n```\n\n### Install dependencies\n\nInstall the necessary dependencies with:\n\n```bash\nyarn install\n```\n\n### Deploy the stack\n\nZip the Lambda function with the following command:\n\n```bash\nzip lambda.zip lambda.py\n```\n\nFor stack preview and deployment, run:\n\n```bash\npulumi up --yes\n```\n\n\u003e You might be prompted for `PULUMI_CONFIG_PASSPHRASE` or `PULUMI_CONFIG_PASSPHRASE_FILE`. If you haven't set a passphrase, you can just press `Enter`.\n\nAfter a successful deployment, you should see the following output:\n\n```bash\nUpdating (dev):\n     Type                              Name                    Status              \n +   pulumi:pulumi:Stack               sns-sqs-dev             created (0.89s)     \n +   ├─ aws:sns:Topic                  trigger-event-topic     created (1s)        \n +   ├─ aws:sqs:Queue                  lambda-event-queue      created (26s)       \n +   ├─ aws:sqs:Queue                  lambda-result-queue     created (25s)       \n +   ├─ aws:lambda:Function            event-echo-lambda       created (29s)       \n +   ├─ aws:sns:TopicSubscription      lambda-event-queue-sub  created (0.05s)     \n +   └─ aws:lambda:EventSourceMapping  sqs-lambda-trigger      created (0.05s)     \n\nResources:\n    + 7 created\n\nDuration: 57s\n```\n\n### Check the stack\n\nPost deployment, verify the available SQS queues \u0026 SNS topics with the following commands:\n\n```bash\nawslocal sqs list-queues\nawslocal sns list-topics\n```\n\n## Test the stack\n\nYou can publish a message to the SNS topic via:\n\n```bash\nawslocal sns publish \\\n\t--topic arn:aws:sns:us-east-1:000000000000:trigger-event-topic \\\n\t--message '{\"event_type\":\"testing\",\"event_payload\":\"hello world\"}'\n```\n\nYou can receive the message from the SQS queue via:\n\n```bash\nawslocal sqs receive-message --wait-time-seconds 10 --visibility-timeout=0 \\\n\t--queue=http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/lambda-result-queue\n```\n\nYou will find the `hello world` message in the output.\n\n## License\n\nThis code is available under the Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshcasper%2Fsns-sqs-subscription-lambda-pulumi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharshcasper%2Fsns-sqs-subscription-lambda-pulumi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshcasper%2Fsns-sqs-subscription-lambda-pulumi/lists"}