

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 [AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 搭配使用 `PutFunctionConcurrency` 與 CLI
<a name="lambda_example_lambda_PutFunctionConcurrency_section"></a>

下列程式碼範例示範如何使用 `PutFunctionConcurrency`。

------
#### [ CLI ]

**AWS CLI**  
**若要設定函數的預留並行限制**  
下列 `put-function-concurrency` 範例會設定 `my-function` 函數的 100 個預留並行執行。  

```
aws lambda put-function-concurrency \
    --function-name  my-function  \
    --reserved-concurrent-executions 100
```
輸出：  

```
{
    "ReservedConcurrentExecutions": 100
}
```
如需詳細資訊，請參閱《AWS Lambda 開發人員指南》**中 [Lambda 函數的預留並行](https://docs.aws.amazon.com/lambda/latest/dg/per-function-concurrency.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [PutFunctionConcurrency](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/put-function-concurrency.html)。

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**範例 1：此範例會整體套用函數的並行設定。**  

```
Write-LMFunctionConcurrency -FunctionName "MylambdaFunction123" -ReservedConcurrentExecution 100
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V4)》**中的 [PutFunctionConcurrency](https://docs.aws.amazon.com/powershell/v4/reference)。

**Tools for PowerShell V5**  
**範例 1：此範例會整體套用函數的並行設定。**  

```
Write-LMFunctionConcurrency -FunctionName "MylambdaFunction123" -ReservedConcurrentExecution 100
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V5)》**中的 [PutFunctionConcurrency](https://docs.aws.amazon.com/powershell/v5/reference)。

------