{"id":37166944,"url":"https://github.com/toshi0607/s3-sns-sqs-lambda-slack-go-sample","last_synced_at":"2026-01-14T19:46:22.926Z","repository":{"id":81574799,"uuid":"146862949","full_name":"toshi0607/s3-sns-sqs-lambda-slack-go-sample","owner":"toshi0607","description":"s3-sns-sqs-lambda-slack-go-sample is a sample implementation of a Funout Pattern of a cloud design pattern","archived":false,"fork":false,"pushed_at":"2020-01-04T08:36:29.000Z","size":55,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T08:19:40.608Z","etag":null,"topics":["go","lambda","s3","slack","sns","sqs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toshi0607.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-08-31T08:18:28.000Z","updated_at":"2024-03-11T12:06:15.000Z","dependencies_parsed_at":"2023-07-03T11:30:36.477Z","dependency_job_id":null,"html_url":"https://github.com/toshi0607/s3-sns-sqs-lambda-slack-go-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/toshi0607/s3-sns-sqs-lambda-slack-go-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshi0607%2Fs3-sns-sqs-lambda-slack-go-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshi0607%2Fs3-sns-sqs-lambda-slack-go-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshi0607%2Fs3-sns-sqs-lambda-slack-go-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshi0607%2Fs3-sns-sqs-lambda-slack-go-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toshi0607","download_url":"https://codeload.github.com/toshi0607/s3-sns-sqs-lambda-slack-go-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshi0607%2Fs3-sns-sqs-lambda-slack-go-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28432823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","lambda","s3","slack","sns","sqs"],"created_at":"2026-01-14T19:46:22.259Z","updated_at":"2026-01-14T19:46:22.908Z","avatar_url":"https://github.com/toshi0607.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"s3-sns-sqs-lambda-slack-go-sample\n====\n\n## Description\ns3-sns-sqs-lambda-slack-go-sample is a sample implementation of a [*Fanout Pattern* of a cloud design pattern](http://aws.clouddesignpattern.org/index.php/CDP:Fanout%E3%83%91%E3%82%BF%E3%83%BC%E3%83%B3)\n\n![sequence](./images/sequence.png)\n\n## Production\n\n### prerequisites\n\nYou have to prepare credentials with proper policies.\n\nAnd,\n\n* install [aws-cli](https://github.com/aws/aws-cli)\n* install [aws-sam-cli](https://github.com/awslabs/aws-sam-cli). Docker is also required. Follow the instruction [here](https://github.com/awslabs/aws-sam-cli#installation).\n* install [direnv](https://github.com/direnv/direnv)\n* install [saw](https://github.com/TylerBrock/saw)\n  * you can watch CloudWatch logs on your terminal\n* set environment variables to [.envrc.sample](./.envrc.sample) and remove *.sample*.\n  * *WEBHOOK_URL* Incoming Webhook URL of Slack. You can get URL at [this page](https://api.slack.com/incoming-webhooks).\n  * *CHANNEL* where the Lambda③'ll post message in Slack\n  * *USER_NAME* by whom the message is posted in Slack\n  * *ICON* message sender's icon like :piggy:\n  * *FILE_BUCKET* S3 bucket where you upload your file. It's *S3* in sequence and hould be unique globally.\n  * *STACK_BUCKET* is S3 bucket name for artifacts of SAM and should be unique globally.\n\n### deploy\n\n```\n$ dep ensure                       # to resolve dependency\n$ aws s3 mb \"s3://${STACK_BUCKET}\" # for artifacts of SAM\n$ make deploy\n```\n\nNow, you can check a behavior of this architecture by uploading file to S3.\n\n```\n$ saw groups\n/aws/lambda/stack-s3-sns-sqs-lambda-slack-go-sa-WriteExtLambda-XXXXXXXXXXXX\n/aws/lambda/stack-s3-sns-sqs-lambda-slack-WriteFileNameLambda-XXXXXXXXXXXX\n/aws/lambda/stack-s3-sns-sqs-lambda-slack-go-sa-NotifierLambda-XXXXXXXXXXXX\n\n$ saw watch /aws/lambda/stack-s3-sns-sqs-lambda-slack-go-sa-WriteExtLambda-XXXXXXXXXXXX \u0026\n$ saw watch /aws/lambda/stack-s3-sns-sqs-lambda-slack-WriteFileNameLambda-XXXXXXXXXXXX \u0026\n$ saw watch /aws/lambda/stack-s3-sns-sqs-lambda-slack-go-sa-NotifierLambda-XXXXXXXXXXXX \u0026\n\n# open another window\n$ aws s3 cp ./README.md \"s3://${FILE_BUCKET}\"\n```\n\n### delete\n\nIn this architecture, Lambdas execute *long polling* to SQS and it's billable. So you should delete your stack by executing the command below after trying deploy.\n\n```\n$ make delete\n```\n\n## Articles (Japanese)\n\n* [Goで学ぶAWS Lambda（PDF、ePubセット版）](https://toshi0607.booth.pm/items/1034858)\n  * This architecture is explained in detail in this book.\n* [技術書典5で『Goで学ぶAWS Lambda』を出展します #技術書典](http://toshi0607.com/programming/learning-aws-lambda-with-go/)\n* [技術書典5の『Goで学ぶAWS Lambda』の振り返りとフィードバックのお願い #技術書典](http://toshi0607.com/event/review-of-tbf5/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoshi0607%2Fs3-sns-sqs-lambda-slack-go-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoshi0607%2Fs3-sns-sqs-lambda-slack-go-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoshi0607%2Fs3-sns-sqs-lambda-slack-go-sample/lists"}