{"id":20535746,"url":"https://github.com/e2fyi/serverless-py-template","last_synced_at":"2025-03-06T03:26:40.038Z","repository":{"id":90236589,"uuid":"129839227","full_name":"e2fyi/serverless-py-template","owner":"e2fyi","description":"Template to setup AWS lambda (python) + API gateway with Serverless Framework","archived":false,"fork":false,"pushed_at":"2018-04-17T03:15:43.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T13:55:52.946Z","etag":null,"topics":["aws-lambda","serverless","serverless-examples"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/e2fyi.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-04-17T03:14:44.000Z","updated_at":"2018-04-17T03:16:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"1746321b-b983-4938-a6e5-1cc30a30642d","html_url":"https://github.com/e2fyi/serverless-py-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e2fyi%2Fserverless-py-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e2fyi%2Fserverless-py-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e2fyi%2Fserverless-py-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e2fyi%2Fserverless-py-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e2fyi","download_url":"https://codeload.github.com/e2fyi/serverless-py-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242140807,"owners_count":20078400,"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":["aws-lambda","serverless","serverless-examples"],"created_at":"2024-11-16T00:34:01.720Z","updated_at":"2025-03-06T03:26:39.990Z","avatar_url":"https://github.com/e2fyi.png","language":"Python","readme":"serverless-aws-py\n=================\n\nThis repo holds a basic template to deploy python codes to AWS lambda function.\n\n## 1. Setup\n#### AWS policy for serverless bot\nPlease create an IAM bot-user in AWS. A default policy for Singapore region can be found in `serverless-aws-py-dev-ap-southeast-1-policy.json`. You can also generate your own policy with yeoman:\n```bash\nnpm run policy\n```\n\n#### Setup AWS credentials locally\nPlease ensure your AWS credentials are exported as your current environment variables `AWS_KEY` and `AWS_SECRET` respectively. Otherwise you can create an `.env` file of the form:\n\n\u003e AWS_KEY=SOMERANDOMIDKEY  \n\u003e AWS_SECRET=SOMERANDOMSECRETVALUE\n\nRun the following command once to setup your credentials:\n```bash\nnpm run init\n```\n\n## 2. Usage\n\n#### Setup nodeJS dependencies\n```bash\nnpm i\n```\nor\n```bash\nyarn\n```\n\n#### Deploy all functions to AWS\n```bash\nnpm run deploy\n```\n\n#### Deploy specific function to AWS\n```bash\nnpm run deployf -- \u003cname of the function\u003e\n```\n\n#### Remove all and clean functions from AWS\n```bash\nnpm run remove\n```\n\n#### Test locally\n```bash\nnpm run function -- \u003cname of the function\u003e\nnpm run function -- echo --data hello!\n```\n\n#### Test deployed function\n```bash\nnpm run api -- \u003cname of the function\u003e\nnpm run api -- echo --data hello!\n```\n\n#### Test api endpoint\nYou will see the api endpoint after deploying to AWS\n\u003e curl -d [DATA] -X POST [API_ENDPOINT]\n\n```bash\n# example\ncurl -d \"hello!\" -X POST https://abcdef.execute-api.ap-southeast-1.amazonaws.com/dev/echo\n```\n\n#### Others\nPlease look at [serverless cli documentation](https://serverless.com/framework/docs/providers/aws/cli-reference/) for more details.\n\nAs `serverless` is installed locally, please prefix the command with a `npx`:\n```bash\nnpx serverless\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe2fyi%2Fserverless-py-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe2fyi%2Fserverless-py-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe2fyi%2Fserverless-py-template/lists"}