|
80 | 80 | - [Endpoint Configuration](#endpoint-configuration) |
81 | 81 | - [Example Private API Gateway configuration](#example-private-api-gateway-configuration) |
82 | 82 | - [Cold Starts (Experimental)](#cold-starts-experimental) |
| 83 | + - [Lambda Test Console Usage](#lambda-test-console-usage) |
| 84 | + - [`raw_command`](#raw_command) |
| 85 | + - [`manage`](#manage) |
83 | 86 | - [Zappa Guides](#zappa-guides) |
84 | 87 | - [Zappa in the Press](#zappa-in-the-press) |
85 | 88 | - [Sites Using Zappa](#sites-using-zappa) |
@@ -133,7 +136,7 @@ And finally, Zappa is **super easy to use**. You can deploy your application wit |
133 | 136 |
|
134 | 137 | ## Installation and Configuration |
135 | 138 |
|
136 | | -_Before you begin, make sure you are running Python 3.8/3.9/3.10/3.11/3.12 and you have a valid AWS account and your [AWS credentials file](https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs) is properly installed._ |
| 139 | +_Before you begin, make sure you are running Python 3.8/3.9/3.10/3.11/3.12/3.13 and you have a valid AWS account and your [AWS credentials file](https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs) is properly installed._ |
137 | 140 |
|
138 | 141 | **Zappa** can easily be installed through pip, like so: |
139 | 142 |
|
@@ -444,7 +447,7 @@ For instance, suppose you have a basic application in a file called "my_app.py", |
444 | 447 |
|
445 | 448 | Any remote print statements made and the value the function returned will then be printed to your local console. **Nifty!** |
446 | 449 |
|
447 | | -You can also invoke interpretable Python 3.8/3.9/3.10/3.11/3.12 strings directly by using `--raw`, like so: |
| 450 | +You can also invoke interpretable Python 3.8/3.9/3.10/3.11/3.12/3.13 strings directly by using `--raw`, like so: |
448 | 451 |
|
449 | 452 | $ zappa invoke production "print(1 + 2 + 3)" --raw |
450 | 453 |
|
@@ -848,7 +851,7 @@ Example: |
848 | 851 |
|
849 | 852 | ```python |
850 | 853 | from zappa.asynchronous import task, get_async_response |
851 | | -from flask import Flask, make_response, abort, url_for, redirect, request, jsonify |
| 854 | +from flask import Flask, abort, url_for, redirect, request, jsonify |
852 | 855 | from time import sleep |
853 | 856 |
|
854 | 857 | app = Flask(__name__) |
@@ -905,6 +908,7 @@ to change Zappa's behavior. Use these at your own risk! |
905 | 908 | "assume_policy": "my_assume_policy.json", // optional, IAM assume policy JSON file |
906 | 909 | "attach_policy": "my_attach_policy.json", // optional, IAM attach policy JSON file |
907 | 910 | "apigateway_policy": "my_apigateway_policy.json", // optional, API Gateway resource policy JSON file |
| 911 | + "architecture": "x86_64", // optional, Set Lambda Architecture, defaults to x86_64. For Graviton 2 use: arm64 |
908 | 912 | "async_source": "sns", // Source of async tasks. Defaults to "lambda" |
909 | 913 | "async_resources": true, // Create the SNS topic and DynamoDB table to use. Defaults to true. |
910 | 914 | "async_response_table": "your_dynamodb_table_name", // the DynamoDB table name to use for captured async responses; defaults to None (can't capture) |
@@ -1003,7 +1007,7 @@ to change Zappa's behavior. Use these at your own risk! |
1003 | 1007 | "role_name": "MyLambdaRole", // Name of Zappa execution role. Default <project_name>-<env>-ZappaExecutionRole. To use a different, pre-existing policy, you must also set manage_roles to false. |
1004 | 1008 | "role_arn": "arn:aws:iam::12345:role/app-ZappaLambdaExecutionRole", // ARN of Zappa execution role. Default to None. To use a different, pre-existing policy, you must also set manage_roles to false. This overrides role_name. Use with temporary credentials via GetFederationToken. |
1005 | 1009 | "route53_enabled": true, // Have Zappa update your Route53 Hosted Zones when certifying with a custom domain. Default true. |
1006 | | - "runtime": "python3.12", // Python runtime to use on Lambda. Can be one of: "python3.8", "python3.9", "python3.10", "python3.11", or "python3.12". Defaults to whatever the current Python being used is. |
| 1010 | + "runtime": "python3.13", // Python runtime to use on Lambda. Can be one of: "python3.8", "python3.9", "python3.10", "python3.11", "python3.12", or "python3.13". Defaults to whatever the current Python being used is. |
1007 | 1011 | "s3_bucket": "dev-bucket", // Zappa zip bucket, |
1008 | 1012 | "slim_handler": false, // Useful if project >50M. Set true to just upload a small handler to Lambda and load actual project from S3 at runtime. Default false. |
1009 | 1013 | "snap_start": "PublishedVersions", // Enable Lambda SnapStart for faster cold starts. Can be "PublishedVersions" or "None". Default "None". |
@@ -1531,6 +1535,37 @@ apigateway_resource_policy.json: |
1531 | 1535 |
|
1532 | 1536 | Lambda may provide additional resources than provisioned during cold start initialization. Set `INSTANTIATE_LAMBDA_HANDLER_ON_IMPORT=True` to instantiate the lambda handler on import. This is an experimental feature - if startup time is critical, look into using Provisioned Concurrency. |
1533 | 1537 |
|
| 1538 | +### Lambda Test Console Usage |
| 1539 | + |
| 1540 | +The zappa lambda handler allows zappa commands can be initiated from the Lambda Test Console by providing the associated JSON payload. |
| 1541 | + |
| 1542 | +#### `raw_command` |
| 1543 | + |
| 1544 | +`raw_command` allows you to execute arbitrary python code in the context of your Zappa application. |
| 1545 | +This is useful for testing or debugging purposes. |
| 1546 | + |
| 1547 | +> **Warning**: This is a powerful feature and should be used with caution. |
| 1548 | +> It can execute any code in your application context, including potentially harmful commands. |
| 1549 | +
|
| 1550 | +Example: |
| 1551 | +```json |
| 1552 | +{ |
| 1553 | + "raw_command": "from myapp import my_function;x = my_function();print(x)" |
| 1554 | +} |
| 1555 | +``` |
| 1556 | + |
| 1557 | +#### `manage` |
| 1558 | + |
| 1559 | +Django `manage` commands are also supported. |
| 1560 | +You can run any Django management command using the `manage` key in the payload. |
| 1561 | + |
| 1562 | +Example: |
| 1563 | +```json |
| 1564 | +{ |
| 1565 | + "manage": "migrate" |
| 1566 | +} |
| 1567 | +``` |
| 1568 | + |
1534 | 1569 | ## Zappa Guides |
1535 | 1570 |
|
1536 | 1571 | - [Django-Zappa tutorial (screencast)](https://www.youtube.com/watch?v=plUrbPN0xc8&feature=youtu.be). |
|
0 commit comments