Loading...
Loading...
Compare original and translation side by side
| Type | Description | Use Case |
|---|---|---|
| Synchronous | Caller waits for response | API Gateway, direct invoke |
| Asynchronous | Fire and forget | S3, SNS, EventBridge |
| Poll-based | Lambda polls source | SQS, Kinesis, DynamoDB Streams |
| 类型 | 描述 | 使用场景 |
|---|---|---|
| 同步调用 | 调用方等待响应 | API Gateway、直接调用 |
| 异步调用 | 触发后无需等待 | S3、SNS、EventBridge |
| 轮询式调用 | Lambda 轮询数据源 | SQS、Kinesis、DynamoDB Streams |
undefinedundefined
**boto3:**
```python
import boto3
import zipfile
import io
lambda_client = boto3.client('lambda')
**boto3:**
```python
import boto3
import zipfile
import io
lambda_client = boto3.client('lambda')undefinedundefinedundefinedundefinedundefinedundefinedaws lambda create-event-source-mapping \
--function-name MyFunction \
--event-source-arn arn:aws:sqs:us-east-1:123456789012:my-queue \
--batch-size 10 \
--maximum-batching-window-in-seconds 5aws lambda create-event-source-mapping \
--function-name MyFunction \
--event-source-arn arn:aws:sqs:us-east-1:123456789012:my-queue \
--batch-size 10 \
--maximum-batching-window-in-seconds 5aws lambda update-function-configuration \
--function-name MyFunction \
--environment "Variables={DB_HOST=mydb.cluster-xyz.us-east-1.rds.amazonaws.com,LOG_LEVEL=INFO}"aws lambda update-function-configuration \
--function-name MyFunction \
--environment "Variables={DB_HOST=mydb.cluster-xyz.us-east-1.rds.amazonaws.com,LOG_LEVEL=INFO}"undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined| Command | Description |
|---|---|
| Create new function |
| Update function code |
| Update settings |
| Delete function |
| List all functions |
| Get function details |
| 命令 | 描述 |
|---|---|
| 创建新函数 |
| 更新函数代码 |
| 更新设置 |
| 删除函数 |
| 列出所有函数 |
| 获取函数详情 |
| Command | Description |
|---|---|
| Invoke function |
| Async invoke (deprecated) |
| 命令 | 描述 |
|---|---|
| 调用函数 |
| 异步调用(已弃用) |
| Command | Description |
|---|---|
| Add event source |
| List mappings |
| Update mapping |
| Remove mapping |
| 命令 | 描述 |
|---|---|
| 添加事件源 |
| 列出事件源映射 |
| 更新事件源映射 |
| 删除事件源映射 |
| Command | Description |
|---|---|
| Add resource-based policy |
| Remove permission |
| View resource policy |
| 命令 | 描述 |
|---|---|
| 添加基于资源的策略 |
| 移除权限 |
| 查看资源策略 |
undefinedundefinedundefinedundefinedTask timed out after X secondsundefinedTask timed out after X secondsundefinedundefinedundefinedaws lambda update-function-configuration \
--function-name MyFunction \
--memory-size 512aws lambda update-function-configuration \
--function-name MyFunction \
--memory-size 512undefinedundefinedundefinedundefinedAccessDeniedExceptionundefinedAccessDeniedExceptionundefinedundefinedundefined