{"id":22511882,"url":"https://github.com/zxkane/dingtalk-callback-on-aws","last_synced_at":"2026-04-17T07:33:13.782Z","repository":{"id":145434541,"uuid":"177542298","full_name":"zxkane/dingtalk-callback-on-aws","owner":"zxkane","description":"The dingtalk callback powered by AWS lambda, Dynamodb.","archived":false,"fork":false,"pushed_at":"2019-06-29T08:38:46.000Z","size":107,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T00:47:16.253Z","etag":null,"topics":["api-gateway","aws","codepipeline","dingding","dingtalk-callback","dynamodb","kotlin","lambda","sam","serverless","serverless-framework"],"latest_commit_sha":null,"homepage":"https://kane.mx/posts/effective-cloud-computing/serverless-dingtalk-callback/","language":"Kotlin","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/zxkane.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":"2019-03-25T08:11:15.000Z","updated_at":"2020-11-24T15:49:52.000Z","dependencies_parsed_at":"2023-06-03T18:15:36.733Z","dependency_job_id":null,"html_url":"https://github.com/zxkane/dingtalk-callback-on-aws","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zxkane/dingtalk-callback-on-aws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxkane%2Fdingtalk-callback-on-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxkane%2Fdingtalk-callback-on-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxkane%2Fdingtalk-callback-on-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxkane%2Fdingtalk-callback-on-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zxkane","download_url":"https://codeload.github.com/zxkane/dingtalk-callback-on-aws/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxkane%2Fdingtalk-callback-on-aws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31920140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"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":["api-gateway","aws","codepipeline","dingding","dingtalk-callback","dynamodb","kotlin","lambda","sam","serverless","serverless-framework"],"created_at":"2024-12-07T02:14:24.924Z","updated_at":"2026-04-17T07:33:13.764Z","avatar_url":"https://github.com/zxkane.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"## A Dingtalk(钉钉) callback on AWS\n\n[![Build Status](https://travis-ci.org/zxkane/dingtalk-callback-on-aws.svg?branch=master)](https://travis-ci.org/zxkane/dingtalk-callback-on-aws)\n\nThe program provides a HTTP API endpoint to receive kinds of dingtalk callback events and persist them in AWS DynamoDB, including `BPM events`, `Organization events` and so on.\n\nIt is written by Kotlin and leverages below AWS services,\n\n- [Lambda](https://aws.amazon.com/lambda/)\n- [DynamoDB](https://aws.amazon.com/dynamodb/)\n- [CloudFormation](https://aws.amazon.com/cloudformation/)\n- [API Gateway](https://aws.amazon.com/api-gateway/)\n- [CodePipeline](https://aws.amazon.com/codepipeline/)\n- [Systems Manager](https://aws.amazon.com/systems-manager/)\n- [S3](https://aws.amazon.com/s3/)\n- [CloudWatch](https://aws.amazon.com/cloudwatch/)\n- [KMS](https://aws.amazon.com/kms/)\n- [IAM](https://aws.amazon.com/iam/)\n\n### How to deploy this program\n\n#### Prerequisites\n\n1. Get the **corpid** of your dingtalk's organization in [open dev platform](https://open-dev.dingtalk.com/#/index)\n1. Create secure parameters named `DD_TOKEN`, `DD_AES_TOKEN` and `DD_CORPID`(from step 1) in [Systems Manager\n](https://ap-southeast-1.console.aws.amazon.com/systems-manager/parameters?region=ap-southeast-1)\n1. Create a S3 bucket(say `my-deploy-bucket`) for deployment\n1. [Optional] Install and configure [SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) for local deployment\n\n#### Build, Test and package\n\n```bash\n# build the source\n./gradlew build\n```\n\n####  Deploy via SAM cli\n\n```bash\n# package the lambda functions\nsam package --output-template-file packaged.yaml \\\n    --s3-bucket my-deploy-bucket --template-file template-sam.yaml\n    \n# deploy the lambda function, api gateway, dybnamodb\nsam deploy --template-file ./packaged.yaml \\\n    --stack-name my-dingtalk-callback --capabilities CAPABILITY_IAM\n```\n\n####  Deploy via [serverless framework](https://serverless.com/)\n\n\n```bash\nsls deploy\n```\n\n#### Deploy via Code pipeline\n1. Put the github person token to `codepipeline.json`\n2. Set the s3 bucket name in `codepipeline.json` \n3. Set any parameter in `codepipeline.json` if necessary, such as app name, repo name and branch name\n4. Create a CI/CD pipeline in CodePipeline via below command, which can be continously triggered by new commits of this repo then deploy lambda HTTP endpoint\n```bash\naws cloudformation create-stack --stack-name dingtalk-mycorp --template-body file://codepipeline.yml --parameters file://codepipeline.json --capabilities CAPABILITY_NAMED_IAM\n```\n\n### Post deployment actions\n\n1. Get `id of api gateway of AWS` created by above deployment\n2. Use [dingtalk API](https://open-doc.dingtalk.com/microapp/serverapi2/pwz3r5) to register/update this serverless API gateway endpoint as callback of dingtalk events.\n\nFor example,\n\n```bash\ncurl -X POST \\\n  'https://oapi.dingtalk.com/call_back/update_call_back?access_token=\u003cyour token\u003e' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"call_back_tag\": [\n        \"bpms_task_change\",\n        \"bpms_instance_change\"\n    ],\n    \"token\": \"\u003ctoken created in prerequisites step 2\u003e\",\n    \"aes_key\": \"\u003caes token created in prerequisites step 2\u003e\",\n    \"url\": \"https://\u003cid of api gateway created by above deployment\u003e.execute-api.\u003cyour region\u003e.amazonaws.com/v1/dingtalk\"\n}' \n\n```\n\n### Spring Cloud Function version\n\nI also port this lambda function to use [Spring Cloud Function](https://spring.io/projects/spring-cloud-function) as lambda framework, you can checkout [this branch](https://github.com/zxkane/dingtalk-callback-on-aws/tree/spring-cloud-function) if your're interested.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxkane%2Fdingtalk-callback-on-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzxkane%2Fdingtalk-callback-on-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxkane%2Fdingtalk-callback-on-aws/lists"}