{"id":16307084,"url":"https://github.com/fujiwara/s32cs","last_synced_at":"2025-10-25T14:30:59.975Z","repository":{"id":47780531,"uuid":"98155315","full_name":"fujiwara/s32cs","owner":"fujiwara","description":"Amazon CloudSearch document uploader via S3 event notification.","archived":false,"fork":false,"pushed_at":"2023-03-06T23:59:53.000Z","size":45,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T07:41:20.530Z","etag":null,"topics":["aqw-bots","cloudsearch","go","lambda","sqs"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/fujiwara.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":"2017-07-24T06:13:08.000Z","updated_at":"2023-12-03T10:12:48.000Z","dependencies_parsed_at":"2024-06-19T18:59:50.959Z","dependency_job_id":"5f1e84f6-16fc-4038-b93a-9b3c8a0c0cb4","html_url":"https://github.com/fujiwara/s32cs","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":0.05128205128205132,"last_synced_commit":"423bcf633f71ff6ba1f95c21153bc0fcfb12c418"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fujiwara%2Fs32cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fujiwara%2Fs32cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fujiwara%2Fs32cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fujiwara%2Fs32cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fujiwara","download_url":"https://codeload.github.com/fujiwara/s32cs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238155550,"owners_count":19425733,"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":["aqw-bots","cloudsearch","go","lambda","sqs"],"created_at":"2024-10-10T21:12:27.126Z","updated_at":"2025-10-25T14:30:59.660Z","avatar_url":"https://github.com/fujiwara.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# s32cs\n\nAmazon CloudSearch document uploader via S3 event notification.\n\n## Usage\n\nExample Lambda functions configuration.\n\n```js\n{\n  \"FunctionName\": \"s32cs\",\n  \"Description\": \"Amazon Cloudsearch uploader via S3 event notification.\",\n  \"Environment\": {\n    \"Variables\": {\n      \"ENDPOINT\": \"\u003cYOUR CloudSearch document default endpoint\",\n      \"KEY_REGEXP\": \"Regexp to extract an endpoint from S3 object key\"\n    }\n  },\n  \"Handler\": \"s32cs\",\n  \"MemorySize\": 128,\n  \"Role\": \"\u003cYOUR role ARN\u003e\",\n  \"Runtime\": \"provided.al2\",\n  \"Timeout\": 60\n}\n```\n\nConfigure your S3 bucket. Set an event notification to the Lambda function.\n\n\n### Example\n\n```js\n{\n  \"FunctionName\": \"s32cs\",\n  \"Description\": \"\"\n  \"Environment\": {\n    \"Variables\": {\n      \"ENDPOINT\": \"example-nregueirgrehbuigre.ap-northeast-1.cloudsearch.amazonaws.com\",\n      \"KEY_REGEXP\": \"example/(.+?)/\"\n    }\n  },\n  \"Handler\": \"s32cs\",\n  \"MemorySize\": 128,\n  \"Role\": \"arn:aws:iam::xxxxxxxxxxxx:role/s32cs_lambda_function\",\n  \"Runtime\": \"provided.al2\",\n  \"Timeout\": 60\n}\n```\n\nThis configuration works as below.\n\n- S3\n   1. Event notification invokes the function.\n- Lambda\n   1. Read notified objects from S3.\n   1. Convert the object (line delimitered JSON) to SDF.\n   1. Upload SDF to CloudSearch.\n     - endpoint is determined by `ENDPOINT` environment value(default) or extract from a object key by `KEY_REGEXP`.\n\n## Source object file format\n\nLine delimitered JSON only.\n\n```json\n{\"id\":\"123\",\"type\":\"add\",\"fields\":{\"foo\":\"bar\",\"bar\":[\"A\",\"B\"]}}\n{\"id\":\"123\",\"type\":\"delete\"}\n```\n\nid, type (add or delete) columns are required.\n\n## Using with Dead Letter Queue(DLQ)\n\nIf Lambda use DLQ (SQS), s32cs also works by jobs from SQS.\n\nWhen s32cs invoked with payload like `{\"queue_url:\"\"}`, s32cs will fetch jobs from the SQS and upload.\n\n```\n// eample payload\n{\"queue_url\":\"https://sqs.ap-northeast-1.amazonaws.com/xxxxxxx/upload\"}\n```\n\nYou can this invocation periodically by CloudWatch Events scheduled jobs.\n\n## Requirements\n\n- Go\n\n## LICENSE\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 FUJIWARA Shunichiro / (c) 2017 KAYAC Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffujiwara%2Fs32cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffujiwara%2Fs32cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffujiwara%2Fs32cs/lists"}