id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
28f61ce9ac29-0
**EC2AccessDeniedException** Need additional permissions to configure VPC settings\. HTTP Status Code: 502 **EC2ThrottledException** AWS Lambda was throttled by Amazon EC2 during Lambda function initialization using the execution role provided for the Lambda function\. HTTP Status Code: 502 **EC2UnexpectedException** AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function\. HTTP Status Code: 502 **EFSIOException** An error occured when reading from or writing to a connected file system\. HTTP Status Code: 410 **EFSMountConnectivityException** The function couldn't make a network connection to the configured file system\. HTTP Status Code: 408 **EFSMountFailureException** The function couldn't mount the configured file system due to a permission or configuration issue\. HTTP Status Code: 403 **EFSMountTimeoutException** The function was able to make a network connection to the configured file system, but the mount operation timed out\. HTTP Status Code: 408 **ENILimitReachedException** AWS Lambda was not able to create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached\. HTTP Status Code: 502
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Invoke.md
28f61ce9ac29-1
HTTP Status Code: 502 **InvalidParameterValueException** One of the parameters in the request is invalid\. HTTP Status Code: 400 **InvalidRequestContentException** The request body could not be parsed as JSON\. HTTP Status Code: 400 **InvalidRuntimeException** The runtime or runtime version specified is not supported\. HTTP Status Code: 502 **InvalidSecurityGroupIDException** The Security Group ID provided in the Lambda function VPC configuration is invalid\. HTTP Status Code: 502 **InvalidSubnetIDException** The Subnet ID provided in the Lambda function VPC configuration is invalid\. HTTP Status Code: 502 **InvalidZipFileException** AWS Lambda could not unzip the deployment package\. HTTP Status Code: 502 **KMSAccessDeniedException** Lambda was unable to decrypt the environment variables because KMS access was denied\. Check the Lambda function's KMS permissions\. HTTP Status Code: 502 **KMSDisabledException** Lambda was unable to decrypt the environment variables because the KMS key used is disabled\. Check the Lambda function's KMS key settings\. HTTP Status Code: 502 **KMSInvalidStateException**
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Invoke.md
28f61ce9ac29-2
HTTP Status Code: 502 **KMSInvalidStateException** Lambda was unable to decrypt the environment variables because the KMS key used is in an invalid state for Decrypt\. Check the function's KMS key settings\. HTTP Status Code: 502 **KMSNotFoundException** Lambda was unable to decrypt the environment variables because the KMS key was not found\. Check the function's KMS key settings\. HTTP Status Code: 502 **RequestTooLargeException** The request payload exceeded the `Invoke` request body JSON input limit\. For more information, see [Limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html)\. HTTP Status Code: 413 **ResourceConflictException** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 **ResourceNotFoundException** The resource specified in the request does not exist\. HTTP Status Code: 404 **ResourceNotReadyException** The function is inactive and its VPC connection is no longer available\. Wait for the VPC connection to reestablish and try again\. HTTP Status Code: 502 **ServiceException** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Invoke.md
28f61ce9ac29-3
**ServiceException** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 **SubnetIPAddressLimitReachedException** AWS Lambda was not able to set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses\. HTTP Status Code: 502 **TooManyRequestsException** The request throughput limit was exceeded\. HTTP Status Code: 429 **UnsupportedMediaTypeException** The content type of the `Invoke` request body is not JSON\. HTTP Status Code: 415
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Invoke.md
bb17f5ac4a04-0
For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/Invoke) + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/Invoke) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Invoke) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Invoke) + [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/Invoke) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/Invoke) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/Invoke)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Invoke.md
bb17f5ac4a04-1
+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Invoke.md
fc7451a13d08-0
You can use AWS Lambda functions to evaluate whether your AWS resource configurations comply with your custom Config rules\. As resources are created, deleted, or changed, AWS Config records these changes and sends the information to your Lambda functions\. Your Lambda functions then evaluate the changes and report results to AWS Config\. You can then use AWS Config to assess overall resource compliance: you can learn which resources are noncompliant and which configuration attributes are the cause of noncompliance\. **Example AWS Config message event** ``` {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-config.md
fc7451a13d08-1
**Example AWS Config message event** ``` { "invokingEvent": "{\"configurationItem\":{\"configurationItemCaptureTime\":\"2016-02-17T01:36:34.043Z\",\"awsAccountId\":\"000000000000\",\"configurationItemStatus\":\"OK\",\"resourceId\":\"i-00000000\",\"ARN\":\"arn:aws:ec2:us-east-1:000000000000:instance/i-00000000\",\"awsRegion\":\"us-east-1\",\"availabilityZone\":\"us-east-1a\",\"resourceType\":\"AWS::EC2::Instance\",\"tags\":{\"Foo\":\"Bar\"},\"relationships\":[{\"resourceId\":\"eipalloc-00000000\",\"resourceType\":\"AWS::EC2::EIP\",\"name\":\"Is attached to ElasticIp\"}],\"configuration\":{\"foo\":\"bar\"}},\"messageType\":\"ConfigurationItemChangeNotification\"}", "ruleParameters": "{\"myParameterKey\":\"myParameterValue\"}",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-config.md
fc7451a13d08-2
"ruleParameters": "{\"myParameterKey\":\"myParameterValue\"}", "resultToken": "myResultToken", "eventLeftScope": false, "executionRoleArn": "arn:aws:iam::012345678912:role/config-role", "configRuleArn": "arn:aws:config:us-east-1:012345678912:config-rule/config-rule-0123456", "configRuleName": "change-triggered-config-rule", "configRuleId": "config-rule-0123456", "accountId": "012345678912", "version": "1.0" } ``` For more information, see [Evaluating resources with AWS Config rules](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-config.md
9e3391402573-0
Cloud security at AWS is the highest priority\. As an AWS customer, you benefit from a data center and network architecture that is built to meet the requirements of the most security\-sensitive organizations\. Security is a shared responsibility between AWS and you\. The [shared responsibility model](http://aws.amazon.com/compliance/shared-responsibility-model/) describes this as security *of* the cloud and security *in* the cloud: + **Security of the cloud** – AWS is responsible for protecting the infrastructure that runs AWS services in the AWS Cloud\. AWS also provides you with services that you can use securely\. Third\-party auditors regularly test and verify the effectiveness of our security as part of the [AWS compliance programs](http://aws.amazon.com/compliance/programs/)\. To learn about the compliance programs that apply to AWS Lambda, see [AWS Services in Scope by Compliance Program](http://aws.amazon.com/compliance/services-in-scope/)\. + **Security in the cloud** – Your responsibility is determined by the AWS service that you use\. You are also responsible for other factors including the sensitivity of your data, your company’s requirements, and applicable laws and regulations\. This documentation helps you understand how to apply the shared responsibility model when using Lambda\. The following topics show you how to configure Lambda to meet your security and compliance objectives\. You also learn how to use other AWS services that help you to monitor and secure your Lambda resources\. **Topics** + [Data protection in AWS Lambda](security-dataprotection.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-security.md
9e3391402573-1
**Topics** + [Data protection in AWS Lambda](security-dataprotection.md) + [Identity and access management for AWS Lambda](security-iam.md) + [Compliance validation for AWS Lambda](security-compliance.md) + [Resilience in AWS Lambda](security-resilience.md) + [Infrastructure security in AWS Lambda](security-infrastructure.md) + [Configuration and vulnerability analysis in AWS Lambda](security-configuration.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-security.md
c0afdfa6dfc3-0
A function's environment variable settings\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Environment.md
7961fa4709a4-0
**Variables** <a name="SSS-Type-Environment-Variables"></a> Environment variable key\-value pairs\. Type: String to string map Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` Required: No
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Environment.md
ec9cb27ce094-0
For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Environment) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Environment) + [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/Environment) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Environment.md
df15b5c68b7a-0
When you create or update a function, Lambda provisions the compute and networking resources that enable it to run\. In most cases, this process is very fast, and your function is ready to be invoked or modified right away\. If you configure your function to connect to a virtual private cloud \(VPC\), the process can take longer\. When you first connect a function to a VPC, Lambda provisions network interfaces, which takes about a minute\. To communicate the current state of your function, Lambda includes additional fields in the [function configuration](API_FunctionConfiguration.md) document that is returned by several Lambda API actions\. When you create a function, the function is initially in the `Pending` state\. When the function is ready to be invoked, the state changes from `Pending` to `Active`\. While the state is `Pending`, invocations and other API actions that operate on the function return an error\. If you build automation around creating and updating functions, wait for the function to become active before performing additional actions that operate on the function\. You can use the Lambda API to get information about a function's state\. State information is included in the [FunctionConfiguration](API_FunctionConfiguration.md) document returned by several API actions\. To view the function's state with the AWS CLI, use the `get-function-configuration` command\. ``` $ aws lambda get-function-configuration --function-name my-function { "FunctionName": "my-function",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/functions-states.md
df15b5c68b7a-1
$ aws lambda get-function-configuration --function-name my-function { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", "Runtime": "nodejs12.x", "Role": "arn:aws:iam::123456789012:role/lambda-role", "TracingConfig": { "Mode": "Active" }, "State": "Pending", "StateReason": "The function is being created.", "StateReasonCode": "Creating", ... } ``` The `StateReason` and `StateReasonCode` contain additional information about the state when it is not `Active`\. The following operations fail while function creation is pending: + [Invoke](API_Invoke.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [PublishVersion](API_PublishVersion.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/functions-states.md
df15b5c68b7a-2
+ [PublishVersion](API_PublishVersion.md) When you update a function's configuration, the update can trigger an asynchronous operation to provision resources\. While this is in progress, you can invoke the function, but other operations on the function fail\. Invocations that occur while the update is in progress run against the previous configuration\. The function's state is `Active`, but its `LastUpdateStatus` is `InProgress`\. **Example Function configuration – Connecting to a VPC** ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", "Runtime": "nodejs12.x", "VpcConfig": { "SubnetIds": [ "subnet-071f712345678e7c8", "subnet-07fd123456788a036", "subnet-0804f77612345cacf" ], "SecurityGroupIds": [ "sg-085912345678492fb" ], "VpcId": "vpc-08e1234569e011e83" }, "State": "Active",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/functions-states.md
df15b5c68b7a-3
}, "State": "Active", "LastUpdateStatus": "InProgress", ... } ``` The following operations fail while an asynchronous update is in progress: + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [PublishVersion](API_PublishVersion.md) Other operations, including invocation, work while updates are in progress\. For example, when you connect your function to a virtual private cloud \(VPC\), Lambda provisions an elastic network interface for each subnet\. This process can leave your function in a pending state for a minute or so\. Lambda also reclaims network interfaces that are not in use, placing your function in an `Inactive` state\. When the function is inactive, an invocation causes it to enter the `Pending` state while network access is restored\. The invocation that triggers restoration, and further invocations while the operation is pending, fail with `ResourceNotReadyException`\. If Lambda encounters an error when restoring a function's network interface, the function goes back to the `Inactive` state\. The next invocation can trigger another attempt\. For some configuration errors, Lambda waits at least 5 minutes before attempting to create another network interface\. These errors have the following `LastUpdateStatusReasonCode` values: + `InsufficientRolePermission` – Role doesn't exist or is missing permissions\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/functions-states.md
df15b5c68b7a-4
+ `InsufficientRolePermission` – Role doesn't exist or is missing permissions\. + `SubnetOutOfIPAddresses` – All IP addresses in a subnet are in use\. For more information on how states work with VPC connectivity, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/functions-states.md
68d88cc6adee-0
Modify the version\-specific settings of a Lambda function\. When you update a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute\. During this time, you can't modify the function, but you can still invoke it\. The `LastUpdateStatus`, `LastUpdateStatusReason`, and `LastUpdateStatusReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the update is complete and the function is processing events with the new configuration\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. These settings can vary between versions of a function and are locked when you publish a version\. You can't modify the configuration of a published version, only the unpublished version\. To configure function concurrency, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. To grant invoke permissions to an account or AWS service, use [AddPermission](API_AddPermission.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
0135877b7379-0
``` PUT /2015-03-31/functions/FunctionName/configuration HTTP/1.1 Content-type: application/json { "DeadLetterConfig": { "TargetArn": "string" }, "Description": "string", "Environment": { "Variables": { "string" : "string" } }, "FileSystemConfigs": [ { "Arn": "string", "LocalMountPath": "string" } ], "Handler": "string", "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, "RevisionId": "string", "Role": "string", "Runtime": "string", "Timeout": number, "TracingConfig": { "Mode": "string" }, "VpcConfig": { "SecurityGroupIds": [ "string" ], "SubnetIds": [ "string" ] } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
840f3b986f49-0
The request uses the following URI parameters\. ** [FunctionName](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-FunctionName"></a> The name of the Lambda function\. **Name formats** + **Function name** \- `my-function`\. + **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(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-_]+))?` Required: Yes
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
06aa97c501fd-0
The request accepts the following data in JSON format\. ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-DeadLetterConfig"></a> A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. Type: [DeadLetterConfig](API_DeadLetterConfig.md) object Required: No ** [Description](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-Description"></a> A description of the function\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No ** [Environment](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-Environment"></a> Environment variables that are accessible from function code during execution\. Type: [Environment](API_Environment.md) object Required: No
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
06aa97c501fd-1
Environment variables that are accessible from function code during execution\. Type: [Environment](API_Environment.md) object Required: No ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-FileSystemConfigs"></a> Connection settings for an Amazon EFS file system\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No ** [Handler](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-Handler"></a> The name of the method within your code that Lambda calls to execute your function\. The format includes the file name\. It can also include namespaces and other qualifiers, depending on the runtime\. For more information, see [Programming Model](https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html)\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` Required: No
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
06aa97c501fd-2
Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` Required: No ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-KMSKeyArn"></a> The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` Required: No ** [Layers](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-Layers"></a> A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment\. Specify each layer by its ARN, including the version\. Type: Array of strings Length Constraints: Minimum length of 1\. Maximum length of 140\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
06aa97c501fd-3
Type: Array of strings Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` Required: No ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-MemorySize"></a> The amount of memory that your function has access to\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value must be a multiple of 64 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 3008\. Required: No ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-RevisionId"></a> Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid modifying a function that has changed since you last read it\. Type: String Required: No ** [Role](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-Role"></a>
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
06aa97c501fd-4
The Amazon Resource Name \(ARN\) of the function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-Runtime"></a> The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-Timeout"></a> The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. Type: Integer
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
06aa97c501fd-5
Type: Integer Valid Range: Minimum value of 1\. Required: No ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-TracingConfig"></a> Set `Mode` to `Active` to sample and trace a subset of incoming requests with AWS X\-Ray\. Type: [TracingConfig](API_TracingConfig.md) object Required: No ** [VpcConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** <a name="SSS-UpdateFunctionConfiguration-request-VpcConfig"></a> For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC\. When you connect a function to a VPC, it can only access resources and the internet through that VPC\. For more information, see [VPC Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)\. Type: [VpcConfig](API_VpcConfig.md) object Required: No
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
62f4f0052032-0
``` HTTP/1.1 200 Content-type: application/json { "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { "TargetArn": "string" }, "Description": "string", "Environment": { "Error": { "ErrorCode": "string", "Message": "string" }, "Variables": { "string" : "string" } }, "FileSystemConfigs": [ { "Arn": "string", "LocalMountPath": "string" } ], "FunctionArn": "string", "FunctionName": "string", "Handler": "string", "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", "LastUpdateStatusReason": "string", "LastUpdateStatusReasonCode": "string", "Layers": [ { "Arn": "string", "CodeSize": number
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
62f4f0052032-1
"Layers": [ { "Arn": "string", "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, "RevisionId": "string", "Role": "string", "Runtime": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", "Timeout": number, "TracingConfig": { "Mode": "string" }, "Version": "string", "VpcConfig": { "SecurityGroupIds": [ "string" ], "SubnetIds": [ "string" ], "VpcId": "string" } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
7dfedfb17c6d-0
If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. ** [CodeSha256](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-CodeSha256"></a> The SHA256 hash of the function's deployment package\. Type: String ** [CodeSize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-CodeSize"></a> The size of the function's deployment package, in bytes\. Type: Long ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-DeadLetterConfig"></a> The function's dead letter queue\. Type: [DeadLetterConfig](API_DeadLetterConfig.md) object ** [Description](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-Description"></a> The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
7dfedfb17c6d-1
The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-Environment"></a> The function's environment variables\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-FileSystemConfigs"></a> Connection settings for an Amazon EFS file system\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. ** [FunctionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-FunctionArn"></a> The function's Amazon Resource Name \(ARN\)\. Type: String
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
7dfedfb17c6d-2
The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `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="SSS-UpdateFunctionConfiguration-response-FunctionName"></a> The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(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="SSS-UpdateFunctionConfiguration-response-Handler"></a>
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
7dfedfb17c6d-3
The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-KMSKeyArn"></a> The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` ** [LastModified](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-LastModified"></a> The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String ** [LastUpdateStatus](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-LastUpdateStatus"></a>
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
7dfedfb17c6d-4
The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` ** [LastUpdateStatusReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-LastUpdateStatusReason"></a> The reason for the last update that was performed on the function\. Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-LastUpdateStatusReasonCode"></a> The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-Layers"></a> The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
7dfedfb17c6d-5
The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Type: Array of [Layer](API_Layer.md) objects ** [MasterArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-MasterArn"></a> For Lambda@Edge functions, the ARN of the master function\. Type: String Pattern: `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="SSS-UpdateFunctionConfiguration-response-MemorySize"></a> The memory that's allocated to the function\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-RevisionId"></a>
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
7dfedfb17c6d-6
The latest updated revision of the function or alias\. Type: String ** [Role](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-Role"></a> The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-Runtime"></a> The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-State"></a>
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
7dfedfb17c6d-7
The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` ** [StateReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-StateReason"></a> The reason for the function's current state\. Type: String ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-StateReasonCode"></a> The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-Timeout"></a> The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
7dfedfb17c6d-8
The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. ** [TracingConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-TracingConfig"></a> The function's AWS X\-Ray tracing configuration\. Type: [TracingConfigResponse](API_TracingConfigResponse.md) object ** [Version](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-Version"></a> The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` ** [VpcConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** <a name="SSS-UpdateFunctionConfiguration-response-VpcConfig"></a> The function's networking configuration\. Type: [VpcConfigResponse](API_VpcConfigResponse.md) object
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
81968da79696-0
**InvalidParameterValueException** One of the parameters in the request is invalid\. HTTP Status Code: 400 **PreconditionFailedException** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 **ResourceConflictException** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 **ResourceNotFoundException** The resource specified in the request does not exist\. HTTP Status Code: 404 **ServiceException** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 **TooManyRequestsException** The request throughput limit was exceeded\. HTTP Status Code: 429
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
ec9df65dc02a-0
For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
ec9df65dc02a-1
+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionConfiguration)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionConfiguration.md
c76a7aec41ca-0
Updates a Lambda function's code\. The function's code is locked when you publish a version\. You can't modify the code of a published version, only the unpublished version\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
57e8e3559bc8-0
``` PUT /2015-03-31/functions/FunctionName/code HTTP/1.1 Content-type: application/json { "DryRun": boolean, "Publish": boolean, "RevisionId": "string", "S3Bucket": "string", "S3Key": "string", "S3ObjectVersion": "string", "ZipFile": blob } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
77d6eed35fbb-0
The request uses the following URI parameters\. ** [FunctionName](#API_UpdateFunctionCode_RequestSyntax) ** <a name="SSS-UpdateFunctionCode-request-FunctionName"></a> The name of the Lambda function\. **Name formats** + **Function name** \- `my-function`\. + **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(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-_]+))?` Required: Yes
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
d606963c0f2c-0
The request accepts the following data in JSON format\. ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** <a name="SSS-UpdateFunctionCode-request-DryRun"></a> Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean Required: No ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** <a name="SSS-UpdateFunctionCode-request-Publish"></a> Set to true to publish a new version of the function after updating the code\. This has the same effect as calling [PublishVersion](API_PublishVersion.md) separately\. Type: Boolean Required: No ** [RevisionId](#API_UpdateFunctionCode_RequestSyntax) ** <a name="SSS-UpdateFunctionCode-request-RevisionId"></a> Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid modifying a function that has changed since you last read it\. Type: String Required: No ** [S3Bucket](#API_UpdateFunctionCode_RequestSyntax) ** <a name="SSS-UpdateFunctionCode-request-S3Bucket"></a> An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
d606963c0f2c-1
An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Type: String Length Constraints: Minimum length of 3\. Maximum length of 63\. Pattern: `^[0-9A-Za-z\.\-_]*(?<!\.)$` Required: No ** [S3Key](#API_UpdateFunctionCode_RequestSyntax) ** <a name="SSS-UpdateFunctionCode-request-S3Key"></a> The Amazon S3 key of the deployment package\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No ** [S3ObjectVersion](#API_UpdateFunctionCode_RequestSyntax) ** <a name="SSS-UpdateFunctionCode-request-S3ObjectVersion"></a> For versioned objects, the version of the deployment package object to use\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No ** [ZipFile](#API_UpdateFunctionCode_RequestSyntax) ** <a name="SSS-UpdateFunctionCode-request-ZipFile"></a> The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
d606963c0f2c-2
The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\. Type: Base64\-encoded binary data object Required: No
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
aa50a435c95d-0
``` HTTP/1.1 200 Content-type: application/json { "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { "TargetArn": "string" }, "Description": "string", "Environment": { "Error": { "ErrorCode": "string", "Message": "string" }, "Variables": { "string" : "string" } }, "FileSystemConfigs": [ { "Arn": "string", "LocalMountPath": "string" } ], "FunctionArn": "string", "FunctionName": "string", "Handler": "string", "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", "LastUpdateStatusReason": "string", "LastUpdateStatusReasonCode": "string", "Layers": [ { "Arn": "string", "CodeSize": number
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
aa50a435c95d-1
"Layers": [ { "Arn": "string", "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, "RevisionId": "string", "Role": "string", "Runtime": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", "Timeout": number, "TracingConfig": { "Mode": "string" }, "Version": "string", "VpcConfig": { "SecurityGroupIds": [ "string" ], "SubnetIds": [ "string" ], "VpcId": "string" } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
223438148030-0
If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. ** [CodeSha256](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-CodeSha256"></a> The SHA256 hash of the function's deployment package\. Type: String ** [CodeSize](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-CodeSize"></a> The size of the function's deployment package, in bytes\. Type: Long ** [DeadLetterConfig](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-DeadLetterConfig"></a> The function's dead letter queue\. Type: [DeadLetterConfig](API_DeadLetterConfig.md) object ** [Description](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-Description"></a> The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
223438148030-1
The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-Environment"></a> The function's environment variables\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-FileSystemConfigs"></a> Connection settings for an Amazon EFS file system\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. ** [FunctionArn](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-FunctionArn"></a> The function's Amazon Resource Name \(ARN\)\. Type: String
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
223438148030-2
The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `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_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-FunctionName"></a> The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(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_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-Handler"></a> The function that Lambda calls to begin executing your function\. Type: String
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
223438148030-3
The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-KMSKeyArn"></a> The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` ** [LastModified](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-LastModified"></a> The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String ** [LastUpdateStatus](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-LastUpdateStatus"></a>
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
223438148030-4
The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` ** [LastUpdateStatusReason](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-LastUpdateStatusReason"></a> The reason for the last update that was performed on the function\. Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-LastUpdateStatusReasonCode"></a> The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-Layers"></a> The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Type: Array of [Layer](API_Layer.md) objects
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
223438148030-5
Type: Array of [Layer](API_Layer.md) objects ** [MasterArn](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-MasterArn"></a> For Lambda@Edge functions, the ARN of the master function\. Type: String Pattern: `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_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-MemorySize"></a> The memory that's allocated to the function\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-RevisionId"></a> The latest updated revision of the function or alias\. Type: String
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
223438148030-6
The latest updated revision of the function or alias\. Type: String ** [Role](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-Role"></a> The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-Runtime"></a> The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-State"></a> The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
223438148030-7
The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` ** [StateReason](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-StateReason"></a> The reason for the function's current state\. Type: String ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-StateReasonCode"></a> The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-Timeout"></a> The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
223438148030-8
The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. ** [TracingConfig](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-TracingConfig"></a> The function's AWS X\-Ray tracing configuration\. Type: [TracingConfigResponse](API_TracingConfigResponse.md) object ** [Version](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-Version"></a> The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` ** [VpcConfig](#API_UpdateFunctionCode_ResponseSyntax) ** <a name="SSS-UpdateFunctionCode-response-VpcConfig"></a> The function's networking configuration\. Type: [VpcConfigResponse](API_VpcConfigResponse.md) object
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
434cb7ffc9a9-0
**CodeStorageExceededException** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) HTTP Status Code: 400 **InvalidParameterValueException** One of the parameters in the request is invalid\. HTTP Status Code: 400 **PreconditionFailedException** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 **ResourceConflictException** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 **ResourceNotFoundException** The resource specified in the request does not exist\. HTTP Status Code: 404 **ServiceException** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 **TooManyRequestsException** The request throughput limit was exceeded\. HTTP Status Code: 429
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
08543b9247f4-0
For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionCode)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
08543b9247f4-1
+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionCode)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UpdateFunctionCode.md
1b61286340d3-0
You can use the AWS SDK for \.NET to manage Amazon EC2 spot instances with C\# code\. The SDK enables you to use the Amazon EC2 API to create spot instance requests, determine when the request is fulfilled, delete requests, and identify the instances created\. This tutorial provides code that performs these tasks and a sample application that you can run locally or on AWS\. It includes a sample project that you can deploy to AWS Lambda's \.NET Core 2\.1 runtime\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-ec2spot.png) For more information about spot instances usage and best practices, see [Spot Instances](https://docs.aws.amazon.com/AWSEC2/latest/DeveloperGuide/using-spot-instances.html) in the Amazon EC2 user guide\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
846af0a2b656-0
To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command this is output ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. This tutorial uses code from the developer guide's GitHub repository\. The repository also contains helper scripts and configuration files that are needed to follow its procedures\. Clone the repository at [github\.com/awsdocs/aws\-lambda\-developer\-guide](https://github.com/awsdocs/aws-lambda-developer-guide)\. To use the sample code you need the following tools: + **AWS CLI** – To deploy the sample application to AWS, install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. The AWS CLI also provides credentials to the sample code when you run it locally\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
846af0a2b656-1
+ **\.NET Core CLI** – To run and test the code locally, install the [\.NET Core SDK 2\.1](https://dotnet.microsoft.com/download/dotnet-core/2.1)\. + **Lambda \.NET Core Global Tool** – To build the deployment package for Lambda, install the [\.NET Core global tool](https://dotnet.microsoft.com/download/dotnet-core/2.1) with the \.NET Core CLI\. ``` $ dotnet tool install -g [Amazon\.Lambda\.Tools](https://www.nuget.org/packages/Amazon.Lambda.Tools) ``` The code in this tutorial manages spot requests that launch Amazon EC2 instances\. To run the code locally, you need SDK credentials with permission to use the following APIs\. + `ec2:RequestSpotInstance` + `ec2:GetSpotRequestState` + `ec2:CancelSpotRequest` + `ec2:TerminateInstances` To run the sample application in AWS, you need [permission to use Lambda](lambda-permissions.md) and the following services\. + [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) \([pricing](https://aws.amazon.com/cloudformation/pricing/)\)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
846af0a2b656-2
+ [Amazon Elastic Compute Cloud](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-policies-for-amazon-ec2.html) \([pricing](https://aws.amazon.com/ec2/pricing/)\) Standard charges apply for each service\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
3b36c79497cb-0
Locate the sample project in the guide repository under [sample\-apps/ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot)\. This directory contains Lambda function code, tests, project files, scripts, and a AWS CloudFormation template\. The `Function` class includes a `FunctionHandler` method that calls other methods to create spot requests, check their status, and clean up\. It creates an Amazon EC2 client with the AWS SDK for \.NET in a static constructor to allow it to be used throughout the class\. **Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** ``` using Amazon.EC2; ... public class Function { private static AmazonEC2Client ec2Client; static Function() { AWSSDKHandler.RegisterXRayForAllServices(); ec2Client = new AmazonEC2Client(); } public async Task<string> FunctionHandler(Dictionary<string, string> input, ILambdaContext context) {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
3b36c79497cb-1
} public async Task<string> FunctionHandler(Dictionary<string, string> input, ILambdaContext context) { // More AMI IDs: [aws\.amazon\.com/amazon\-linux\-2/release\-notes/](https://aws.amazon.com/amazon-linux-2/release-notes/) // us-east-2 HVM EBS-Backed 64-bit Amazon Linux 2 string ami = "ami-09d9edae5eb90d556"; string sg = "default"; [InstanceType](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/EC2/TInstanceType.html) type = InstanceType.T3aNano; string price = "0.003"; int count = 1; var requestSpotInstances = await RequestSpotInstance(ami, sg, type, price, count); var spotRequestId = requestSpotInstances.SpotInstanceRequests[0].SpotInstanceRequestId; ``` The `RequestSpotInstance` method creates a spot instance request\. **Example [Function\.cs – RequestSpotInstance](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/ec2-spot/src/ec2spot/Function.cs#L59)**
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
3b36c79497cb-2
``` using Amazon; using Amazon.Util; using Amazon.EC2; using Amazon.EC2.Model; ... public async Task<RequestSpotInstancesResponse> RequestSpotInstance( string amiId, string securityGroupName, InstanceType instanceType, string spotPrice, int instanceCount) { var request = new RequestSpotInstancesRequest(); var launchSpecification = new [LaunchSpecification](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotLaunchSpecification.html)(); launchSpecification.ImageId = amiId; launchSpecification.InstanceType = instanceType; launchSpecification.SecurityGroups.Add(securityGroupName); request.SpotPrice = spotPrice; request.InstanceCount = instanceCount; request.LaunchSpecification = launchSpecification; RequestSpotInstancesResponse response = await ec2Client.RequestSpotInstancesAsync(request); return response; } ... ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
3b36c79497cb-3
return response; } ... ``` Next, you need to wait until the spot request reaches the `Active` state before proceeding to the last step\. To determine the state of your spot request, use the [DescribeSpotInstanceRequests](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/EC2/TDescribeSpotInstanceRequestsRequest.html) method to obtain the state of the spot request ID to monitor\. ``` public async Task<SpotInstanceRequest> GetSpotRequest(string spotRequestId) { var request = new DescribeSpotInstanceRequestsRequest(); request.SpotInstanceRequestIds.Add(spotRequestId); var describeResponse = await ec2Client.DescribeSpotInstanceRequestsAsync(request); return describeResponse.SpotInstanceRequests[0]; } ``` The final step is to clean up your requests and instances\. It is important to both cancel any outstanding requests and terminate any instances\. Just canceling your requests will not terminate your instances, which means that you will continue to be charged for them\. If you terminate your instances, your Spot requests may be canceled, but there are some scenarios, such as if you use persistent requests, where terminating your instances is not sufficient to stop your request from being re\-fulfilled\. Therefore, it is a best practice to both cancel any active requests and terminate any running instances\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
3b36c79497cb-4
You use the [CancelSpotInstanceRequests](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/EC2/MEC2CancelSpotInstanceRequestsCancelSpotInstanceRequestsRequest.html) method to cancel a Spot request\. The following example demonstrates how to cancel a Spot request\. ``` public async Task CancelSpotRequest(string spotRequestId) { Console.WriteLine("Canceling request " + spotRequestId); var cancelRequest = new CancelSpotInstanceRequestsRequest(); cancelRequest.SpotInstanceRequestIds.Add(spotRequestId); await ec2Client.CancelSpotInstanceRequestsAsync(cancelRequest); } ``` You use the [TerminateInstances](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/EC2/MEC2TerminateInstancesTerminateInstancesRequest.html) method to terminate an instance\. ``` public async Task TerminateSpotInstance(string instanceId) { Console.WriteLine("Terminating instance " + instanceId); var terminateRequest = new TerminateInstancesRequest(); terminateRequest.InstanceIds = new List<string>() { instanceId }; try {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
3b36c79497cb-5
terminateRequest.InstanceIds = new List<string>() { instanceId }; try { var terminateResponse = await ec2Client.TerminateInstancesAsync(terminateRequest); } catch (AmazonEC2Exception ex) { // Check the ErrorCode to see if the instance does not exist. if ("InvalidInstanceID.NotFound" == ex.ErrorCode) { Console.WriteLine("Instance {0} does not exist.", instanceId); } else { // The exception was thrown for another reason, so re-throw the exception. throw; } } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
3fb1a4dc162f-0
Run the code on your local machine to create a spot instance request\. After the request is fulfilled, the code deletes the request and terminates the instance\. **To run the application code** 1. Navigate to the `ec2Spot.Tests` directory\. ``` $ cd test/ec2Spot.Tests ``` 1. Use the \.NET CLI to run the project's unit tests\. ``` test/ec2Spot.Tests$ dotnet test Starting test execution, please wait... sir-x5tgs5ij open open open open open active Canceling request sir-x5tgs5ij Terminating instance i-0b3fdff0e12e0897e Complete Test Run Successful. Total tests: 1 Passed: 1 Total time: 7.6060 Seconds ``` The unit test invokes the FunctionHandler method to create a spot instance request, monitor it, and clean up\. It is implemented in the [xUnit\.net](https://xunit.net/) testing framework\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
101846a32bce-0
Run the code in Lambda as a starting point for creating a serverless application\. **To deploy and test the application** 1. Set your region to `us-east-2`\. ``` $ export AWS_DEFAULT_REGION=us-east-2 ``` 1. Create a bucket for deployment artifacts\. ``` $ ./create-bucket.sh make_bucket: lambda-artifacts-63d5cbbf18fa5ecc ``` 1. Create a deployment package and deploy the application\. ``` $ ./deploy.sh Amazon Lambda Tools for .NET Core applications (3.3.0) Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet Executing publish command ... Created publish archive (ec2spot.zip) Lambda project successfully packaged: ec2spot.zip Uploading to ebd38e401cedd7d676d05d22b76f0209 1305107 / 1305107.0 (100.00%) Successfully packaged artifacts and wrote output template to file out.yaml. Execute the following command to deploy the packaged template
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
101846a32bce-1
Successfully packaged artifacts and wrote output template to file out.yaml. Execute the following command to deploy the packaged template aws cloudformation deploy --template-file out.yaml --stack-name <YOUR STACK NAME> Waiting for changeset to be created.. Waiting for stack create/update to complete Successfully created/updated stack - ec2-spot ``` 1. Open the [Applications page](https://us-east-2.console.aws.amazon.com/lambda/home?region=us-east-2#/applications/ec2-spot) of the Lambda console\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-ec2spot-application.png) 1. Under **Resources**, choose **function**\. 1. Choose **Test** and create a test event from the default template\. 1. Choose **Test** again to invoke the function\. View the logs and trace information to see the spot request ID and sequence of calls to Amazon EC2\. To view the service map, open the [Service map page](https://console.aws.amazon.com/xray/home#/service-map) in the X\-Ray console\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-ec2spot-servicemap.png)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
101846a32bce-2
Choose a node in the service map and then choose **View traces** to see a list of traces\. Choose a trace from the list to see the timeline of calls that the function made to Amazon EC2\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-ec2spot-timeline.png)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
0359ef5538a4-0
The code provided in this tutorial is designed to create and delete spot instance requests, and to terminate the instances that they launch\. However, if an error occurs, the requests and instances might not be cleaned up automatically\. View the spot requests and instances in the Amazon EC2 console\. **To confirm that Amazon EC2 resources are cleaned up** 1. Open the [Spot Requests page](https://console.aws.amazon.com/ec2sp/v1/spot/home) in the Amazon EC2 console\. 1. Verify that the state of the requests is **Cancelled**\. 1. Choose the instance ID in the **Capacity** column to view the instance\. 1. Verify that the state of the instances is **Terminated** or **Shutting down**\. To clean up the sample function and support resources, delete its AWS CloudFormation stack and the artifacts bucket that you created\. ``` $ ./cleanup.sh Delete deployment artifacts and bucket (lambda-artifacts-63d5cbbf18fa5ecc)?y delete: s3://lambda-artifacts-63d5cbbf18fa5ecc/ebd38e401cedd7d676d05d22b76f0209 remove_bucket: lambda-artifacts-63d5cbbf18fa5ecc ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
0359ef5538a4-1
remove_bucket: lambda-artifacts-63d5cbbf18fa5ecc ``` The function's log group is not deleted automatically\. You can delete it in the [CloudWatch Logs console](https://console.aws.amazon.com/cloudwatch/home#logs:)\. Traces in X\-Ray expire after a few weeks and are deleted automatically\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-ec2-tutorial.md
1e63280ffabf-0
The \.NET Core CLI offers a cross\-platform way for you to create \.NET\-based Lambda applications\. This section assumes you have installed the \.NET Core CLI\. If you haven't, do so [here](https://www.microsoft.com/net/download/windows)\. In the \.NET CLI, you use the `new` command to create \.NET projects from a command line\. This is useful if you want to create a project outside of Visual Studio\. To view a list of the available project types, open a command line and navigate to where you installed the \.NET Core runtime and run the following command: ``` dotnet new -all Usage: new [options] ... Templates Short Name Language Tags ---------------------------------------------------------------------------------------------------------------------------- Console Application console [C#], F#, VB Common/Console Class library classlib [C#], F#, VB Common/Library Unit Test Project mstest [C#], F#, VB Test/MSTest
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/csharp-package-cli.md
1e63280ffabf-1
Unit Test Project mstest [C#], F#, VB Test/MSTest xUnit Test Project xunit [C#], F#, VB Test/xUnit ... Examples: dotnet new mvc --auth Individual dotnet new viewstart dotnet new --help ``` AWS Lambda offers additional templates via the [Amazon\.Lambda\.Templates](https://www.nuget.org/packages/Amazon.Lambda.Templates) nuget package\. To install this package, run the following command: ``` dotnet new -i Amazon.Lambda.Templates ``` Once the install is complete, the Lambda templates show up as part of `dotnet new`\. To examine details about a template, use the help option\. ``` dotnet new lambda.EmptyFunction --help ``` The `lambda.EmptyFunction` template supports the following options\. + `--name` – The name of the function\. + `--profile` – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html)\. + `--region` – The AWS Region to create the function in\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/csharp-package-cli.md
1e63280ffabf-2
+ `--region` – The AWS Region to create the function in\. These options are saved to a file named `aws-lambda-tools-defaults.json`\. Create a function project with the `lambda.EmptyFunction` template\. ``` dotnet new lambda.EmptyFunction --name MyFunction ``` Under the `src/myfunction` directory, examine the following files: + **aws\-lambda\-tools\-defaults\.json**: This is where you specify the command line options when deploying your Lambda function\. For example: ``` "profile" : "default", "region" : "us-east-2", "configuration" : "Release", "framework" : "netcoreapp2.1", "function-runtime":"dotnetcore3.1", "function-memory-size" : 256, "function-timeout" : 30, "function-handler" : "MyFunction::MyFunction.Function::FunctionHandler" ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/csharp-package-cli.md
1e63280ffabf-3
"function-handler" : "MyFunction::MyFunction.Function::FunctionHandler" ``` + **Function\.cs**: Your Lambda handler function code\. It's a C\# template that includes the default `Amazon.Lambda.Core` library and a default `LambdaSerializer` attribute\. For more information on serialization requirements and options, see [Serializing Lambda functions](csharp-handler.md#csharp-handler-serializer)\. It also includes a sample function that you can edit to apply your Lambda function code\. ``` using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Amazon.Lambda.Core; // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class. [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] namespace MyFunction { public class Function { public string FunctionHandler1(string input, ILambdaContext context) { return input?.ToUpper(); } } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/csharp-package-cli.md
1e63280ffabf-4
{ return input?.ToUpper(); } } } ``` + **MyFunction\.csproj**: An [MSBuild](https://msdn.microsoft.com/en-us/library/dd393574.aspx) file that lists the files and assemblies that comprise your application\. ``` <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp2.1</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Amazon.Lambda.Core" Version="1.0.0 " /> <PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.3.0" /> </ItemGroup> </Project> ``` + **Readme**: Use this file to document your Lambda function\. Under the `myfunction/test directory, examine the following files:`
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/csharp-package-cli.md
1e63280ffabf-5
+ **Readme**: Use this file to document your Lambda function\. Under the `myfunction/test directory, examine the following files:` + **myFunction\.Tests\.csproj**: As noted above, this is an [MSBuild](https://msdn.microsoft.com/en-us/library/dd393574.aspx) file that lists the files and assemblies that comprise your test project\. Note also that it includes the `Amazon.Lambda.Core` library, allowing you to seamlesssly integrate any Lambda templates required to test your function\. ``` <Project Sdk="Microsoft.NET.Sdk"> ... <PackageReference Include="Amazon.Lambda.Core" Version="1.0.0 " /> ... ``` + **FunctionTest\.cs**: The same C\# code template file that it is included in the `src` directory\. Edit this file to mirror your function's production code and test it before uploading your Lambda function to a production environment\. ``` using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Xunit; using Amazon.Lambda.Core; using Amazon.Lambda.TestUtilities; using MyFunction; namespace MyFunction.Tests {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/csharp-package-cli.md
1e63280ffabf-6
using Amazon.Lambda.TestUtilities; using MyFunction; namespace MyFunction.Tests { public class FunctionTest { [Fact] public void TestToUpperFunction() { // Invoke the lambda function and confirm the string was upper cased. var function = new Function(); var context = new TestLambdaContext(); var upperCase = function.FunctionHandler("hello world", context); Assert.Equal("HELLO WORLD", upperCase); } } } ``` Once your function has passed its tests, you can build and deploy using the Amazon\.Lambda\.Tools \.NET Core Global Tool\. To install the \.NET Core Global Tool run the following command\. ``` dotnet tool install -g Amazon.Lambda.Tools ``` If you already have the tool installed you can make sure you are using the latest version with the following command\. ``` dotnet tool update -g Amazon.Lambda.Tools ``` For more information about the Amazon\.Lambda\.Tools \.NET Core Global see its [GitHub repository](https://github.com/aws/aws-extensions-for-dotnet-cli)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/csharp-package-cli.md
1e63280ffabf-7
With the Amazon\.Lambda\.Tools installed you can deploy your function with the following command: ``` dotnet lambda deploy-function MyFunction --function-role role ``` After deployment, you can re\-test it in a production environment with the following command and pass in a different value to your Lambda function handler: ``` dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" ``` Presuming everything was successful, you should see the following: ``` dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" Payload: "JUST CHECKING IF EVERYTHING IS OK" Log Tail: START RequestId: id Version: $LATEST END RequestId: id REPORT RequestId: id Duration: 0.99 ms Billed Duration: 100 ms Memory Size: 256 MB Max Memory Used: 12 MB ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/csharp-package-cli.md
8a922e3c84ea-0
Retrieves the provisioned concurrency configuration for a function's alias or version\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
ee2d0d853dcb-0
``` GET /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifier HTTP/1.1 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
a5ee21885bda-0
The request uses the following URI parameters\. ** [FunctionName](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** <a name="SSS-GetProvisionedConcurrencyConfig-request-FunctionName"></a> The name of the Lambda function\. **Name formats** + **Function name** \- `my-function`\. + **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(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-_]+))?` Required: Yes
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
a5ee21885bda-1
Required: Yes ** [Qualifier](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** <a name="SSS-GetProvisionedConcurrencyConfig-request-Qualifier"></a> The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` Required: Yes
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
1e9f7c804519-0
The request does not have a request body\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
3ff04cd0fa3c-0
``` HTTP/1.1 200 Content-type: application/json { "AllocatedProvisionedConcurrentExecutions": number, "AvailableProvisionedConcurrentExecutions": number, "LastModified": "string", "RequestedProvisionedConcurrentExecutions": number, "Status": "string", "StatusReason": "string" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
532848ebe7d4-0
If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. ** [AllocatedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** <a name="SSS-GetProvisionedConcurrencyConfig-response-AllocatedProvisionedConcurrentExecutions"></a> The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. ** [AvailableProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** <a name="SSS-GetProvisionedConcurrencyConfig-response-AvailableProvisionedConcurrentExecutions"></a> The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. ** [LastModified](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** <a name="SSS-GetProvisionedConcurrencyConfig-response-LastModified"></a> The date and time that a user last updated the configuration, in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)\. Type: String
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
532848ebe7d4-1
Type: String ** [RequestedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** <a name="SSS-GetProvisionedConcurrencyConfig-response-RequestedProvisionedConcurrentExecutions"></a> The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. ** [Status](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** <a name="SSS-GetProvisionedConcurrencyConfig-response-Status"></a> The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` ** [StatusReason](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** <a name="SSS-GetProvisionedConcurrencyConfig-response-StatusReason"></a> For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
4b15fa004bd7-0
**InvalidParameterValueException** One of the parameters in the request is invalid\. HTTP Status Code: 400 **ProvisionedConcurrencyConfigNotFoundException** The specified configuration does not exist\. HTTP Status Code: 404 **ResourceNotFoundException** The resource specified in the request does not exist\. HTTP Status Code: 404 **ServiceException** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 **TooManyRequestsException** The request throughput limit was exceeded\. HTTP Status Code: 429
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
dc8a348f150c-0
For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
dc8a348f150c-1
+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetProvisionedConcurrencyConfig.md
203fbd366a96-0
You can configure a Lambda function to connect to private subnets in a virtual private cloud \(VPC\) in your AWS account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources during execution\. **To connect a function to a VPC** 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. 1. Choose a function\. 1. Under **VPC**, choose **Edit**\. 1. For **VPC connection**, choose **Custom VPC**\. 1. Choose a VPC, subnets, and security groups\. **Note** Connect your function to private subnets to access private resources\. If your function needs internet access, use [network address translation \(NAT\)](#vpc-internet)\. Connecting a function to a public subnet doesn't give it internet access or a public IP address\. 1. Choose **Save**\. When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each combination of security group and subnet in your function's VPC configuration\. This process can take about a minute\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-vpc.md
203fbd366a96-1
While Lambda creates a network interface, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For more information about function states, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. Multiple functions connected to the same subnets share network interfaces\. Connecting additional functions to a subnet that has an existing Lambda\-managed network interface is much quicker than having Lambda create additional network interfaces\. However, if you have many functions or functions with high network usage, Lambda might still create additional network interfaces\. If your functions aren't active for a long period of time, Lambda reclaims its network interfaces, and the functions become `Idle`\. To reactivate an idle function, invoke it\. This invocation fails, and the function enters a `Pending` state again until a network interface is available\. Lambda functions can't connect directly to a VPC with [ dedicated instance tenancy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)\. To connect to resources in a dedicated VPC, [peer it to a second VPC with default tenancy](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-dedicated-vpc/)\. **VPC tutorials**
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-vpc.md
203fbd366a96-2
**VPC tutorials** + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) **Topics** + [Execution role and user permissions](#vpc-permissions) + [Configuring VPC access with the Lambda API](#vpc-configuring) + [Using IAM condition keys for VPC settings](#vpc-conditions) + [Internet and service access for VPC\-connected functions](#vpc-internet) + [Sample VPC configurations](#vpc-samples)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-vpc.md