Files
tldr/pages.zh/common/aws-lambda.md

32 lines
870 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# AWS Lambda
> 使用 AWS Lambda这是一项计算服务可以在不配置或管理服务器的情况下运行代码。
> 更多信息:<https://docs.aws.amazon.com/cli/latest/reference/lambda/>.
- 运行一个函数:
`aws lambda invoke --function-name {{name}} {{path/to/response.json}}`
- 以 JSON 格式的输入负载运行一个函数:
`aws lambda invoke --function-name {{name}} --payload {{json}} {{path/to/response.json}}`
- 列出函数:
`aws lambda list-functions`
- 显示函数的配置:
`aws lambda get-function-configuration --function-name {{name}}`
- 列出函数别名:
`aws lambda list-aliases --function-name {{name}}`
- 显示函数的保留并发配置:
`aws lambda get-function-concurrency --function-name {{name}}`
- 列出哪些 AWS 服务可以调用该函数:
`aws lambda get-policy --function-name {{name}}`