{"id":16225654,"url":"https://github.com/lasuillard/serverless-python-examples","last_synced_at":"2025-08-23T22:32:07.920Z","repository":{"id":220699775,"uuid":"751867125","full_name":"lasuillard/serverless-python-examples","owner":"lasuillard","description":"Examples deploying Python applications using serverless framework.","archived":false,"fork":false,"pushed_at":"2024-12-03T23:41:54.000Z","size":102,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-04T00:27:55.818Z","etag":null,"topics":["aws-lambda","docker","playwright","python","selenium","serverless-framework"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/lasuillard.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":"2024-02-02T13:59:14.000Z","updated_at":"2024-12-03T23:42:37.000Z","dependencies_parsed_at":"2024-11-25T17:30:44.032Z","dependency_job_id":"d698e6b1-fa34-4141-9ac4-2c74e6d62c39","html_url":"https://github.com/lasuillard/serverless-python-examples","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":0.303030303030303,"last_synced_commit":"69763350caf343dd366b5d5edba1e9cbf3d5d9ac"},"previous_names":["lasuillard/serverless-python-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasuillard%2Fserverless-python-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasuillard%2Fserverless-python-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasuillard%2Fserverless-python-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasuillard%2Fserverless-python-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lasuillard","download_url":"https://codeload.github.com/lasuillard/serverless-python-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230747034,"owners_count":18274353,"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","docker","playwright","python","selenium","serverless-framework"],"created_at":"2024-10-10T12:45:51.402Z","updated_at":"2024-12-21T17:28:26.328Z","avatar_url":"https://github.com/lasuillard.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-python-examples\n\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/lasuillard/serverless-python-examples/main.svg)](https://results.pre-commit.ci/latest/github/lasuillard/serverless-python-examples/main)\n\nExamples deploying Python applications using serverless framework.\n\n## 👟 Quick Start\n\nClone the repository:\n\n```bash\n$ git clone https://github.com/lasuillard/serverless-python-examples\n```\n\nInstall the project deps (npm) for [serverless](https://www.serverless.com/) CLI and plugins:\n\n```bash\n$ npm install\n$ alias sls=\"npx serverless\" # For convenience\n```\n\nCreate an access key for your IAM. I recommend creating an IAM and giving appropriate permissions. I gave following (just for convenience, **not recommended for production**) permissions to new IAM account:\n\n- AmazonEC2ContainerRegistryFullAccess\n- AmazonS3FullAccess\n- AWSCloudFormationFullAccess\n- AWSLambda_FullAccess\n- CloudWatchLogsFullAccess\n- IAMFullAccess\n\nThen configure the profile **serverless-python-examples**. Region is not necessarily to be **us-east-1**, choose what you want.\n\n```bash\n$ aws configure --profile serverless-python-examples\nAWS Access Key ID [None]: XXXXXXXXXXXXXXXXXXXX\nAWS Secret Access Key [None]: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\nDefault region name [None]: us-east-1\nDefault output format [None]:\n```\n\nList of examples currently available:\n\n- fastapi-playwright\n\n  Example app with FastAPI and Playwright installed.\n\n- fastapi-selenium\n\n  Example app with FastAPI and Selenium, with Google Chrome and ChromeDriver installed (via [Chrome for Testing](https://github.com/GoogleChromeLabs/chrome-for-testing)).\n\nRun following to deploy:\n\n```bash\n$ cd fastapi-playwright\n$ sls deploy\n(node:400182) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n\nDeploying serverless-python-examples to stage dev (us-east-1)\nUpdated AWS resource tags..\nUpdated AWS resource tags..\nUpdated APIGateway resource tags..\n\n✔ Service deployed to stack serverless-python-examples-dev (289s)\n\nendpoint: https://35fg4ihpurh2jfkoo6luv74etu0drsry.lambda-url.us-east-1.on.aws/\nfunctions:\n  app: serverless-python-examples-dev-app\n\nNeed a faster logging experience than CloudWatch? Try our Dev Mode in Console: run \"serverless dev\"\n```\n\nserverless will take care of creating all necessary resources: S3 bucket, ECR repository and Lambda functions, CloudWatch log groups.\n\nCopy the endpoint URL (https://35fg4ihpurh2jfkoo6luv74etu0drsry.lambda-url.us-east-1.on.aws/ above) for later testing.\n\n## 🧪 Testing\n\nOnce deployed, CLI will show the URL of Lambda endpoint. Access the root URL with query parameter `url`, for example:\n\n```bash\n$ curl https://35fg4ihpurh2jfkoo6luv74etu0drsry.lambda-url.us-east-1.on.aws/?url=https://example.com\n\"Example Domain\"\n```\n\nFunction will respond with given URL's page title.\n\nTo see logs, run:\n\n```bash\n$ sls logs --function app --tail\n```\n\n## 🧹 Cleanup Resources\n\nRemove resources created by serverless:\n\n```bash\n$ sls remove\n```\n\nIt will remove all the resources created by CLI.\n\nAs AWS CLI does not provide removing profile you should edit **~/.aws/credentials** file and remove the **serverless-python-examples** profile manually.\n\nDelete the IAM if you created one, and no need anymore.\n\n## 🖇️ References\n\n- https://www.cloudtechsimplified.com/playwright-aws-lambda-python/\n- https://github.com/umihico/docker-selenium-lambda\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasuillard%2Fserverless-python-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasuillard%2Fserverless-python-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasuillard%2Fserverless-python-examples/lists"}