

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

# UpdateFunctionConfiguration
<a name="API_UpdateFunctionConfiguration"></a>

修改 Lambda 函數的版本特定設定。

當您更新函數時，Lambda 會佈建函數執行個體及其支援的資源。如果您的函數連線到 VPC，則此過程可能需要一分鐘。在此期間，您無法修改函數，但是仍可調用它。來自 [GetFunctionConfiguration](API_GetFunctionConfiguration.md) 的回應中的 `LastUpdateStatus`、`LastUpdateStatusReason` 以及 `LastUpdateStatusReasonCode` 欄位指示更新何時完成，以及函數正在使用新組態處理事件。如需詳細資訊，請參閱 [Lambda 函數狀態](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)。

這些設定可能會因函數的版本而有所不同，並在您發佈版本時鎖定。您無法修改已發佈版本的組態，只能修改未發佈版本。

若要設定函數並行，請使用 [PutFunctionConcurrency](API_PutFunctionConcurrency.md)。若要為 AWS 帳戶或 AWS 服務授與調用許可，請使用 [AddPermission](API_AddPermission.md)。

## 請求語法
<a name="API_UpdateFunctionConfiguration_RequestSyntax"></a>

```
PUT /2015-03-31/functions/FunctionName/configuration HTTP/1.1
Content-type: application/json

{
   "DeadLetterConfig": { 
      "TargetArn": "string"
   },
   "Description": "string",
   "Environment": { 
      "Variables": { 
         "string" : "string" 
      }
   },
   "EphemeralStorage": { 
      "Size": number
   },
   "FileSystemConfigs": [ 
      { 
         "Arn": "string",
         "LocalMountPath": "string"
      }
   ],
   "Handler": "string",
   "ImageConfig": { 
      "Command": [ "string" ],
      "EntryPoint": [ "string" ],
      "WorkingDirectory": "string"
   },
   "KMSKeyArn": "string",
   "Layers": [ "string" ],
   "LoggingConfig": { 
      "ApplicationLogLevel": "string",
      "LogFormat": "string",
      "LogGroup": "string",
      "SystemLogLevel": "string"
   },
   "MemorySize": number,
   "RevisionId": "string",
   "Role": "string",
   "Runtime": "string",
   "SnapStart": { 
      "ApplyOn": "string"
   },
   "Timeout": number,
   "TracingConfig": { 
      "Mode": "string"
   },
   "VpcConfig": { 
      "Ipv6AllowedForDualStack": boolean,
      "SecurityGroupIds": [ "string" ],
      "SubnetIds": [ "string" ]
   }
}
```

## URI 請求參數
<a name="API_UpdateFunctionConfiguration_RequestParameters"></a>

請求會使用下列 URI 參數。

 ** [FunctionName](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-FunctionName"></a>
Lambda 函數的名稱。  

**名稱格式**
+  **函數名稱** - `my-function`。
+  **函數 ARN** - `arn:aws:lambda:us-west-2:123456789012:function:my-function`。
+  **部分 ARN** - `123456789012:function:my-function`。
長度限制條件僅會套用到完整的 ARN。若您僅指定函數名稱，則其長度限制為 64 個字元。  
長度限制：長度下限為 1。長度上限為 140。  
模式：`(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?`  
必要：是

## 請求主體
<a name="API_UpdateFunctionConfiguration_RequestBody"></a>

請求接受採用 JSON 格式的下列資料。

 ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-DeadLetterConfig"></a>
無效字母佇列組態，可指定在處理失敗時，Lambda 傳送的非同步事件的佇列或主題。如需詳細資訊，請參閱[無效字母佇列](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq)。  
類型：[DeadLetterConfig](API_DeadLetterConfig.md) 物件  
必要：否

 ** [Description](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-Description"></a>
函數的敘述。  
類型：字串  
長度限制：長度下限為 0。長度上限為 256。  
必要：否

 ** [Environment](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-Environment"></a>
環境變數，可在執行期間透過函數程式碼取得。  
類型：[Environment](API_Environment.md) 物件  
必要：否

 ** [EphemeralStorage](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-EphemeralStorage"></a>
函數的 `/tmp` 目錄大小，以 MB 為單位。預設值為 512，但可以是介於 512 和 10,240 MB 之間的任何非負整數。如需詳細資訊，請參閱[設定暫時性儲存 (主控台)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage)。  
類型：[EphemeralStorage](API_EphemeralStorage.md) 物件  
必要：否

 ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-FileSystemConfigs"></a>
Amazon EFS 檔案系統的連線設定。  
類型：[FileSystemConfig](API_FileSystemConfig.md) 物件陣列  
陣列成員：最多 1 個項目。  
必要：否

 ** [Handler](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-Handler"></a>
程式碼中的方法名稱，Lambda 會呼叫此程式碼來執行您的函數。如果部署套件是 .zip 檔案封存，則需要處理常式。格式包含檔案名稱。它也可以包含命名空間和其他限定詞，取決於執行時間。如需詳細資訊，請參閱 [Lambda 程式設計模型](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html)。  
類型：字串  
長度限制：長度上限為 128。  
模式：`[^\s]+`  
必要：否

 ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-ImageConfig"></a>
 [容器映像組態值](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html)，它們會覆寫容器映像 Docker 檔案中的值。  
類型：[ImageConfig](API_ImageConfig.md) 物件  
必要：否

 ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-KMSKeyArn"></a>
AWS Key Management Service (AWS KMS) 客戶受管金鑰的 ARN，用於加密函數的[環境變數](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption)。啟動 [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) 時，Lambda 也會使用此金鑰來加密函數的快照集。如果您使用容器映像部署函數，Lambda 也會在部署函數時使用此金鑰來加密函數。請注意，這與在 Amazon Elastic Container Registry (Amazon ECR) 中用於保護容器映像的金鑰不同。若沒有提供客戶受管金鑰，Lambda 會使用預設服務金鑰。  
類型：String  
模式：`(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()`  
必要：否

 ** [Layers](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-Layers"></a>
要新增到函數執行環境的[函數 Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)。依 ARN 指定每個 layer (包括版本)。  
類型：字串陣列  
長度限制：長度下限為 1。長度上限為 140。  
模式：`arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+`  
必要：否

 ** [LoggingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-LoggingConfig"></a>
該功能的 Amazon CloudWatch 日誌配置設置。  
類型：[LoggingConfig](API_LoggingConfig.md) 物件  
必要：否

 ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-MemorySize"></a>
[可供函數在執行階段使用的記憶體量](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console)。增加函數記憶體也會增加它的 CPU 配置。預設值為 128 MB。該值可以是 1 MB 的任何倍數。  
類型：整數  
有效範圍：最小值為 128。最大值為 10240。  
必要：否

 ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-RevisionId"></a>
只有在修訂版本 ID 符合指定的 ID 時才更新函數。使用此選項來避免修改自您最近一次讀取之後產生變更的函數。  
類型：字串  
必要：否

 ** [Role](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-Role"></a>
函數執行角色的 Amazon Resource Name (ARN)。  
類型：String  
模式：`arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+`  
必要：否

 ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-Runtime"></a>
函數的[執行時間](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)的識別符。如果部署套件是 .zip 檔案封存，則需要執行時間。  
下列清單包含已淘汰的執行時間。如需詳細資訊，請參閱[執行時間淘汰政策](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)。  
類型：字串  
有效值:`nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2 | nodejs18.x | python3.10 | java17 | ruby3.2 | python3.11 | nodejs20.x | provided.al2023 | python3.12 | java21`   
必要：否

 ** [SnapStart](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-SnapStart"></a>
功能的[SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)設定。  
類型：[SnapStart](API_SnapStart.md) 物件  
必要：否

 ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-Timeout"></a>
Lambda 在停止函數前允許函數執行的時間 (以秒為單位)。預設為 3 秒。允許的最大值為 900 秒。如需詳細資訊，請參閱 [Lambda 執行環境](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)。  
類型：整數  
有效範圍：最小值為 1。  
必要：否

 ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-TracingConfig"></a>
將 `Mode` 設為 `Active`，使用 [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) 取樣及追蹤一部分的傳入請求。  
類型：[TracingConfig](API_TracingConfig.md) 物件  
必要：否

 ** [VpcConfig](#API_UpdateFunctionConfiguration_RequestSyntax) **   <a name="lambda-UpdateFunctionConfiguration-request-VpcConfig"></a>
對於 VPC 中 AWS 資源的網路連線，指定 VPC 中安全群組和子網路的清單。將函數連接到 VPC 時，只能透過該 VPC 存取資源和網際網路。如需詳細資訊，請參閱[設定 Lambda 函數以存取 VPC 中的資源](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)。  
類型：[VpcConfig](API_VpcConfig.md) 物件  
必要：否

## 回應語法
<a name="API_UpdateFunctionConfiguration_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "Architectures": [ "string" ],
   "CodeSha256": "string",
   "CodeSize": number,
   "DeadLetterConfig": { 
      "TargetArn": "string"
   },
   "Description": "string",
   "Environment": { 
      "Error": { 
         "ErrorCode": "string",
         "Message": "string"
      },
      "Variables": { 
         "string" : "string" 
      }
   },
   "EphemeralStorage": { 
      "Size": number
   },
   "FileSystemConfigs": [ 
      { 
         "Arn": "string",
         "LocalMountPath": "string"
      }
   ],
   "FunctionArn": "string",
   "FunctionName": "string",
   "Handler": "string",
   "ImageConfigResponse": { 
      "Error": { 
         "ErrorCode": "string",
         "Message": "string"
      },
      "ImageConfig": { 
         "Command": [ "string" ],
         "EntryPoint": [ "string" ],
         "WorkingDirectory": "string"
      }
   },
   "KMSKeyArn": "string",
   "LastModified": "string",
   "LastUpdateStatus": "string",
   "LastUpdateStatusReason": "string",
   "LastUpdateStatusReasonCode": "string",
   "Layers": [ 
      { 
         "Arn": "string",
         "CodeSize": number,
         "SigningJobArn": "string",
         "SigningProfileVersionArn": "string"
      }
   ],
   "LoggingConfig": { 
      "ApplicationLogLevel": "string",
      "LogFormat": "string",
      "LogGroup": "string",
      "SystemLogLevel": "string"
   },
   "MasterArn": "string",
   "MemorySize": number,
   "PackageType": "string",
   "RevisionId": "string",
   "Role": "string",
   "Runtime": "string",
   "RuntimeVersionConfig": { 
      "Error": { 
         "ErrorCode": "string",
         "Message": "string"
      },
      "RuntimeVersionArn": "string"
   },
   "SigningJobArn": "string",
   "SigningProfileVersionArn": "string",
   "SnapStart": { 
      "ApplyOn": "string",
      "OptimizationStatus": "string"
   },
   "State": "string",
   "StateReason": "string",
   "StateReasonCode": "string",
   "Timeout": number,
   "TracingConfig": { 
      "Mode": "string"
   },
   "Version": "string",
   "VpcConfig": { 
      "Ipv6AllowedForDualStack": boolean,
      "SecurityGroupIds": [ "string" ],
      "SubnetIds": [ "string" ],
      "VpcId": "string"
   }
}
```

## 回應元素
<a name="API_UpdateFunctionConfiguration_ResponseElements"></a>

如果動作成功，則服務傳回 HTTP 200 回應。

服務會傳回下列 JSON 格式的資料。

 ** [Architectures](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-Architectures"></a>
函數支援的指令集架構。架構是具有其中一個有效值的字串陣列。預設架構值為 `x86_64`。  
類型：字串陣列  
陣列成員：固定項目數為 1。  
有效值:`x86_64 | arm64` 

 ** [CodeSha256](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-CodeSha256"></a>
函數部署套件的 SHA256 雜湊。  
類型：字串

 ** [CodeSize](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-CodeSize"></a>
函數部署套件的大小 (以位元組為單位)。  
類型：Long

 ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-DeadLetterConfig"></a>
函數的無效字母佇列。  
類型：[DeadLetterConfig](API_DeadLetterConfig.md) 物件

 ** [Description](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-Description"></a>
函數的描述。  
類型：字串  
長度限制：長度下限為 0。長度上限為 256。

 ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-Environment"></a>
函數的[環境變數](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)。從 AWS CloudTrail 日誌中省略。  
類型：[EnvironmentResponse](API_EnvironmentResponse.md) 物件

 ** [EphemeralStorage](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-EphemeralStorage"></a>
函數的 `/tmp` 目錄大小，以 MB 為單位。預設值為 512，但可以是介於 512 和 10,240 MB 之間的任何非負整數。如需詳細資訊，請參閱[設定暫時性儲存 (主控台)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage)。  
類型：[EphemeralStorage](API_EphemeralStorage.md) 物件

 ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-FileSystemConfigs"></a>
[Amazon EFS 檔案系統](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)的連線設定。  
類型：[FileSystemConfig](API_FileSystemConfig.md) 物件陣列  
陣列成員：最多 1 個項目。

 ** [FunctionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-FunctionArn"></a>
函數的 Amazon Resource Name (ARN)。  
類型：String  
模式：`arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?`

 ** [FunctionName](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-FunctionName"></a>
函數的名稱。  
類型：字串  
長度限制：長度下限為 1。長度上限為 170。  
模式：`(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?`

 ** [Handler](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-Handler"></a>
Lambda 為了開始執行您的函數所呼叫的函數。  
類型：字串  
長度限制：長度上限為 128。  
模式：`[^\s]+`

 ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-ImageConfigResponse"></a>
函數的映像組態值。  
類型：[ImageConfigResponse](API_ImageConfigResponse.md) 物件

 ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-KMSKeyArn"></a>
用來加密函數[環境變數](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption)的 AWS KMS key。啟動 [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) 時，也會使用此金鑰來加密函數的快照集。只有在您已設定客戶受管金鑰的情況下，才會傳回此金鑰。  
類型：String  
模式：`(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()`

 ** [LastModified](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-LastModified"></a>
上次更新函數的日期和時間，採用 [ISO-8601](https://www.w3.org/TR/NOTE-datetime) 格式 (YYYY-MM-DDThh:mm:ss.sTZD)。  
類型：字串

 ** [LastUpdateStatus](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-LastUpdateStatus"></a>
對函數執行的上次更新的狀態。這是在函數建立完成後首次設定為 `Successful`。  
類型：字串  
有效值:`Successful | Failed | InProgress` 

 ** [LastUpdateStatusReason](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-LastUpdateStatusReason"></a>
對函數執行的上次更新的原因。  
類型：字串

 ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-LastUpdateStatusReasonCode"></a>
對函數執行的上次更新的原因代碼。  
類型：字串  
有效值:`EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage | KMSKeyAccessDenied | KMSKeyNotFound | InvalidStateKMSKey | DisabledKMSKey | EFSIOError | EFSMountConnectivityError | EFSMountFailure | EFSMountTimeout | InvalidRuntime | InvalidZipFileException | FunctionError` 

 ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-Layers"></a>
函數的[層](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)。  
類型：[Layer](API_Layer.md) 物件陣列

 ** [LoggingConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-LoggingConfig"></a>
該功能的 Amazon CloudWatch 日誌配置設置。  
類型：[LoggingConfig](API_LoggingConfig.md) 物件

 ** [MasterArn](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-MasterArn"></a>
若是 Lambda@Edge 函數，則為主函數的 ARN。  
類型：String  
模式：`arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?`

 ** [MemorySize](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-MemorySize"></a>
可供函數在執行階段使用的記憶體量。  
類型：整數  
有效範圍：最小值為 128。最大值為 10240。

 ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-PackageType"></a>
部署套件的類型。針對容器影像設定為 `Image`，並針對 .zip 檔案封存設定 `Zip`。  
類型：字串  
有效值:`Zip | Image` 

 ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-RevisionId"></a>
函數或別名的最新更新修訂版。  
類型：字串

 ** [Role](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-Role"></a>
函數的執行角色。  
類型：String  
模式：`arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+`

 ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-Runtime"></a>
函數的[執行時間](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)的識別符。如果部署套件是 .zip 檔案封存，則需要執行時間。  
下列清單包含已淘汰的執行時間。如需詳細資訊，請參閱[執行時間淘汰政策](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)。  
類型：字串  
有效值:`nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2 | nodejs18.x | python3.10 | java17 | ruby3.2 | python3.11 | nodejs20.x | provided.al2023 | python3.12 | java21` 

 ** [RuntimeVersionConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-RuntimeVersionConfig"></a>
執行階段的 ARN 和任何發生的錯誤。  
類型：[RuntimeVersionConfig](API_RuntimeVersionConfig.md) 物件

 ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-SigningJobArn"></a>
簽署任務的 ARN。  
類型：String  
模式：`arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)`

 ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-SigningProfileVersionArn"></a>
簽署描述檔版本的 ARN。  
類型：String  
模式：`arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)`

 ** [SnapStart](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-SnapStart"></a>
將 `ApplyOn` 設為 `PublishedVersions`，即可在您發佈函數版本時建立初始化執行環境的快照。如需詳細資訊，請參閱[使用 Lambda 改善啟動效能 SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)。  
類型：[SnapStartResponse](API_SnapStartResponse.md) 物件

 ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-State"></a>
函數目前的狀態。當狀態為 `Inactive` 時，您可以透過調用它來重新激活該函數。  
類型：字串  
有效值:`Pending | Active | Inactive | Failed` 

 ** [StateReason](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-StateReason"></a>
函數目前狀態的原因。  
類型：字串

 ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-StateReasonCode"></a>
函數目前狀態的原因代碼。當代碼為 `Creating` 時，則無法調用或修改函數。  
類型：字串  
有效值:`Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage | KMSKeyAccessDenied | KMSKeyNotFound | InvalidStateKMSKey | DisabledKMSKey | EFSIOError | EFSMountConnectivityError | EFSMountFailure | EFSMountTimeout | InvalidRuntime | InvalidZipFileException | FunctionError` 

 ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-Timeout"></a>
Lambda 在停止函數前允許函數執行的時間 (以秒為單位)。  
類型：整數  
有效範圍：最小值為 1。

 ** [TracingConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-TracingConfig"></a>
函數的 AWS X-Ray 追蹤組態。  
類型：[TracingConfigResponse](API_TracingConfigResponse.md) 物件

 ** [Version](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-Version"></a>
Lambda 函數的版本。  
類型：字串  
長度限制：長度下限為 1。長度上限為 1024。  
模式：`(\$LATEST|[0-9]+)`

 ** [VpcConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) **   <a name="lambda-UpdateFunctionConfiguration-response-VpcConfig"></a>
函數的聯網設定。  
類型：[VpcConfigResponse](API_VpcConfigResponse.md) 物件

## 錯誤
<a name="API_UpdateFunctionConfiguration_Errors"></a>

如需所有動作常見錯誤的資訊，請參閱[常見錯誤](CommonErrors.md)。

 ** CodeSigningConfigNotFoundException **   
指定的程式碼簽署組態不存在。  
HTTP 狀態碼：404

 ** CodeVerificationFailedException **   
程式碼簽章無法進行一個或多個驗證檢查，因為簽章不符或到期，程式碼簽署政策設定為 ENFORCE。Lambda 會阻止部署。  
HTTP 狀態碼：400

 ** InvalidCodeSignatureException **   
程式碼簽章無法進行完整性檢查。如果完整性檢查失敗，即使程式碼簽署政策設定為 WARN，Lambda 仍會阻止部署。  
HTTP 狀態碼：400

 ** InvalidParameterValueException **   
請求中的其中一個參數無效。  
HTTP 狀態碼：400

 ** PreconditionFailedException **   
 RevisionId 提供的與 Lambda 函數或別名 RevisionId 的最新版本不相符。呼叫`GetFunction`或 `GetAlias` API 作業以擷取資源 RevisionId 的最新資源。  
HTTP 狀態碼：412

 ** ResourceConflictException **   
資源已存在，或另一個操作正在進行中。  
HTTP 狀態碼：409

 ** ResourceNotFoundException **   
請求中指定的資源不存在。  
HTTP 狀態碼：404

 ** ServiceException **   
AWS Lambda 服務發生內部錯誤。  
HTTP 狀態碼：500

 ** TooManyRequestsException **   
超出請求輸送量限制。如需詳細資訊，請參閱 [Lambda 配額](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests)。  
HTTP 狀態碼：429

## 另請參閱
<a name="API_UpdateFunctionConfiguration_SeeAlso"></a>

如需在語言特定的 AWS 開發套件之一中使用此 API 的詳細資訊，請參閱下列說明：
+  [AWS 命令列介面](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionConfiguration) 
+  [適用於 .NET 的 AWS 軟體開發套件](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionConfiguration) 
+  [適用於 C\$1\$1 的 AWS 開發套件](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionConfiguration) 
+  [適用於 Go 的 AWS 軟體開發套件](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionConfiguration) 
+  [適用於 Java 的 AWS 軟體開發套件第 2 版](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) 
+  [AWS適用於 JavaScript V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/lambda-2015-03-31/UpdateFunctionConfiguration) 
+  [適用於 PHP 的 AWS 軟體開發套件第 3 版](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionConfiguration) 
+  [適用於 Python 的 AWS 開發套件](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) 
+  [適用於 Ruby 的 AWS 軟體開發套件第 3 版](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionConfiguration) 