Now you will be able to add your dependencies to requirements.txt file ( Pipfile and pyproject.toml is also supported but requires additional configuration) and they will be automatically injected to Lambda package during build process. The package.json file will be automatically created if it doesn't exist beforehand. Running the above will automatically add serverless-python-requirements to plugins section in your serverless.yml file and add it as a devDependency to package.json file. You can set it up by running the following command: serverless plugin install -n serverless-python-requirements In case you would like to include third-party dependencies, you will need to use a plugin called serverless-python-requirements. Which should result in response similar to the following: " Hello: aws-python-project-dev-hello (1.5 kB)Īfter successful deployment, you can invoke the deployed function by using the following command: serverless invoke - function hello ✔ Service deployed to stack aws-python-project-dev (112s) In order to deploy the example, you need to run the following command: $ serverless deployĪfter running deploy, you should see output similar to: Deploying aws-python-project to stage dev (us-east-1) For details about configuration of specific events, please refer to our documentation. For more advanced configurations check out the examples repo which includes integrations with SQS, DynamoDB or examples of functions that are triggered in cron-like manner. The deployed function does not include any event definitions as well as any kind of persistence (database). This template demonstrates how to deploy a Python function running on AWS Lambda using the traditional Serverless Framework.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |