From 0bb4f8b7d2a25fd9c4c8653379a8f4d3cb2d9554 Mon Sep 17 00:00:00 2001 From: eanbyrne <46104948+eanbyrne@users.noreply.github.com> Date: Sun, 17 Jan 2021 10:21:04 +0000 Subject: [PATCH 01/94] Fix to VPC endpoint policy example Fixed the VPC endpoint policy example to show a correct version of how Principal should be used per the docs[1]. The previous example would return an error if you attempted to use a Principal in that manner. [1] https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-accounts --- doc_source/configuration-vpc-endpoints.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 2c15b7c4..af0834c1 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -80,7 +80,9 @@ The following is an example of an endpoint policy for Lambda\. When attached to { "Statement":[ { - "Principal": "arn:aws:iam::123412341234:user/MyUser", + "Principal": { + "AWS": "arn:aws:iam::123412341234:user/MyUser", + } "Effect":"Allow", "Action":[ "lambda:InvokeFunction" @@ -91,4 +93,4 @@ The following is an example of an endpoint policy for Lambda\. When attached to } ] } -``` \ No newline at end of file +``` From 865145029f6471daa0ec10697754e77b82cb5123 Mon Sep 17 00:00:00 2001 From: Amol Date: Wed, 27 Jan 2021 22:28:24 +0530 Subject: [PATCH 02/94] Update with-sns-example.md corrected line number 110. SourceARN should have SNS arn and not that of lambda function. --- doc_source/with-sns-example.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index eac2ef44..6be99da0 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -107,7 +107,7 @@ $ aws lambda add-permission --function-name SNS-X-Account \ --principal sns.amazonaws.com --profile accountB { "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": - \"arn:aws:lambda:us-east-2:12345678901B:function:SNS-X-Account\"}}, + \"arn:aws:sns:us-east-2:12345678901A:lambda-x-account\"}}, \"Action\":[\"lambda:InvokeFunction\"], \"Resource\":\"arn:aws:lambda:us-east-2:01234567891A:function:SNS-X-Account\", \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, @@ -148,4 +148,4 @@ $ aws sns publish --message file://message.txt --subject Test \ This will return a message id with a unique identifier, indicating the message has been accepted by the Amazon SNS service\. Amazon SNS will then attempt to deliver it to the topic's subscribers\. Alternatively, you could supply a JSON string directly to the `message` parameter, but using a text file allows for line breaks in the message\. -To learn more about Amazon SNS, see [What is Amazon Simple Notification Service](https://docs.aws.amazon.com/sns/latest/dg/)\. \ No newline at end of file +To learn more about Amazon SNS, see [What is Amazon Simple Notification Service](https://docs.aws.amazon.com/sns/latest/dg/)\. From 5e56ef5b303e528fe9ed7f5aa06e1a7d4ce1100d Mon Sep 17 00:00:00 2001 From: Steve Beaumont Date: Sun, 31 Jan 2021 08:53:53 +0000 Subject: [PATCH 03/94] Update python-package.md I spent many hours tracking down why my Python modules were not importable. When I renamed the package folder in the console from A to B and back from B to A the issue resolved and this led me to the discovery that files and directories must be globally readable for the Lambda to run despite everything looking perfectly OK in the console. I think it is important to fix this flaw or let people know about it. --- doc_source/python-package.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc_source/python-package.md b/doc_source/python-package.md index d042952c..f3aa695c 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -62,6 +62,9 @@ To create or update a function with the Lambda API, create a deployment package } ``` +**Note** +In order for your Python modules can be imported at runtime, ensure the files in the zip produced are globally readable (o+r) and any directories are globally readable (o+x). + ## Updating a function with additional dependencies If your Lambda function depends on libraries other than the AWS SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. @@ -204,4 +207,4 @@ A library may appear in `site-packages` or `dist-packages` and the first folder "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", ... } - ``` \ No newline at end of file + ``` From 6e832e6c4660bf2f5f832d7ab2b9d00673c57256 Mon Sep 17 00:00:00 2001 From: Juan Manuel Olaya Ortiz Date: Tue, 2 Feb 2021 22:08:24 +0100 Subject: [PATCH 04/94] Fix configuration-codesigning.md * Fix IAM policy formatting to add required Resource * Fix condition StringEquals syntax --- doc_source/configuration-codesigning.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md index 05d3a723..c35cf82d 100644 --- a/doc_source/configuration-codesigning.md +++ b/doc_source/configuration-codesigning.md @@ -145,7 +145,8 @@ The following example policy statement grants permission to create, update, and "lambda:CreateCodeSigningConfig", "lambda:UpdateCodeSigningConfig", "lambda:GetCodeSigningConfig" - ] + ], + "Resource": "*" } ] } @@ -168,7 +169,7 @@ The following example policy statement grants permission to create a function\. "Resource": "*", "Condition": { "StringEquals": { - "lambda:codeSigningConfig: { + "lambda:codeSigningConfig": “arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0d4518bd353a0a7c6” } } @@ -192,4 +193,4 @@ To manage the code signing configuration for a function, use the following API o + [GetFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionCodeSigningConfig.html) + [PutFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionCodeSigningConfig.html) + [DeleteFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionCodeSigningConfig.html) -+ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) \ No newline at end of file ++ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) From 33593b75d49ff672fb492d53fe7d1461daef326c Mon Sep 17 00:00:00 2001 From: Nitav Shah Date: Wed, 10 Feb 2021 13:56:42 +0530 Subject: [PATCH 05/94] 'RequestId' to 'RequestID' in Golang Example In the Golang Lambda Handler for API Gateway, the RequestContext has no field as RequestId, so based on https://github.com/aws/aws-lambda-go/blob/v1.22.0/events/apigw.go#L32, field needs to be changed to 'RequestID' --- doc_source/services-apigateway-code.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index 85847284..40225f51 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -125,7 +125,7 @@ import ( ) func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { - fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestId) + fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestID) fmt.Printf("Body size = %d.\n", len(request.Body)) fmt.Println("Headers:") @@ -137,4 +137,4 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) ( } ``` -Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file +Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. From 6c005f9f58dee6740643b068410fd0d165603894 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Wed, 24 Feb 2021 19:24:08 +0000 Subject: [PATCH 06/94] Periodic update --- doc_source/API_CreateEventSourceMapping.md | 86 +----- doc_source/API_CreateFunction.md | 99 +------ doc_source/API_DeleteEventSourceMapping.md | 43 +-- .../API_EventSourceMappingConfiguration.md | 39 +-- doc_source/API_FunctionCode.md | 7 +- doc_source/API_FunctionCodeLocation.md | 10 - doc_source/API_FunctionConfiguration.md | 33 +-- doc_source/API_GetEventSourceMapping.md | 43 +-- doc_source/API_GetFunction.md | 22 +- doc_source/API_GetFunctionConfiguration.md | 47 +-- doc_source/API_GetLayerVersion.md | 6 +- doc_source/API_GetLayerVersionByArn.md | 6 +- doc_source/API_Layer.md | 12 - doc_source/API_LayerVersionContentOutput.md | 10 - doc_source/API_LayerVersionsListItem.md | 2 +- doc_source/API_ListEventSourceMappings.md | 9 - doc_source/API_ListFunctions.md | 18 +- doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- doc_source/API_ListVersionsByFunction.md | 18 +- doc_source/API_Operations.md | 9 - doc_source/API_PublishLayerVersion.md | 8 +- doc_source/API_PublishVersion.md | 47 +-- doc_source/API_SourceAccessConfiguration.md | 18 +- doc_source/API_Types.md | 7 - doc_source/API_UpdateEventSourceMapping.md | 71 +---- doc_source/API_UpdateFunctionCode.md | 70 +---- doc_source/API_UpdateFunctionConfiguration.md | 75 +---- doc_source/access-control-identity-based.md | 19 +- doc_source/access-control-resource-based.md | 69 ++++- doc_source/applications-tutorial.md | 23 +- doc_source/best-practices.md | 4 +- doc_source/code-editor.md | 36 +-- doc_source/configuration-aliases.md | 18 +- doc_source/configuration-codesigning.md | 13 +- doc_source/configuration-concurrency.md | 48 ++- doc_source/configuration-console.md | 2 +- doc_source/configuration-database.md | 12 +- doc_source/configuration-envvars.md | 16 +- doc_source/configuration-filesystem.md | 13 +- doc_source/configuration-images.md | 6 +- doc_source/configuration-layers.md | 128 +++++--- doc_source/configuration-memory.md | 32 +- doc_source/configuration-tags.md | 10 +- doc_source/configuration-versions.md | 7 +- doc_source/configuration-vpc-endpoints.md | 9 +- doc_source/configuration-vpc.md | 12 +- doc_source/csharp-exceptions.md | 123 +++++++- doc_source/csharp-handler.md | 33 +-- doc_source/csharp-image.md | 2 +- doc_source/csharp-logging.md | 170 ++++++----- doc_source/csharp-package.md | 6 +- doc_source/csharp-tracing.md | 14 +- doc_source/deploying-lambda-apps.md | 2 + doc_source/functions-states.md | 7 +- doc_source/getting-started-create-function.md | 21 +- doc_source/gettingstarted-awscli.md | 74 +++-- doc_source/gettingstarted-concepts.md | 2 +- doc_source/gettingstarted-features.md | 2 +- doc_source/gettingstarted-limits.md | 6 +- doc_source/gettingstarted-package.md | 51 +++- doc_source/gettingstarted-tools.md | 2 +- doc_source/go-image.md | 2 +- doc_source/golang-exceptions.md | 123 +++++++- doc_source/golang-handler.md | 4 +- doc_source/golang-logging.md | 94 ++++-- doc_source/golang-package.md | 141 ++++++--- doc_source/golang-tracing.md | 18 +- doc_source/images-create.md | 10 +- doc_source/images-test.md | 39 +-- doc_source/index.md | 33 +-- doc_source/invocation-async.md | 23 +- doc_source/invocation-eventsourcemapping.md | 9 +- doc_source/invocation-retries.md | 4 +- doc_source/invocation-sync.md | 43 ++- doc_source/java-context.md | 30 +- doc_source/java-exceptions.md | 278 +++++++++--------- doc_source/java-handler.md | 50 ++-- doc_source/java-image.md | 10 +- doc_source/java-logging.md | 110 ++++--- doc_source/java-package-eclipse.md | 6 - doc_source/java-package.md | 82 +++--- doc_source/java-samples.md | 16 +- doc_source/java-tracing.md | 26 +- doc_source/kafka-hosting.md | 4 +- doc_source/kafka-smaa.md | 6 +- doc_source/kafka-using-cluster.md | 6 +- doc_source/lambda-api-permissions-ref.md | 4 +- doc_source/lambda-csharp.md | 4 +- doc_source/lambda-golang.md | 23 +- doc_source/lambda-images.md | 6 +- doc_source/lambda-intro-execution-role.md | 15 +- doc_source/lambda-java.md | 2 +- doc_source/lambda-kafka.md | 2 +- doc_source/lambda-monitoring.md | 21 +- doc_source/lambda-nodejs.md | 19 +- doc_source/lambda-permissions.md | 2 +- doc_source/lambda-powershell.md | 7 +- doc_source/lambda-python.md | 10 +- doc_source/lambda-releases.md | 1 + doc_source/lambda-rolling-deployments.md | 2 - doc_source/lambda-ruby.md | 3 +- doc_source/lambda-runtimes.md | 15 +- doc_source/lambda-samples.md | 39 +-- doc_source/lambda-security.md | 2 +- doc_source/lambda-services.md | 2 +- doc_source/monitoring-cloudwatchlogs.md | 39 ++- .../monitoring-functions-access-metrics.md | 69 ++++- doc_source/monitoring-insights.md | 36 +-- doc_source/monitoring-metrics.md | 30 +- doc_source/nodejs-exceptions.md | 145 +++++++-- doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-image.md | 1 + doc_source/nodejs-logging.md | 92 ++++-- doc_source/nodejs-package.md | 55 +++- doc_source/nodejs-tracing.md | 18 +- doc_source/powershell-exceptions.md | 123 +++++++- doc_source/powershell-logging.md | 94 ++++-- doc_source/powershell-package.md | 19 +- doc_source/python-context.md | 2 +- doc_source/python-exceptions.md | 169 +++++++++-- doc_source/python-handler.md | 2 +- doc_source/python-image.md | 35 ++- doc_source/python-logging.md | 94 ++++-- doc_source/python-package.md | 130 ++++---- doc_source/python-tracing.md | 18 +- doc_source/ruby-exceptions.md | 139 +++++++-- doc_source/ruby-logging.md | 132 ++++----- doc_source/ruby-package.md | 59 +++- doc_source/ruby-tracing.md | 18 +- doc_source/runtime-support-policy.md | 1 + doc_source/runtimes-avx2.md | 2 - doc_source/runtimes-context.md | 2 - doc_source/runtimes-extensions-api.md | 11 +- doc_source/runtimes-modify.md | 3 +- doc_source/runtimes-walkthrough.md | 13 +- doc_source/samples-blank.md | 32 +- doc_source/samples-errorprocessor.md | 8 +- doc_source/samples-listmanager.md | 12 +- doc_source/security-iam.md | 2 +- doc_source/security_iam_troubleshoot.md | 23 +- doc_source/services-alb.md | 7 +- doc_source/services-apigateway-blueprint.md | 14 +- doc_source/services-apigateway-code.md | 2 +- doc_source/services-apigateway-tutorial.md | 107 +++++-- doc_source/services-apigateway.md | 20 +- doc_source/services-cloudformation.md | 2 +- .../services-cloudwatchevents-tutorial.md | 4 +- doc_source/services-ec2-tutorial.md | 47 ++- doc_source/services-elasticache-tutorial.md | 17 +- doc_source/services-iot.md | 7 +- doc_source/services-iotevents.md | 7 +- doc_source/services-lex.md | 2 +- doc_source/services-msk-topic-add.md | 4 +- doc_source/services-rds-tutorial.md | 36 ++- doc_source/services-rds.md | 26 +- doc_source/services-smaa-topic-add.md | 18 +- doc_source/services-stepfunctions.md | 2 +- doc_source/services-xray.md | 10 +- doc_source/smaa-permissions.md | 10 +- doc_source/stepfunctions-patterns.md | 1 - doc_source/troubleshooting-deployment.md | 4 +- doc_source/troubleshooting-execution.md | 2 +- doc_source/troubleshooting-invocation.md | 49 ++- doc_source/using-extensions.md | 3 +- doc_source/with-android-create-package.md | 2 +- doc_source/with-android-example.md | 17 +- doc_source/with-cloudtrail-example.md | 14 +- doc_source/with-ddb-create-package.md | 2 +- doc_source/with-ddb-example.md | 23 +- doc_source/with-ddb.md | 32 +- doc_source/with-kinesis-create-package.md | 6 +- doc_source/with-kinesis-example.md | 70 ++++- doc_source/with-kinesis.md | 39 ++- doc_source/with-mq.md | 25 +- doc_source/with-s3-example-deployment-pkg.md | 227 ++++++++------ doc_source/with-s3-example.md | 51 +++- doc_source/with-sns-create-package.md | 6 +- doc_source/with-sns-example.md | 83 +++++- doc_source/with-sns.md | 17 +- doc_source/with-sqs-create-package.md | 15 +- doc_source/with-sqs-example.md | 59 +++- doc_source/with-sqs.md | 15 +- 183 files changed, 3561 insertions(+), 2330 deletions(-) diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 1988ce23..ad941e89 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -8,7 +8,6 @@ For details about each event source type, see the following topics\. + [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) + [Using AWS Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html) + [Using AWS Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) -+ [Using AWS Lambda with Self\-Managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. @@ -37,17 +36,11 @@ Content-type: application/json "Enabled": boolean, "EventSourceArn": "string", "FunctionName": "string", - "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", @@ -56,8 +49,7 @@ Content-type: application/json ], "StartingPosition": "string", "StartingPositionTimestamp": number, - "Topics": [ "string" ], - "TumblingWindowInSeconds": number + "Topics": [ "string" ] } ``` @@ -73,9 +65,8 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. ++ **Amazon Simple Queue Service** \- Default 10\. Max 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. -+ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -103,7 +94,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No +Required: Yes ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. @@ -119,15 +110,8 @@ 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 - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` -Required: No - ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -156,17 +140,14 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` -Required: No - - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** -The Self\-Managed Apache Kafka cluster to send records\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. +Array Members: Fixed number of 1 item\. Required: No ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** @@ -181,17 +162,11 @@ Type: Timestamp Required: No ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` -Required: No - - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No ## Response Syntax @@ -213,7 +188,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -221,23 +195,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -271,12 +237,6 @@ The ARN of the Lambda 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-_]+))?` - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -286,7 +246,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -312,23 +272,12 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. - - ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -339,17 +288,12 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 84688eea..f87bbbec 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -1,6 +1,6 @@ # CreateFunction -Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. +Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. When you create 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 or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. @@ -8,8 +8,6 @@ A function has an unpublished version, and can have published versions and alias The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. -You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. - If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. @@ -22,13 +20,11 @@ Content-type: application/json { "Code": { - "ImageUri": "string", "S3Bucket": "string", "S3Key": "string", "S3ObjectVersion": "string", "ZipFile": blob }, - "CodeSigningConfigArn": "string", "DeadLetterConfig": { "TargetArn": "string" }, @@ -46,15 +42,9 @@ Content-type: application/json ], "FunctionName": "string", "Handler": "string", - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, - "PackageType": "string", "Publish": boolean, "Role": "string", "Runtime": "string", @@ -85,13 +75,6 @@ The code for the function\. Type: [FunctionCode](API_FunctionCode.md) object Required: Yes - ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** -To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. -Type: String -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` -Required: No - ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** 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 @@ -132,12 +115,7 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` -Required: No - - ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** -Configuration values that override the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object -Required: No +Required: Yes ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** 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\. @@ -153,15 +131,9 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_CreateFunction_RequestSyntax) ** -The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. +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 10240\. -Required: No - - ** [PackageType](#API_CreateFunction_RequestSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. Required: No ** [Publish](#API_CreateFunction_RequestSyntax) ** @@ -178,8 +150,8 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: No +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: Yes ** [Tags](#API_CreateFunction_RequestSyntax) ** A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. @@ -233,17 +205,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -252,19 +213,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -330,10 +286,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** 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 @@ -355,7 +307,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -367,14 +319,9 @@ 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_CreateFunction_ResponseSyntax) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_CreateFunction_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -388,17 +335,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +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_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -412,7 +349,7 @@ Type: String ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_CreateFunction_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -435,20 +372,8 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - **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 - - **CodeVerificationFailedException** -The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. -HTTP Status Code: 400 - - **InvalidCodeSignatureException** -The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index c422cfc4..44f1d88c 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -41,7 +41,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -49,23 +48,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -99,12 +90,6 @@ The ARN of the Lambda 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-_]+))?` - ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -114,7 +99,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -140,23 +125,12 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. - - ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -167,17 +141,12 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 395a5f43..9e78f5c5 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -30,13 +30,6 @@ Required: No The ARN of the Lambda 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-_]+))?` -Required: No - - **FunctionResponseTypes** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` Required: No **LastModified** @@ -50,7 +43,7 @@ Type: String Required: No **MaximumBatchingWindowInSeconds** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -79,28 +72,14 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` -Required: No - - **SelfManagedEventSource** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No **SourceAccessConfigurations** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. -Required: No - - **StartingPosition** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` -Required: No - - **StartingPositionTimestamp** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. Required: No **State** @@ -114,17 +93,11 @@ Type: String Required: No **Topics** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` -Required: No - - **TumblingWindowInSeconds** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No **UUID** diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index e3f4b32c..8487a2d7 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -1,14 +1,9 @@ # FunctionCode -The code for the Lambda function\. You can specify either an object in Amazon S3, upload a \.zip file archive deployment package directly, or specify the URI of a container image\. +The code for the Lambda function\. You can specify either an object in Amazon S3, or upload a deployment package directly\. ## Contents - **ImageUri** -URI of a container image in the Amazon ECR registry\. -Type: String -Required: No - **S3Bucket** An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Type: String diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md index 31347605..850b4594 100644 --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -4,11 +4,6 @@ Details about a function's deployment package\. ## Contents - **ImageUri** -URI of a container image in the Amazon ECR registry\. -Type: String -Required: No - **Location** A presigned URL that you can use to download the deployment package\. Type: String @@ -17,11 +12,6 @@ Required: No **RepositoryType** The service that's hosting the file\. Type: String -Required: No - - **ResolvedImageUri** -The resolved URI for the image\. -Type: String Required: No ## See Also diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index e4d33f74..2fa66b1c 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -54,11 +54,6 @@ The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` -Required: No - - **ImageConfigResponse** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object Required: No **KMSKeyArn** @@ -86,7 +81,7 @@ Required: No **LastUpdateStatusReasonCode** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` Required: No **Layers** @@ -101,15 +96,9 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi Required: No **MemorySize** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. -Required: No - - **PackageType** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. Required: No **RevisionId** @@ -126,19 +115,7 @@ Required: No **Runtime** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: No - - **SigningJobArn** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - **SigningProfileVersionArn** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +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 **State** @@ -155,7 +132,7 @@ Required: No **StateReasonCode** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` Required: No **Timeout** diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index 6a4ec54e..f073a04e 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -39,7 +39,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -47,23 +46,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -97,12 +88,6 @@ The ARN of the Lambda 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-_]+))?` - ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -112,7 +97,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -138,23 +123,12 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. - - ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -165,17 +139,12 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index f3d54f64..247f695e 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -41,10 +41,8 @@ Content-type: application/json { "Code": { - "ImageUri": "string", "Location": "string", - "RepositoryType": "string", - "ResolvedImageUri": "string" + "RepositoryType": "string" }, "Concurrency": { "ReservedConcurrentExecutions": number @@ -74,17 +72,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -93,19 +80,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 453c1f46..4d3a9dc4 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -66,17 +66,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -85,19 +74,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -163,10 +147,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** 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 @@ -188,7 +168,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -200,14 +180,9 @@ 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_GetFunctionConfiguration_ResponseSyntax) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -221,17 +196,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +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_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -245,7 +210,7 @@ Type: String ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index a6908afd..d0469dc3 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -37,9 +37,7 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "Location": "string" }, "CreatedDate": "string", "Description": "string", @@ -60,7 +58,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +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` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index a42e0458..46aaf325 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -33,9 +33,7 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "Location": "string" }, "CreatedDate": "string", "Description": "string", @@ -56,7 +54,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +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` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index 13cc1eab..df0d9d16 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -14,18 +14,6 @@ Required: No **CodeSize** The size of the layer archive in bytes\. Type: Long -Required: No - - **SigningJobArn** -The Amazon Resource Name \(ARN\) of a signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - **SigningProfileVersionArn** -The Amazon Resource Name \(ARN\) for a signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No ## See Also diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index 99cecb7d..09f64516 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -17,16 +17,6 @@ Required: No **Location** A link to the layer archive in Amazon S3 that is valid for 10 minutes\. Type: String -Required: No - - **SigningJobArn** -The Amazon Resource Name \(ARN\) of a signing job\. -Type: String -Required: No - - **SigningProfileVersionArn** -The Amazon Resource Name \(ARN\) for a signing profile version\. -Type: String Required: No ## See Also diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 69fd3776..2e858f4a 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -8,7 +8,7 @@ Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lam The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +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 **CreatedDate** diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 38cf844a..803b3be6 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -64,7 +64,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -72,23 +71,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ], diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index e2f10d65..ae21f90a 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -66,17 +66,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -85,19 +74,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index ed2b84b1..1e38e5f3 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +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` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 91720146..cf6939f7 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +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` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index f5232b20..cfdddb83 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -69,17 +69,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -88,19 +77,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md index 70a90b0c..4dedc902 100644 --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -4,24 +4,19 @@ The following actions are supported: + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) -+ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) -+ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) -+ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) -+ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) -+ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -33,11 +28,9 @@ The following actions are supported: + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) -+ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) -+ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -45,7 +38,6 @@ The following actions are supported: + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) -+ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -54,7 +46,6 @@ The following actions are supported: + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) -+ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 2bd56784..fcbe9f72 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -41,7 +41,7 @@ The request accepts the following data in JSON format\. A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +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 ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -75,9 +75,7 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "Location": "string" }, "CreatedDate": "string", "Description": "string", @@ -98,7 +96,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +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` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 2241a33d..4e1749f3 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -86,17 +86,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -105,19 +94,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -183,10 +167,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** 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 @@ -208,7 +188,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -220,14 +200,9 @@ 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_PublishVersion_ResponseSyntax) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_PublishVersion_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -241,17 +216,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +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_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -265,7 +230,7 @@ Type: String ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_PublishVersion_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 9d67d5af..8a21b665 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -1,25 +1,21 @@ # SourceAccessConfiguration -You can specify the authentication protocol, or the VPC components to secure access to your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` ## Contents **Type** -The type of authentication protocol or the VPC components for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. -+ `BASIC_AUTH` \- \(MQ\) The Secrets Manager secret that stores your broker credentials\. -+ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your Self\-Managed Apache Kafka cluster\. -+ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your Self\-Managed Apache Kafka brokers\. -+ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your Self\-Managed Apache Kafka brokers\. -+ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your Self\-Managed Apache Kafka brokers\. +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: String -Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH` +Valid Values:` BASIC_AUTH` Required: No **URI** -The value for your chosen configuration in `Type`\. For example: `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`\. +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: String -Length Constraints: Minimum length of 1\. Maximum length of 200\. -Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No ## See Also diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index aaa9f473..ebedf4f7 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -5,9 +5,6 @@ The following data types are supported: + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) -+ [AllowedPublishers](API_AllowedPublishers.md) -+ [CodeSigningConfig](API_CodeSigningConfig.md) -+ [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -20,9 +17,6 @@ The following data types are supported: + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) -+ [ImageConfig](API_ImageConfig.md) -+ [ImageConfigError](API_ImageConfigError.md) -+ [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) @@ -31,7 +25,6 @@ The following data types are supported: + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) -+ [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 01660b10..c6a09e35 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -28,7 +28,6 @@ Content-type: application/json }, "Enabled": boolean, "FunctionName": "string", - "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, @@ -38,8 +37,7 @@ Content-type: application/json "Type": "string", "URI": "string" } - ], - "TumblingWindowInSeconds": number + ] } ``` @@ -59,9 +57,8 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. ++ **Amazon Simple Queue Service** \- Default 10\. Max 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. -+ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -93,17 +90,10 @@ The length constraint applies only to the full ARN\. If you specify only the fun Type: String 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: No - - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` Required: No ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -127,15 +117,11 @@ Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. -Required: No - - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. +Array Members: Fixed number of 1 item\. Required: No ## Response Syntax @@ -157,7 +143,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -165,23 +150,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -215,12 +192,6 @@ The ARN of the Lambda 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-_]+))?` - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -230,7 +201,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -256,23 +227,12 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. - - ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -283,17 +243,12 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 5c2b4326..f0f55d47 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -1,12 +1,9 @@ # UpdateFunctionCode -Updates a Lambda function's code\. If code signing is enabled for the function, the code package must be signed by a trusted publisher\. For more information, see [Configuring code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html)\. +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\. -**Note** -For a function defined as a container image, Lambda resolves the image tag to an image digest\. In Amazon ECR, if you update the image tag to a new image, Lambda does not automatically update the function\. - ## Request Syntax ``` @@ -15,7 +12,6 @@ Content-type: application/json { "DryRun": boolean, - "ImageUri": "string", "Publish": boolean, "RevisionId": "string", "S3Bucket": "string", @@ -48,11 +44,6 @@ The request accepts the following data in JSON format\. ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean -Required: No - - ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** -URI of a container image in the Amazon ECR registry\. -Type: String Required: No ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** @@ -120,17 +111,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -139,19 +119,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -217,10 +192,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** 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 @@ -242,7 +213,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -254,14 +225,9 @@ 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) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -275,17 +241,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +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) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -299,7 +255,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -322,20 +278,8 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - **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 - - **CodeVerificationFailedException** -The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. -HTTP Status Code: 400 - - **InvalidCodeSignatureException** -The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 0470b867..f4b2ea77 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -31,11 +31,6 @@ Content-type: application/json } ], "Handler": "string", - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, @@ -100,11 +95,6 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` -Required: No - - ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Configuration values that override the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object Required: No ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -121,9 +111,9 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. +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 10240\. +Valid Range: Minimum value of 128\. Maximum value of 3008\. Required: No ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -140,7 +130,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +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) ** @@ -190,17 +180,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -209,19 +188,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -287,10 +261,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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 @@ -312,7 +282,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -324,14 +294,9 @@ 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) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -345,17 +310,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +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) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -369,7 +324,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -392,18 +347,6 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - - **CodeVerificationFailedException** -The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. -HTTP Status Code: 400 - - **InvalidCodeSignatureException** -The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. -HTTP Status Code: 400 - **InvalidParameterValueException** One of the parameters in the request is invalid\. HTTP Status Code: 400 diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 4b3e15f6..5a6a3318 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -1,13 +1,16 @@ -# Identity\-based IAM policies for AWS Lambda +# Identity\-based IAM policies for Lambda You can use identity\-based policies in AWS Identity and Access Management \(IAM\) to grant users in your account access to Lambda\. Identity\-based policies can apply to users directly, or to groups and roles that are associated with a user\. You can also grant users in another account permission to assume a role in your account and access your Lambda resources\. -Lambda provides managed policies that grant access to Lambda API actions and, in some cases, access to other services used to develop and manage Lambda resources\. Lambda updates the managed policies as needed, to ensure that your users have access to new features when they're released\. -+ **AWSLambdaFullAccess** – Grants full access to AWS Lambda actions and other services used to develop and maintain Lambda resources\. -+ **AWSLambdaReadOnlyAccess** – Grants read\-only access to AWS Lambda resources\. -+ **AWSLambdaRole** – Grants permissions to invoke Lambda functions\. +Lambda provides AWS managed policies that grant access to Lambda API actions and, in some cases, access to other AWS services used to develop and manage Lambda resources\. Lambda updates these managed policies as needed to ensure that your users have access to new features when they're released\. -Managed policies grant permission to API actions without restricting the functions or layers that a user can modify\. For finer\-grained control, you can create your own policies that limit the scope of a user's permissions\. +**Note** +The AWS managed policies **AWSLambdaFullAccess** and **AWSLambdaReadOnlyAccess** will be [deprecated](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-deprecated.html) on March 1, 2021\. After this date, you cannot attach these policies to new IAM users\. For more information, see the related [troubleshooting topic](security_iam_troubleshoot.md#security_iam_troubleshoot-admin-deprecation)\. ++ **AWSLambdaFullAccess** – Grants full access to Lambda actions and other AWS services used to develop and maintain Lambda resources\. ++ **AWSLambdaReadOnlyAccess** – Grants read\-only access to Lambda resources\. ++ **AWSLambdaRole** – Grants permissions to invoke Lambda functions\. + +AWS managed policies grant permission to API actions without restricting the Lambda functions or layers that a user can modify\. For finer\-grained control, you can create your own policies that limit the scope of a user's permissions\. **Topics** + [Function development](#permissions-user-function) @@ -147,7 +150,7 @@ The permissions in the policy are organized into statements based on the [resour ], "Resource": "arn:aws:iam::*:role/intern-lambda-execution-role" ``` -+ `ViewExecutionRolePolicies` – View the AWS\-provided managed policies that are attached to the execution role\. This lets you view the function's permissions in the console, but doesn't include permission to view policies that were created by other users in the account\. ++ `ViewExecutionRolePolicies` – View the AWS managed policies that are attached to the execution role\. This lets you view the function's permissions in the console, but doesn't include permission to view policies that were created by other users in the account\. ``` "Action": [ @@ -167,7 +170,7 @@ The permissions in the policy are organized into statements based on the [resour This policy allows a user to get started with Lambda, without putting other users' resources at risk\. It doesn't allow a user to configure a function to be triggered by or call other AWS services, which requires broader IAM permissions\. It also doesn't include permission to services that don't support limited\-scope policies, like CloudWatch and X\-Ray\. Use the read\-only policies for these services to give the user access to metrics and trace data\. -When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. +When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/iam-policies)\. ## Layer development and use diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 58d81fc7..0778a999 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -64,22 +64,27 @@ When you add a trigger to your function with the Lambda console, the console upd Add a statement with the `add-permission` command\. The simplest resource\-based policy statement allows a service to invoke a function\. The following command grants Amazon SNS permission to invoke a function named `my-function`\. ``` -$ aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns \ +aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns \ --principal sns.amazonaws.com --output text +``` + +You should see the following output: + +``` {"Sid":"sns","Effect":"Allow","Principal":{"Service":"sns.amazonaws.com"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"} ``` This lets Amazon SNS call the `lambda:Invoke` API for the function, but it doesn't restrict the Amazon SNS topic that triggers the invocation\. To ensure that your function is only invoked by a specific resource, specify the Amazon Resource Name \(ARN\) of the resource with the `source-arn` option\. The following command only allows Amazon SNS to invoke the function for subscriptions to a topic named `my-topic`\. ``` -$ aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns-my-topic \ +aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns-my-topic \ --principal sns.amazonaws.com --source-arn arn:aws:sns:us-east-2:123456789012:my-topic ``` Some services can invoke functions in other accounts\. If you specify a source ARN that has your account ID in it, that isn't an issue\. For Amazon S3, however, the source is a bucket whose ARN doesn't have an account ID in it\. It's possible that you could delete the bucket and another account could create a bucket with the same name\. Use the `source-account` option with your account ID to ensure that only resources in your account can invoke the function\. ``` -$ aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id s3-account \ +aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id s3-account \ --principal s3.amazonaws.com --source-arn arn:aws:s3:::my-bucket-123456 --source-account 123456789012 ``` @@ -88,19 +93,29 @@ $ aws lambda add-permission --function-name my-function --action lambda:InvokeFu To grant permissions to another AWS account, specify the account ID as the `principal`\. The following example grants account `210987654321` permission to invoke `my-function` with the `prod` alias\. ``` -$ aws lambda add-permission --function-name my-function:prod --statement-id xaccount --action lambda:InvokeFunction \ +aws lambda add-permission --function-name my-function:prod --statement-id xaccount --action lambda:InvokeFunction \ --principal 210987654321 --output text +``` + +You should see the following output: + +``` {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"} ``` The resource\-based policy grants permission for the other account to access the function, but doesn't allow users in that account to exceed their permissions\. Users in the other account must have the corresponding [user permissions](access-control-identity-based.md) to use the Lambda API\. -To limit access to a user, group, or role in another account, specify the full ARN of the identity as the principal\. For example, `arn:aws:iam::123456789012:user/developer`\. +To limit access to a user or role in another account, specify the full ARN of the identity as the principal\. For example, `arn:aws:iam::123456789012:user/developer`\. The [alias](configuration-aliases.md) limits which version the other account can invoke\. It requires the other account to include the alias in the function ARN\. ``` -$ aws lambda invoke --function-name arn:aws:lambda:us-west-2:123456789012:function:my-function:prod out +aws lambda invoke --function-name arn:aws:lambda:us-west-2:123456789012:function:my-function:prod out +``` + +You should see the following output: + +``` { "StatusCode": 200, "ExecutedVersion": "1" @@ -140,19 +155,29 @@ To grant other accounts permission for multiple functions, or for actions that d To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. ``` -$ aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ +aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ --action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text +``` + +You should see the following output: + +``` e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} ``` -Permissions only apply to a single version of a layer\. Repeat the procedure each time you create a new layer version\. +Permissions apply only to a single version of a layer\. Repeat the process each time that you create a new layer version\. To grant permission to all accounts in an organization, use the `organization-id` option\. The following example grants all accounts in an organization permission to use version 3 of a layer\. ``` -$ aws lambda add-layer-version-permission --layer-name my-layer \ +aws lambda add-layer-version-permission --layer-name my-layer \ --statement-id engineering-org --version-number 3 --principal '*' \ --action lambda:GetLayerVersion --organization-id o-t194hfs8cz --output text +``` + +You should see the following output: + +``` b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" ``` @@ -163,27 +188,41 @@ To grant permission to all AWS accounts, use `*` for the principal, and omit the To view a function's resource\-based policy, use the `get-policy` command\. ``` -$ aws lambda get-policy --function-name my-function --output text +aws lambda get-policy --function-name my-function --output text +``` + +You should see the following output: + +``` {"Version":"2012-10-17","Id":"default","Statement":[{"Sid":"sns","Effect":"Allow","Principal":{"Service":"s3.amazonaws.com"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function","Condition":{"ArnLike":{"AWS:SourceArn":"arn:aws:sns:us-east-2:123456789012:lambda*"}}}]} 7c681fc9-b791-4e91-acdf-eb847fdaa0f0 ``` For versions and aliases, append the version number or alias to the function name\. ``` -$ aws lambda get-policy --function-name my-function:PROD +aws lambda get-policy --function-name my-function:PROD ``` To remove permissions from your function, use `remove-permission`\. ``` -$ aws lambda remove-permission --function-name example --statement-id sns +aws lambda remove-permission --function-name example --statement-id sns ``` -Use the `get-layer-version-policy` command to view the permissions on a layer\. Use `remove-layer-version-permission` to remove statements from the policy\. +Use the `get-layer-version-policy` command to view the permissions on a layer\. + +``` +aws lambda get-layer-version-policy --layer-name my-layer --version-number 3 --output text +``` + +You should see the following output: ``` -$ aws lambda get-layer-version-policy --layer-name my-layer --version-number 3 --output text b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-west-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" +``` + +Use `remove-layer-version-permission` to remove statements from the policy\. -$ aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org +``` +aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org ``` \ No newline at end of file diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index d5b82cb2..7c4c9ddb 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -6,7 +6,7 @@ In this tutorial, you create the following resources\. + **Application** – A Node\.js Lambda function, build specification, and AWS Serverless Application Model \(AWS SAM\) template\. + **Pipeline** – An AWS CodePipeline pipeline that connects the other resources to enable continuous delivery\. + **Repository** – A Git repository in AWS CodeCommit\. When you push a change, the pipeline copies the source code into an Amazon S3 bucket and passes it to the build project\. -+ **Trigger** – An Amazon CloudWatch Events rule that watches the master branch of the repository and triggers the pipeline\. ++ **Trigger** – An Amazon CloudWatch Events rule that watches the main branch of the repository and triggers the pipeline\. + **Build project** – An AWS CodeBuild build that gets the source code from the pipeline and packages the application\. The source includes a build specification with commands that install dependencies and prepare the application template for deployment\. + **Deployment configuration** – The pipeline's deployment stage defines a set of actions that take the processed AWS SAM template from the build output, and deploy the new version with AWS CloudFormation\. + **Bucket** – An Amazon Simple Storage Service \(Amazon S3\) bucket for deployment artifact storage\. @@ -29,12 +29,17 @@ The pipeline maps a single branch in a repository to a single application stack\ ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -115,7 +120,7 @@ In the previous step, Lambda console created a Git repository that contains func 1. To clone the repository, use the `git clone` command\. ``` - ~$ git clone ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/my-app-repo + git clone ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/my-app-repo ``` To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTable` resource in the template\. @@ -160,8 +165,8 @@ To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTa 1. Commit and push the change\. ``` - ~/my-app-repo$ git commit -am "Add DynamoDB table" - ~/my-app-repo$ git push + git commit -am "Add DynamoDB table" + git push ``` When you push a change, it triggers the application's pipeline\. Use the **Deployments** tab of the application screen to track the change as it flows through the pipeline\. When the deployment is complete, proceed to the next step\. @@ -239,8 +244,8 @@ Next, update the function code to use the table\. The following code uses the Dy 1. Commit and push the change\. ``` - ~/my-app-repo$ git add . && git commit -m "Use DynamoDB table" - ~/my-app-repo$ git push + git add . && git commit -m "Use DynamoDB table" + git push ``` After the code change is deployed, invoke the function a few times to update the DynamoDB table\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index ef4c0aaa..9e01a7db 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -27,11 +27,11 @@ The following are recommended best practices for using AWS Lambda: + **Take advantage of execution environment reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves cost by reducing function run time\. To avoid potential data leaks across invocations, don’t use the execution environment to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. -+ **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.amazonaws.cn/en_us/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. ++ **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.aws.amazon.com//sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. + **Use [environment variables](configuration-envvars.md) to pass operational parameters to your function\.** For example, if you are writing to an Amazon S3 bucket, instead of hard\-coding the bucket name you are writing to, configure the bucket name as an environment variable\. + **Control the dependencies in your function's deployment package\. ** The AWS Lambda execution environment contains a number of libraries such as the AWS SDK for the Node\.js and Python runtimes \(a full list can be found here: [Lambda runtimes](lambda-runtimes.md)\)\. To enable the latest set of features and security updates, Lambda will periodically update these libraries\. These updates may introduce subtle changes to the behavior of your Lambda function\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. + **Minimize your deployment package size to its runtime necessities\. ** This will reduce the amount of time that it takes for your deployment package to be downloaded and unpacked ahead of invocation\. For functions authored in Java or \.NET Core, avoid uploading the entire AWS SDK library as part of your deployment package\. Instead, selectively depend on the modules which pick up components of the SDK you need \(e\.g\. DynamoDB, Amazon S3 SDK modules and [Lambda core libraries](https://github.com/aws/aws-lambda-java-libs)\)\. -+ **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [Deploy Java Lambda functions with \.zip file archives](java-package.md) for instructions\. ++ **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) for instructions\. + **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. diff --git a/doc_source/code-editor.md b/doc_source/code-editor.md index 2472dcff..6812db13 100644 --- a/doc_source/code-editor.md +++ b/doc_source/code-editor.md @@ -4,8 +4,6 @@ The Lambda console provides a code editor for languages that do not require comp The code editor includes the *menu bar*, *windows*, and the *editor pane*\. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. @@ -28,8 +26,6 @@ You can use the **Environment** window in the code editor to create, open, and m ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) - - **To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. **To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. @@ -37,13 +33,9 @@ You can use the **Environment** window in the code editor to create, open, and m **To create a new file**, do one of the following: + In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. + Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -+ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. - - ++ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) - - **To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. **To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. @@ -56,8 +48,6 @@ You can use the **Environment** window in the code editor to create, open, and m **To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) **To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. @@ -68,27 +58,17 @@ Use the editor pane in the code editor to view and write code\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) - - ### Working with tab buttons Use the *tab buttons bar* to select, view, and create files\. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) - - **To display an open file's contents**, do one of the following: + Choose the file's tab\. -+ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. - - ++ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) - - **To close an open file**, do one of the following: + Choose the **X** icon in the file's tab\. + Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. @@ -103,20 +83,12 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) - - **To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) - - **To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) **To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. @@ -127,8 +99,6 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) - - ## Working in fullscreen mode You can expand the code editor to get more room to work with your code\. @@ -137,8 +107,6 @@ To expand the code editor to the edges of the web browser window, choose the **T ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) - - To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 31d4c28e..0fa7f0a8 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -30,19 +30,19 @@ To view the aliases that are currently defined for a function, on the function c To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html) command\. ``` -$ aws lambda create-alias --function-name my-function --name alias-name --function-version version-number --description " " +aws lambda create-alias --function-name my-function --name alias-name --function-version version-number --description " " ``` To change an alias to point a new version of the function, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html) command\. ``` -$ aws lambda update-alias --function-name my-function --name alias-name --function-version version-number +aws lambda update-alias --function-name my-function --name alias-name --function-version version-number ``` To delete an alias, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html) command\. ``` -$ aws lambda delete-alias --function-name my-function --name alias-name +aws lambda delete-alias --function-name my-function --name alias-name ``` The AWS CLI commands in the preceding steps correspond to the following Lambda API operations: @@ -67,7 +67,7 @@ If you attempt to invoke the function without an alias or a specific version, th For example, the following AWS CLI command grants Amazon S3 permissions to invoke the PROD alias of the `helloworld` function when Amazon S3 is acting on behalf of `examplebucket`\. ``` -$ aws lambda add-permission --function-name helloworld \ +aws lambda add-permission --function-name helloworld \ --qualifier PROD --statement-id 1 --principal s3.amazonaws.com --action lambda:InvokeFunction \ --source-arn arn:aws:s3:::examplebucket --source-account 123456789012 ``` @@ -116,21 +116,21 @@ Use the `create-alias` and `update-alias` AWS CLI commands to configure the traf The following example creates a Lambda function alias named **routing\-alias** that points to version 1 of the function\. Version 2 of the function receives 3 percent of the traffic\. The remaining 97 percent of traffic is routed to version 1\. ``` -$ aws lambda create-alias --name routing-alias --function-name my-function --function-version 1 \ +aws lambda create-alias --name routing-alias --function-name my-function --function-version 1 \ --routing-config AdditionalVersionWeights={"2"=0.03} ``` Use the `update-alias` command to increase the percentage of incoming traffic to version 2\. In the following example, you increase the traffic to 5 percent\. ``` -$ aws lambda update-alias --name routing-alias --function-name my-function \ +aws lambda update-alias --name routing-alias --function-name my-function \ --routing-config AdditionalVersionWeights={"2"=0.05} ``` To route all traffic to version 2, use the `update-alias` command to change the `function-version` property to point the alias to version 2\. The command also resets the routing configuration\. ``` -$ aws lambda update-alias --name routing-alias --function-name my-function \ +aws lambda update-alias --name routing-alias --function-name my-function \ --function-version 2 --routing-config AdditionalVersionWeights={} ``` @@ -146,6 +146,4 @@ When you configure traffic weights between two function versions, there are two `19:44:37 START RequestId: request id Version: $version ` For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. -+ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. - - \ No newline at end of file ++ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. \ No newline at end of file diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md index c35cf82d..f61f5d92 100644 --- a/doc_source/configuration-codesigning.md +++ b/doc_source/configuration-codesigning.md @@ -131,7 +131,7 @@ To enable code signing for a function, you associate a code signing configuratio ## Configuring IAM policies -To grant permission for a user to access the [code signing API operations](#config-codesigning-api), attach one or more policy statements to the user policy\. For more information about user policies, see [Identity\-based IAM policies for AWS Lambda](access-control-identity-based.md)\. +To grant permission for a user to access the [code signing API operations](#config-codesigning-api), attach one or more policy statements to the user policy\. For more information about user policies, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. The following example policy statement grants permission to create, update, and retrieve code signing configurations\. @@ -146,15 +146,15 @@ The following example policy statement grants permission to create, update, and "lambda:UpdateCodeSigningConfig", "lambda:GetCodeSigningConfig" ], - "Resource": "*" + "Resource": "*" } ] } ``` -Administrators can use the `CodeSigningConfig` condition key to specify the code signing configurations that developers must use to create or update your functions\. +Administrators can use the `CodeSigningConfigArn` condition key to specify the code signing configurations that developers must use to create or update your functions\. -The following example policy statement grants permission to create a function\. The policy statement includes a `lambda:codeSigningConfig` condition to specify the allowed code signing configuration\. Lambda blocks the `CreateFunction` API request if the `CodeSigningConfigArn` parameter is missing or does not match the value in the condition\. +The following example policy statement grants permission to create a function\. The policy statement includes a `lambda:CodeSigningConfigArn` condition to specify the allowed code signing configuration\. Lambda blocks any `CreateFunction` API request if its `CodeSigningConfigArn` parameter is missing or does not match the value in the condition\. ``` { @@ -169,9 +169,8 @@ The following example policy statement grants permission to create a function\. "Resource": "*", "Condition": { "StringEquals": { - "lambda:codeSigningConfig": + "lambda:CodeSigningConfigArn": “arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0d4518bd353a0a7c6” - } } } } @@ -193,4 +192,4 @@ To manage the code signing configuration for a function, use the following API o + [GetFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionCodeSigningConfig.html) + [PutFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionCodeSigningConfig.html) + [DeleteFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionCodeSigningConfig.html) -+ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) ++ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) \ No newline at end of file diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index a1e499ca..03cd0ad3 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -1,8 +1,14 @@ # Managing concurrency for a Lambda function -Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. +Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. Concurrency is subject to a Regional [quota](gettingstarted-limits.md) that is shared by all functions in a Region\. -Concurrency is subject to a Regional [quota](gettingstarted-limits.md) that is shared by all functions in a Region\. To ensure that a function can always reach a certain level of concurrency, you can configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. +There are two types of concurrency available: ++ Reserved concurrency – Reserved concurrency creates a pool of requests that can only be used by its function, and also prevents its function from using unreserved concurrency\. ++ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond to your function's invocations\. + +This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see AWS Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. + +To ensure that a function can always reach a certain level of concurrency, configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. When Lambda allocates an instance of your function, the [runtime](lambda-runtimes.md) loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. As your function [scales up](invocation-scaling.md), this causes the portion of requests that are served by new instances to have higher latency than the rest\. @@ -95,7 +101,13 @@ Provisioned concurrency does not come online immediately after you configure it\ + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency -Your function's [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. +To optimize latency, you can customize the initialization behavior for functions that use provisioned concurrency \. You can run initialization code for provisioned concurrency instances without impacting latency, because the initialization code runs at allocation time\. However, the initialization code for an on\-demand instance directly impacts the latency of the first invocation\. For an on\-demand instance, you may choose to defer initialization for a specific capability until the function needs that capability\. + +To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIALIZATION\_TYPE\. Lambda sets this environment variable to `provisioned-concurrency` or `on-demand`\. The value of AWS\_LAMBDA\_INITIALIZATION\_TYPE is immutable and does not change over the lifetime of the execution environment\. + +If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PREJIT environment variable to improve the latency for functions that use provisioned concurrency\. The \.NET runtime lazily compiles and initializes each library that your code calls for the first time\. As a result, the first invocation of a Lambda function can take longer than subsequent invocations\. When you set AWS\_LAMBDA\_DOTNET\_PREJIT to `ProvisionedConcurrency`, Lambda performs ahead\-of\-time JIT compilation for common system dependencies\. Lambda performs this initialization optimization for provisioned concurrency instances only, which results in faster performance for the first invocation\. If you set the environment variable to `Always`, Lambda performs ahead\-of\-time JIT compilation for every initialization\. If you set the environment variable to `Never`, ahead\-of\-time JIT compilation is disabled\. The default value for AWS\_LAMBDA\_DOTNET\_PREJIT is `ProvisionedConcurrency`\. + +For provisioned concurrency instances, your function's [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. @@ -128,7 +140,12 @@ To manage concurrency settings and autoscaling with the AWS CLI or AWS SDK, use To configure reserved concurrency with the AWS CLI, use the `put-function-concurrency` command\. The following command reserves a concurrency of 100 for a function named `my-function`: ``` -$ aws lambda put-function-concurrency --function-name my-function --reserved-concurrent-executions 100 +aws lambda put-function-concurrency --function-name my-function --reserved-concurrent-executions 100 +``` + +You should see the following output: + +``` { "ReservedConcurrentExecutions": 100 } @@ -137,8 +154,13 @@ $ aws lambda put-function-concurrency --function-name my-function --reserved-con To allocate provisioned concurrency for a function, use `put-provisioned-concurrency-config`\. The following command allocates a concurrency of 100 for the `BLUE` alias of a function named `my-function`: ``` -$ aws lambda put-provisioned-concurrency-config --function-name my-function \ +aws lambda put-provisioned-concurrency-config --function-name my-function \ --qualifier BLUE --provisioned-concurrent-executions 100 +``` + +You should see the following output: + +``` { "Requested ProvisionedConcurrentExecutions": 100, "Allocated ProvisionedConcurrentExecutions": 0, @@ -150,7 +172,7 @@ $ aws lambda put-provisioned-concurrency-config --function-name my-function \ To configure Application Auto Scaling to manage provisioned concurrency, use the Application Auto Scaling to configure [target tracking scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html)\. First, register a function's alias as a scaling target\. The following example registers the `BLUE` alias of a function named `my-function`: ``` -$ aws application-autoscaling register-scalable-target --service-namespace lambda \ +aws application-autoscaling register-scalable-target --service-namespace lambda \ --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ --scalable-dimension lambda:function:ProvisionedConcurrency ``` @@ -158,10 +180,15 @@ $ aws application-autoscaling register-scalable-target --service-namespace lambd Next, apply a scaling policy to the target\. The following example configures Application Auto Scaling to adjust the provisioned concurrency configuration for an alias to keep utilization near 70 percent: ``` -$ aws application-autoscaling put-scaling-policy --service-namespace lambda \ +aws application-autoscaling put-scaling-policy --service-namespace lambda \ --scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ --policy-name my-policy --policy-type TargetTrackingScaling \ --target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' +``` + +You should see the following output: + +``` { "PolicyARN": "arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:12266dbb-1524-xmpl-a64e-9a0a34b996fa:resource/lambda/function:my-function:BLUE:policyName/my-policy", "Alarms": [ @@ -192,7 +219,12 @@ In the following example, a function scales between a minimum and maximum amount To view your account's concurrency quotas in a Region, use `get-account-settings`\. ``` -$ aws lambda get-account-settings +aws lambda get-account-settings +``` + +You should see the following output: + +``` { "AccountLimit": { "TotalCodeSize": 80530636800, diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md index 02e7ef4f..9a05cc2c 100644 --- a/doc_source/configuration-console.md +++ b/doc_source/configuration-console.md @@ -52,7 +52,7 @@ To configure functions with the Lambda API, use the following actions: For example, to update a function's memory setting with the AWS CLI, use the `update-function-configuration` command\. ``` -$ aws lambda update-function-configuration --function-name my-function --memory-size 256 +aws lambda update-function-configuration --function-name my-function --memory-size 256 ``` For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\. \ No newline at end of file diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index c13a3714..cc56da29 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -46,7 +46,7 @@ You can create a database proxy that uses the function's IAM credentials for aut The Lambda console adds the required permission \(`rds-db:connect`\) to the execution role\. You can then use the AWS SDK to generate a token that allows it to connect to the proxy\. The following example shows how to configure a database connection with the `mysql2` library in Node\.js\. -**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** +**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** ``` const signer = new AWS.RDS.Signer({ @@ -75,11 +75,11 @@ For more information, see [IAM database authentication](https://docs.aws.amazon. ## Sample application Sample applications that demonstrate the use of Lambda with an Amazon RDS database are available in this guide's GitHub repository\. There are two applications: -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. ++ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. - [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) -+ [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. + [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) ++ [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. - [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) + [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) -To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/README.md)\. \ No newline at end of file +To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index e17e2131..5720a4a1 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -119,6 +119,8 @@ Lambda [runtimes](lambda-runtimes.md) set several environment variables during i + `AWS_LAMBDA_FUNCTION_NAME` – The name of the function\. + `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` – The amount of memory available to the function in MB\. + `AWS_LAMBDA_FUNCTION_VERSION` – The version of the function being executed\. + + `AWS_LAMBDA_INITIALIZATION_TYPE` – The initialization type of the function, which is either `on-demand` or `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. + `AWS_LAMBDA_LOG_GROUP_NAME`, `AWS_LAMBDA_LOG_STREAM_NAME` – The name of the Amazon CloudWatch Logs group and stream for the function\. + `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` – The access keys obtained from the function's [execution role](lambda-intro-execution-role.md)\. + `AWS_LAMBDA_RUNTIME_API` – \([Custom runtime](runtimes-custom.md)\) The host and port of the [runtime API](runtimes-api.md)\. @@ -137,6 +139,7 @@ The following additional environment variables aren't reserved and can be extend + `GEM_PATH` – \([Ruby](lambda-ruby.md)\) The Ruby library path \(`$LAMBDA_TASK_ROOT/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0`\)\. + `AWS_XRAY_CONTEXT_MISSING` – For X\-Ray tracing, Lambda sets this to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. + `AWS_XRAY_DAEMON_ADDRESS` – For X\-Ray tracing, the IP address and port of the X\-Ray daemon\. ++ `AWS_LAMBDA_DOTNET_PREJIT` – For the \.NET 3\.1 runtime, set this variable to enable or disable \.NET 3\.1 specific runtime optimizations\. Values include `always`, `never`, and `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. The sample values shown reflect the latest runtimes\. The presence of specific variables or their values can vary on earlier runtimes\. @@ -230,7 +233,7 @@ To manage environment variables with the AWS CLI or AWS SDK, use the following A The following example sets two environment variables on a function named `my-function`\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --environment "Variables={BUCKET=my-bucket,KEY=file.txt}" ``` @@ -239,7 +242,12 @@ When you apply environment variables with the `update-function-configuration` co To get the current configuration, use the `get-function-configuration` command\. ``` -$ aws lambda get-function-configuration --function-name my-function +aws lambda get-function-configuration --function-name my-function +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -261,7 +269,7 @@ To ensure that the values don't change between when you read the configuration a To configure a function's encryption key, set the `KMSKeyARN` option\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --kms-key-arn arn:aws:kms:us-east-2:123456789012:key/055efbb4-xmpl-4336-ba9c-538c7d31f599 ``` @@ -271,4 +279,4 @@ Sample applications in this guide's GitHub repository demonstrate the use of env **Sample applications** + [Blank function](samples-blank.md) – Create a function and an Amazon SNS topic in the same template\. Pass the name of the topic to the function in an environment variable\. Read environment variables in code \(multiple languages\)\. -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file ++ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 2a9a0a32..29308b57 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -80,15 +80,20 @@ Use the following API operations to connect your Lambda function to a file syste To connect a function to a file system, use the `update-function-configuration` command\. The following example connects a function named `my-function` to a file system with ARN of an access point\. ``` -$ ARN=arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd -$ aws lambda update-function-configuration --function-name my-function \ +ARN=arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd +aws lambda update-function-configuration --function-name my-function \ --fs-config FileSystemArn=$ARN,LocalMountPath=/mnt/efs0 ``` You can get the ARN of a file system's access point with the `describe-access-points` command\. ``` -$ aws efs describe-access-points +aws efs describe-access-points +``` + +You should see the following output: + +``` { "AccessPoints": [ { @@ -174,4 +179,4 @@ For the AWS CloudFormation `AWS::Lambda::Function` type, the property name and f ## Sample applications The GitHub repository for this guide includes a sample application that demonstrates the use of Amazon EFS with a Lambda function\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 35a6a8cd..5c252be0 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -23,7 +23,7 @@ In Amazon ECR, if you reassign the image tag to another image, Lambda does not u ## Function version $LATEST -When you publish a function version, the code and most of the configuration settings are locked to maintain a consistent experience for users of that version\. You can change the code and many configuration settings only on the unpublished version of the function\. The unpublished version is named **$LATEST**\. To view the current function version, choose the function, then choose **Qualifiers**\. +When you publish a function version, the code and most of the configuration settings are locked to maintain a consistent experience for users of that version\. You can change the code and many configuration settings only on the unpublished version of the function\. By default, the console displays configuration information for the unpublished version of the function\. To view the versions of a function, choose **Qualifiers**\. The unpublished version is named **$LATEST**\. Note that Amazon Elastic Container Registry \(Amazon ECR\) also uses a *latest* tag to denote the latest version of the container image\. Be careful not to confuse this tag with the **$LATEST** function version\. @@ -153,7 +153,7 @@ To manage functions defined as container images, use the following API operation + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. +To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. Note that you must create the function from the same account as the container registry in Amazon EFS\. ``` aws lambda create-function --region sa-east-1 --function-name my-function \ @@ -169,7 +169,7 @@ You cannot change the `package-type` of a function\. ``` aws lambda update-function-code --region sa-east-1 --function-name my-function \ - --imageUri \ + --image-uri \ ``` To update the function parameters, use the `update-function-configuration` operation\. Specify `EntryPoint` and `Command` as arrays of strings, and `WorkingDirectory` as a string\. diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 7178be02..209a0076 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -1,39 +1,45 @@ -# AWS Lambda layers +# Lambda layers -You can configure your Lambda function to pull in additional code and content in the form of layers\. A layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. +You can configure your Lambda function to pull in additional code and content in the form of layers\. A *layer* is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. **Note** -Functions defined as a container images do not support Lambda layers\. You can package your preferred runtimes and dependencies as a part of the container image when you build the image\. +Functions defined as container images do not support layers\. When you build a container image, you can package your preferred runtimes and dependencies as a part of the image\. Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB\. **Note** -A function can use up to 5 layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. +A function can use up to five layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. -You can create layers, or use layers published by AWS and other AWS customers\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/), or all accounts\. +You can create layers, or use layers that AWS or an AWS customer has published\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html), or all accounts\. Layers are extracted to the `/opt` directory in the function execution environment\. Each runtime looks for libraries in a different location under `/opt`, depending on the language\. [Structure your layer](#configuration-layers-path) so that function code can access libraries without additional configuration\. -You can also use AWS Serverless Application Model \(AWS SAM\) to manage layers and your function's layer configuration\. For instructions, see [Declaring serverless resources](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template.html) in the *AWS Serverless Application Model Developer Guide*\. +You can also use the AWS Serverless Application Model \(AWS SAM\) to manage layers and your function's layer configuration\. For instructions, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. **Topics** -+ [Configuring a function to use layers](#configuration-layers-using) -+ [Managing layers](#configuration-layers-manage) -+ [Including library dependencies in a layer](#configuration-layers-path) ++ [Configure a function to use layers](#configuration-layers-using) ++ [Create layers](#configuration-layers-create) ++ [Manage layers](#configuration-layers-manage) ++ [Include library dependencies in a layer](#configuration-layers-path) + [Layer permissions](#configuration-layers-permissions) + [AWS CloudFormation and AWS SAM](#configuration-layers-cloudformation) + [Sample applications](#configuration-layers-samples) -## Configuring a function to use layers +## Configure a function to use layers -You can specify up to 5 layers in your function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, update your function's configuration\. +You can specify up to five layers in your Lambda function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, update your function's configuration\. To add layers to your function, use the `update-function-configuration` command\. The following example adds two layers: one from the same account as the function, and one from a different account\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 +``` + +You should see the following output: + +``` { "FunctionName": "test-layers", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -54,23 +60,52 @@ arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 } ``` -You must specify the version of each layer to use by providing the full ARN of the layer version\. When you add layers to a function that already has layers, the previous list is overwritten by the new one\. Include all layers every time you update the layer configuration\. To remove all layers, specify an empty list\. +You must specify the version of each layer to use by providing the full Amazon Resource Name \(ARN\) of the layer version\. When you add layers to a function that already has layers, the new list overwrites the previous list\. Include all layers every time that you update the layer configuration\. To remove all layers, specify an empty list\. ``` -$ aws lambda update-function-configuration --function-name my-function --layers [] +aws lambda update-function-configuration --function-name my-function --layers [] ``` While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. -The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still existed\. However, when you update the layer configuration, you must remove the reference to the deleted version\. +The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. + +## Create layers + +You can create new layers in the Lambda console or using the Lambda API\. + +**To create a layer in the console** + +1. Open the [Layers page](https://console.aws.amazon.com/lambda/home#/layers) of the Lambda console\. + +1. Choose **Create layer**\. -## Managing layers +1. For **Name**, enter a name for your layer\. + +1. \(Optional\) For **Description**, enter a description for your layer\. + +1. To upload your layer code, do one of the following: + + To upload a \.zip file from your computer, choose **Upload a \.zip file**, choose your \.zip file, and then choose **Open**\. + + To upload a file from Amazon Simple Storage Service \(Amazon S3\), choose **Upload a file from Amazon S3**\. Then, for **Amazon S3 link URL**, enter a link to the file\. + +1. \(Optional\) For **Compatible runtimes**, choose up to 15 runtimes\. + +1. \(Optional\) For **License**, enter any necessary license information\. + +1. Choose **Create**\. + +**To create a layer using the API** To create a layer, use the `publish-layer-version` command with a name, description, \.zip file archive, and a list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional, but it makes the layer easier to discover\. ``` -$ aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ +aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip --compatible-runtimes python3.6 python3.7 +``` + +You should see the following output: + +``` { "Content": { "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-4aaa2fbb-ff77-4b0a-ad92-5b78a716a96a?versionId=27iWyA73cCAYqyH...", @@ -91,12 +126,19 @@ $ aws lambda publish-layer-version --layer-name my-layer --description "My layer } ``` -Each time you call `publish-layer-version`, you create a new version\. Functions that use the layer refer directly to a layer version\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. +Each time that you call `publish-layer-version`, you create a new version\. Functions that use the layer refer directly to a layer version\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. + +## Manage layers + + To find layers that are compatible with your Lambda function's runtime, use the `list-layers` command\. - To find layers that are compatible with your function's runtime, use the `list-layers` command\. +``` +aws lambda list-layers --compatible-runtime python3.8 +``` + +You should see the following output: ``` -$ aws lambda list-layers --compatible-runtime python3.8 { "Layers": [ { @@ -118,10 +160,15 @@ $ aws lambda list-layers --compatible-runtime python3.8 } ``` -You can omit the runtime option to list all layers\. The details in the response reflect the latest version of the layer\. See all the versions of a layer with `list-layer-versions`\. To see more information about a version, use `get-layer-version`\. +To list all layers, you can omit the runtime option\. The details in the response reflect the latest version of the layer\. See all the versions of a layer with `list-layer-versions`\. To see more information about a version, use `get-layer-version`\. + +``` +aws lambda get-layer-version --layer-name my-layer --version-number 2 +``` + +You should see the following output: ``` -$ aws lambda get-layer-version --layer-name my-layer --version-number 2 { "Content": { "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-91e9ea6e-492d-4100-97d5-a4388d442f3f?versionId=GmvPV.309OEpkfN...", @@ -141,19 +188,21 @@ $ aws lambda get-layer-version --layer-name my-layer --version-number 2 } ``` -The link in the response lets you download the layer archive and is valid for 10 minutes\. To delete a layer version, use the `delete-layer-version` command\. +The link in the response lets you download the layer archive\. The link is valid for 10 minutes\. + +To delete a layer version, use the `delete-layer-version` command\. ``` -$ aws lambda delete-layer-version --layer-name my-layer --version-number 1 +aws lambda delete-layer-version --layer-name my-layer --version-number 1 ``` -When you delete a layer version, you can no longer configure functions to use it\. However, any function that already uses the version continues to have access to it\. Version numbers are never re\-used for a layer name\. +When you delete a layer version, you can no longer configure functions to use it\. However, any function that already uses the version continues to have access to it\. Version numbers are never reused for a layer name\. -## Including library dependencies in a layer +## Include library dependencies in a layer -You can move runtime dependencies out of your function code by placing them in a layer\. Lambda runtimes include paths in the `/opt` directory to ensure that your function code has access to libraries that are included in layers\. +You can move runtime dependencies out of your Lambda function code by placing them in a layer\. Lambda runtimes include paths in the `/opt` directory to ensure that your function code has access to libraries that are included in layers\. -To include libraries in a layer, place them in one of the folders supported by your runtime, or modify that path variable for your language\. +To include libraries in a layer, place them in one of the folders that your runtime supports, or modify that path variable for your language\. + **Node\.js** – `nodejs/node_modules`, `nodejs/node8/node_modules` \(`NODE_PATH`\) **Example AWS X\-Ray SDK for Node\.js** @@ -203,25 +252,30 @@ For more information about path settings in the Lambda execution environment, se ## Layer permissions -Layer usage permissions are managed on the resource\. To configure a function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md) or from the function's [resource\-based policy](access-control-resource-based.md)\. To use a layer in another account, you need permission on your user policy, and the owner of the other account must grant your account permission with a resource\-based policy\. +Layer usage permissions are managed on the resource\. To configure a Lambda function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md) or from the function's [resource\-based policy](access-control-resource-based.md)\. To use a layer in another account, you need permission on your user policy, and the owner of the other account must grant your account permission with a resource\-based policy\. To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. ``` -$ aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ +aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ --action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text +``` + +You should see the following output: + +``` e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} ``` -Permissions only apply to a single version of a layer\. Repeat the procedure each time you create a new layer version\. +Permissions apply only to a single version of a layer\. Repeat the process each time that you create a new layer version\. For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. ## AWS CloudFormation and AWS SAM -Use the AWS Serverless Application Model \(AWS SAM\) in your AWS CloudFormation templates to automate the creation and mapping of layers in your application\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your function configuration\. +To automate the creation and mapping of layers in your application, use AWS SAM in your AWS CloudFormation templates\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Serverless resources** ``` AWSTemplateFormatVersion: '2010-09-09' @@ -259,9 +313,9 @@ When you update your dependencies and deploy, AWS SAM creates a new version of t ## Sample applications The GitHub repository for this guide provides [sample applications](lambda-samples.md) that demonstrate the use of layers for dependency management\. -+ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) -+ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) -+ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) -+ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) ++ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) ++ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) ++ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) ++ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. \ No newline at end of file diff --git a/doc_source/configuration-memory.md b/doc_source/configuration-memory.md index 1ecbcf60..ee80ac23 100644 --- a/doc_source/configuration-memory.md +++ b/doc_source/configuration-memory.md @@ -1,19 +1,39 @@ # Configuring Lambda function memory -AWS Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your function at runtime\. You can increase or decrease the memory and CPU power allocated to your Lambda function using the Memory \(MB\) setting\. To set the memory for your function, enter a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. This page describes how to update the memory allotted to your function on the Lambda console\. +Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your Lambda function at runtime\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. -## Configuring function memory on the Lambda console +This page describes how to update the memory allotted to your function in the Lambda console\. -You can configure the memory of your function in a text field on the Lambda console\. +## Configuring function memory in the Lambda console -**To update the memory for an existing function** +You can configure the memory of your function in the Lambda console\. + +**To update the memory of a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. On the [function configuration page](configuration-console.md), on the **Basic settings** pane, choose **Edit**\. + +1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\. + +1. Choose **Save**\. + +## Accepting function memory recommendations on the Lambda console + +If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. + +When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\. + +**To accept a function memory recommendation** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. -1. Choose **Edit** on the **Basic settings** pane\. +1. On the [function configuration page](configuration-console.md), on the **Basic settings** pane, choose **Edit**\. -1. Enter a value in the text box\. +1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\. 1. Choose **Save**\. \ No newline at end of file diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 3aa5fcd3..7b97c72a 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -42,7 +42,7 @@ With AWS Billing and Cost Management, you can use tags to customize billing repo When you create a new Lambda function, you can include tags with the `--tags` option\. ``` -$ aws lambda create-function --function-name my-function +aws lambda create-function --function-name my-function --handler index.js --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-role \ --tags Department=Marketing,CostCenter=1234ABCD @@ -51,7 +51,7 @@ $ aws lambda create-function --function-name my-function To add tags to an existing function, use the `tag-resource` command\. ``` -$ aws lambda tag-resource \ +aws lambda tag-resource \ --resource arn:aws:lambda:us-east-2:123456789012:function:my-function \ --tags Department=Marketing,CostCenter=1234ABCD ``` @@ -59,7 +59,7 @@ $ aws lambda tag-resource \ To remove tags, use the `untag-resource` command\. ``` -$ aws lambda untag-resource --resource function arn \ +aws lambda untag-resource --resource function arn \ --tag-keys Department ``` @@ -67,12 +67,12 @@ If you want to view the tags that are applied to a specific Lambda function, you + [ListTags](API_ListTags.md) – You supply your Lambda function ARN \(Amazon Resource Name\) to view a list of the tags associated with this function: ``` - $ aws lambda list-tags --resource function arn + aws lambda list-tags --resource function arn ``` + [GetFunction](API_GetFunction.md) – You supply your Lambda function name to a view a list of the tags associated with this function: ``` - $ aws lambda get-function --function-name my-function + aws lambda get-function --function-name my-function ``` You can also use the AWS Tagging Service’s [GetResources](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) API to filter your resources by tags\. The GetResources API receives up to 10 filters, with each filter containing a tag key and up to 10 tag values\. You provide GetResources with a ‘ResourceType’ to filter by specific resource types\. For more information about the AWS Tagging Service, see [Working with Resource Groups](https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/resource-groups.html)\. diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index 8bfe7d5d..75d05619 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -35,7 +35,12 @@ To publish a version of a function, use the [PublishVersion](API_PublishVersion. The following example publishes a new version of a function\. The response returns configuration information about the new version, including the version number and the function ARN with the version suffix\. ``` -$ aws lambda publish-version --function-name my-function +aws lambda publish-version --function-name my-function +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:1", diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index af0834c1..7ac4795d 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -80,9 +80,10 @@ The following is an example of an endpoint policy for Lambda\. When attached to { "Statement":[ { - "Principal": { - "AWS": "arn:aws:iam::123412341234:user/MyUser", - } + "Principal": + { + "AWS": "arn:aws:iam::123412341234:user/MyUser" + }, "Effect":"Allow", "Action":[ "lambda:InvokeFunction" @@ -93,4 +94,4 @@ The following is an example of an endpoint policy for Lambda\. When attached to } ] } -``` +``` \ No newline at end of file diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index eea956ec..a592160d 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -2,7 +2,7 @@ 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 while the function is running\. -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\. +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 subnet in your function's VPC configuration\. This process can take about a minute\. 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)\. @@ -84,7 +84,7 @@ To connect a Lambda function to a VPC, you can use the following API operations: To create a function and connect it to a VPC using the AWS Command Line Interface \(AWS CLI\), you can use the `create-function` command with the `vpc-config` option\. The following example creates a function with a connection to a VPC with two subnets and one security group\. ``` -$ aws lambda create-function --function-name my-function \ +aws lambda create-function --function-name my-function \ --runtime nodejs12.x --handler index.js --zip-file fileb://function.zip \ --role arn:aws:iam::123456789012:role/lambda-role \ --vpc-config SubnetIds=subnet-071f712345678e7c8,subnet-07fd123456788a036,SecurityGroupIds=sg-085912345678492fb @@ -93,14 +93,14 @@ $ aws lambda create-function --function-name my-function \ To connect an existing function to a VPC, use the `update-function-configuration` command with the `vpc-config` option\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --vpc-config SubnetIds=subnet-071f712345678e7c8,subnet-07fd123456788a036,SecurityGroupIds=sg-085912345678492fb ``` To disconnect your function from a VPC, update the function configuration with an empty list of subnets and security groups\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --vpc-config SubnetIds=[],SecurityGroupIds=[] ``` @@ -296,7 +296,7 @@ In the following tutorials, you connect a Lambda function to resources in your V ## Sample VPC configurations You can use the following sample AWS CloudFormation templates to create VPC configurations to use with Lambda functions\. There are two templates available in this guide's GitHub repository: -+ [vpc\-private\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/vpc-private.yaml) – A VPC with two private subnets and VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. Use this template to create a VPC for functions that don't need internet access\. This configuration supports use of Amazon S3 and DynamoDB with the AWS SDKs, and access to database resources in the same VPC over a local network connection\. -+ [vpc\-privatepublic\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/vpc-privatepublic.yaml) – A VPC with two private subnets, VPC endpoints, a public subnet with a NAT gateway, and an internet gateway\. Internet\-bound traffic from functions in the private subnets is routed to the NAT gateway using a route table\. ++ [vpc\-private\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/vpc-private.yaml) – A VPC with two private subnets and VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. Use this template to create a VPC for functions that don't need internet access\. This configuration supports use of Amazon S3 and DynamoDB with the AWS SDKs, and access to database resources in the same VPC over a local network connection\. ++ [vpc\-privatepublic\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/vpc-privatepublic.yaml) – A VPC with two private subnets, VPC endpoints, a public subnet with a NAT gateway, and an internet gateway\. Internet\-bound traffic from functions in the private subnets is routed to the NAT gateway using a route table\. To create a VPC using a template, on the AWS CloudFormation console [Stacks page](https://console.aws.amazon.com/cloudformation/home#/stacks), choose **Create stack**, and then follow the instructions in the **Create stack** wizard\. \ No newline at end of file diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index 3384f72a..dbb88487 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -1,10 +1,18 @@ # AWS Lambda function errors in C\# -When an exception occurs in your Lambda function, Lambda will report the exception information back to you\. Exceptions can occur in two different places: -+ Initialization \(Lambda loading your code, validating the handler string, and creating an instance of your class if it is non\-static\)\. -+ The Lambda function invocation\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. -The serialized exception information is returned as the payload as a modeled JSON object and outputted to CloudWatch logs\. +This page describes how to view Lambda function invocation errors for the C\# runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#csharp-exceptions-syntax) ++ [How it works](#csharp-exceptions-how) ++ [Using the Lambda console](#csharp-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#csharp-exceptions-cli) ++ [Error handling in other AWS services](#csharp-exceptions-other-services) ++ [What's next?](#csharp-exceptions-next-up) + +## Syntax In the initialization phase, exceptions can be thrown for invalid handler strings, a rule\-breaking type or method \(see [Lambda function handler restrictions ](csharp-handler.md#csharp-handler-restrictions)\), or any other validation method \(such as forgetting the serializer attribute and having a POCO as your input or output type\)\. These exceptions are of type `LambdaException`\. For example: @@ -116,4 +124,109 @@ The method in which error information is conveyed depends on the invocation type For example, if you invoke a Lambda function using the Lambda console, the `RequestResponse` is always the invocation type and the console displays the error information returned by AWS Lambda in the **Execution result** section of the console\. + `Event` invocation type \(that is, asynchronous execution\): In this case AWS Lambda does not return anything\. Instead, it logs the error information in CloudWatch Logs and CloudWatch metrics\. -Depending on the event source, AWS Lambda may retry the failed Lambda function\. For more information, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. \ No newline at end of file +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ + +You should see the AWS CLI response in your command prompt: + +``` +{ + "StatusCode": 200, + "FunctionError": "Unhandled", + "ExecutedVersion": "$LATEST" +} +``` + +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: + +``` +cat output.txt +``` + +You should see the invocation response in your command prompt\. + +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in C\#](csharp-logging.md)\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting C\# code in AWS Lambda](csharp-tracing.md)\. + +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in C\#](csharp-logging.md) page\. \ No newline at end of file diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index bad3a2ad..04b6de39 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -52,24 +52,23 @@ All other types, as listed below, require you to specify a serializer\. Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializer that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. - To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.Json` in your `project.json` file\. + To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.Json` in your `.csproj` file\. ``` -{ - "version": "1.0.0-*", - "dependencies":{ - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.1" - }, - "Amazon.Lambda.Serialization.Json": "1.3.0" - }, - "frameworks": { - "netcoreapp1.0": { - "imports": "dnxcore50" - } - } -} + + + netcoreapp3.1 + true + AssemblyName + + + + + + + + + ``` The example below illustrates the flexibility you can leverage by specifying the default Json\.NET serializer on one method and another of your choosing on a different method: @@ -98,7 +97,7 @@ If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda When creating Lambda functions, you have to provide a handler string that tells AWS Lambda where to look for the code to invoke\. In C\#, the format is: *ASSEMBLY::TYPE::METHOD* where: -+ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `buildOptions.outputName` setting in project\.json, the *ASSEMBLY* name will be the name of the folder that contains your project\.json file\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the folder name is `HelloWorldApp`\. ++ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in \.csproj, the *ASSEMBLY* name will be the name of the folder that contains your \.csproj file once the build is complete\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the folder name is `HelloWorldApp`\. + *TYPE* is the full name of the handler type, which consists of the *Namespace* and the *ClassName*\. In this case `Example.Hello`\. + *METHOD* is name of the function handler, in this case `MyHandler`\. diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 664397c5..eabed738 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -15,7 +15,7 @@ AWS provides the following base images for \.NET: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/master/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | +| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/main/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | | core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index ac5fd8e0..e939a3ce 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -1,29 +1,40 @@ # AWS Lambda function logging in C\# -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** +**Topics** ++ [Creating a function that returns logs](#csharp-logging-output) ++ [Using the Lambda console](#csharp-logging-console) ++ [Using the CloudWatch console](#csharp-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#csharp-logging-cli) ++ [Deleting logs](#csharp-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. + +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** ``` public async Task FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) + { + GetAccountSettingsResponse accountSettings; + try { - GetAccountSettingsResponse accountSettings; - try - { - accountSettings = await callLambda(); - } - catch (AmazonLambdaException ex) - { - throw ex; - } - AccountUsage accountUsage = accountSettings.AccountUsage; - LambdaLogger.Log("ENVIRONMENT VARIABLES: " + JsonConvert.SerializeObject(System.Environment.GetEnvironmentVariables())); - LambdaLogger.Log("CONTEXT: " + JsonConvert.SerializeObject(context)); - LambdaLogger.Log("EVENT: " + JsonConvert.SerializeObject(invocationEvent)); - return accountUsage; + accountSettings = await callLambda(); + } + catch (AmazonLambdaException ex) + { + throw ex; } + AccountUsage accountUsage = accountSettings.AccountUsage; + LambdaLogger.Log("ENVIRONMENT VARIABLES: " + JsonConvert.SerializeObject(System.Environment.GetEnvironmentVariables())); + LambdaLogger.Log("CONTEXT: " + JsonConvert.SerializeObject(context)); + LambdaLogger.Log("EVENT: " + JsonConvert.SerializeObject(invocationEvent)); + return accountUsage; + } ``` **Example Log format** @@ -32,32 +43,32 @@ public async Task FunctionHandler(SQSEvent invocationEvent, ILambd START RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d Version: $LATEST ENVIRONMENT VARIABLES: { - "AWS_EXECUTION_ENV": "AWS_Lambda_dotnetcore2.1", - "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256", - "AWS_LAMBDA_LOG_GROUP_NAME": "/aws/lambda/blank-csharp-function-WU56XMPLV2XA", - "AWS_LAMBDA_FUNCTION_VERSION": "$LATEST", - "AWS_LAMBDA_LOG_STREAM_NAME": "2020/03/27/[$LATEST]5296xmpl084f411d9fb73b258393f30c", - "AWS_LAMBDA_FUNCTION_NAME": "blank-csharp-function-WU56XMPLV2XA", - ... + "AWS_EXECUTION_ENV": "AWS_Lambda_dotnetcore2.1", + "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256", + "AWS_LAMBDA_LOG_GROUP_NAME": "/aws/lambda/blank-csharp-function-WU56XMPLV2XA", + "AWS_LAMBDA_FUNCTION_VERSION": "$LATEST", + "AWS_LAMBDA_LOG_STREAM_NAME": "2020/03/27/[$LATEST]5296xmpl084f411d9fb73b258393f30c", + "AWS_LAMBDA_FUNCTION_NAME": "blank-csharp-function-WU56XMPLV2XA", + ... EVENT: { - "Records": [ - { - "MessageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", - "ReceiptHandle": "MessageReceiptHandle", - "Body": "Hello from SQS!", - "Md5OfBody": "7b270e59b47ff90a553787216d55d91d", - "Md5OfMessageAttributes": null, - "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:MyQueue", - "EventSource": "aws:sqs", - "AwsRegion": "us-west-2", - "Attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1523232000000", - "SenderId": "123456789012", - "ApproximateFirstReceiveTimestamp": "1523232000001" - }, - ... + "Records": [ + { + "MessageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", + "ReceiptHandle": "MessageReceiptHandle", + "Body": "Hello from SQS!", + "Md5OfBody": "7b270e59b47ff90a553787216d55d91d", + "Md5OfMessageAttributes": null, + "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:MyQueue", + "EventSource": "aws:sqs", + "AwsRegion": "us-west-2", + "Attributes": { + "ApproximateReceiveCount": "1", + "SentTimestamp": "1523232000000", + "SenderId": "123456789012", + "ApproximateFirstReceiveTimestamp": "1523232000001" + }, + ... END RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d REPORT RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d Duration: 4157.16 ms Billed Duration: 4200 ms Memory Size: 256 MB Max Memory Used: 99 MB Init Duration: 841.60 ms XRAY TraceId: 1-5e7e8131-7ff0xmpl32bfb31045d0a3bb SegmentId: 0152xmpl6016310f Sampled: true @@ -76,33 +87,43 @@ The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocatio + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#csharp-logging-console) -+ [Using the AWS CLI](#csharp-logging-cli) -+ [Deleting logs](#csharp-logging-delete) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. + +## Using the CloudWatch console + +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. + +**To view logs on the CloudWatch console** -## Viewing logs in the AWS Management Console +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -**To view your Lambda function's logs** +1. Choose a log stream\. -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -1. Choose the first stream in the list\. +## Using the AWS Command Line Interface \(AWS CLI\) -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -## Using the AWS CLI +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -110,23 +131,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -136,10 +160,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md index 39aaad94..cf47126e 100644 --- a/doc_source/csharp-package.md +++ b/doc_source/csharp-package.md @@ -1,10 +1,6 @@ # Deploy C\# Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. - -A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. - -A \.NET Core deployment package \(\.zip file archive\) contains your function's compiled assembly along with all of its assembly dependencies\. The package also contains a `proj.deps.json` file\. This signals to the \.NET Core runtime all of your function's dependencies and a `proj.runtimeconfig.json` file, which is used to configure the runtime\. The \.NET command line interface \(CLI\) `publish` command can create a folder with all of these files\. However, by default the `proj.runtimeconfig.json` is not included because a Lambda project is typically configured to be a class library\. To force the `proj.runtimeconfig.json` to be written as part of the `publish` process, pass in the command line argument `/p:GenerateRuntimeConfigurationFiles=true` to the `publish` command\. +A \.NET Core deployment package \(\.zip file archive\) contains your function's compiled assembly along with all of its assembly dependencies\. The package also contains a `proj.deps.json` file\. This signals to the \.NET Core runtime all of your function's dependencies and a `proj.runtimeconfig.json` file, which is used to configure the runtime\. The \.NET command line interface \(CLI\) `publish` command can create a folder with all of these files\. By default, the `proj.runtimeconfig.json` is not included because a Lambda project is typically configured to be a class library\. To force the `proj.runtimeconfig.json` to be written as part of the `publish` process, pass in the command line argument `/p:GenerateRuntimeConfigurationFiles=true` to the `publish` command\. Although it is possible to create the deployment package with the `dotnet publish` command, we recommend that you create the deployment package with either the [\.NET Core CLI](csharp-package-cli.md) or the [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)\. These are tools optimized specifically for Lambda to ensure that the `lambda-project.runtimeconfig.json` file exists and optimizes the package bundle, including the removal of any non\-Linux\-based dependencies\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index fdce4a13..37704f8a 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -31,7 +33,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your function code to record metadata and trace downstream calls\. To record detail about calls that your function makes to other resources and services, use the X\-Ray SDK for \.NET\. To get the SDK, add the `AWSXRayRecorder` packages to your project file\. -**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** +**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** ``` @@ -55,7 +57,7 @@ You can instrument your function code to record metadata and trace downstream ca To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initialization code\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** ``` static async void initialize() { @@ -90,7 +92,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -100,7 +102,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -114,7 +116,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index 3bc7c59b..5e2b25a1 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -8,6 +8,8 @@ The [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverle The [AWS CLI](gettingstarted-tools.md#gettingstarted-tools-awscli) and [SAM CLI](gettingstarted-tools.md#gettingstarted-tools-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates and testing locally\. +When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [What are connections?](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. + **Topics** + [Managing applications in the AWS Lambda console](applications-console.md) + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index 8eb61de2..6ff428af 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -9,7 +9,12 @@ When you create a function, the function is initially in the `Pending` state\. W 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 +aws lambda get-function-configuration --function-name my-function +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 90dc9733..77869296 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 12\.x** is selected\. + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. 1. Choose **Create function**\. @@ -125,10 +125,15 @@ In this getting started exercise, you use the Docker CLI to create a container i ### Prerequisites -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -185,7 +190,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. 1. Build your Docker image\. From your project directory, run the following command: ``` - docker build -t hello-world . + docker build -t hello-world . ``` 1. \(Optional\) AWS base images include the Lambda runtime interface emulator, so you can test your function locally\. @@ -196,7 +201,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. docker run -p 9000:8080 hello-world:latest ``` - 1. Test your Lambda function\. From your project directory, run a `curl` command to invoke your function: + 1. Test your Lambda function\. In a new terminal window, run a `curl` command to invoke your function: ``` curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' @@ -207,13 +212,13 @@ In the following commands, replace `123456789012` with your AWS account ID\. 1. Authenticate the Docker CLI to your Amazon ECR registry\. ``` - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com ``` 1. Create a repository in Amazon ECR using the `create-repository` command\. ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE ``` 1. Tag your image to match your repository name using the `docker tag` command\. @@ -340,4 +345,4 @@ If you are done working with your function, delete it\. You can also delete the 1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index f83328b5..7d821b6d 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -1,17 +1,22 @@ # Using AWS Lambda with the AWS Command Line Interface -You can use the AWS Command Line Interface to manage functions and other AWS Lambda resources\. The AWS CLI uses the AWS SDK for Python \(Boto\) to interact with the Lambda API\. You can use it to learn about the API, and apply that knowledge in building applications that use Lambda with the AWS SDK\. +You can use the AWS Command Line Interface to manage functions and other AWS Lambda resources\. The AWS CLI uses the AWS SDK for Python \(Boto\) to interact with the Lambda API\. You can use it to learn about the API, and apply that knowledge in building applications that use Lambda with the AWS SDK\. -In this tutorial, you manage and invoke Lambda functions with the AWS CLI\. +In this tutorial, you manage and invoke Lambda functions with the AWS CLI\. For more information, see [What is the AWS CLI?](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) in the *AWS Command Line Interface User Guide*\. ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started-create-function.md)\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -26,7 +31,12 @@ This tutorial uses the AWS Command Line Interface \(AWS CLI\) to call service AP Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. To create an execution role with the AWS CLI, use the `create-role` command\. ``` -$ aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json +aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json +``` + +You should see the following output: + +``` { "Role": { "Path": "/", @@ -72,13 +82,13 @@ The `trust-policy.json` file is a JSON file in the current directory that define You can also specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. ``` -$ aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' +aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' ``` To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` -$ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole +aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole ``` The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. @@ -104,15 +114,20 @@ exports.handler = async function(event, context) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. Replace the highlighted text in the role ARN with your account ID\. ``` - $ aws lambda create-function --function-name my-function \ + aws lambda create-function --function-name my-function \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-ex + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -132,7 +147,12 @@ exports.handler = async function(event, context) { To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail +aws lambda invoke --function-name my-function out --log-type Tail +``` + +You should see the following output: + +``` { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -143,8 +163,13 @@ $ aws lambda invoke --function-name my-function out --log-type Tail You can use the `base64` utility to decode the logs\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` + +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 @@ -169,7 +194,12 @@ aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-na The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. ``` -$ ./get-logs.sh +./get-logs.sh +``` + +You should see the following output: + +``` { "StatusCode": 200, "ExecutedVersion": "$LATEST" @@ -212,7 +242,12 @@ $ ./get-logs.sh Run the following AWS CLI `list-functions` command to retrieve a list of functions that you have created\. ``` -$ aws lambda list-functions --max-items 10 +aws lambda list-functions --max-items 10 +``` + +You should see the following output: + +``` { "Functions": [ { @@ -240,7 +275,7 @@ $ aws lambda list-functions --max-items 10 In response, Lambda returns a list of up to 10 functions\. If there are more functions you can retrieve, `NextToken` provides a marker you can use in the next `list-functions` request\. The following `list-functions` AWS CLI command is an example that shows the `--starting-token` parameter\. ``` -$ aws lambda list-functions --max-items 10 --starting-token eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0= +aws lambda list-functions --max-items 10 --starting-token eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0= ``` ## Retrieve a Lambda function @@ -248,7 +283,12 @@ $ aws lambda list-functions --max-items 10 --starting-token eyJNYXJrZXIiOiBudWxs The Lambda CLI `get-function` command returns Lambda function metadata and a presigned URL that you can use to download the function's deployment package\. ``` -$ aws lambda get-function --function-name my-function +aws lambda get-function --function-name my-function +``` + +You should see the following output: + +``` { "Configuration": { "FunctionName": "my-function", @@ -277,7 +317,7 @@ For more information, see [GetFunction](API_GetFunction.md)\. Run the following `delete-function` command to delete the `my-function` function\. ``` -$ aws lambda delete-function --function-name my-function +aws lambda delete-function --function-name my-function ``` Delete the IAM role you created in the IAM console\. For information about deleting a role, see [Deleting roles or instance profiles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage_delete.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 24624f14..b9e05f9f 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -44,7 +44,7 @@ For more information, see [Lambda deployment packages](gettingstarted-package.md A Lambda layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. You can use a layer to distribute a dependency to multiple functions\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. -For more information, see [AWS Lambda layers](configuration-layers.md)\. +For more information, see [Lambda layers](configuration-layers.md)\. ## Runtime diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 2ecf9594..2c676ff4 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -19,7 +19,7 @@ Authoring specifics vary between runtimes, but all runtimes share a common progr When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in *initialization code* can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. -Initialization is billed as part of the duration for the first invocation that an instance of your function processes\. When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. +When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 4145bc38..f6bca081 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -7,7 +7,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | | Function and layer storage \(\.zip file archives\) | 75 GB | Terabytes | -| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. @@ -21,10 +21,10 @@ The following quotas apply to function configuration, deployments, and execution | Function [timeout](configuration-console.md) | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | -| Function [layers](configuration-layers.md) | 5 layers | +| Function [layers](configuration-layers.md) | five layers | | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | | [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | -| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | +| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\), 512 KB maximum for an individual file | | [Container image](lambda-images.md) code package size | 10 GB | | Test events \(console editor\) | 10 | | `/tmp` directory storage | 512 MB | diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index fc5f489e..388e7af3 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -1,11 +1,12 @@ # Lambda deployment packages -Your Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. **Topics** + [Container images](#gettingstarted-package-images) + [\.zip file archives](#gettingstarted-package-zip) + [Layers](#gettingstarted-package-layers) ++ [Using other AWS services to build a deployment package](#gettingstarted-package-awsother) ## Container images @@ -23,19 +24,61 @@ A \.zip file archive includes your application code and its dependencies\. When When you create functions with the Lambda API, command line tools, or the AWS SDKs, you must create a deployment package\. You also must create a deployment package if your function uses a compiled language, or to add dependencies to your function\. To deploy your function's code, you upload the deployment package from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. -For language\-specific instructions, see the following topics\. +You can upload a \.zip file as your deployment package using the Lambda console, AWS Command Line Interface \(AWS CLI\), or to an Amazon Simple Storage Service \(Amazon S3\) bucket\. + +### Using the Lambda console + +The following steps demonstrate how to upload a \.zip file as your deployment package using the Lambda console\. + +**To upload a \.zip file on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Select a function\. + +1. Choose **Actions**, **Upload a \.zip file** in the **Function code** pane\. + +1. Choose **Upload** to select your local \.zip file\. + +1. Choose **Save**\. + +### Using the AWS CLI + +You can upload a \.zip file as your deployment package using the AWS Command Line Interface \(AWS CLI\)\. For language\-specific instructions, see the following topics\. + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip file archives](java-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) +### Using Amazon S3 + +You can upload a \.zip file as your deployment package using Amazon Simple Storage Service \(Amazon S3\)\. For more information, see [Using other AWS services to build a deployment package](#gettingstarted-package-awsother)\. + ## Layers If you deploy your function code using a \.zip file archive, you can use Lambda layers as a distribution mechanism for libraries, custom runtimes, and other function dependencies\. Layers enable you to manage your in\-development function code independently from the unchanging code and resources that it uses\. You can configure your function to use layers that you create, layers that AWS provides, or layers from other AWS customers\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. -For more information about layers, see [AWS Lambda layers](configuration-layers.md)\. \ No newline at end of file +For more information about layers, see [Lambda layers](configuration-layers.md)\. + +## Using other AWS services to build a deployment package + +The following section describes other AWS services you can use to package dependencies for your Lambda function\. + +### Deployment packages with C or C\+\+ libraries + +If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + +For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + +### Deployment packages over 50 MB + +If your deployment package is larger than 50 MB, we recommend uploading your function code and dependencies to an Amazon S3 bucket\. + +You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS Command Line Interface \(AWS CLI\)\. + +To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. \ No newline at end of file diff --git a/doc_source/gettingstarted-tools.md b/doc_source/gettingstarted-tools.md index 1880e4ac..dcae16df 100644 --- a/doc_source/gettingstarted-tools.md +++ b/doc_source/gettingstarted-tools.md @@ -20,7 +20,7 @@ To set up the AWS CLI, see the following topics in the *AWS Command Line Interfa To verify that the AWS CLI is configured correctly, run the `list-functions` command to see a list of your Lambda functions in the current AWS Region\. ``` -$ aws lambda list-functions +aws lambda list-functions ``` ## AWS SAM diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 548b1033..4b8e4564 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -160,7 +160,7 @@ If you do not want to add the RIE to your image, you can test your image locally 1. Post an event to the following endpoint using a `curl` command: ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` This command invokes the function running in the container image and returns a response\. diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index b2af9e95..719cfd9c 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -1,8 +1,20 @@ # AWS Lambda function errors in Go -You can create custom error handling to raise an exception directly from your Lambda function and handle it directly\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. -The following code samples demonstrate how to do this\. Note that custom errors in Go must import the `errors` module\. +This page describes how to view Lambda function invocation errors for the Go runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Creating a function that returns exceptions](#go-exceptions-createfunction) ++ [How it works](#go-exceptions-how) ++ [Using the Lambda console](#go-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#go-exceptions-cli) ++ [Error handling in other AWS services](#go-exceptions-other-services) ++ [What's next?](#go-exceptions-next-up) + +## Creating a function that returns exceptions + +The following code sample demonstrates custom error handling that raises an exception directly from a Lambda function and handles it directly\. Note that custom errors in Go must import the `errors` module\. ``` package main @@ -28,4 +40,109 @@ Which returns the following: "errorMessage": "something went wrong!", "errorType": "errorString" } -``` \ No newline at end of file +``` + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ + +You should see the AWS CLI response in your command prompt: + +``` +{ + "StatusCode": 200, + "FunctionError": "Unhandled", + "ExecutedVersion": "$LATEST" +} +``` + +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: + +``` +cat output.txt +``` + +You should see the invocation response in your command prompt\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Go code in AWS Lambda](golang-tracing.md)\. + +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Go](golang-logging.md) page\. \ No newline at end of file diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 6d9032d1..5acc75f7 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -2,7 +2,7 @@ The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. -A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. +A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/main/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. ``` package main @@ -90,7 +90,7 @@ And the response would look like this: } ``` -To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events)\. +To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/main/events)\. ### Valid handler signatures diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 0f8004cc..a6175f9a 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -1,10 +1,21 @@ # AWS Lambda function logging in Go -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. -**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-go/function/main.go) – Logging** +**Topics** ++ [Creating a function that returns logs](#golang-logging-output) ++ [Using the Lambda console](#golang-logging-console) ++ [Using the CloudWatch console](#golang-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#golang-logging-cli) ++ [Deleting logs](#golang-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. + +**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-go/function/main.go) – Logging** ``` func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { @@ -61,33 +72,43 @@ The Go runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#golang-logging-console) -+ [Using the AWS CLI](#golang-logging-cli) -+ [Deleting logs](#golang-logging-delete) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. -## Viewing logs in the AWS Management Console +## Using the CloudWatch console -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -**To view your Lambda function's logs** +**To view logs on the CloudWatch console** -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Choose the first stream in the list\. +1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -## Using the AWS CLI +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -95,23 +116,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -121,10 +145,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index 75c9aa48..007e8ea5 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -1,61 +1,128 @@ # Deploy Go Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package for your Lambda function that consists of your code \(a Go executable\) and any dependencies\. +This page describes how to create a \.zip file as your deployment package for the Go runtime, and then use the \.zip file to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](gettingstarted-package.md)\. -After you create the deployment package, you can upload it directly to an Amazon Simple Storage Service \(Amazon S3\) bucket in the AWS Region where you want to create the Lambda function\. Or, you can upload the \.zip file archive first and then specify the S3 bucket name and object key name when you create the function using the Lambda console or the AWS Command Line Interface \(AWS CLI\)\. +**Topics** ++ [Prerequisites](#golang-package-prereqs) ++ [Tools and libraries](#golang-package-libraries) ++ [Sample applications](#golang-package-sample) ++ [Creating a \.zip file on macOS and Linux](#golang-package-mac-linux) ++ [Creating a \.zip file on Windows](#golang-package-windows) ++ [Creating the Lambda function using the AWS CLI](#golang-package-create) -Download the Lambda library for Go with `go get`, and compile your executable\. +## Prerequisites -**Note** -Use `aws-lambda-go` version 1\.18\.0 or later``\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -``` -~/my-function$ go get github.com/aws/aws-lambda-go/lambda -~/my-function$ GOOS=linux go build main.go -``` +## Tools and libraries -Setting `GOOS` to `linux` ensures that the compiled executable is compatible with the [Go runtime](lambda-runtimes.md), even if you compile it in a non\-Linux environment\. +Lambda provides the following tools and libraries for the Go runtime: -Create a deployment package by packaging the executable in a \.zip file, and use the AWS CLI to create a function\. The handler parameter must match the name of the executable containing your handler\. +**Tools and libraries for Go** ++ [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. ++ [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. ++ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing execution context information from the [context object](golang-context.md)\. ++ [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. ++ [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. -``` -~/my-function$ zip function.zip main -~/my-function$ aws lambda create-function --function-name my-function --runtime go1.x \ - --zip-file fileb://function.zip --handler main \ - --role arn:aws:iam::123456789012:role/execution_role -``` +For more information, see [aws\-lambda\-go](https://github.com/aws/aws-lambda-go) on GitHub\. + +## Sample applications + +Lambda provides the following sample applications for the Go runtime: + +**Sample Lambda applications in Go** ++ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. + +## Creating a \.zip file on macOS and Linux + +The following steps demonstrate how to download the [lambda](https://github.com/aws/aws-lambda-go/tree/main/lambda) library from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. + +1. Download the **lambda** library from GitHub\. + + ``` + go get github.com/aws/aws-lambda-go/lambda + ``` + +1. Compile your executable\. + + ``` + GOOS=linux go build main.go + ``` + + Setting `GOOS` to `linux` ensures that the compiled executable is compatible with the [Go runtime](lambda-runtimes.md), even if you compile it in a non\-Linux environment\. + +1. \(Optional\) If your `main` package consists of multiple files, use the following [go build](https://golang.org/cmd/go/) command to compile the package: + + ``` + GOOS=linux go build main + ``` -## Creating a deployment package on Windows +1. \(Optional\) You may need to compile packages with `CGO_ENABLED=0` set on Linux: -To create a \.zip file archive that works on Lambda using Windows, we recommend installing the **build\-lambda\-zip** tool\. + ``` + GOOS=linux CGO_ENABLED=0 go build main.go + ``` + + This command creates a stable binary package for standard C library \(`libc`\) versions, which may be different on Lambda and other devices\. + +1. Create a deployment package by packaging the executable in a \.zip file\. + + ``` + zip function.zip main + ``` + +## Creating a \.zip file on Windows + +The following steps demonstrate how to download the [build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/main/cmd/build-lambda-zip) tool for Windows from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. **Note** If you have not already done so, you must install [git](https://git-scm.com/) and then add the `git` executable to your Windows `%PATH%` environment variable\. -To download the **build\-lambda\-zip** tool, run the following command: +1. Download the **build\-lambda\-zip** tool from GitHub: -``` -go.exe get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip -``` + ``` + go.exe get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip + ``` -Use the tool from your `GOPATH`\. If you have a default installation of Go, the tool is typically in `%USERPROFILE%\Go\bin`\. Otherwise, navigate to where you installed the Go runtime and do one of the following: +1. Use the tool from your `GOPATH` to create a \.zip file\. If you have a default installation of Go, the tool is typically in `%USERPROFILE%\Go\bin`\. Otherwise, navigate to where you installed the Go runtime and do one of the following: -In cmd\.exe, run the following: +------ +#### [ cmd\.exe ] -``` -set GOOS=linux -go build -o main main.go -%USERPROFILE%\Go\bin\build-lambda-zip.exe -output main.zip main -``` + In cmd\.exe, run the following: + + ``` + set GOOS=linux + go build -o main main.go + %USERPROFILE%\Go\bin\build-lambda-zip.exe -output main.zip main + ``` + +------ +#### [ PowerShell ] + + In PowerShell, run the following: + + ``` + $env:GOOS = "linux" + $env:CGO_ENABLED = "0" + $env:GOARCH = "amd64" + go build -o main main.go + ~\Go\Bin\build-lambda-zip.exe -output main.zip main + ``` + +------ + +## Creating the Lambda function using the AWS CLI + +Lambda needs to know the [Lambda runtime](lambda-runtimes.md) environment to use for your function's code \(in `runtime`\), a name for your Lambda function \(in `function-name`\), the Lambda handler in your function code \(in `handler`\), and the [execution role](lambda-intro-execution-role.md) it can use to invoke your function \(in `role`\)\. -In PowerShell, run the following: +Use the [create\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-function.html) command to create the Lambda function\. ``` -$env:GOOS = "linux" -$env:CGO_ENABLED = "0" -$env:GOARCH = "amd64" -go build -o main main.go -~\Go\Bin\build-lambda-zip.exe -output main.zip main +aws lambda create-function --function-name my-function --runtime go1.x --zip-file fileb://function.zip --handler main --role arn:aws:iam::your-account-id:role/execution_role ``` \ No newline at end of file diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 94e19067..ee119846 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -32,7 +34,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Go\. Download the SDK from its [GitHub repository](https://github.com/aws/aws-xray-sdk-go) with `go get`: ``` -$ go get github.com/aws/aws-xray-sdk-go +go get github.com/aws/aws-xray-sdk-go ``` To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. @@ -41,6 +43,12 @@ To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. xray.AWS(s3.Client) ``` +Then you can trace your calls by using the `WithContext` version of the method\. + +``` + svc.ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput) +``` + The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) @@ -66,7 +74,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -76,7 +84,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -90,7 +98,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/images-create.md b/doc_source/images-create.md index e854576c..9b67b93f 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -1,6 +1,6 @@ # Creating Lambda container images -You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. +You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. Note that you must create the Lambda function from the same account as the container registry in Amazon ECR\. AWS provides a set of open\-source [base images](runtimes-images.md#runtimes-images-lp) that you can use to create your container image\. These base images include a [runtime interface client](runtimes-images.md#runtimes-api-client) to manage the interaction between Lambda and your function code\. @@ -112,7 +112,13 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do docker build -t hello-world . ``` -1. \(Optional\) Test your application locally using the [runtime interface emulator](images-test.md)\. +1. \(Optional\) Test your application locally using the [runtime interface emulator](images-test.md)\. From a new terminal window, post an event to the following endpoint using a `curl` command: + + ``` + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' + ``` + + This command invokes the function running in the container image and returns a response\. 1. Authenticate the Docker CLI to your Amazon ECR registry\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 2021a3cb..990b4999 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -1,10 +1,10 @@ -# Testing AWS Lambda container images locally +# Testing Lambda container images locally -The Lambda Runtime Interface Emulator \(RIE\) is a proxy for the Lambda Runtime API that allows you to locally test your Lambda function packaged as a container image\. The emulator is a lightweight web server that converts HTTP requests into JSON events to pass to the Lambda function in the container image\. +The AWS Lambda Runtime Interface Emulator \(RIE\) is a proxy for the Lambda Runtime API that allows you to locally test your Lambda function packaged as a container image\. The emulator is a lightweight web server that converts HTTP requests into JSON events to pass to the Lambda function in the container image\. The AWS base images for Lambda include the RIE component\. If you use an alternate base image, you can test your image without adding RIE to the image\. You can also build the RIE component into your base image\. AWS provides an open\-sourced RIE component on the AWS GitHub repository\. -You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. +You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your Lambda function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, you can use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. For examples of how to use the RIE, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. @@ -19,25 +19,25 @@ For examples of how to use the RIE, see [Container image support for Lambda](htt Note the following guidelines when using the Runtime Interface Emulator: + The RIE does not emulate Lambda’s security and authentication configurations, or Lambda orchestration\. -+ The emulator supports only Linux x84\-64 architectures\. ++ The emulator supports only Linux x86\-64 architectures\. + The emulator does not support AWS X\-Ray tracing or other Lambda integrations\. ## Environment variables The runtime interface emulator supports a subset of [environment variables](configuration-envvars.md) for the Lambda function in the local running image\. -If your Lambda function uses security credentials, you can configure the credentials by setting the following environment variables: +If your function uses security credentials, you can configure the credentials by setting the following environment variables: + `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY` + `AWS_SESSION_TOKEN` + `AWS_REGION` -To set the Lambda function timeout, configure `AWS_LAMBDA_FUNCTION_TIMEOUT`\. Enter the maximum number of seconds that you want to allow the Lambda function to run\. +To set the function timeout, configure `AWS_LAMBDA_FUNCTION_TIMEOUT`\. Enter the maximum number of seconds that you want to allow the function to run\. -The emulator does not populate the following Lambda environment variables\. However, you can set them to match the values that you expect when the Lambda function runs in the Lambda service: +The emulator does not populate the following Lambda environment variables\. However, you can set them to match the values that you expect when the function runs in the Lambda service: + `AWS_LAMBDA_FUNCTION_VERSION` -+ `AWS_LAMBDA_FUNCION_NAME` -+ `AWS_LAMBDA_MEMORY_SIZE` ++ `AWS_LAMBDA_FUNCTION_NAME` ++ `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` ## Test an image with RIE included in the image @@ -59,10 +59,10 @@ The AWS base images for Lambda include the runtime interface emulator\. You can This command runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. -1. Post an event to the following endpoint using a `curl` command: +1. From a new terminal window, post an event to the following endpoint using a `curl` command: ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` This command invokes the Lambda function running in the container image and returns a response\. @@ -101,7 +101,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ## Test an image without adding RIE to the image -You install the runtime interface emulator to your local machine\. When you run the Lambda image function, you set the entry point to be the emulator\. +You install the runtime interface emulator to your local machine\. When you run the container image, you set the entry point to be the emulator\. **To test an image without adding RIE to the image** @@ -109,15 +109,16 @@ You install the runtime interface emulator to your local machine\. When you run ``` mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ - https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ - && chmod +x ~/.aws-lambda-rie/aws-lambda-rie + https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ + && chmod +x ~/.aws-lambda-rie/aws-lambda-rie ``` -1. Run your Lambda image function using the `docker run` command\. +1. Run your Lambda function using the `docker run` command\. ``` - docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest - --entrypoint /aws-lambda/aws-lambda-rie <(optional) image command> + docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ + --entrypoint /aws-lambda/aws-lambda-rie myfunction:latest \ + <(optional) image command> ``` This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. @@ -125,7 +126,7 @@ You install the runtime interface emulator to your local machine\. When you run 1. Post an event to the following endpoint using a `curl` command: ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the Lambda function running in the container image and returns a response\. + This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index d30ca936..9e959188 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -27,7 +27,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource-based policies for AWS Lambda](access-control-resource-based.md) - + [Identity-based IAM policies for AWS Lambda](access-control-identity-based.md) + + [Identity-based IAM policies for Lambda](access-control-identity-based.md) + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Managing AWS Lambda functions](lambda-functions.md) @@ -38,7 +38,7 @@ Amazon's trademarks and trade dress may not be used in + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) + [Lambda function aliases](configuration-aliases.md) - + [AWS Lambda layers](configuration-layers.md) + + [Lambda layers](configuration-layers.md) + [Configuring Lambda function memory](configuration-memory.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) @@ -119,13 +119,14 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with Amazon Lex](services-lex.md) + [Using Lambda with Amazon MQ](with-mq.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) + + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + [Using AWS Lambda with Amazon S3](with-s3.md) + [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md) + [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + [Using AWS Lambda with Amazon SES](services-ses.md) - + [Using AWS Lambda with Amazon SNS](with-sns.md) + + [Using Lambda with Amazon SNS](with-sns.md) + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) + [Sample function code](with-sns-create-package.md) + [Using AWS Lambda with Amazon SQS](with-sqs.md) @@ -143,9 +144,9 @@ Amazon's trademarks and trade dress may not be used in + [Using Lambda with Amazon MSK](with-msk.md) + [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) + [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) - + [Using Lambda with self-managed Apache Kafka](kafka-smaa.md) - + [Managing access and permissions for a self-managed Apache Kafka cluster](smaa-permissions.md) - + [Adding a self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + + [Using Lambda with Self-managed Apache Kafka](kafka-smaa.md) + + [Managing access and permissions for a Self-managed Apache Kafka cluster](smaa-permissions.md) + + [Adding a Self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) @@ -177,7 +178,7 @@ Amazon's trademarks and trade dress may not be used in + [Building Lambda functions with Java](lambda-java.md) + [Java sample applications for AWS Lambda](java-samples.md) + [AWS Lambda function handler in Java](java-handler.md) - + [Deploy Java Lambda functions with .zip file archives](java-package.md) + + [Deploy Java Lambda functions with .zip or JAR file archives](java-package.md) + [Deploy Java Lambda functions with container images](java-image.md) + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) @@ -217,7 +218,7 @@ Amazon's trademarks and trade dress may not be used in + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + [Security in AWS Lambda](lambda-security.md) + [Data protection in AWS Lambda](security-dataprotection.md) - + [Identity and access management for AWS Lambda](security-iam.md) + + [Identity and access management for Lambda](security-iam.md) + [How AWS Lambda works with IAM](security_iam_service-with-iam.md) + [AWS Lambda identity-based policy examples](security_iam_id-based-policy-examples.md) + [Troubleshooting AWS Lambda identity and access](security_iam_troubleshoot.md) @@ -237,24 +238,19 @@ Amazon's trademarks and trade dress may not be used in + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) - + [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) - + [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) - + [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) - + [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) - + [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -266,11 +262,9 @@ Amazon's trademarks and trade dress may not be used in + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) - + [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) - + [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -278,7 +272,6 @@ Amazon's trademarks and trade dress may not be used in + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) - + [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -287,7 +280,6 @@ Amazon's trademarks and trade dress may not be used in + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) - + [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) @@ -297,9 +289,6 @@ Amazon's trademarks and trade dress may not be used in + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) - + [AllowedPublishers](API_AllowedPublishers.md) - + [CodeSigningConfig](API_CodeSigningConfig.md) - + [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -312,9 +301,6 @@ Amazon's trademarks and trade dress may not be used in + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) - + [ImageConfig](API_ImageConfig.md) - + [ImageConfigError](API_ImageConfigError.md) - + [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) @@ -323,7 +309,6 @@ Amazon's trademarks and trade dress may not be used in + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) - + [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index c1fc2ff3..8fbb60cd 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -9,7 +9,12 @@ The following diagram shows clients invoking a Lambda function asynchronously\. For asynchronous invocation, Lambda places the event in a queue and returns a success response without additional information\. A separate process reads events from the queue and sends them to your function\. To invoke a function asynchronously, set the invocation type parameter to `Event`\. ``` -$ aws lambda invoke --function-name my-function --invocation-type Event --payload '{ "key": "value" }' response.json +aws lambda invoke --function-name my-function --invocation-type Event --payload '{ "key": "value" }' response.json +``` + +You should see the following output: + +``` { "StatusCode": 202 } @@ -147,8 +152,13 @@ To manage asynchronous invocation settings with the AWS CLI or AWS SDK, use the To configure asynchronous invocation with the AWS CLI, use the `put-function-event-invoke-config` command\. The following example configures a function with a maximum event age of 1 hour and no retries\. ``` -$ aws lambda put-function-event-invoke-config --function-name error \ +aws lambda put-function-event-invoke-config --function-name error \ --maximum-event-age-in-seconds 3600 --maximum-retry-attempts 0 +``` + +You should see the following output: + +``` { "LastModified": 1573686021.479, "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:error:$LATEST", @@ -164,8 +174,13 @@ $ aws lambda put-function-event-invoke-config --function-name error \ The `put-function-event-invoke-config` command overwrites any existing configuration on the function, version, or alias\. To configure an option without resetting others, use `update-function-event-invoke-config`\. The following example configures Lambda to send a record to an SQS queue named `destination` when an event can't be processed\. ``` -$ aws lambda update-function-event-invoke-config --function-name error \ +aws lambda update-function-event-invoke-config --function-name error \ --destination-config '{"OnFailure":{"Destination": "arn:aws:sqs:us-east-2:123456789012:destination"}}' +``` + +You should see the following output: + +``` { "LastModified": 1573687896.493, "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:error:$LATEST", @@ -217,7 +232,7 @@ After creating the target and updating your function's execution role, add the d To configure a dead\-letter queue with the AWS CLI, use the `update-function-configuration` command\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --dead-letter-config TargetArn=arn:aws:sns:us-east-2:123456789012:my-topic ``` diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index d926e1d3..b66cc774 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -7,7 +7,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [Self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. @@ -22,8 +22,13 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. ``` -$ aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ +aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ --event-source-arn arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525 +``` + +You should see the following output: + +``` { "UUID": "14e0db71-5d35-4eb5-b481-8945cf9d10c2", "BatchSize": 500, diff --git a/doc_source/invocation-retries.md b/doc_source/invocation-retries.md index 11efc02b..7f165662 100644 --- a/doc_source/invocation-retries.md +++ b/doc_source/invocation-retries.md @@ -33,9 +33,9 @@ When you invoke a function indirectly, you need to be aware of the retry behavio + **Event source mappings** – Event source mappings that read from streams retry the entire batch of items\. Repeated errors block processing of the affected shard until the error is resolved or the items expire\. To detect stalled shards, you can monitor the [Iterator Age](monitoring-metrics.md) metric\. For event source mappings that read from a queue, you determine the length of time between retries and destination for failed events by configuring the visibility timeout and redrive policy on the source queue\. For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md) and the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md)\. -+ **AWS services** – AWS services can invoke your function [synchronously](invocation-sync.md) or asynchronously\. For synchronous invocation, the service decides whether to retry\. Services like API Gateway and Elastic Load Balancing, which proxy requests from an upstream user or client, can also choose to relay the error response back to the requestor\. ++ **AWS services** – AWS services can invoke your function [synchronously](invocation-sync.md) or asynchronously\. For synchronous invocation, the service decides whether to retry\. For example, Amazon S3 batch operations retries the operation if the Lambda function returns a `TemporaryFailure` response code\. Services that proxy requests from an upstream user or client may have a retry strategy or may relay the error response back to the requestor\. For example, API Gateway always relays the error response back to the requestor\. - For asynchronous invocation, the behavior is the same as when you invoke the function asynchronously\. For more information, see the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md) and the invoking service's documentation\. + For asynchronous invocation, the behavior is the same as when you invoke the function synchronously\. For more information, see the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md) and the invoking service's documentation\. + **Other accounts and clients** – When you grant access to other accounts, you can use [resource\-based policies](access-control-resource-based.md) to restrict the services or resources they can configure to invoke your function\. To protect your function from being overloaded, consider putting an API layer in front of your function with [Amazon API Gateway](services-apigateway.md)\. To help you deal with errors in Lambda applications, Lambda integrates with services like Amazon CloudWatch and AWS X\-Ray\. You can use a combination of logs, metrics, alarms, and tracing to quickly detect and identify issues in your function code, API, or other resources that support your application\. For more information, see [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md)\. diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md index 6e18c851..849c5b15 100644 --- a/doc_source/invocation-sync.md +++ b/doc_source/invocation-sync.md @@ -3,7 +3,12 @@ When you invoke a function synchronously, Lambda runs the function and waits for a response\. When the function completes, Lambda returns the response from the function's code with additional data, such as the version of the function that was invoked\. To invoke a function synchronously with the AWS CLI, use the `invoke` command\. ``` -$ aws lambda invoke --function-name my-function --payload '{ "key": "value" }' response.json +aws lambda invoke --function-name my-function --payload '{ "key": "value" }' response.json +``` + +You should see the following output: + +``` { "ExecutedVersion": "$LATEST", "StatusCode": 200 @@ -24,15 +29,31 @@ For functions with a long timeout, your client might be disconnected during sync If Lambda isn't able to run the function, the error is displayed in the output\. ``` -$ aws lambda invoke --function-name my-function --payload value response.json +aws lambda invoke --function-name my-function --payload value response.json +``` + +You should see the following output: + +``` An error occurred (InvalidRequestContentException) when calling the Invoke operation: Could not parse request body into json: Unrecognized token 'value': was expecting ('true', 'false' or 'null') at [Source: (byte[])"value"; line: 1, column: 11] ``` -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -40,18 +61,22 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` - -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. For more information about the `Invoke` API, including a full list of parameters, headers, and errors, see [Invoke](API_Invoke.md)\. diff --git a/doc_source/java-context.md b/doc_source/java-context.md index faa7afe0..bf682e40 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -17,13 +17,13 @@ When Lambda runs your function, it passes a context object to the [handler](java The following example shows a function that uses the context object to access the Lambda logger\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.Handler @@ -64,17 +64,17 @@ END RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 REPORT RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Duration: 198.50 ms Billed Duration: 200 ms Memory Size: 512 MB Max Memory Used: 90 MB Init Duration: 524.75 ms ``` -The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. +The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/main/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. -**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/test/java/example/TestContext.java)** +**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/test/java/example/TestContext.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); -import [com\.amazonaws\.services\.lambda\.runtime\.CognitoIdentity](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java); -import [com\.amazonaws\.services\.lambda\.runtime\.ClientContext](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/ClientContext.java); -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); +import [com\.amazonaws\.services\.lambda\.runtime\.CognitoIdentity](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java); +import [com\.amazonaws\.services\.lambda\.runtime\.ClientContext](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/ClientContext.java); +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) public class TestContext implements Context{ public TestContext() {} @@ -99,10 +99,10 @@ For more information on logging, see [AWS Lambda function logging in Java](java- The GitHub repository for this guide includes sample applications that demonstrate the use of the context object\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index dd8bd376..270b0470 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -1,31 +1,99 @@ # AWS Lambda function errors in Java -When your function raises an error, Lambda returns details about the error to the invoker\. The body of the response that Lambda returns contains a JSON document with the error name, error type, and an array of stack frames\. The client or service that invoked the function can handle the error or pass it along to an end user\. You can use custom exceptions to return helpful information to users for client errors\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. -**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** +This page describes how to view Lambda function invocation errors for the Java runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#java-exceptions-syntax) ++ [How it works](#java-exceptions-how) ++ [Creating a function that returns exceptions](#java-exceptions-createfunction) ++ [Using the Lambda console](#java-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#java-exceptions-cli) ++ [Error handling in other AWS services](#java-exceptions-other-services) ++ [Sample applications](#java-exceptions-samples) ++ [What's next?](#java-exceptions-next-up) + +## Syntax + +In the following example, the runtime fails to deserialize the event into an object\. The input is a valid JSON type, but it doesn't match the type expected by the handler method\. + +**Example Lambda runtime error** + +``` +{ + "errorMessage": "An error occurred during JSON parsing", + "errorType": "java.lang.RuntimeException", + "stackTrace": [], + "cause": { + "errorMessage": "com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", + "errorType": "java.io.UncheckedIOException", + "stackTrace": [], + "cause": { + "errorMessage": "Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", + "errorType": "com.fasterxml.jackson.databind.exc.InvalidFormatException", + "stackTrace": [ + "com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:55)", + "com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:907)", + ... + ] + } + } +} +``` + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Creating a function that returns exceptions + +You can create a Lambda function that displays human\-readable error messages to users\. + +**Note** +To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. + +**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** ``` import java.util.List; -// Handler value: example.HandlerDivide -public class HandlerDivide implements RequestHandler, Integer>{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public Integer handleRequest(List event, Context context) - { - LambdaLogger logger = context.getLogger(); - // process event - if ( event.size() != 2 ) + // Handler value: example.HandlerDivide + public class HandlerDivide implements RequestHandler, Integer>{ + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public Integer handleRequest(List event, Context context) { - throw new InputLengthException("Input must be an array that contains 2 numbers."); + LambdaLogger logger = context.getLogger(); + // process event + if ( event.size() != 2 ) + { + throw new InputLengthException("Input must be an array that contains 2 numbers."); + } + int numerator = event.get(0); + int denominator = event.get(1); + logger.log("EVENT: " + gson.toJson(event)); + logger.log("EVENT TYPE: " + event.getClass().toString()); + return numerator/denominator; } - int numerator = event.get(0); - int denominator = event.get(1); - logger.log("EVENT: " + gson.toJson(event)); - logger.log("EVENT TYPE: " + event.getClass().toString()); - return numerator/denominator; } -} ``` When the function throws `InputLengthException`, the Java runtime serializes it into the following document\. @@ -34,16 +102,16 @@ When the function throws `InputLengthException`, the Java runtime serializes it ``` { - "errorMessage":"Input must contain 2 numbers.", - "errorType":"java.lang.InputLengthException", - "stackTrace": [ - "example.HandlerDivide.handleRequest(HandlerDivide.java:23)", - "example.HandlerDivide.handleRequest(HandlerDivide.java:14)" - ] -} + "errorMessage":"Input must contain 2 numbers.", + "errorType":"java.lang.InputLengthException", + "stackTrace": [ + "example.HandlerDivide.handleRequest(HandlerDivide.java:23)", + "example.HandlerDivide.handleRequest(HandlerDivide.java:14)" + ] + } ``` -In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. +In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. The return statement in the previous example can also throw a runtime exception\. @@ -57,20 +125,11 @@ This code can return an arithmetic error\. {"errorMessage":"/ by zero","errorType":"java.lang.ArithmeticException","stackTrace":["example.HandlerDivide.handleRequest(HandlerDivide.java:28)","example.HandlerDivide.handleRequest(HandlerDivide.java:13)"]} ``` -**Topics** -+ [Viewing error output](#java-exceptions-view) -+ [Understanding error types and sources](#java-exceptions-types) -+ [Error handling in clients](#java-exceptions-clients) -+ [Error handling in other AWS services](#java-exceptions-services) -+ [Error handling in sample applications](#java-exceptions-samples) +## Using the Lambda console -## Viewing error output +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. -You can invoke your function with a test payload and view error output in the Lambda console, from the command line, or with the AWS SDK\. Error output is also captured in the function's execution logs and, when [tracing](java-tracing.md) is enabled, in AWS X\-Ray\. - -To view error output in the Lambda console, invoke it with a test event\. - -**To invoke a function in the Lambda console** +**To invoke a function on the Lambda console** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -79,9 +138,11 @@ To view error output in the Lambda console, invoke it with a test event\. 1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) -1. Choose an **Event template** that matches the events that your function processes\. +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. -1. Enter a name for the test event and modify the event structure as needed\. +1. Enter the JSON for the test event\. 1. Choose **Create**\. @@ -89,103 +150,35 @@ To view error output in the Lambda console, invoke it with a test event\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. -When you invoke the function from the command line, the AWS CLI splits the response into two documents\. To indicate that a function error occurred, the response displayed in the terminal includes a `FunctionError` field\. The response or error returned by the function is written to the output file\. +## Using the AWS Command Line Interface \(AWS CLI\) -``` -$ aws lambda invoke --function-name my-function out.json -{ - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" -} -``` +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -View the output file to see the error document\. +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. -``` -$ cat out.json -{"errorMessage":"Input must contain 2 numbers.","errorType":"java.lang.InputLengthException","stackTrace": ["example.HandlerDivide.handleRequest(HandlerDivide.java:23)","example.HandlerDivide.handleRequest(HandlerDivide.java:14)"]} -``` +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. -Lambda also records up to 256 KB of the error object in the function's logs\. To view logs when you invoke the function from the command line, use the `--log-type` option and decode the base64 string in the response\. +------ +#### [ mac OS/Linux OS ] ``` -$ aws lambda invoke --function-name my-function --payload "[100,0]" out.json --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: 081f7522-xmpl-48e2-8f67-96686904bb4f Version: $LATEST -EVENT: [ - 100, - 0 -]EVENT TYPE: class java.util.ArrayList/ by zero: java.lang.ArithmeticException -java.lang.ArithmeticException: / by zero - at example.HandlerDivide.handleRequest(HandlerDivide.java:28) - at example.HandlerDivide.handleRequest(HandlerDivide.java:13) - -END RequestId: 081f7522-xmpl-48e2-8f67-96686904bb4f -REPORT RequestId: 081f7522-xmpl-48e2-8f67-96686904bb4f Duration: 4.20 ms Billed Duration: 5 ms Memory Size: 512 MB Max Memory Used: 95 MB -XRAY TraceId: 1-5e73162b-1919xmpl2592f4549e1c39be SegmentId: 3dadxmpl48126cb8 Sampled: true +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -For more information about logs, see [AWS Lambda function logging in Java](java-logging.md)\. - -## Understanding error types and sources - -When you invoke a function, multiple subsystems handle the request, event, output, and response\. Errors can come from the Lambda service \(invocation errors\), or from an instance of your function\. Function errors include exceptions returned by your handler code and exceptions returned by the Lambda runtime\. - -The Lambda service receives the invocation request and validates it\. It checks permissions, verifies that the event document is a valid JSON document, and checks parameter values\. If the Lambda service encounters an error, it returns an exception type, message, and HTTP status code that indicate the cause of the error\. - -**Note** -For a full list of errors that the `Invoke` API operation can return, see [Invoke Errors](API_Invoke.md#API_Invoke_Errors) in the Lambda API reference\. - -A `4xx` series error from the Lambda service indicates an error that the invoker can fix by modifying the request, requesting permission, or trying again\. A `5xx` series error indicates an issue with the Lambda service, or an issue with the function's configuration or resources\. These issues can't be addressed by the invoker, but the function's owner might be able to fix them\. - -If a request passes validation, Lambda sends it to an instance of the function\. The runtime converts the event document into an object and passes it to your handler code\. Errors can occur during this process if, for example, the name of your handler method doesn't match the function's configuration, or if the invocation times out before your handler code returns a response\. Lambda runtime errors are formatted like errors that your code returns, but they are returned by the runtime\. - -In the following example, the runtime fails to deserialize the event into an object\. The input is a valid JSON type, but it doesn't match the type expected by the handler method\. - -**Example Lambda runtime error** +------ +#### [ Windows OS ] ``` -{ - "errorMessage": "An error occurred during JSON parsing", - "errorType": "java.lang.RuntimeException", - "stackTrace": [], - "cause": { - "errorMessage": "com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", - "errorType": "java.io.UncheckedIOException", - "stackTrace": [], - "cause": { - "errorMessage": "Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", - "errorType": "com.fasterxml.jackson.databind.exc.InvalidFormatException", - "stackTrace": [ - "com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:55)", - "com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:907)", - ... - ] - } - } -} -``` - -For Lambda runtime errors and other function errors, the Lambda service does not return an error code\. A `2xx` series status code indicates that the Lambda service accepted the request\. Instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. - -For asynchronous invocation, events are queued before Lambda sends them to your function\. For valid requests, Lambda returns a success response immediately and adds the event to the queue\. Lambda then reads events from the queue and invokes the function\. If an error occurs, Lambda retries with behavior that varies depending on the type of error\. For more information, see [Asynchronous invocation](invocation-async.md)\. - -## Error handling in clients - -Clients that invoke Lambda functions can choose to handle errors or pass them on to the end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. For example, if an invocation fails with an error code `429` \(too many requests\), the AWS CLI retries up to 4 times before showing an error to the user\. - -``` -$ aws lambda invoke --function-name my-function out.json -An error occurred (TooManyRequestsException) when calling the Invoke operation (reached max retries: 4): Rate Exceeded. +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -For other invocation errors, the correct behavior depends on the response code\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. A retry might or might not succeed\. `4xx` series errors other than `429` generally indicate an error with the request\. A retry is not likely to succeed\. +------ -For function errors, the client can process the error document and show the error message in a user\-friendly format\. A browser\-based application might show the error message and type, but omit the stack trace\. The AWS CLI saves the error object to the output file and displays a document generated from the response headers instead\. +You should see the AWS CLI response in your command prompt: ``` -$ aws lambda invoke --function-name my-function --payload '[1000]' out.json { "StatusCode": 200, "FunctionError": "Unhandled", @@ -193,35 +186,44 @@ $ aws lambda invoke --function-name my-function --payload '[1000]' out.json } ``` -**Example out\.json** +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: ``` -{"errorMessage":"Input must be an array that contains 2 numbers.","errorType":"example.InputLengthException","stackTrace":["example.HandlerDivide.handleRequest(HandlerDivide.java:22)","example.HandlerDivide.handleRequest(HandlerDivide.java:13)"]} +cat output.txt ``` -## Error handling in other AWS services +You should see the invocation response in your command prompt\. -When an AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. +``` +{"errorMessage":"Input must contain 2 numbers.","errorType":"java.lang.InputLengthException","stackTrace": ["example.HandlerDivide.handleRequest(HandlerDivide.java:23)","example.HandlerDivide.handleRequest(HandlerDivide.java:14)"]} +``` -For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a 500 error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in Java](java-logging.md)\. -To determine the source of an error and its cause, use AWS X\-Ray\. With X\-Ray, you can find out which component encountered an error and see details about exceptions\. The following example shows a function error that resulted in a 502 response from API Gateway\. +## Error handling in other AWS services -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. -Get started with X\-Ray by [enabling active tracing](java-tracing.md) on your functions\. +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. -For details on how other services handler errors, see the topics in the [Using AWS Lambda with other services](lambda-services.md) chapter\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Java code in AWS Lambda](java-tracing.md)\. -## Error handling in sample applications +## Sample applications The GitHub repository for this guide includes sample applications that demonstrate the use of the errors\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. + +The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. -The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. \ No newline at end of file +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Java](java-logging.md) page\. \ No newline at end of file diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 6287d7cd..5bc8a0b4 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -4,13 +4,13 @@ The AWS Lambda function handler is the method in your function code that process In the following example, a class named `Handler` defines a handler method named `handleRequest`\. The handler method takes an event and context object as input and returns a string\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.Handler @@ -42,7 +42,7 @@ You can add [initialization code](gettingstarted-features.md#gettingstarted-feat In the following example, the logger, serializer, and AWS SDK client are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** ``` // Handler value: example.Handler @@ -75,7 +75,7 @@ The GitHub repo for this guide provides easy\-to\-deploy sample applications tha You specify the type of object that the event maps to in the handler method's signature\. In the preceding example, the Java runtime deserializes the event into a type that implements the `Map` interface\. String\-to\-string maps work for flat events like the following: -**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/event.json) – Weather data** +**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/event.json) – Weather data** ``` { @@ -104,15 +104,15 @@ The output type can be an object or `void`\. The runtime serializes return value ## Handler interfaces -The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library defines two interfaces for handler methods\. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time\. +The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/main/aws-lambda-java-core) library defines two interfaces for handler methods\. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time\. **** -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) ++ [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) ++ [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) The `RequestHandler` interface is a generic type that takes two parameters: the input type and the output type\. Both types must be objects\. When you use this interface, the Java runtime deserializes the event into an object with the input type, and serializes the output into text\. Use this interface when the built\-in serialization works with your input and output types\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** ``` // Handler value: example.Handler @@ -125,12 +125,12 @@ To use your own serialization, implement the `RequestStreamHandler` interface\. The following example uses buffered reader and writer types to work with the input and output streams\. It uses the [Gson](https://github.com/google/gson) library for serialization and deserialization\. -**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** +**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** ``` -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.HandlerStream public class HandlerStream implements RequestStreamHandler { @@ -170,18 +170,18 @@ public class HandlerStream implements RequestStreamHandler { The GitHub repository for this guide includes sample applications that demonstrate the use of various handler types and interfaces\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: -+ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. -+ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. -+ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. -+ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. -+ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. -+ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. ++ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. ++ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. ++ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. ++ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. ++ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. ++ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. To test different handler types, just change the handler value in the AWS SAM template\. For detailed instructions, see the sample application's readme file\. \ No newline at end of file diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 458af4cd..8ae09915 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -8,6 +8,10 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +**Topics** ++ [AWS base images for Java](#java-image-base) ++ [Java runtime interface clients](#java-image-clients) + ## AWS base images for Java AWS provides the following base images for Java: @@ -15,9 +19,9 @@ AWS provides the following base images for Java: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 11 | Java 11 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 11 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java11/Dockerfile.java11) | -| 8\.al2 | Java 8 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 8\.al2 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8.al2/Dockerfile.java8.al2) | -| 8 | Java 8 \(OpenJDK\) | Amazon Linux 2018\.03 | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8/Dockerfile.java8) | +| 11 | Java 11 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 11 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java11/Dockerfile.java11) | +| 8\.al2 | Java 8 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 8\.al2 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8.al2/Dockerfile.java8.al2) | +| 8 | Java 8 \(OpenJDK\) | Amazon Linux 2018\.03 | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8/Dockerfile.java8) | Docker Hub repository: amazon/aws\-lambda\-java diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 0bc1d9e0..8babf997 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -1,6 +1,19 @@ # AWS Lambda function logging in Java -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. + +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. + +**Topics** ++ [Creating a function that returns logs](#java-logging-output) ++ [Using the Lambda console](#java-logging-console) ++ [Using the CloudWatch console](#java-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#java-logging-cli) ++ [Deleting logs](#java-logging-delete) ++ [Advanced logging with Log4j 2 and SLF4J](#java-logging-log4j2) ++ [Sample logging code](#java-logging-samples) + +## Creating a function that returns logs To output logs from your function code, you can use methods on [java\.lang\.System](https://docs.oracle.com/javase/8/docs/api/java/lang/System.html), or any logging module that writes to `stdout` or `stderr`\. The [aws\-lambda\-java\-core](java-package.md) library provides a logger class named `LambdaLogger` that you can access from the context object\. The logger class supports multiline logs\. @@ -73,35 +86,43 @@ The Java runtime logs the `START`, `END`, and `REPORT` lines for each invocation + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#java-logging-console) -+ [Using the AWS CLI](#java-logging-cli) -+ [Deleting logs](#java-logging-delete) -+ [Advanced logging with Log4j 2 and SLF4J](#java-logging-log4j2) -+ [Sample logging code](#java-logging-samples) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. + +## Using the CloudWatch console -## Viewing logs in the AWS Management Console +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +**To view logs on the CloudWatch console** -**To view your Lambda function's logs** +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Choose a log stream\. -1. Choose the first stream in the list\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -## Using the AWS CLI +## Using the AWS Command Line Interface \(AWS CLI\) -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -109,23 +130,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -135,10 +159,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" @@ -186,7 +222,7 @@ To customize log output, support logging during unit tests, and log AWS SDK call To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. -**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** +**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** ``` @@ -233,7 +269,7 @@ SLF4J is a facade library for logging in Java code\. In your function code, you In the following example, the handler class uses SLF4J to retrieve a logger\. -**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** +**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** ``` import org.slf4j.Logger; @@ -259,7 +295,7 @@ public class Handler implements RequestHandler{ The build configuration takes runtime dependencies on the Lambda appender and SLF4J adapter, and implementation dependencies on Log4J 2\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Logging dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/build.gradle) – Logging dependencies** ``` dependencies { @@ -289,11 +325,11 @@ When you run your code locally for tests, the context object with the Lambda log The GitHub repository for this guide includes sample applications that demonstrate the use of various logging configurations\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md index 03935add..5a74dc55 100644 --- a/doc_source/java-package-eclipse.md +++ b/doc_source/java-package-eclipse.md @@ -59,12 +59,8 @@ If you are following other tutorial topics in this guide, the specific tutorials 1. Open the context \(right\-click\) menu for the `src/main/java` subdirectory in the project, choose **New**, and then choose **Class**\. 1. In the **New Java Class** window, type the following values: - - + **Package**: **example** + **Name**: **Hello** - - **Note** If you are following other tutorial topics in this guide, the specific tutorials might recommend different package name or class name\. @@ -83,8 +79,6 @@ The resulting \.jar, `lambda-java-example-0.0.1-SNAPSHOT.jar`, is not the final 1. Open the context \(right\-click\) menu for the `pom.xml` file, choose **Maven**, and then choose **Add Plugin**\. 1. In the **Add Plugin** window, type the following values: - - + **Group Id:** org\.apache\.maven\.plugins + **Artifact Id:** maven\-shade\-plugin + **Version:** 3\.2\.2 diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 194d4f9f..2eb8094b 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -1,8 +1,24 @@ -# Deploy Java Lambda functions with \.zip file archives +# Deploy Java Lambda functions with \.zip or JAR file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package that contains your compiled function code and dependencies\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +This page describes how to create your deployment package as a \.zip file or Jar file, and then use the deployment package to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. + +**Topics** ++ [Prerequisites](#java-package-prereqs) ++ [Tools and libraries](#java-package-libraries) ++ [Building a deployment package with Gradle](#java-package-gradle) ++ [Building a deployment package with Maven](#java-package-maven) ++ [Uploading a deployment package with the Lambda API](#java-package-cli) ++ [Uploading a deployment package with AWS SAM](#java-package-cloudformation) + +## Prerequisites + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +## Tools and libraries Lambda provides the following libraries for Java functions: + [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. @@ -50,27 +66,7 @@ dependencies { To create a deployment package, compile your function code and dependencies into a single \.zip file or Java Archive \(JAR\) file\. For Gradle, [use the `Zip` build type](#java-package-gradle)\. For Apache Maven, [use the Maven Shade plugin](#java-package-maven)\. **Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [AWS Lambda layers](configuration-layers.md)\. - -You can upload your deployment package by using the Lambda console, the Lambda API, or AWS Serverless Application Model \(AWS SAM\)\. - -**To upload a deployment package with the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Under **Function code**, choose **Upload**\. - -1. Upload the deployment package\. - -1. Choose **Save**\. - -**Topics** -+ [Building a deployment package with Gradle](#java-package-gradle) -+ [Building a deployment package with Maven](#java-package-maven) -+ [Uploading a deployment package with the Lambda API](#java-package-cli) -+ [Uploading a deployment package with AWS SAM](#java-package-cloudformation) +To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [Lambda layers](configuration-layers.md)\. ## Building a deployment package with Gradle @@ -88,7 +84,7 @@ task buildZip(type: Zip) { } ``` -This build configuration produces a deployment package in the `build/distributions` directory\. The `compileJava` task compiles your function's classes\. The `processResources` task copies libraries from the build's classpath into a directory named `lib`\. +This build configuration produces a deployment package in the `build/distributions` directory\. The `compileJava` task compiles your function's classes\. The `processResources` task copies the Java project resources into their target directory, potentially processing then\. The statement `into('lib')` then copies dependency libraries from the build's classpath into a folder named `lib`\. **Example build\.gradle – Dependencies** @@ -212,7 +208,12 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf To update a function's code with the AWS Command Line Interface \(AWS CLI\) or AWS SDK, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. For the AWS CLI, use the `update-function-code` command\. The following command uploads a deployment package named `my-function.zip` in the current directory: ``` -~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://my-function.zip +aws lambda update-function-code --function-name my-function --zip-file fileb://my-function.zip +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -232,10 +233,23 @@ To update a function's code with the AWS Command Line Interface \(AWS CLI\) or A If your deployment package is larger than 50 MB, you can't upload it directly\. Upload it to an Amazon Simple Storage Service \(Amazon S3\) bucket and point Lambda to the object\. The following example commands upload a deployment package to an S3 bucket named `my-bucket` and use it to update a function's code: ``` -~/my-function$ aws s3 cp my-function.zip s3://my-bucket - upload: my-function.zip to s3://my-bucket/my-function - ~/my-function$ aws lambda update-function-code --function-name my-function \ +aws s3 cp my-function.zip s3://my-bucket +``` + +You should see the following output: + +``` +upload: my-function.zip to s3://my-bucket/my-function +``` + +``` +aws lambda update-function-code --function-name my-function \ --s3-bucket my-bucket --s3-key my-function.zip +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -299,8 +313,8 @@ aws cloudformation deploy --template-file out.yml --stack-name java-basic --capa For a complete working example, see the following sample applications: **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 453a9d39..3dc7ed56 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -3,19 +3,19 @@ The GitHub repository for this guide provides sample applications that demonstrate the use of Java in AWS Lambda\. Each sample application includes scripts for easy deployment and cleanup, an AWS CloudFormation template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. Use the `blank-java` sample app to learn the basics, or as a starting point for your own application\. It shows the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. It uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times when you are iterating on your function code\. The project requires minimal setup and can be deployed from the command line in less than a minute\. -[https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) +[https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. -**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** +**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** ``` // Handler value: example.HandlerStream @@ -38,7 +38,7 @@ public class HandlerStream implements RequestStreamHandler { The `java-events` and `java-events-v1sdk` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. For event types like `DynamodbEvent` that require types from the AWS SDK for Java, `java-events-v1sdk` includes the SDK in its build configuration\. -**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** +**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** ``` import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 6ed9517a..dd48f6e2 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -31,7 +33,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio To record detail about calls that your function makes to other resources and services, add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that enable automatic instrumentation of AWS SDK for Java 2\.x clients\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Tracing dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/build.gradle) – Tracing dependencies** ``` dependencies { @@ -73,7 +75,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -83,7 +85,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -97,7 +99,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -114,7 +116,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/template.yml) – Dependencies layer** ``` Resources: @@ -138,18 +140,18 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) sample application\. +Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) sample application\. ## Tracing in sample applications The GitHub repository for this guide includes sample applications that demonstrate the use of tracing\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have active tracing enabled for Lambda functions\. The `blank-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. diff --git a/doc_source/kafka-hosting.md b/doc_source/kafka-hosting.md index 096de4b5..fe678e3a 100644 --- a/doc_source/kafka-hosting.md +++ b/doc_source/kafka-hosting.md @@ -10,7 +10,7 @@ To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud pro When you create a Kafka cluster using a non\-AWS provider, you receive the connection information for your cluster\. This information includes the Kafka cluster hostname, topic name, Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) user name and password, and bootstrap server host\-port pairs\. -For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. +For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md)\. ## Using Amazon MSK @@ -26,4 +26,4 @@ For more information about using an MSK cluster, see [Using Lambda with Amazon M You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. -For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file +For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file diff --git a/doc_source/kafka-smaa.md b/doc_source/kafka-smaa.md index df8fc0ed..11235148 100644 --- a/doc_source/kafka-smaa.md +++ b/doc_source/kafka-smaa.md @@ -1,9 +1,9 @@ -# Using Lambda with self\-managed Apache Kafka +# Using Lambda with Self\-managed Apache Kafka You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. This section describes how to use a function with a self\-managed Kafka cluster to process records in an Kafka topic\. **Topics** -+ [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md) -+ [Adding a self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file ++ [Managing access and permissions for a Self\-managed Apache Kafka cluster](smaa-permissions.md) ++ [Adding a Self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file diff --git a/doc_source/kafka-using-cluster.md b/doc_source/kafka-using-cluster.md index 61272809..6a02ca8c 100644 --- a/doc_source/kafka-using-cluster.md +++ b/doc_source/kafka-using-cluster.md @@ -1,7 +1,5 @@ # Using an Apache Kafka cluster as an event source for Lambda - - You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. This page describes how to use your Kafka cluster as an event source for your Lambda function\. @@ -12,8 +10,6 @@ This page describes how to use your Kafka cluster as an event source for your La ## How it works - - When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. + If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. + If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. @@ -21,7 +17,7 @@ When you add your Apache Kafka cluster as a trigger for your Lambda function, th + Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. + Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. -For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. +For Amazon MSK and Self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. ## Event source API operations diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index 3805a252..93ea4ae9 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -82,8 +82,6 @@ When making Lambda API calls, users can specify a version or alias by passing a You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. - - ### Best practices for using Deny statements with functions The following table summarizes the resources to use in Deny effects\. In the **Resource** column, `MyFunction` is the name of the function, `:1` refers to version 1 of the function, and `MyAlias` is the name of a function alias\. @@ -194,7 +192,7 @@ Actions that operate on a function can be restricted to a specific function by f | --- | --- | --- | | [AddPermission](API_AddPermission.md) [RemovePermission](API_RemovePermission.md) | Function Function version Function alias | `lambda:Principal` | | [Invoke](API_Invoke.md) **Permission:** `lambda:InvokeFunction` | Function Function version Function alias | None | -| [CreateFunction](API_CreateFunction.md) [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) | Function | `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` | +| [CreateFunction](API_CreateFunction.md) [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) | Function | `lambda:CodeSigningConfigArn` `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` | | [CreateAlias](API_CreateAlias.md) [DeleteAlias](API_DeleteAlias.md) [DeleteFunction](API_DeleteFunction.md) [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) [GetAlias](API_GetAlias.md) [GetFunction](API_GetFunction.md) [GetFunctionConfiguration](API_GetFunctionConfiguration.md) [GetPolicy](API_GetPolicy.md) [ListAliases](API_ListAliases.md) [ListVersionsByFunction](API_ListVersionsByFunction.md) [PublishVersion](API_PublishVersion.md) [PutFunctionConcurrency](API_PutFunctionConcurrency.md) [UpdateAlias](API_UpdateAlias.md) [UpdateFunctionCode](API_UpdateFunctionCode.md) | Function | None | | [GetAccountSettings](API_GetAccountSettings.md) [ListFunctions](API_ListFunctions.md) [ListTags](API_ListTags.md) [TagResource](API_TagResource.md) [UntagResource](API_UntagResource.md) | `*` | None | diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index d033617b..407b533d 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -28,8 +28,8 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. +[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. +[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. **Topics** + [AWS Lambda function handler in C\#](csharp-handler.md) diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 4ed714e7..319081ad 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -9,14 +9,21 @@ The following sections explain how common programming patterns and core concepts | --- | --- | --- | | Go 1\.x | `go1.x` | Amazon Linux | -AWS Lambda provides the following libraries for Go: -+ **github\.com/aws/aws\-lambda\-go/lambda**: The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. -+ **github\.com/aws/aws\-lambda\-go/lambdacontext**: Helpers for accessing execution context information from the [context object](golang-context.md)\. -+ **github\.com/aws/aws\-lambda\-go/events**: This library provides type definitions for common event source integrations\. - -**Note** -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. +Lambda provides the following tools and libraries for the Go runtime: + +**Tools and libraries for Go** ++ [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. ++ [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. ++ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing execution context information from the [context object](golang-context.md)\. ++ [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. ++ [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. + +For more information, see [aws\-lambda\-go](https://github.com/aws/aws-lambda-go) on GitHub\. + +Lambda provides the following sample applications for the Go runtime: + +**Sample Lambda applications in Go** ++ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. **Topics** + [AWS Lambda function handler in Go](golang-handler.md) diff --git a/doc_source/lambda-images.md b/doc_source/lambda-images.md index 58a0fa17..186814f5 100644 --- a/doc_source/lambda-images.md +++ b/doc_source/lambda-images.md @@ -1,6 +1,6 @@ # Using container images with Lambda -You can package your code and dependencies as a container image using tools such as the Docker command line interface \(CLI\)\. You can then upload the image to a container registry such as Amazon Elastic Container Registry \(Amazon ECR\)\. +You can package your code and dependencies as a container image using tools such as the Docker command line interface \(CLI\)\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. AWS provides a set of open\-source base images that you can use to build the container image for your function code\. You can also use alternative base images from other container registries\. AWS also provides an open\-source runtime client that you add to your alternative base image to make it compatible with the Lambda service\. @@ -8,8 +8,6 @@ Additionally, AWS provides a runtime interface emulator for you to test your fun There is no additional charge for packaging and deploying functions as container images\. When a function deployed as a container image is invoked, you pay for invocation requests and execution duration\. You do incur charges related to storing your container images in Amazon ECR\. For more information, see [Amazon ECR pricing](http://aws.amazon.com/ecr/pricing/)\. -**Note**: Using the container image currently only support for the image from Amazon ECR in the same AWS account. - **Topics** + [Creating Lambda container images](images-create.md) -+ [Testing Lambda container images locally](images-test.md) ++ [Testing Lambda container images locally](images-test.md) \ No newline at end of file diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index a1a5cef1..2213e8af 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -50,7 +50,12 @@ For detailed instructions, see [Creating a role for an AWS service \(console\)]( To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the `create-role` command\. ``` -$ aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json +aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json +``` + +You should see the following output: + +``` { "Role": { "Path": "/", @@ -96,13 +101,13 @@ The `trust-policy.json` file is a JSON file in the current directory that define You can also specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. ``` -$ aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' +aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' ``` To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` -$ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole +aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole ``` ## AWS managed policies for Lambda features @@ -127,7 +132,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [Self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) -In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file +In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index fd9d2667..b843a7f6 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -68,7 +68,7 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti **Topics** + [Java sample applications for AWS Lambda](java-samples.md) + [AWS Lambda function handler in Java](java-handler.md) -+ [Deploy Java Lambda functions with \.zip file archives](java-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + [Deploy Java Lambda functions with container images](java-image.md) + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) diff --git a/doc_source/lambda-kafka.md b/doc_source/lambda-kafka.md index 0cb6ab64..fbeb3491 100644 --- a/doc_source/lambda-kafka.md +++ b/doc_source/lambda-kafka.md @@ -10,4 +10,4 @@ This section describes how to use an AWS or non\-AWS hosted Kafka cluster with L + [Hosting an Apache Kafka cluster](kafka-hosting.md) + [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) + [Using Lambda with Amazon MSK](with-msk.md) -+ [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file ++ [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index f5e0333c..c25149b1 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -1,25 +1,8 @@ # Monitoring and troubleshooting Lambda applications -Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code when it runs, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. Lambda also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. +AWS Lambda integrates with other AWS services to help you monitor and troubleshoot your Lambda functions\. Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code when it runs, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. -The Lambda console provides a built\-in [monitoring dashboard](monitoring-functions-access-metrics.md) for each of your functions and applications\. - -**To monitor a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Monitoring**\. - -**Pricing** -CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatch charges for metrics, dashboards, alarms, logs, and insights\. For more information, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. - -Each time your function is invoked, Lambda records [metrics](monitoring-metrics.md) for the request, the function's response, and the overall state of the function\. You can use metrics to set alarms that are triggered when function performance degrades, or when you are close to hitting concurrency limits in the current AWS Region\. - -To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language\. The Lambda runtime uploads your function's log output to CloudWatch Logs\. You can [view logs](monitoring-cloudwatchlogs.md) in the CloudWatch Logs console, in the Lambda console, or from the command line\. - -In addition to monitoring logs and metrics in CloudWatch, you can use AWS X\-Ray to trace and debug requests served by your application\. For more information, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. +You can use other AWS services to troubleshoot your Lambda functions\. This section describes how to use these AWS services to monitor, trace, debug, and troubleshoot your Lambda functions and applications\. **Topics** + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index b99c110a..66466169 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,8 +9,9 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.771\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.771\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. @@ -37,7 +38,7 @@ You can add permissions to the role later, or swap it out for a different role t 1. Configure the following settings: + **Name** – **my\-function**\. - + **Runtime** – **Node\.js 12\.x**\. + + **Runtime** – **Node\.js 14\.x**\. + **Role** – **Choose an existing role**\. + **Existing role** – **lambda\-role**\. @@ -62,12 +63,12 @@ Each time you save your function code, the Lambda console creates a deployment p **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -[nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -[rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -[list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -[error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. +[blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. +[rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. +[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. +[list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. +[error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](nodejs-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md index 800a57a1..7f3c461d 100644 --- a/doc_source/lambda-permissions.md +++ b/doc_source/lambda-permissions.md @@ -18,6 +18,6 @@ For more information about IAM, see [What is IAM?](https://docs.aws.amazon.com/I **Topics** + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource\-based policies for AWS Lambda](access-control-resource-based.md) -+ [Identity\-based IAM policies for AWS Lambda](access-control-identity-based.md) ++ [Identity\-based IAM policies for Lambda](access-control-identity-based.md) + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) \ No newline at end of file diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md index a2b7f8bd..21bc2a35 100644 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -10,9 +10,10 @@ The following sections explain how common programming patterns and core concepts | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | -**Note** -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. +Lambda provides the following sample applications for the PowerShell runtime: + +**Sample Lambda applications in PowerShell** ++ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. Before you get started, you must first set up a PowerShell development environment\. For instructions on how to do this, see [Setting Up a PowerShell Development Environment](powershell-devenv.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 8fb03ceb..87978144 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -9,10 +9,10 @@ Lambda supports the following Python runtimes\. | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. @@ -64,7 +64,7 @@ Each time you save your function code, the Lambda console creates a deployment p **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](python-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 55ce258e..a9f5e883 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | | [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | | [ Code signing for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss) | Lambda now supports code signing\. Administrators can configure Lambda functions to accept only signed code on deployment\. Lambda checks the signatures to ensure that the code is not altered or tampered\. Additionally, Lambda ensures that the code is signed by trusted developers before accepting the deployment\. For details, see [Configuring code signing for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss)\. | November 23, 2020 | | [Preview: Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss) | Lambda now supports the Runtime Logs API\. Lambda extensions can use the Logs API to subscribe to log streams in the execution environment\. For details, see [Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss)\. | November 12, 2020 | diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md index ba58d856..4375f047 100644 --- a/doc_source/lambda-rolling-deployments.md +++ b/doc_source/lambda-rolling-deployments.md @@ -16,8 +16,6 @@ In a rolling deployment, AWS SAM performs these tasks: + It detects when you create a new version of your Lambda function\. + It triggers CodeDeploy to start the deployment of the new version\. - - ## Example AWS SAM Lambda template The following example shows an [AWS SAM template](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) for a simple rolling deployment\. diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index 4d67d391..ce4963c7 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -62,7 +62,8 @@ Each time you save your function code, the Lambda console creates a deployment p **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[Ruby Code Samples for AWS Lambda](https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-ruby-example_code-lambda.html) – Code samples written in Ruby that demonstrate how to interact with AWS Lambda\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](ruby-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 277d0492..93d6a5b7 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -1,6 +1,6 @@ # Lambda runtimes -Lambda supports multiple languages through the use of runtimes\. For a [function defined as a container image](configuration-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. +Lambda supports multiple languages through the use of [runtimes](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. For a [function defined as a container image](configuration-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-console.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. @@ -21,18 +21,19 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.771\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.771\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | **Python runtimes** | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | **Ruby runtimes** diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index aa51f020..e7a4582c 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -6,53 +6,58 @@ The GitHub repository for this guide includes sample applications that demonstra #### [ Node\.js ] **Sample Lambda applications in Node\.js** -+ [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -+ [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -+ [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -+ [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -+ [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. ++ [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. ++ [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. ++ [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. ++ [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. ------ #### [ Python ] **Sample Lambda applications in Python** -+ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ------ #### [ Ruby ] **Sample Lambda applications in Ruby** -+ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [Ruby Code Samples for AWS Lambda](https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-ruby-example_code-lambda.html) – Code samples written in Ruby that demonstrate how to interact with AWS Lambda\. ------ #### [ Java ] **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ------ #### [ Go ] +Lambda provides the following sample applications for the Go runtime: + **Sample Lambda applications in Go** -+ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. ++ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. ------ #### [ C\# ] **Sample Lambda applications in C\#** -+ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. ++ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. ------ #### [ PowerShell ] +Lambda provides the following sample applications for the PowerShell runtime: + **Sample Lambda applications in PowerShell** -+ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ++ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ------ diff --git a/doc_source/lambda-security.md b/doc_source/lambda-security.md index ddfc4a94..738703b2 100644 --- a/doc_source/lambda-security.md +++ b/doc_source/lambda-security.md @@ -10,7 +10,7 @@ This documentation helps you understand how to apply the shared responsibility m **Topics** + [Data protection in AWS Lambda](security-dataprotection.md) -+ [Identity and access management for AWS Lambda](security-iam.md) ++ [Identity and access management for 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) diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 960d08e1..d8cfce11 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -53,7 +53,7 @@ For services that generate a queue or data stream, you create an [event source m + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [Self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md index 45a82007..b17ff9c9 100644 --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -2,13 +2,29 @@ AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch\. To help you troubleshoot failures in a function, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs\. -You can insert logging statements into your code to help you validate that your code is working as expected\. Lambda automatically integrates with CloudWatch Logs and pushes all logs from your code to a CloudWatch Logs group associated with a Lambda function, which is named /aws/lambda/**\. To learn more about log groups and accessing them through the CloudWatch console, see the [Monitoring system, application, and custom log files](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchLogs.html) in the *Amazon CloudWatch User Guide*\. +You can insert logging statements into your code to help you validate that your code is working as expected\. Lambda automatically integrates with CloudWatch Logs and pushes all logs from your code to a CloudWatch Logs group associated with a Lambda function, which is named /aws/lambda/**\. -You can view logs for Lambda by using the Lambda console, the CloudWatch console, the AWS CLI, or the CloudWatch API\. The following procedure show you how to view the logs by using the Lambda console\. +You can view logs for Lambda functions using the Lambda console, the CloudWatch console, the AWS Command Line Interface \(AWS CLI\), or the CloudWatch API\. This page describes how to view logs using the Lambda console\. + +**Topics** ++ [Prerequisites](#monitoring-cloudwatchlogs-prereqs) ++ [Pricing](#monitoring-cloudwatchlogs-pricing) ++ [Using the Lambda console](#monitoring-cloudwatchlogs-console) ++ [Using the AWS CLI](#monitoring-cloudwatchlogs-cli) ++ [What's next?](#monitoring-cloudwatchlogs-next-up) + +## Prerequisites + +Your [execution role](lambda-intro-execution-role.md) needs permission to upload logs to CloudWatch Logs\. You can add CloudWatch Logs permissions using an AWS managed policy provided by Lambda\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md)\. + +## Pricing -**Note** There is no additional charge for using Lambda logs; however, standard CloudWatch Logs charges apply\. For more information, see [CloudWatch pricing\.](https://aws.amazon.com/cloudwatch/pricing/) +## Using the Lambda console + +The following section describes how to view logs for your function on the Lambda console\. + **To view logs using the Lambda console** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -22,4 +38,19 @@ There is no additional charge for using Lambda logs; however, standard CloudWatc 1. Choose **View logs in CloudWatch**\. -Lambda uses your function's permissions to upload logs to CloudWatch Logs\. If you don't see logs in the console, check your [execution role permissions](lambda-intro-execution-role.md)\. \ No newline at end of file +**Note** +Logs may not be immediately available after invocation\. We recommend waiting 5 to 10 minutes before checking your execution role\. + +## Using the AWS CLI + +To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language\. The Lambda runtime uploads your function's log output to CloudWatch Logs\. For language\-specific instructions, see the following topics: ++ [AWS Lambda function logging in Node\.js](nodejs-logging.md) ++ [AWS Lambda function logging in Python](python-logging.md) ++ [AWS Lambda function logging in Ruby](ruby-logging.md) ++ [AWS Lambda function logging in Java](java-logging.md) ++ [AWS Lambda function logging in Go](golang-logging.md) ++ [AWS Lambda function logging in C\#](csharp-logging.md) ++ [AWS Lambda function logging in PowerShell](powershell-logging.md) + +## What's next? ++ Learn more about log groups and accessing them through the CloudWatch console in [Monitoring system, application, and custom log files](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchLogs.html) in the *Amazon CloudWatch User Guide*\. \ No newline at end of file diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md index 837f8544..5d586b61 100644 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -1,15 +1,28 @@ # Monitoring functions in the AWS Lambda console -AWS Lambda monitors functions on your behalf and sends metrics to Amazon CloudWatch\. The metrics include total requests, duration, and error rates\. The Lambda console creates graphs for these metrics and shows them on the **Monitoring** page for each function\. +AWS Lambda monitors functions on your behalf and sends metrics to Amazon CloudWatch\. The Lambda console creates monitoring graphs for these metrics and shows them on the **Monitoring** page for each Lambda function\. -**To access the monitoring console** +This page describes the basics of using the Lambda console to view function metrics, including total requests, duration, and error rates\. + +## Pricing + +CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatch charges for metrics, dashboards, alarms, logs, and insights\. For more information, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. + +## Using the Lambda console + +You can use the Lambda console's monitoring dashboard to monitor your Lambda functions and applications\. + +**To monitor a function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose **Monitoring**\. -![\[Graphs of various CloudWatch metrics.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) +1. Choose a function\. + +1. Choose **Monitoring**\. + +## Types of monitoring graphs -The console provides the following graphs\. +The following section describes the monitoring graphs on the Lambda console\. **Lambda monitoring graphs** + **Invocations** – The number of times that the function was invoked in each 5\-minute period\. @@ -20,10 +33,48 @@ The console provides the following graphs\. + **Async delivery failures** – The number of errors that occurred when Lambda attempted to write to a destination or dead\-letter queue\. + **Concurrent executions** – The number of function instances that are processing events\. -To see the definition of a graph in CloudWatch, choose **View in metrics** from the menu in the top right of the graph\. For more information about the metrics that Lambda records, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +## Viewing graphs on the Lambda console + +The following section describes how to view CloudWatch monitoring graphs on the Lambda console, and open the CloudWatch metrics dashboard\. + +**To view monitoring graphs for a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Monitoring**\. + +1. Choose from the predefined time ranges, or choose a custom time range\. + +1. To see the definition of a graph in CloudWatch, choose the three vertical dots, and then choose **View in metrics** to open the **Metrics** dashboard in CloudWatch\. + +![\[An example monitoring definition on the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-definition.png) + +## Viewing queries in the CloudWatch Logs console + +The following section describes how to view and add reports from CloudWatch Logs Insights to a custom dashboard on the CloudWatch Logs console\. + +**To view reports for a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Monitoring**\. + +1. Choose **View logs in CloudWatch**\. + +1. Choose **View in Logs Insights**\. + +1. Choose from the predefined time ranges, or choose a custom time range\. + +1. Choose **Run query**\. -The console also shows reports from CloudWatch Logs Insights that are compiled from information in your function's logs\. You can add these reports to a custom dashboard in the CloudWatch Logs console\. Use the queries as a starting point for your own reports\. +1. \(Optional\) Choose **Save**\. -![\[AWS CloudWatch Logs Insights reports\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) +![\[The AWS CloudWatch Logs Insights reports on the CloudWatch dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) -To view a query, choose **View in CloudWatch Logs Insights** from the menu in the top right of the report\. \ No newline at end of file +## What's next? ++ Learn about the metrics that Lambda records and sends to CloudWatch in [Working with AWS Lambda function metrics](monitoring-metrics.md)\. ++ Learn how to use Lambda Insights to collect and aggregate Lambda function runtime performance metrics and logs in [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md)\. \ No newline at end of file diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index ef5bd61f..69a62cef 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -1,17 +1,17 @@ # Using Lambda Insights in Amazon CloudWatch -Amazon CloudWatch Lambda Insights collects and aggregates Lambda function runtime performance metrics and logs for your serverless applications\. +Amazon CloudWatch Lambda Insights collects and aggregates Lambda function runtime performance metrics and logs for your serverless applications\. This page describes how to enable and use Lambda Insights to diagnose issues with your Lambda functions\. **Topics** + [How Lambda Insights monitors serverless applications](#monitoring-insights-how) + [Pricing](#monitoring-insights-pricing) + [Supported runtimes](#monitoring-insights-runtimes) -+ [Region availability](#monitoring-insights-regions) + [Enabling Lambda Insights in the Lambda console](#monitoring-insights-enabling-console) + [Enabling Lambda Insights programmatically](#monitoring-insights-enabling-programmatically) + [Using the Lambda Insights dashboard](#monitoring-insights-multifunction) + [Example workflow to detect function anomalies](#monitoring-insights-anomalies) + [Example workflow using queries to troubleshoot a function](#monitoring-insights-queries) ++ [What's next?](#monitoring-console-next-up) ## How Lambda Insights monitors serverless applications @@ -23,7 +23,7 @@ The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for t ## Pricing -For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. +For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see�[Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. ## Supported runtimes @@ -40,29 +40,9 @@ You can use Lambda Insights with any of the following [Lambda function runtimes] + Ruby 2\.7 \(`ruby2.7`\) + Ruby 2\.5 \(`ruby2.5`\) -## Region availability - -Lambda Insights is currently available in the following AWS Regions: -+ US East \(N\. Virginia\) -+ US East \(Ohio\) -+ US West \(N\. California\) -+ US West \(Oregon\) -+ Asia Pacific \(Mumbai\) -+ Asia Pacific \(Seoul\) -+ Asia Pacific \(Singapore\) -+ Asia Pacific \(Sydney\) -+ Asia Pacific \(Tokyo\) -+ Canada \(Central\) -+ Europe \(Frankfurt\) -+ Europe \(Ireland\) -+ Europe \(London\) -+ Europe \(Paris\) -+ Europe \(Stockholm\) -+ South America \(São Paulo\) - ## Enabling Lambda Insights in the Lambda console -You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. **To enable Lambda Insights in the Lambda console** @@ -80,7 +60,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu ## Enabling Lambda Insights programmatically -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. @@ -161,4 +141,8 @@ You can use the single\-function view on the Lambda Insights dashboard to identi An autogenerated query for your function opens in the **Logs Insights** dashboard\. 1. Choose **Run query** to generate a **Logs** message for the invocation request\. -![\[Querying the selected function in the Logs Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-query.png) \ No newline at end of file +![\[Querying the selected function in the Logs Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-query.png) + +## What's next? ++ Learn how to create a CloudWatch Logs dashboard in [Create a Dashboard](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create_dashboard.html) in the *Amazon CloudWatch User Guide*\. ++ Learn how to add queries to a CloudWatch Logs dashboard in [Add Query to Dashboard or Export Query Results](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_ExportQueryResults.html) in the *Amazon CloudWatch User Guide*\. \ No newline at end of file diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index e43e10e2..97d9062c 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -1,10 +1,20 @@ # Working with AWS Lambda function metrics -When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. Use dimensions to filter and sort function metrics by function name, alias, or version\. +When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. + +This page describes the Lambda function invocation, performance, and concurrency metrics available on the CloudWatch console\. + +**Topics** ++ [Viewing metrics in the CloudWatch console](#monitoring-metrics-console) ++ [Types of metrics](#monitoring-metrics-types) + +## Viewing metrics in the CloudWatch console + +You can use the CloudWatch console to filter and sort function metrics by function name, alias, or version\. **To view metrics in the CloudWatch console** -1. Open the [Amazon CloudWatch console Metrics page](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=~();namespace=~'AWS*2fLambda) \(`AWS/Lambda` namespace\)\. +1. Open the [Metrics page](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=~();namespace=~'AWS*2fLambda) \(`AWS/Lambda` namespace\) on the CloudWatch console\. 1. Choose a dimension\. + **By Function Name** \(`FunctionName`\) – View aggregate metrics for all versions and aliases of a function\. @@ -21,12 +31,11 @@ The timestamp on a metric reflects when the function was invoked\. Depending on For more information about CloudWatch, see the [https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/)\. -**Topics** -+ [Using invocation metrics](#monitoring-metrics-invocation) -+ [Using performance metrics](#monitoring-metrics-performance) -+ [Using concurrency metrics](#monitoring-metrics-concurrency) +## Types of metrics + +The following section describes the type of metrics available on the CloudWatch console\. -## Using invocation metrics +### Using invocation metrics Invocation metrics are binary indicators of the outcome of an invocation\. For example, if the function returns an error, Lambda sends the `Errors` metric with a value of 1\. To get a count of the number of function errors that occurred each minute, view the `Sum` of the `Errors` metric with a period of one minute\. @@ -41,17 +50,18 @@ You should view the following metrics with the `Sum` statistic\. + `ProvisionedConcurrencyInvocations` – The number of times your function code is executed on [provisioned concurrency](configuration-concurrency.md)\. + `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. -## Using performance metrics +### Using performance metrics Performance metrics provide performance details about a single invocation\. For example, the `Duration` metric indicates the amount of time in milliseconds that your function spends processing an event\. To get a sense of how fast your function processes events, view these metrics with the `Average` or `Max` statistic\. **Performance metrics** -+ `Duration` – The amount of time that your function code spends processing an event\. For the first event processed by an instance of your function, this includes [initialization time](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. ++ `Duration` – The amount of time that your function code spends processing an event\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. ++ `PostRuntimeExecutionDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. + `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when the stream receives the record and when the event source mapping sends the event to the function\. `Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the P95 statistic shows the maximum duration of 95 percent of executions, excluding the slowest 5 percent\. -## Using concurrency metrics +### Using concurrency metrics Lambda reports concurrency metrics as an aggregate count of the number of instances processing events across a function, version, alias, or AWS Region\. To see how close you are to hitting concurrency limits, view these metrics with the `Max` statistic\. diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 4cccd0d9..4dbaf14d 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -1,34 +1,117 @@ # AWS Lambda function errors in Node\.js -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. + +This page describes how to view Lambda function invocation errors for the Node\.js runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#nodejs-exceptions-syntax) ++ [How it works](#nodejs-exceptions-how) ++ [Using the Lambda console](#nodejs-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#nodejs-exceptions-cli) ++ [Error handling in other AWS services](#nodejs-exceptions-other-services) ++ [What's next?](#python-exceptions-next-up) + +## Syntax **Example index\.js file – Reference error** ``` exports.handler = async function() { - return x + 10 -} + return x + 10 + } ``` This code results in a reference error\. Lambda catches the error and generates a JSON document with fields for the error message, the type, and the stack trace\. ``` { - "errorType": "ReferenceError", - "errorMessage": "x is not defined", - "trace": [ - "ReferenceError: x is not defined", - " at Runtime.exports.handler (/var/task/index.js:2:3)", - " at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)", - " at process._tickCallback (internal/process/next_tick.js:68:7)" - ] -} + "errorType": "ReferenceError", + "errorMessage": "x is not defined", + "trace": [ + "ReferenceError: x is not defined", + " at Runtime.exports.handler (/var/task/index.js:2:3)", + " at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)", + " at process._tickCallback (internal/process/next_tick.js:68:7)" + ] + } +``` + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -When you invoke the function from the command line, the AWS CLI splits the response into two documents\. To indicate that a function error occurred, the response displayed in the terminal includes a `FunctionError` field\. The response or error returned by the function is written to the output file\. +------ + +You should see the AWS CLI response in your command prompt: ``` -$ aws lambda invoke --function-name my-function out.json { "StatusCode": 200, "FunctionError": "Unhandled", @@ -36,27 +119,31 @@ $ aws lambda invoke --function-name my-function out.json } ``` -View the output file to see the error document\. +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: ``` -$ cat out.json -{"errorType":"ReferenceError","errorMessage":"x is not defined","trace":["ReferenceError: x is not defined"," at Runtime.exports.handler (/var/task/index.js:2:3)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]} +cat output.txt ``` -**Note** -The 200 \(success\) status code in the response from Lambda indicates that there wasn't an error with the request that you sent to Lambda\. For issues that result in an error status code, see [Errors](API_Invoke.md#API_Invoke_Errors)\. - -Lambda also records up to 256 KB of the error object in the function's logs\. To view logs when you invoke the function from the command line, use the `--log-type` option and decode the base64 string in the response\. +You should see the invocation response in your command prompt\. ``` -$ aws lambda invoke --function-name my-function out.json --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 Version: $LATEST -2019-06-05T22:11:27.082Z 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 ERROR Invoke Error {"errorType":"ReferenceError","errorMessage":"x is not defined","stack":["ReferenceError: x is not defined"," at Runtime.exports.handler (/var/task/index.js:2:3)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]} -END RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 -REPORT RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 Duration: 76.85 ms Billed Duration: 77 ms Memory Size: 128 MB Max Memory Used: 74 MB +{"errorType":"ReferenceError","errorMessage":"x is not defined","trace":["ReferenceError: x is not defined"," at Runtime.exports.handler (/var/task/index.js:2:3)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]} ``` -For more information about logs, see [AWS Lambda function logging in Node\.js](nodejs-logging.md)\. +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in Node\.js](nodejs-logging.md)\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md)\. -Depending on the event source, AWS Lambda might retry the failed Lambda function\. For example, if Kinesis is the event source, AWS Lambda retries the failed invocation until the Lambda function succeeds or the records in the stream expire\. For more information on retries, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. \ No newline at end of file +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Node\.js](nodejs-logging.md) page\. \ No newline at end of file diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index adeb8c95..24c8bd92 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -13,7 +13,7 @@ exports.handler = async function(event, context) { } ``` -When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the exported handler module, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` module that's exported by `index.js`\. +When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. The runtime passes three arguments to the handler method\. The first argument is the `event` object, which contains information from the invoker\. The invoker passes this information as a JSON\-formatted string when it calls [Invoke](API_Invoke.md), and the runtime converts it to an object\. When an AWS service invokes your function, the event structure [varies by service](lambda-services.md)\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 19c63b99..98044798 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -15,6 +15,7 @@ AWS provides the following base images for Node\.js: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | +| 14 | NodeJS 14\.x | Amazon Linux 2 | [Dockerfile for Node\.js 14\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | | 12 | NodeJS 12\.x | Amazon Linux 2 | [Dockerfile for Node\.js 12\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | | 10 | NodeJS 10\.x | Amazon Linux 2 | [Dockerfile for Node\.js 10\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs10.x/Dockerfile.nodejs10.x) | diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 62a40104..5f73c122 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -1,8 +1,19 @@ # AWS Lambda function logging in Node\.js -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use methods on the [console object](https://developer.mozilla.org/en-US/docs/Web/API/Console), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. + +**Topics** ++ [Creating a function that returns logs](#node-logging-output) ++ [Using the Lambda console](#nodejs-logging-console) ++ [Using the CloudWatch console](#nodejs-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#nodejs-logging-cli) ++ [Deleting logs](#nodejs-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on the [console object](https://developer.mozilla.org/en-US/docs/Web/API/Console), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example index\.js file – Logging** @@ -54,31 +65,43 @@ The Node\.js runtime logs the `START`, `END`, and `REPORT` lines for each invoca You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. -**Topics** -+ [Viewing logs in the AWS Management Console](#nodejs-logging-console) -+ [Using the AWS CLI](#nodejs-logging-cli) -+ [Deleting logs](#nodejs-logging-delete) +## Using the Lambda console -## Viewing logs in the AWS Management Console +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +## Using the CloudWatch console -**To view your Lambda function's logs** +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +**To view logs on the CloudWatch console** -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Choose the first stream in the list\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +1. Choose a log stream\. -## Using the AWS CLI +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -86,23 +109,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -112,10 +138,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index b15ec6d0..f349ad9d 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -1,18 +1,25 @@ # Deploy Node\.js Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. ++ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. ++ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. ++ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. -If you use the [Lambda console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. - -**Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [AWS Lambda layers](configuration-layers.md)\. +This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. **Topics** ++ [Prerequisites](#node-package-prereqs) + [Updating a function with no dependencies](#nodejs-package-codeonly) + [Updating a function with additional dependencies](#nodejs-package-dependencies) +## Prerequisites + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + ## Updating a function with no dependencies To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS Command Line Interface \(AWS CLI\)\. @@ -22,13 +29,18 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U 1. Create a \.zip file archive\. ``` - ~/my-function$ zip function.zip index.js + zip function.zip index.js ``` 1. To upload the package, use the `update-function-code` command\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", @@ -47,18 +59,26 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U ## Updating a function with additional dependencies -If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. If any of the libraries use native code, [use an Amazon Linux environment](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) to create the deployment package\. +If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. You can add the SDK for JavaScript to the deployment package if you need a newer version than the one [included on the runtime](lambda-nodejs.md), or to ensure that the version doesn't change in the future\. +If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + +For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + +As an alternative, you can create the deployment package using an Amazon EC2 instance that provides an Amazon Linux environment\. For instructions, see [Using Packages and Native nodejs Modules in AWS](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) in the AWS compute blog\. + **To update a Node\.js function with dependencies** 1. Open a command line terminal or shell\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. +1. Create a folder for the deployment package\. The following steps assume that the folder is named `my-function>`\. + 1. Install libraries in the node\_modules directory using the `npm install` command\. ``` - ~/my-function$ npm install aws-xray-sdk + npm install aws-xray-sdk ``` This creates a folder structure that's similar to the following: @@ -75,16 +95,21 @@ You can add the SDK for JavaScript to the deployment package if you need a newer ├── aws-xray-sdk-core ``` -1. Create a \.zip file that contains the contents of your project folder\. +1. Create a \.zip file that contains the contents of your project folder\. Use the `r` \(recursive\) option to ensure that zip compresses the subfolders\. ``` - ~/my-function$ zip -r function.zip . + zip -r function.zip . ``` 1. Upload the package using the `update-function-code` command\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -101,6 +126,4 @@ You can add the SDK for JavaScript to the deployment package if you need a newer } ``` -In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see the following on the AWS Compute Blog: -+ [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) -+ [Using Packages and Native nodejs Modules in AWS Lambda](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) \ No newline at end of file +In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. \ No newline at end of file diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 68794a93..44827ac0 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -44,7 +46,7 @@ AWSXRay.setContextMissingStrategy(() => {}); You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. -**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/package.json)** +**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/package.json)** ``` { @@ -66,7 +68,7 @@ You can instrument your handler code to record metadata and trace downstream cal To instrument AWS SDK clients, wrap the `aws-sdk` library with the `captureAWS` method\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -107,7 +109,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -117,7 +119,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -131,7 +133,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -148,7 +150,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Dependencies layer** ``` Resources: @@ -172,4 +174,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) sample application\. \ No newline at end of file diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index 1e1f8142..9b9c131d 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -1,6 +1,18 @@ # AWS Lambda function errors in PowerShell -If your Lambda function has a terminating error, AWS Lambda recognizes the failure, serializes the error information into JSON, and returns it\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. + +This page describes how to view Lambda function invocation errors for the Powershell runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#powershell-exceptions-syntax) ++ [How it works](#powershell-exceptions-how) ++ [Using the Lambda console](#powershell-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#powershell-exceptions-cli) ++ [Error handling in other AWS services](#powershell-exceptions-other-services) ++ [What's next?](#powershell-exceptions-next-up) + +## Syntax Consider the following PowerShell script example statement: @@ -47,4 +59,111 @@ The error is serialized like this: "errorMessage": "AccountNotFound", "errorType": "AccountNotFound" } -``` \ No newline at end of file +``` + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ + +You should see the AWS CLI response in your command prompt: + +``` +{ + "StatusCode": 200, + "FunctionError": "Unhandled", + "ExecutedVersion": "$LATEST" +} +``` + +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: + +``` +cat output.txt +``` + +You should see the invocation response in your command prompt\. + +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in PowerShell](powershell-logging.md)\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. + +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in PowerShell](powershell-logging.md) page\. \ No newline at end of file diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 1be2191b..4c265319 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -1,10 +1,21 @@ # AWS Lambda function logging in PowerShell -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. -**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-powershell/function/Handler.ps1) – Logging** +**Topics** ++ [Creating a function that returns logs](#powershell-logging-output) ++ [Using the Lambda console](#powershell-logging-console) ++ [Using the CloudWatch console](#powershell-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#powershell-logging-cli) ++ [Deleting logs](#powershell-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. + +**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-powershell/function/Handler.ps1) – Logging** ``` #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} @@ -64,33 +75,43 @@ The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocatio + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#powershell-logging-console) -+ [Using the AWS CLI](#powershell-logging-cli) -+ [Deleting logs](#powershell-logging-delete) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. -## Viewing logs in the AWS Management Console +## Using the CloudWatch console -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -**To view your Lambda function's logs** +**To view logs on the CloudWatch console** -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Choose the first stream in the list\. +1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -## Using the AWS CLI +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -98,23 +119,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -124,10 +148,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/powershell-package.md b/doc_source/powershell-package.md index bd736767..09fdac4c 100644 --- a/doc_source/powershell-package.md +++ b/doc_source/powershell-package.md @@ -1,8 +1,14 @@ # Deploy PowerShell Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +A deployment package for the PowerShell runtime contains your PowerShell script, PowerShell modules that are required for your PowerShell script, and the assemblies needed to host PowerShell Core\. -A \.zip file archive is a PowerShell Lambda deployment package that contains your PowerShell script, PowerShell modules that are required for your PowerShell script, and the assemblies needed to host PowerShell Core\. +## Tools and libraries + +Lambda provides the following sample applications for the PowerShell runtime: + +**Tools and libraries for PowerShell** ++ [AWS Lambda and AWS Tools for PowerShell](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-lambda.html): the steps to install PowerShell, the \.NET Core 2\.1 SDK, and the `AWSLambdaPSCore` module\. ++ [aws\-lambda\-dotnet](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell): Lambda tools for Powershell on GitHub\. The AWSLambdaPSCore module has the following new cmdlets to help author and publish PowerShell Lambda functions: @@ -12,6 +18,15 @@ The AWSLambdaPSCore module has the following new cmdlets to help author and publ + **Publish\-AWSPowerShellLambda** – Publishes a given PowerShell script to Lambda\. + **New\-AWSPowerShellLambdaPackage** – Creates a Lambda deployment package that you can use in a CI/CD system for deployment\. +## Sample applications + +Lambda provides the following sample applications for the PowerShell runtime: + +**Sample Lambda applications in PowerShell** ++ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. + +## Creating the Lambda function + To get started writing and invoking a PowerShell script with Lambda, you can use the `New-AWSPowerShellLambda` cmdlet to create a starter script based on a template\. You can use the `Publish-AWSPowerShellLambda` cmdlet to deploy your script to Lambda\. Then you can test your script either through the command line or the Lambda console\. To create a new PowerShell script, upload it, and test it, do the following: diff --git a/doc_source/python-context.md b/doc_source/python-context.md index 652e7e8f..b0770e46 100644 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -1,6 +1,6 @@ # AWS Lambda context object in Python -When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. +When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [AWS Lambda function handler in Python](python-handler.md)\. **Context methods** + `get_remaining_time_in_millis` – Returns the number of milliseconds left before the execution times out\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index c8d129a4..a4f8a519 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,30 +1,93 @@ # AWS Lambda function errors in Python -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. -**Example lambda\_function\.py file – Exception** +This page describes how to view Lambda function invocation errors for the Python runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [How it works](#python-exceptions-how) ++ [Using the Lambda console](#python-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#python-exceptions-cli) ++ [Error handling in other AWS services](#python-exceptions-other-services) ++ [Error examples](#python-exceptions-examples) ++ [Sample applications](#python-exceptions-samples) ++ [What's next?](#python-exceptions-next-up) + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] ``` -def lambda_handler(event, context): - return x + 10 +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -This code results in a name error\. Lambda catches the error and generates a JSON document with fields for the error message, the type, and the stack trace\. +------ +#### [ Windows OS ] ``` -{ - "errorMessage": "name 'x' is not defined", - "errorType": "NameError", - "stackTrace": [ - " File \"/var/task/error_function.py\", line 2, in lambda_handler\n return x + 10\n" - ] -} +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -When you invoke the function from the command line, the AWS CLI splits the response into two documents\. To indicate that a function error occurred, the response displayed in the terminal includes a `FunctionError` field\. The response or error returned by the function is written to the output file\. +------ + +You should see the AWS CLI response in your command prompt: ``` -$ aws lambda invoke --function-name my-function out.json { "StatusCode": 200, "FunctionError": "Unhandled", @@ -32,25 +95,77 @@ $ aws lambda invoke --function-name my-function out.json } ``` -View the output file to see the error document\. +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: ``` -$ cat out.json -{"errorMessage": "name 'x' is not defined", "errorType": "NameError", "stackTrace": [" File \"/var/task/error_function.py\", line 2, in lambda_handler\n return x + 10\n"]} +cat output.txt ``` -**Note** -The 200 \(success\) status code in the response from Lambda indicates that there wasn't an error with the request that you sent to Lambda\. For issues that result in an error status code, see [Errors](API_Invoke.md#API_Invoke_Errors)\. +You should see the invocation response in your command prompt\. -Lambda also records up to 256 KB of the error object in the function's logs\. To view logs when you invoke the function from the command line, use the `--log-type` option and decode the base64 string in the response\. +``` +{"errorMessage": "'action'", "errorType": "KeyError", "stackTrace": [" File \"/var/task/lambda_function.py\", line 36, in lambda_handler\n result = ACTIONS[event['action']](event['number'])\n"]} +``` + +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in Python](python-logging.md)\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Python code in AWS Lambda](python-tracing.md)\. + +## Error examples + +The following section shows common errors you may receive when creating, updating, or invoking your function using the Python [Lambda runtimes](lambda-runtimes.md)\. + +**Example Runtime exception – ImportError** ``` -$ aws lambda invoke --function-name my-function out.json --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 Version: $LATEST -     return x + 10/lambda_function.py", line 2, in lambda_handler -END RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 -REPORT RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 Duration: 12.33 ms Billed Duration: 13 ms Memory Size: 128 MB Max Memory Used: 56 MB +{ + "errorMessage": "Unable to import module 'lambda_function': Cannot import name '_imaging' from 'PIL' (/var/task/PIL/__init__.py)", + "errorType": "Runtime.ImportModuleError" +} ``` -For more information about logs, see [AWS Lambda function logging in Python](python-logging.md)\. \ No newline at end of file +This error is a result of using the AWS Command Line Interface \(AWS CLI\) to upload a deployment package that contains a C or C\+\+ library\. For example, the [Pillow \(PIL\)](https://pypi.org/project/Pillow/), [numpy](https://pypi.org/project/numpy/), or [pandas](https://pypi.org/project/pandas/) library\. + +We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create your deployment package\. Using the AWS SAM CLI with this option creates a Docker container with a Lambda\-like environment that is compatible with Lambda\. + +**Example JSON serialization error – Runtime\.MarshalError** + +``` +{ + "errorMessage": "Unable to marshal response: Object of type AttributeError is not JSON serializable", + "errorType": "Runtime.MarshalError" +} +``` + +This error can be the result of the base64\-encoding mechanism you are using in your function code\. For example: + +``` +import base64 +encrypted_data = base64.b64encode(payload_enc).decode("utf-8") +``` + +This error can also be the result of not specifying your \.zip file as a binary file when you created or updated your function\. We recommend using the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) command option to upload your deployment package \(\.zip file\)\. + +``` +aws lambda create-function --function-name my-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.lambda_handler --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex +``` + +## Sample applications + +The GitHub repository for this guide includes sample applications that demonstrate the use of the errors\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. + +**Sample Lambda applications in Python** ++ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. + +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Python](python-logging.md) page\. \ No newline at end of file diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index 20ffb7da..d4e4c1d3 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -108,7 +108,7 @@ The function in this example depends on a successful response \(in `200`\) from ### Returning a calculation -The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. +The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): diff --git a/doc_source/python-image.md b/doc_source/python-image.md index de094d08..0f5b3e34 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -16,7 +16,7 @@ AWS provides the following base images for Python: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | | 3, 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | -| 3\.7 | Python 3\.7 | Amazon Linux 2 | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | +| 3\.7 | Python 3\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | | 3\.6 | Python 3\.6 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.6 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.6/Dockerfile.python3.6) | | 2, 2\.7 | Python 2\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python2.7/Dockerfile.python2.7) | @@ -34,4 +34,35 @@ pip install awslambdaric For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on the Python Package Index \(PyPI\) website\. -You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. \ No newline at end of file +You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. + +## Deploying Python with an AWS base image + +When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. + +**To build and deploy a Python function with the `python:3.8` base image\.** + +1. On your local machine, create a project directory for your new function\. + +1. In your project directory, add a file named `app.py` containing your function code\. The following example shows a simple Python handler\. + + ``` + import sys + def handler(event, context): + return 'Hello from AWS Lambda using Python' + sys.version + '!' + ``` + +1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. + + ``` + FROM public.ecr.aws/lambda/python:3.8 + + COPY app.py ./ + CMD ["app.handler"] + ``` + +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-1.title)\. + +## Create a Python image from an alternative base image + +For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index ecca9be3..3211a16b 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -1,8 +1,20 @@ # AWS Lambda function logging in Python -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use [the `print` method](https://docs.python.org/3/library/functions.html#print), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. + +**Topics** ++ [Creating a function that returns logs](#python-logging-output) ++ [Using the Lambda console](#python-logging-console) ++ [Using the CloudWatch console](#python-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#python-logging-cli) ++ [Deleting logs](#python-logging-delete) ++ [Logging library](#python-logging-lib) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use the [`print` method](https://docs.python.org/3/library/functions.html#print), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example lambda\_function\.py** @@ -42,34 +54,43 @@ The Python runtime logs the `START`, `END`, and `REPORT` lines for each invocati + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#python-logging-console) -+ [Using the AWS CLI](#python-logging-cli) -+ [Deleting logs](#python-logging-delete) -+ [Logging library](#python-logging-lib) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. + +## Using the CloudWatch console + +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -## Viewing logs in the AWS Management Console +**To view logs on the CloudWatch console** -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -**To view your Lambda function's logs** +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Choose a log stream\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -1. Choose the first stream in the list\. +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +## Using the AWS Command Line Interface \(AWS CLI\) -## Using the AWS CLI +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -77,23 +98,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -103,10 +127,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/python-package.md b/doc_source/python-package.md index f3aa695c..ceeba98a 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -1,53 +1,49 @@ # Deploy Python Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. ++ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. ++ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. ++ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. -If you use the [Lambda console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. - -You can also use the AWS Serverless Application Model \(AWS SAM\) CLI `build` command to create a deployment package for your Python function code and dependencies\. The AWS SAM CLI also provides an option to build your deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. - -**Note** -We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow](https://pypi.org/project/Pillow/) library\. +This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. **Topics** + [Prerequisites](#python-package-prereqs) + [Updating a function with no dependencies](#python-package-codeonly) + [Updating a function with additional dependencies](#python-package-dependencies) -+ [With a virtual environment](#python-package-venv) ++ [Using a virtual environment](#python-package-venv) ## Prerequisites -These instructions assume that you have already created a Lambda function and are updating the deployment package for your function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. - -To complete the following steps, you 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 -``` +The following steps assume that you have created a Lambda function, and are updating the deployment package for your function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. -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\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) ## Updating a function with no dependencies -To create or update a function with the Lambda API, create a deployment package that contains your function code and upload it with the AWS Command Line Interface \(AWS CLI\)\. +The following steps show how to create a deployment package that contains only your function code, and upload it to Lambda using the AWS CLI\. **To update a Python function with no dependencies** 1. Add function code files to the root of your deployment package\. ``` - ~/my-function$ zip my-deployment-package.zip lambda_function.py + zip my-deployment-package.zip lambda_function.py + ``` + +1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip ``` -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file deployment package to Lambda and update the function code\. + You should see the following output: ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", @@ -62,38 +58,54 @@ To create or update a function with the Lambda API, create a deployment package } ``` -**Note** -In order for your Python modules can be imported at runtime, ensure the files in the zip produced are globally readable (o+r) and any directories are globally readable (o+x). +The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. ## Updating a function with additional dependencies -If your Lambda function depends on libraries other than the AWS SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. +If your Lambda function depends on libraries other than the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), install the libraries to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package \(\.zip file\)\. + +**Note** +Make sure that the files and directories in the deployment package have their permissions set to be globally readable, so that Lambda can import your Python modules at runtime\. -The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. + The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. **Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with dependencies** 1. Install libraries in a `package` directory with `pip`'s `--target` option\. ``` - ~/my-function$ pip install --target ./package requests + pip install --target ./package requests ``` **Note** To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) such as Ubuntu, you may need to pass the `--system` option\. +1. Navigate to the `package` directory\. + + ``` + cd package + ``` + 1. Create a deployment package with the installed libraries at the root\. ``` - ~/my-function$ zip -r my-deployment-package.zip ./package/ + zip -r ../my-deployment-package.zip . + ``` + + The last command saves the deployment package to the root of the `my-function` directory\. + +1. Navigate back to the `my-function` directory\. + + ``` + cd.. ``` 1. Add function code files to the root of your deployment package\. ``` - ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + zip -g my-deployment-package.zip lambda_function.py ``` After you complete this step, you should have the following directory structure: @@ -109,10 +121,15 @@ To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa ... ``` -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file deployment package to Lambda and update the function code\. +1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + ``` + + You should see the following output: ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", @@ -127,55 +144,61 @@ To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa } ``` -## With a virtual environment +The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. -In some cases, you may need to use a [virtual environment](https://virtualenv.pypa.io/en/latest) to install dependencies for your function\. This can occur if your function or its dependencies have dependencies on native libraries, or if you used Homebrew to install Python\. +## Using a virtual environment -The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload it to Lambda using the AWS CLI\. +If your Lambda function depends on libraries other than the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), install the libraries to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package \(\.zip file\)\. + + The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are using the [virtualenv](https://docs.python.org/3/library/venv.html) module for a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. **Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with a virtual environment** 1. Create a virtual environment\. ``` - ~/my-function$ virtualenv myvenv + virtualenv myvenv ``` +**Note** +The [virtualenv](https://docs.python.org/3/library/venv.html) module uses Python 2\.7 by default\. You may need to add a local export path to your command line profile, such as `export VIRTUALENV_PYTHON=/usr/bin/python3.8` when using the *virtualenv* module with Python 3 and pip 3\. 1. Activate the environment\. ``` - ~/my-function$ source myvenv/bin/activate + source myvenv/bin/activate ``` 1. Install libraries with pip\. ``` - (myvenv) ~/my-function$ pip install requests + pip install requests ``` 1. Deactivate the virtual environment\. ``` - (myvenv) ~/my-function$ deactivate + deactivate ``` -1. Create a deployment package with the installed libraries at the root\. +1. Create a deployment package with the installed libraries at the root\. ``` - ~/my-function$ cd myvenv/lib/python3.8/site-packages - ~/my-function/myvenv/lib/python3.8/site-packages$ zip -r my-deployment-package.zip . + cd myvenv/lib/python3.8/site-packages + zip -r ../../../../my-deployment-package.zip . ``` -**Note** + + The last command saves the deployment package to the root of the `my-function` directory\. +**Tip** A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. 1. Add function code files to the root of your deployment package\. ``` - ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ - ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + cd ../../../../ + zip -g my-deployment-package.zip lambda_function.py ``` After you complete this step, you should have the following directory structure: @@ -191,10 +214,15 @@ A library may appear in `site-packages` or `dist-packages` and the first folder ... ``` -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file deployment package to Lambda and update the function code\. +1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + ``` + + You should see the following output: ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", @@ -208,3 +236,5 @@ A library may appear in `site-packages` or `dist-packages` and the first folder ... } ``` + +The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index e9f25cda..35b517d7 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -31,7 +33,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/requirements.txt)** +**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/function/requirements.txt)** ``` jsonpickle==1.3 @@ -40,7 +42,7 @@ aws-xray-sdk==2.4.3 To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** ``` import boto3 @@ -85,7 +87,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -95,7 +97,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -109,7 +111,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -126,7 +128,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/template.yml) – Dependencies layer** ``` Resources: @@ -150,4 +152,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) sample application\. \ No newline at end of file diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index 1111c347..be98e869 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -1,6 +1,19 @@ # AWS Lambda function errors in Ruby -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. + +This page describes how to view Lambda function invocation errors for the Ruby runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#ruby-exceptions-syntax) ++ [How it works](#ruby-exceptions-how) ++ [Using the Lambda console](#ruby-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#ruby-exceptions-cli) ++ [Error handling in other AWS services](#ruby-exceptions-other-services) ++ [Sample applications](#ruby-exceptions-samples) ++ [What's next?](#ruby-exceptions-next-up) + +## Syntax **Example function\.rb** @@ -25,10 +38,81 @@ This code results in a type error\. Lambda catches the error and generates a JSO } ``` -When you invoke the function from the command line, the AWS CLI splits the response into two documents\. To indicate that a function error occurred, the response displayed in the terminal includes a `FunctionError` field\. The response or error returned by the function is written to the output file\. +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ + +You should see the AWS CLI response in your command prompt: ``` -$ aws lambda invoke --function-name my-function out.json { "StatusCode": 200, "FunctionError": "Unhandled", @@ -36,36 +120,37 @@ $ aws lambda invoke --function-name my-function out.json } ``` -View the output file to see the error document\. +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: ``` -$ cat out.json -{"errorMessage":"no implicit conversion of String into Integer","errorType":"Function","stackTrace":["/var/task/function.rb:3:in `first'","/var/task/function.rb:3:in `handler'"]} +cat output.txt ``` -**Note** -The 200 \(success\) status code in the response from Lambda indicates that there wasn't an error with the request that you sent to Lambda\. For issues that result in an error status code, see [Errors](API_Invoke.md#API_Invoke_Errors)\. - -Lambda also records up to 256 KB of the error object in the function's logs\. To view logs when you invoke the function from the command line, use the `--log-type` option and decode the base64 string in the response\. +You should see the invocation response in your command prompt\. ``` -$ aws lambda invoke --function-name my-function out.json --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 Version: $LATEST -Processing event... -Error raised from handler method -{ - "errorMessage": "no implicit conversion of String into Integer", - "errorType": "Function", - "stackTrace": [ - "/var/task/function.rb:3:in `first'", - "/var/task/function.rb:3:in `handler'" - ] -} -END RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 -REPORT RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 Duration: 22.74 ms Billed Duration: 23 ms Memory Size: 128 MB Max Memory Used: 18 MB +{"errorMessage":"no implicit conversion of String into Integer","errorType":"Function","stackTrace":["/var/task/function.rb:3:in `first'","/var/task/function.rb:3:in `handler'"]} ``` -For more information about logs, see [AWS Lambda function logging in Ruby](ruby-logging.md)\. +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md)\. + +## Sample applications + +The following sample code is available for the Ruby runtime\. + +**Sample Lambda applications in Ruby** ++ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [Ruby Code Samples for AWS Lambda](https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-ruby-example_code-lambda.html) – Code samples written in Ruby that demonstrate how to interact with AWS Lambda\. -Depending on the event source, AWS Lambda might retry the failed Lambda function\. For example, if Kinesis is the event source, AWS Lambda retries the failed invocation until the Lambda function succeeds or the records in the stream expire\. For more information on retries, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. \ No newline at end of file +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Ruby](ruby-logging.md) page\. \ No newline at end of file diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 46da0ba2..1eb563fa 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -1,8 +1,19 @@ # AWS Lambda function logging in Ruby -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use `puts` statements, or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. + +**Topics** ++ [Creating a function that returns logs](#ruby-logging-output) ++ [Using the Lambda console](#ruby-logging-console) ++ [Using the CloudWatch console](#ruby-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#ruby-logging-cli) ++ [Deleting logs](#ruby-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use `puts` statements, or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example lambda\_function\.rb** @@ -41,44 +52,6 @@ I, [2019-10-26T10:04:01.689856 #8] INFO 6573a3a0-2fb1-4e78-a582-2c769282e0bd -- I, [2019-10-26T10:04:01.689874 #8] INFO 6573a3a0-2fb1-4e78-a582-2c769282e0bd -- : {"key1"=>"value1", "key2"=>"value2", "key3"=>"value3"} ``` -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. - -**To view your Lambda function's logs** - -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. - -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. - -1. Choose the first stream in the list\. - -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -``` -$ aws lambda invoke --function-name my-function out --log-type Tail -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -You can use the `base64` utility to decode the logs\. - -``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` - -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. - **Example log format** ``` @@ -114,33 +87,43 @@ The Ruby runtime logs the `START`, `END`, and `REPORT` lines for each invocation + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#python-logging-console) -+ [Using the AWS CLI](#python-logging-cli) -+ [Deleting logs](#python-logging-delete) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. -## Viewing logs in the AWS Management Console +## Using the CloudWatch console -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -**To view your Lambda function's logs** +**To view logs on the CloudWatch console** -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Choose the first stream in the list\. +1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -## Using the AWS CLI +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -148,23 +131,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -174,10 +160,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" @@ -215,6 +213,6 @@ $ ./get-logs.sh } ``` -## Deleting logs +## Deleting logs Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. \ No newline at end of file diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index 9b173859..7144e0d4 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -1,18 +1,33 @@ # Deploy Ruby Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. ++ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. ++ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. ++ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. -If you use the [Lambda console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. - -**Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [AWS Lambda layers](configuration-layers.md)\. +This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. **Topics** ++ [Prerequisites](#ruby-package-prereqs) ++ [Tools and libraries](#ruby-package-libraries) + [Updating a function with no dependencies](#ruby-package-codeonly) + [Updating a function with additional dependencies](#ruby-package-dependencies) +## Prerequisites + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +## Tools and libraries + +Lambda provides the following tools and libraries for the Ruby runtime: + +**Tools and libraries for Ruby** ++ [AWS SDK for Ruby](https://github.com/aws/aws-sdk-ruby): the official AWS SDK for the Ruby programming language\. + ## Updating a function with no dependencies To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS Command Line Interface \(AWS CLI\)\. @@ -22,13 +37,18 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U 1. Create a \.zip file archive\. ``` - ~/my-function$ zip function.zip function.rb + zip function.zip function.rb ``` 1. To upload the package, use the `update-function-code` command\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", @@ -54,7 +74,12 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t 1. Install libraries in the vendor directory using the `bundle` command\. ``` - ~/my-function$ bundle install --path vendor/bundle + bundle install --path vendor/bundle + ``` + + You should see the following output: + + ``` Fetching gem metadata from https://rubygems.org/.............. Resolving dependencies... Fetching aws-eventstream 1.0.1 @@ -67,8 +92,13 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t 1. Create a \.zip file archive\. ``` - package$ zip -r function.zip function.rb vendor - adding: function.rb (deflated 37%) + zip -r function.zip function.rb vendor + ``` + + You should see the following output: + + ``` + adding: function.rb (deflated 37%) adding: vendor/ (stored 0%) adding: vendor/bundle/ (stored 0%) adding: vendor/bundle/ruby/ (stored 0%) @@ -82,7 +112,12 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t 1. Update the function code\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index a5224563..55ffaa4e 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -31,7 +33,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Ruby\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/Gemfile)** +**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/function/Gemfile)** ``` # Gemfile @@ -44,7 +46,7 @@ gem 'test-unit', '3.3.5' To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** ``` # lambda_function.rb @@ -87,7 +89,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -97,7 +99,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -111,7 +113,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -128,7 +130,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/template.yml) – Dependencies layer** ``` Resources: @@ -152,4 +154,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) sample application\. \ No newline at end of file diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index da6e9f76..c03b0a65 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -21,6 +21,7 @@ The following runtimes have been deprecated: | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | April 30, 2019 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | August 12, 2019 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | March 6, 2020 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | May 28, 2021 | In most cases, the end\-of\-life date of a language version or operating system is known well in advance\. If you have functions running on a runtime that will be deprecated in the next 60 days, Lambda notifies you by email that you should prepare by migrating your function to a supported runtime\. In some cases, such as security issues that require a backwards\-incompatible update, or software that doesn't support a long\-term support \(LTS\) schedule, advance notice might not be possible\. diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md index a3fa3b30..7c0f280c 100644 --- a/doc_source/runtimes-avx2.md +++ b/doc_source/runtimes-avx2.md @@ -40,8 +40,6 @@ For more information about Intel MKL and similar libraries, see [Math Kernel Lib If you don't use C or C\+\+ libraries and don't build with Intel MKL, you can still get some AVX2 performance improvement for your applications\. Note that the actual improvement depends on the compiler or interpreter's ability to utilize the AVX2 capabilities on your code\. - - Python Python users generally use SciPy and NumPy libraries for compute\-intensive workloads\. You can compile these libraries to enable AVX2, or you can use the Intel MKL\-enabled versions of the libraries\. diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index d0b9384c..50268a89 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -4,8 +4,6 @@ Lambda invokes your function in an execution environment, which provides a secur The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages from the function by subscribing to logs using the [Logs API](runtimes-logs-api.md)\. - - ![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) When you create your Lambda function, you specify configuration information, such as the amount of memory available and the maximum execution time allowed for your function\. Lambda uses this information to set up the execution environment\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index f26f8fc8..c498b4ab 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -14,6 +14,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Custom runtime on Amazon Linux 2 \(`provided.al2`\) + Java 11 \(Corretto\) \(`java11`\) + Java 8 \(Corretto\) \(`java8.al2`\) ++ Node\.js 14\.x \(`nodejs14.x`\) + Node\.js 12\.x \(`nodejs12.x`\) + Node\.js 10\.x \(`nodejs10.x`\) + Python 3\.8 \(`python3.8`\) @@ -48,8 +49,6 @@ Each phase starts with an event from the Lambda service to the runtime and to al ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Full-Sequence.png) - - **Topics** + [Init phase](#runtimes-extensions-api-reg) + [Invoke phase](#runtimes-lifecycle-invoke) @@ -106,9 +105,7 @@ Here is an example payload: **Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. -To help identify the overhead introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. - -You can assess the performance impact of an extension by using the `PostRuntimeExtensionsDuration` metric to measure the extra time an extension adds to the function execution\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. @@ -325,6 +322,4 @@ The extension uses this method to report an error to Lambda before exiting\. Cal + 202 – Accepted + 400 – Bad Request + 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. - - \ No newline at end of file ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. \ No newline at end of file diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index ebcc6286..432d4f33 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -17,7 +17,7 @@ Using language\-specific environment variables is the preferred way to set start The Java virtual machine \(JVM\) tries to locate the class that was specified with the `javaagent` parameter to the JVM, and invoke its `premain` method before the application's entry point\. -The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. +The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. ``` import com.amazonaws.services.lambda.runtime.RequestStreamHandler; @@ -143,6 +143,7 @@ You can create a *wrapper script* to customize the runtime startup behavior of y Invocations may fail if the wrapper script does not successfully start the runtime process\. The following [Lambda runtimes](lambda-runtimes.md) support wrapper scripts: ++ Node\.js 14\.x + Node\.js 12\.x + Node\.js 10\.x + Python 3\.8 diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md index 5e5b7623..bb0ab2f1 100644 --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -4,12 +4,17 @@ In this tutorial, you create a Lambda function with a custom runtime\. You start ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -127,7 +132,7 @@ runtime-tutorial$ aws lambda create-function --function-name bash-runtime \ Invoke the function and verify the response\. ``` -runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt –cli-binary-format raw-in-base64-out +runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt --cli-binary-format raw-in-base64-out { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 743ac593..a2357ac0 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -7,17 +7,17 @@ The blank function sample application is a starter application that demonstrates Variants of this sample application are available for the following languages: **Variants** -+ Node\.js – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs)\. -+ Python – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python)\. -+ Ruby – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby)\. -+ Java – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java)\. -+ Go – [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go)\. -+ C\# – [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp)\. -+ PowerShell – [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell)\. ++ Node\.js – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs)\. ++ Python – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python)\. ++ Ruby – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby)\. ++ Java – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java)\. ++ Go – [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go)\. ++ C\# – [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp)\. ++ PowerShell – [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell)\. The examples in this topic highlight code from the Node\.js version, but the details are generally applicable to all variants\. -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) to download, configure, and deploy it in your account\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) to download, configure, and deploy it in your account\. **Topics** + [Architecture and handler code](#samples-blank-architecture) @@ -39,7 +39,7 @@ Standard charges apply for each service\. For more information, see [AWS Pricing The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Handler code** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Handler code** ``` // Handler @@ -66,7 +66,7 @@ var serialize = function(object) { The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. -The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. +The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ## Deployment automation with AWS CloudFormation and the AWS CLI @@ -78,7 +78,7 @@ The application template uses an AWS Serverless Application Model \(AWS SAM\) re The template defines the resources in the application *stack*\. This includes the function, its execution role, and a Lambda layer that provides the function's library dependencies\. The stack does not include the bucket that the AWS CLI uses during deployment or the CloudWatch Logs log group\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Serverless resources** ``` AWSTemplateFormatVersion: '2010-09-09' @@ -152,7 +152,7 @@ In this example, the `Code` property specifies an object in an Amazon S3 bucket\ To upload the project files to Amazon S3, the deployment script uses commands in the AWS CLI\. The `cloudformation package` command preprocesses the template, uploads artifacts, and replaces local paths with Amazon S3 object locations\. The `cloudformation deploy` command deploys the processed template with a AWS CloudFormation change set\. -**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** +**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** ``` #!/bin/bash @@ -164,7 +164,7 @@ aws cloudformation deploy --template-file out.yml --stack-name blank-nodejs --ca The first time you run this script, it creates a AWS CloudFormation stack named `blank-nodejs`\. If you make changes to the function code or template, you can run it again to update the stack\. -The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. +The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. ## Instrumentation with the AWS X\-Ray @@ -176,7 +176,7 @@ The first service node \(`AWS::Lambda`\) represents the Lambda service, which va To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Instrumentation** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -200,7 +200,7 @@ You can include the X\-Ray SDK and other libraries in your function's deployment You can install libraries locally and include them in the deployment package that you upload to Lambda, but this has its drawbacks\. Larger file sizes cause increased deployment times and can prevent you from testing changes to your function code in the Lambda console\. To keep the deployment package small and avoid uploading dependencies that haven't changed, the sample app creates a [Lambda layer](configuration-layers.md) and associates it with the function\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependency layer** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Dependency layer** ``` Resources: @@ -232,7 +232,7 @@ Resources: The `2-build-layer.sh` script installs the function's dependencies with npm and places them in a folder with the [structure required by the Lambda runtime](configuration-layers.md#configuration-layers-path)\. -**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** +**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** ``` #!/bin/bash diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 20830f04..19a44d70 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -5,10 +5,10 @@ The Error Processor sample application demonstrates the use of AWS Lambda to han ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor.png) Function code is available in the following files: -+ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/random-error/index.js) -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/processor/index.js) ++ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/random-error/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/processor/index.js) -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor)\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor)\. **Topics** + [Architecture and event structure](#sample-errorprocessor-architecture) @@ -84,7 +84,7 @@ The application is implemented in two Node\.js modules and deployed with an AWS + Resource\-based policy – A permission statement on the processor function that allows CloudWatch Logs to invoke it\. + Amazon S3 bucket – A storage location for output from the processor function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/template.yml) on GitHub\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-stack.png) diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 5ac70cf1..a7247d54 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -7,10 +7,10 @@ The list manager sample application demonstrates the use of AWS Lambda to proces Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/processor/index.js) -+ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/dbadmin/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/processor/index.js) ++ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/dbadmin/index.js) -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager)\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager)\. **Topics** + [Architecture and event structure](#samples-listmanager-architecture) @@ -66,7 +66,7 @@ A *ranking* contains a list of entries where the value is the order in which the A Lambda [event source mapping](invocation-eventsourcemapping.md) read records from the stream in batches and invokes the processor function\. The event that the function handler received contains an array of objects that each contain details about a record, such as when it was received, details about the stream, and an encoded representation of the original record document\. -**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/events/kinesis.json) – Record** +**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/events/kinesis.json) – Record** ``` { @@ -112,9 +112,9 @@ The application is implemented in Node\.js modules and deployed with an AWS Clou + Execution role – An IAM role that grants the functions permission to access other AWS services\. + Lambda event source mapping – Reads records from the data stream and invokes the function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/template.yml) on GitHub\. -A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. +A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. **Infrastructure resources** + VPC – A virtual private cloud network with private subnets, a route table, and a VPC endpoint that allows the function to communicate with DynamoDB without an internet connection\. diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md index 2f776eab..21dd686a 100644 --- a/doc_source/security-iam.md +++ b/doc_source/security-iam.md @@ -1,4 +1,4 @@ -# Identity and access management for AWS Lambda +# Identity and access management for Lambda AWS Identity and Access Management \(IAM\) is an AWS service that helps an administrator securely control access to AWS resources\. IAM administrators control who can be *authenticated* \(signed in\) and *authorized* \(have permissions\) to use Lambda resources\. IAM is an AWS service that you can use with no additional charge\. diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md index 14169d60..e2e7810d 100644 --- a/doc_source/security_iam_troubleshoot.md +++ b/doc_source/security_iam_troubleshoot.md @@ -7,6 +7,7 @@ Use the following information to help you diagnose and fix common issues that yo + [I am not authorized to perform iam:PassRole](#security_iam_troubleshoot-passrole) + [I want to view my access keys](#security_iam_troubleshoot-access-keys) + [I'm an administrator and want to allow others to access Lambda](#security_iam_troubleshoot-admin-delegate) ++ [I'm an administrator and want to migrate from AWS managed policies for Lambda that will be deprecated](#security_iam_troubleshoot-admin-deprecation) + [I want to allow people outside of my AWS account to access my Lambda resources](#security_iam_troubleshoot-cross-account-access) ## I am not authorized to perform an action in Lambda @@ -52,6 +53,26 @@ To allow others to access Lambda, you must create an IAM entity \(user or role\) To get started right away, see [Creating your first IAM delegated user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-delegated-user.html) in the *IAM User Guide*\. +## I'm an administrator and want to migrate from AWS managed policies for Lambda that will be deprecated + +After March 1, 2021, the AWS managed policies **AWSLambdaReadOnlyAccess** and **AWSLambdaFullAccess** will be deprecated and can no longer be attached to new IAM users\. For more information about policy deprecations, see [Deprecated AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-deprecated.html) in the *IAM User Guide*\. + +Lambda has introduced two new AWS managed policies: ++ The **AWSLambda\_ReadOnlyAccess** policy grants read\-only access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaReadOnlyAccess**\. ++ The **AWSLambda\_FullAccess** policy grants full access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaFullAccess**\. + +### Using the AWS managed policies + +We recommend using the newly launched managed policies to grant users, groups, and roles access to Lambda; however, review the permissions granted in the policies to ensure they meet your requirements\. ++ To review the permissions of the **AWSLambda\_ReadOnlyAccess** policy, see the [AWSLambda\_ReadOnlyAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSLambda_ReadOnlyAccess$jsonEditor) policy page in the IAM console\. ++ To review the permissions of the **AWSLambda\_FullAccess** policy, see the [AWSLambda\_FullAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSLambda_FullAccess$jsonEditor) policy page in the IAM console\. + +After reviewing the permissions, you can attach the policies to an IAM identity \(groups, users, or roles\)\. For instructions about attaching an AWS managed policy, see [Adding and removing IAM identity permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html) in the *IAM User Guide*\. + +### Using customer managed policies + +If you need more fine\-grained access control or would like to add permissions, you can create your own [customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#customer-managed-policies)\. For more information, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. + ## I want to allow people outside of my AWS account to access my Lambda resources You can create a role that users in other accounts or people outside of your organization can use to access your resources\. You can specify who is trusted to assume the role\. For services that support resource\-based policies or access control lists \(ACLs\), you can use those policies to grant people access to your resources\. @@ -59,6 +80,6 @@ You can create a role that users in other accounts or people outside of your org To learn more, consult the following: + To learn whether Lambda supports these features, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. + To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*\. -+ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing access to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. ++ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing ccess to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. + To learn how to provide access through identity federation, see [Providing access to externally authenticated users \(identity federation\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*\. + To learn the difference between using roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/services-alb.md b/doc_source/services-alb.md index 8f88cac2..5bd0b328 100644 --- a/doc_source/services-alb.md +++ b/doc_source/services-alb.md @@ -58,9 +58,14 @@ To configure an Application Load Balancer as a function trigger, grant Elastic L Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. ``` -$ aws lambda add-permission --function-name alb-function \ +aws lambda add-permission --function-name alb-function \ --statement-id load-balancer --action "lambda:InvokeFunction" \ --principal elasticloadbalancing.amazonaws.com +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"load-balancer\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"elasticloadbalancing.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:alb-function\"}" } diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md index ca37351f..cb626549 100644 --- a/doc_source/services-apigateway-blueprint.md +++ b/doc_source/services-apigateway-blueprint.md @@ -26,7 +26,6 @@ Follow the steps in this section to create a new Lambda function and an API Gate + **Role name** – **lambda\-apigateway\-role**\. + **Policy templates** – **Simple microservice permissions**\. + **API** – **Create a new API**\. - + **API type** - **REST API**\. + **Security** – **Open**\. Choose **Create function**\. @@ -35,15 +34,17 @@ When you complete the wizard and create your function, Lambda creates a proxy re A proxy resource has an `AWS_PROXY` integration type and a catch\-all method `ANY`\. The `AWS_PROXY` integration type applies a default mapping template to pass through the entire request to the Lambda function and transforms the output from the Lambda function to HTTP responses\. The `ANY` method defines the same integration setup for all the supported methods, including `GET`, `POST`, `PATCH`, `DELETE `and others\. -## Test sending an HTTPS request +## Test sending an HTTP request -In this step, you will use the console to test the Lambda function\. In addition, you can run a `curl` command to test the end\-to\-end experience\. That is, send an HTTPS request to your API method and have Amazon API Gateway invoke your Lambda function\. In order to complete the steps, make sure you have created a DynamoDB table and named it "MyTable"\. For more information, see [Create a DynamoDB table with a stream enabled](with-ddb-example.md#with-ddb-create-buckets) +In this step, you will use the console to test the Lambda function\. In addition, you can run a `curl` command to test the end\-to\-end experience\. That is, [send an HTTP request](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) to your API method and have Amazon API Gateway invoke your Lambda function\. In order to complete the steps, make sure you have created a DynamoDB table and named it "MyTable"\. For more information, see [Create a DynamoDB table with a stream enabled](with-ddb-example.md#with-ddb-create-buckets) **To test the API** -1. With your `lambda-microservice` function still open in the console, choose **Configure test events** from the **Select a test event** dropdown list. +1. With your `lambda-microservice` function still open in the console, in the upper right hand corner of the console, choose **Test**\. -1. Replace the existing text with the following: +1. In **Event name**, enter a name for the test event\. + +1. In the text entry panel, replace the existing text with the following: ``` { @@ -55,4 +56,5 @@ In this step, you will use the console to test the Lambda function\. In addition ``` 1. After entering the text above choose **Create**\. -1. Choose the event and choose **Test**\. + +1. Choose the event that you created and choose **Test**\. \ No newline at end of file diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index 40225f51..594b4580 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -137,4 +137,4 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) ( } ``` -Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. +Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index e7ada6ec..344eb18f 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -25,8 +25,6 @@ The request payload you send in the `POST` request identifies the DynamoDB opera ``` + The following is a sample request payload for a DynamoDB read item operation: - - ``` { "operation": "read", @@ -59,12 +57,17 @@ To learn more about these API Gateway features, see [Configure proxy integration ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. + +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` -To complete the following steps, you 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: +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -186,13 +189,13 @@ exports.handler = function(event, context, callback) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` -1. Create a Lambda function with the `create-function` command\. +1. Create a Lambda function with the `create-function` command\. For the `role` parameter, enter the ARN of the execution role that you created earlier\. ``` - $ aws lambda create-function --function-name LambdaFunctionOverHttps \ + aws lambda create-function --function-name LambdaFunctionOverHttps \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role ``` @@ -218,7 +221,7 @@ Invoke the function manually using the sample event data\. We recommend that you 1. Run the following `invoke` command: ``` - $ aws lambda invoke --function-name LambdaFunctionOverHttps \ + aws lambda invoke --function-name LambdaFunctionOverHttps \ --payload fileb://input.txt outputfile.txt ``` @@ -233,7 +236,12 @@ First, you create an API \(`DynamoDBOperations`\) using Amazon API Gateway with Run the following `create-rest-api` command to create the `DynamoDBOperations` API for this tutorial\. ``` -$ aws apigateway create-rest-api --name DynamoDBOperations +aws apigateway create-rest-api --name DynamoDBOperations +``` + +You should see the following output: + +``` { "id": "bs8fqo6bp0", "name": "DynamoDBOperations", @@ -250,8 +258,13 @@ $ aws apigateway create-rest-api --name DynamoDBOperations Save the API ID for use in further commands\. You also need the ID of the API root resource\. To get the ID, run the `get-resources` command\. ``` -$ API=bs8fqo6bp0 -$ aws apigateway get-resources --rest-api-id $API +API=bs8fqo6bp0 +aws apigateway get-resources --rest-api-id $API +``` + +You should see the following output: + +``` { "items": [ { @@ -269,8 +282,13 @@ At this time you only have the root resource, but you add more resources in the Run the following `create-resource` command to create a resource \(`DynamoDBManager`\) in the API that you created in the preceding section\. ``` -$ aws apigateway create-resource --rest-api-id $API --path-part DynamoDBManager \ +aws apigateway create-resource --rest-api-id $API --path-part DynamoDBManager \ --parent-id e8kitthgdb +``` + +You should see the following output: + +``` { "path": "/DynamoDBManager", "pathPart": "DynamoDBManager", @@ -286,9 +304,14 @@ Note the ID in the response\. This is the ID of the `DynamoDBManager` resource t Run the following `put-method` command to create a `POST` method on the `DynamoDBManager` resource in your API\. ``` -$ RESOURCE=iuig5w -$ aws apigateway put-method --rest-api-id $API --resource-id $RESOURCE \ +RESOURCE=iuig5w +aws apigateway put-method --rest-api-id $API --resource-id $RESOURCE \ --http-method POST --authorization-type NONE +``` + +You should see the following output: + +``` { "apiKeyRequired": false, "httpMethod": "POST", @@ -303,11 +326,16 @@ We specify `NONE` for the `--authorization-type` parameter, which means that una Run the following command to set the Lambda function as the integration point for the `POST` method\. This is the method Amazon API Gateway invokes when you make an HTTP request for the `POST` method endpoint\. This command and others use ARNs that include your account ID and region\. Save these to variables \(you can find your account ID in the role ARN that you used to create the function\)\. ``` -$ REGION=us-east-2 -$ ACCOUNT=123456789012 -$ aws apigateway put-integration --rest-api-id $API --resource-id $RESOURCE \ +REGION=us-east-2 +ACCOUNT=123456789012 +aws apigateway put-integration --rest-api-id $API --resource-id $RESOURCE \ --http-method POST --type AWS --integration-http-method POST \ --uri arn:aws:apigateway:$REGION:lambda:path/2015-03-31/functions/arn:aws:lambda:$REGION:$ACCOUNT:function:LambdaFunctionOverHttps/invocations +``` + +You should see the following output: + +``` { "type": "AWS", "httpMethod": "POST", @@ -325,9 +353,14 @@ Set `content-type` of the `POST` method response and integration response to JSO + Run the following command to set the `POST` method response to JSON\. This is the response type that your API method returns\. ``` - $ aws apigateway put-method-response --rest-api-id $API \ + aws apigateway put-method-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ --status-code 200 --response-models application/json=Empty + ``` + + You should see the following output: + + ``` { "statusCode": "200", "responseModels": { @@ -338,9 +371,14 @@ Set `content-type` of the `POST` method response and integration response to JSO + Run the following command to set the `POST` method integration response to JSON\. This is the response type that Lambda function returns\. ``` - $ aws apigateway put-integration-response --rest-api-id $API \ + aws apigateway put-integration-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ --status-code 200 --response-templates application/json="" + ``` + + You should see the following output: + + ``` { "statusCode": "200", "responseTemplates": { @@ -356,7 +394,12 @@ If you encounter an error running this command, you can use escape characters ar In this step, you deploy the API that you created to a stage called `prod`\. ``` -$ aws apigateway create-deployment --rest-api-id $API --stage-name prod +aws apigateway create-deployment --rest-api-id $API --stage-name prod +``` + +You should see the following output: + +``` { "id": "20vgsz", "createdDate": 1539820012 @@ -370,10 +413,15 @@ Now that you have an API created using Amazon API Gateway and you've deployed it To do this, you need to add a permission to the permissions policy associated with your Lambda function\. Run the following `add-permission` AWS Lambda command to grant the Amazon API Gateway service principal \(`apigateway.amazonaws.com`\) permissions to invoke your Lambda function \(`LambdaFunctionOverHttps`\)\. ``` -$ aws lambda add-permission --function-name LambdaFunctionOverHttps \ +aws lambda add-permission --function-name LambdaFunctionOverHttps \ --statement-id apigateway-test-2 --action lambda:InvokeFunction \ --principal apigateway.amazonaws.com \ --source-arn "arn:aws:execute-api:$REGION:$ACCOUNT:$API/*/POST/DynamoDBManager" +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"apigateway-test-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1yprki7/*/POST/DynamoDBManager\"}}}" } @@ -387,10 +435,15 @@ If your function and API are in different regions, the region identifier in the Now, run the same command again, but this time you grant to your deployed API permissions to invoke the Lambda function\. ``` -$ aws lambda add-permission --function-name LambdaFunctionOverHttps \ +aws lambda add-permission --function-name LambdaFunctionOverHttps \ --statement-id apigateway-prod-2 --action lambda:InvokeFunction \ --principal apigateway.amazonaws.com \ --source-arn "arn:aws:execute-api:$REGION:$ACCOUNT:$API/prod/POST/DynamoDBManager" +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"apigateway-prod-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1yprki7/prod/POST/DynamoDBManager\"}}}" } @@ -440,7 +493,7 @@ The Lambda function supports using the `create` operation to create an item in y Save the test input to a file named `create-item.json`\. Run the `test-invoke-method` Amazon API Gateway command to send an HTTP `POST` method request to the resource \(`DynamoDBManager`\) endpoint\. ``` -$ aws apigateway test-invoke-method --rest-api-id $API \ +aws apigateway test-invoke-method --rest-api-id $API \ --resource-id $RESOURCE --http-method POST --path-with-query-string "" \ --body file://create-item.json ``` @@ -448,7 +501,7 @@ $ aws apigateway test-invoke-method --rest-api-id $API \ Or, you can use the following Curl command: ``` -$ curl -X POST -d "{\"operation\":\"create\",\"tableName\":\"lambda-apigateway\",\"payload\":{\"Item\":{\"id\":\"1\",\"name\":\"Bob\"}}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager +curl -X POST -d "{\"operation\":\"create\",\"tableName\":\"lambda-apigateway\",\"payload\":{\"Item\":{\"id\":\"1\",\"name\":\"Bob\"}}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager ``` To send request for the `echo` operation that your Lambda function supports, you can use the following request payload: @@ -468,7 +521,7 @@ To send request for the `echo` operation that your Lambda function supports, you Save the test input to a file named `echo.json`\. Run the `test-invoke-method` Amazon API Gateway CLI command to send an HTTP `POST` method request to the resource \(`DynamoDBManager`\) endpoint using the preceding JSON in the request body\. ``` -$ aws apigateway test-invoke-method --rest-api-id $API \ +aws apigateway test-invoke-method --rest-api-id $API \ --resource-id $RESOURCE --http-method POST --path-with-query-string "" \ --body file://echo.json ``` @@ -476,7 +529,7 @@ $ aws apigateway test-invoke-method --rest-api-id $API \ Or, you can use the following Curl command: ``` -$ curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\",\"somekey2\":\"somevalue2\"}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager +curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\",\"somekey2\":\"somevalue2\"}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager ``` ## Clean up your resources diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index 23d9cf67..0644383b 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -34,7 +34,7 @@ A Lambda integration maps a path and HTTP method combination to a Lambda functio Amazon API Gateway invokes your function [synchronously](invocation-sync.md) with an event that contains a JSON representation of the HTTP request\. For a custom integration, the event is the body of the request\. For a proxy integration, the event has a defined structure\. The following example shows a proxy event from an API Gateway REST API\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** ``` { @@ -79,7 +79,7 @@ API Gateway waits for a response from your function and relays the result to the The following example shows a response object from a Node\.js function\. The response object represents a successful HTTP response that contains a JSON document\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** ``` var response = { @@ -168,10 +168,15 @@ You can manage function policy permissions manually with the following API opera To grant invocation permission to an existing API, use the `add-permission` command\. ``` -$ aws lambda add-permission --function-name my-function \ +aws lambda add-permission --function-name my-function \ --statement-id apigateway-get --action lambda:InvokeFunction \ --principal apigateway.amazonaws.com \ --source-arn "arn:aws:execute-api:us-east-2:123456789012:mnh1xmpli7/default/GET/" +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"apigateway-test-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:my-function\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1xmpli7/default/GET\"}}}" } @@ -193,13 +198,16 @@ For details on viewing the policy and removing statements, see [Cleaning up reso API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a 500 error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502\. In both cases, the body of the response from API Gateway is `{"message": "Internal server error"}`\. +**Note** +API Gateway does not retry any Lambda invocations\. If Lambda returns an error, API Gateway returns an error response to the client\. + The following example shows an X\-Ray trace map for a request that resulted in a function error and a 502 from API Gateway\. The client receives the generic error message\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) To customize the error response, you must catch errors in your code and format a response in the required format\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Error formatting** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/function/index.js) – Error formatting** ``` var formatError = function(error){ @@ -247,7 +255,7 @@ WebSocket APIs also use the API Gateway version 2 API and support a similar feat HTTP APIs support a simplified event format \(version 2\.0\)\. The following example shows an event from an HTTP API\. -**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** +**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** ``` { @@ -291,6 +299,6 @@ For more information, see [AWS Lambda integrations](https://docs.aws.amazon.com/ ## Sample applications The GitHub repository for this guide provides the following sample application for API Gateway\. -+ [API Gateway with Node\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with an AWS SAM template that creates a REST API that has AWS X\-Ray tracing enabled\. It includes scripts for deploying, invoking the function, testing the API, and cleanup\. ++ [API Gateway with Node\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with an AWS SAM template that creates a REST API that has AWS X\-Ray tracing enabled\. It includes scripts for deploying, invoking the function, testing the API, and cleanup\. Lambda also provides [blueprints](gettingstarted-features.md#gettingstarted-features-blueprints) and [templates](gettingstarted-features.md#gettingstarted-features-templates) that you can use to create an API Gateway application in the Lambda console\. \ No newline at end of file diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md index 6ff099f0..6b2ba087 100644 --- a/doc_source/services-cloudformation.md +++ b/doc_source/services-cloudformation.md @@ -56,7 +56,7 @@ AWS CloudFormation provides a library called `cfn-response` that handles sending The following example function invokes a second function\. If the call succeeds, the function sends a success response to AWS CloudFormation, and the stack update continues\. The template uses the [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) resource type provided by AWS Serverless Application Model\. -**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) – Custom resource function** +**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/template.yml) – Custom resource function** ``` Transform: 'AWS::Serverless-2016-10-31' diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 0683e11d..a592cf3a 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -9,7 +9,7 @@ In this tutorial, you do the following: ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. ## Create a Lambda function @@ -105,8 +105,6 @@ Configure an alarm in Amazon CloudWatch that monitors the Lambda function and se + Threshold – **Whenever Errors is >=****1**\. + **Send notification to** – **lambda\-canary\-notifications**\. - - ## Test the alarm Update the function configuration to cause the function to return an error, which triggers the alarm\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 25f585f9..e0f41bf8 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -8,14 +8,17 @@ This tutorial provides code that performs these tasks and a sample application t 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\. +## Prerequisites +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: -## Prerequisites +``` +this is a command +``` -To complete the following steps, you 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: +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -31,7 +34,7 @@ To use the sample code you need the following tools: + **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) + 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\. @@ -48,11 +51,11 @@ Standard charges apply for each service\. ## Review the code -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\. +Locate the sample project in the guide repository under [sample\-apps/ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/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)** +**Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** ``` using Amazon.EC2; @@ -180,13 +183,18 @@ Run the code on your local machine to create a spot instance request\. After the 1. Navigate to the `ec2Spot.Tests` directory\. ``` - $ cd test/ec2Spot.Tests + cd test/ec2Spot.Tests ``` 1. Use the \.NET CLI to run the project's unit tests\. ``` - test/ec2Spot.Tests$ dotnet test + dotnet test + ``` + + You should see the following output: + + ``` Starting test execution, please wait... sir-x5tgs5ij open @@ -216,20 +224,30 @@ Run the code in Lambda as a starting point for creating a serverless application 1. Set your region to `us-east-2`\. ``` - $ export AWS_DEFAULT_REGION=us-east-2 + export AWS_DEFAULT_REGION=us-east-2 ``` 1. Create a bucket for deployment artifacts\. ``` - $ ./create-bucket.sh + ./create-bucket.sh + ``` + + You should see the following output: + + ``` make_bucket: lambda-artifacts-63d5cbbf18fa5ecc ``` 1. Create a deployment package and deploy the application\. ``` - $ ./deploy.sh + ./deploy.sh + ``` + + You should see the following output: + + ``` 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 @@ -283,7 +301,12 @@ The code provided in this tutorial is designed to create and delete spot instanc To clean up the sample function and support resources, delete its AWS CloudFormation stack and the artifacts bucket that you created\. ``` -$ ./cleanup.sh +./cleanup.sh +``` + +You should see the following output: + +``` Delete deployment artifacts and bucket (lambda-artifacts-63d5cbbf18fa5ecc)?y delete: s3://lambda-artifacts-63d5cbbf18fa5ecc/ebd38e401cedd7d676d05d22b76f0209 remove_bucket: lambda-artifacts-63d5cbbf18fa5ecc diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index a256337e..7d1a7434 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -9,12 +9,17 @@ For details on using Lambda with Amazon VPC, see [Configuring a Lambda function ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -46,7 +51,7 @@ Create an ElastiCache cluster in your default VPC\. 1. Run the following AWS CLI command to create a Memcached cluster\. ``` - $ aws elasticache create-cache-cluster --cache-cluster-id ClusterForLambdaTest --cache-node-type cache.t3.medium --engine memcached --num-cache-nodes 1 --security-group-ids sg-0123a1b123456c1de + aws elasticache create-cache-cluster --cache-cluster-id ClusterForLambdaTest --cache-node-type cache.t3.medium --engine memcached --num-cache-nodes 1 --security-group-ids sg-0123a1b123456c1de ``` You can look up the default VPC security group in the VPC console under **Security Groups**\. Your example Lambda function will add and retrieve an item from this cluster\. @@ -106,7 +111,7 @@ Install dependencies with Pip and create a deployment package\. For instructions Create the Lambda function with the `create-function` command\. ``` -$ aws lambda create-function --function-name AccessMemCache --timeout 30 --memory-size 1024 \ +aws lambda create-function --function-name AccessMemCache --timeout 30 --memory-size 1024 \ --zip-file fileb://function.zip --handler app.handler --runtime python3.8 \ --role arn:aws:iam::123456789012:role/lambda-vpc-role \ --vpc-config SubnetIds=subnet-0532bb6758ce7c71f,subnet-d6b7fda068036e11f,SecurityGroupIds=sg-0897d5f549934c2fb @@ -121,7 +126,7 @@ In this step, you invoke the Lambda function manually using the `invoke` command 1. Invoke the Lambda function with the `invoke` command\. ``` - $ aws lambda invoke --function-name AccessMemCache output.txt + aws lambda invoke --function-name AccessMemCache output.txt ``` 1. Verify that the Lambda function executed successfully as follows: diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md index af9d05fe..66e2c48a 100644 --- a/doc_source/services-iot.md +++ b/doc_source/services-iot.md @@ -23,8 +23,13 @@ For asynchronous invocation, Lambda queues the message and [retries](invocation- You need to grant permission for the AWS IoT service to invoke your Lambda function\. Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. ``` -$ aws lambda add-permission --function-name my-function \ +aws lambda add-permission --function-name my-function \ --statement-id iot-events --action "lambda:InvokeFunction" --principal iotevents.amazonaws.com +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"iot-events\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"iot.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:my-function\"}" } diff --git a/doc_source/services-iotevents.md b/doc_source/services-iotevents.md index e6692b7c..997a2044 100644 --- a/doc_source/services-iotevents.md +++ b/doc_source/services-iotevents.md @@ -50,8 +50,13 @@ The event that is passed into the Lambda function includes the following fields: You need to grant permission for the AWS IoT Events service to invoke your Lambda function\. Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. ``` -$ aws lambda add-permission --function-name my-function \ +aws lambda add-permission --function-name my-function \ --statement-id iot-events --action "lambda:InvokeFunction" --principal iotevents.amazonaws.com +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"iot-events\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"iotevents.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:my-function\"}" } diff --git a/doc_source/services-lex.md b/doc_source/services-lex.md index 0049b611..c633196e 100644 --- a/doc_source/services-lex.md +++ b/doc_source/services-lex.md @@ -100,7 +100,7 @@ Note that the additional fields required for `dialogAction` vary based on the va You need to configure a service\-linked role as your function's [execution role](lambda-intro-execution-role.md)\. Amazon Lex defines the service\-linked role with predefined permissions\. When you create an Amazon Lex bot using the console, the service\-linked role is created automatically\. To create a service\-linked role with the AWS CLI, use the `create-service-linked-role` command\. ``` -$ aws iam create-service-linked-role --aws-service-name lex.amazonaws.com +aws iam create-service-linked-role --aws-service-name lex.amazonaws.com ``` This command creates the following role\. diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md index e91da77b..04b9c692 100644 --- a/doc_source/services-msk-topic-add.md +++ b/doc_source/services-msk-topic-add.md @@ -45,7 +45,7 @@ Use the following example AWS CLI commands to create and view an Amazon MSK trig The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. ``` -$ aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function +aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function ``` For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. @@ -55,5 +55,5 @@ For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. ``` -$ aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 +aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 ``` \ No newline at end of file diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index 45e85697..98f38168 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -7,14 +7,19 @@ In this tutorial, you do the following: For details on using Lambda with Amazon VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. -### Prerequisites +## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -22,7 +27,7 @@ For long commands, an escape character \(`\`\) is used to split a command over m 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\. -### Create the execution role +## Create the execution role Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. @@ -39,7 +44,7 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func The **AWSLambdaVPCAccessExecutionRole** has the permissions that the function needs to manage network connections to a VPC\. -### Create an Amazon RDS database instance +## Create an Amazon RDS database instance In this tutorial, the example Lambda function creates a table \(Employee\), inserts a few records, and then retrieves the records\. The table that the Lambda function creates has the following schema: @@ -56,7 +61,7 @@ You can launch an RDS MySQL instance using one of the following methods: + Use the following AWS CLI command: ``` - $ aws rds create-db-instance --db-name ExampleDB --engine MySQL \ + aws rds create-db-instance --db-name ExampleDB --engine MySQL \ --db-instance-identifier MySQLForLambdaTest --backup-retention-period 3 \ --db-instance-class db.t2.micro --allocated-storage 5 --no-publicly-accessible \ --master-username username --master-user-password password @@ -64,7 +69,7 @@ You can launch an RDS MySQL instance using one of the following methods: Write down the database name, user name, and password\. You also need the host address \(endpoint\) of the DB instance, which you can get from the RDS console\. You might need to wait until the instance status is available and the Endpoint value appears in the console\. -### Create a deployment package +## Create a deployment package The following example Python code runs a SELECT query against the Employee table in the MySQL RDS instance that you created in the VPC\. The code creates a table in the ExampleDB database, adds sample records, and retrieves those records\. @@ -130,30 +135,33 @@ db_password = "password" db_name = "ExampleDB" ``` +A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: + **Dependencies** + `pymysql` – The Lambda function code uses this library to access your MySQL instance \(see [PyMySQL](https://pypi.python.org/pypi/PyMySQL)\) \. -Install dependencies with Pip and create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. +**To create a deployment package** ++ Install dependencies with Pip and create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. -### Create the Lambda function +## Create the Lambda function Create the Lambda function with the `create-function` command\. You can find the subnet IDs and security group ID for your default VPC in the [Amazon VPC console](https://console.aws.amazon.com/vpc)\. ``` -$ aws lambda create-function --function-name CreateTableAddRecordsAndRead --runtime python3.8 \ +aws lambda create-function --function-name CreateTableAddRecordsAndRead --runtime python3.8 \ --zip-file fileb://app.zip --handler app.handler \ --role arn:aws:iam::123456789012:role/lambda-vpc-role \ --vpc-config SubnetIds=subnet-0532bb6758ce7c71f,subnet-d6b7fda068036e11f,SecurityGroupIds=sg-0897d5f549934c2fb ``` -### Test the Lambda function +## Test the Lambda function In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function runs, it runs the SELECT query against the Employee table in the RDS MySQL instance and prints the results, which also go to the CloudWatch Logs\. 1. Invoke the Lambda function with the `invoke` command\. ``` - $ aws lambda invoke --function-name CreateTableAddRecordsAndRead output.txt + aws lambda invoke --function-name CreateTableAddRecordsAndRead output.txt ``` 1. Verify that the Lambda function executed successfully as follows: @@ -163,7 +171,7 @@ In this step, you invoke the Lambda function manually using the `invoke` command Now that you have created a Lambda function that accesses a database in your VPC, you can have the function invoked in response to events\. For information about configuring event sources and examples, see [Using AWS Lambda with other services](lambda-services.md)\. -### Clean up your resources +## Clean up your resources You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. diff --git a/doc_source/services-rds.md b/doc_source/services-rds.md index 7fa38cb0..7e346dbb 100644 --- a/doc_source/services-rds.md +++ b/doc_source/services-rds.md @@ -2,8 +2,6 @@ You can use AWS Lambda to process event notifications from an Amazon Relational Database Service \(Amazon RDS\) database\. Amazon RDS sends notifications to an Amazon Simple Notification Service \(Amazon SNS\) topic, which you can configure to invoke a Lambda function\. Amazon SNS wraps the message from Amazon RDS in its own event document and sends it to your function\. -## Example - **Example Amazon RDS message in an Amazon SNS event** ``` @@ -31,21 +29,13 @@ You can use AWS Lambda to process event notifications from an Amazon Relational } ``` -## Configuring the function - -**Configuring the maximum concurrency of a function** - -If too many function instances run concurrently, one or more instances may fail to obtain a database connection\. You can use reserved concurrency to limit the maximum concurrency of the function\. Set the reserved concurrency to be less than the number of database connections\. Reserved concurrency also reserves those instances for this function, which may not be ideal\. If you are invoking the Lambda functions from your application, we recommend you write code that limits the number of concurrent instances\. For more information, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. - -**Sending notifications from a database** - -For instructions on configuring an Amazon RDS database to send notifications, see [Using Amazon RDS event notification](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html) in the Amazon RDS User Guide\. - -**Using Amazon SNS as a trigger** - -For details on using Amazon SNS as trigger, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. +**Topics** ++ [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) ++ [Configuring the function](#configuration) -## What's Next? +## Configuring the function -**Topics** -+ [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) \ No newline at end of file +The following section shows additional configurations and topics we recommend as part of this tutorial\. ++ If too many function instances run concurrently, one or more instances may fail to obtain a database connection\. You can use reserved concurrency to limit the maximum concurrency of the function\. Set the reserved concurrency to be less than the number of database connections\. Reserved concurrency also reserves those instances for this function, which may not be ideal\. If you are invoking the Lambda functions from your application, we recommend you write code that limits the number of concurrent instances\. For more information, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. ++ For more information on configuring an Amazon RDS database to send notifications, see [Using Amazon RDS event notifications](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html)\. ++ For more information on using Amazon SNS as trigger, see [Using Lambda with Amazon SNS](with-sns.md)\. \ No newline at end of file diff --git a/doc_source/services-smaa-topic-add.md b/doc_source/services-smaa-topic-add.md index d76e8c26..ebbaa92f 100644 --- a/doc_source/services-smaa-topic-add.md +++ b/doc_source/services-smaa-topic-add.md @@ -1,4 +1,4 @@ -# Adding a self\-managed Apache Kafka cluster as an event source +# Adding a Self\-managed Apache Kafka cluster as an event source You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. @@ -6,11 +6,11 @@ This section describes how to add your Kafka cluster and topic as a function tri ## Prerequisites + A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](kafka-hosting.md)\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md)\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a Self\-managed Apache Kafka cluster](smaa-permissions.md)\. -## Adding a self\-managed Apache Kafka cluster using the Lambda console +## Adding a Self\-managed Apache Kafka cluster using the Lambda console -Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. +Follow these steps to add your Self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. **To add an Apache Kafka trigger to your Lambda function \(console\)** @@ -24,16 +24,16 @@ Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka to 1. Configure the remaining options, and then choose **Add**\. -## Adding a self\-managed Apache Kafka cluster using the AWS CLI +## Adding a Self\-managed Apache Kafka cluster using the AWS CLI -Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. +Use the following example AWS CLI commands to create and view a Self\-managed Apache Kafka trigger for your Lambda function\. ### Using SASL/SCRAM If Kafka users access your Kafka brokers over the internet, you must specify your AWS Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. ``` -$ aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. @@ -43,7 +43,7 @@ For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon If only Kafka users within your virtual private cloud \(VPC\) access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. ``` -$ aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. @@ -53,5 +53,5 @@ For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. ``` -$ aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 +aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 ``` \ No newline at end of file diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md index 78802d24..f17599c6 100644 --- a/doc_source/services-stepfunctions.md +++ b/doc_source/services-stepfunctions.md @@ -23,7 +23,7 @@ Step Functions can invoke Lambda functions directly from a `Task` state in an [A You can create a `Task` state that invokes your Lambda function with the input to the state machine or any JSON document\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** ``` { diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 80ac78f1..d9294ca1 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -78,7 +80,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -88,7 +90,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -102,7 +104,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/smaa-permissions.md b/doc_source/smaa-permissions.md index 7da4dcd6..4f0c5452 100644 --- a/doc_source/smaa-permissions.md +++ b/doc_source/smaa-permissions.md @@ -1,4 +1,4 @@ -# Managing access and permissions for a self\-managed Apache Kafka cluster +# Managing access and permissions for a Self\-managed Apache Kafka cluster Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. @@ -25,7 +25,7 @@ Your Lambda function might need permission to describe your Secrets Manager secr ### VPC permissions -If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +If only users within your VPC access your Self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) + [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) @@ -35,9 +35,9 @@ If only users within your VPC access your self\-managed Apache Kafka cluster, yo ## Adding permissions to your execution role -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. +To access other AWS services that your Self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. -By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. +By default, Lambda isn't permitted to perform the required or optional actions for a Self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. ``` { @@ -67,7 +67,7 @@ By default, IAM users and roles don't have permission to perform [event source A ## Using SASL/SCRAM authentication -User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. +User name and password authentication for a Self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md index a38cdde0..9e48472f 100644 --- a/doc_source/stepfunctions-patterns.md +++ b/doc_source/stepfunctions-patterns.md @@ -110,7 +110,6 @@ The following Amazon States Language definition of the `WhichCoat` state machine } ``` - **Example Python function** The following Lambda function in Python \(`wear_heavy_coat`\) can be invoked for the state machine defined in the previous example\. If the `WhichCoat` state machine equals a string value of `FREEZING`, the `wear_heavy_coat` function is invoked from Lambda, and the user receives the message that corresponds with the function: "You should wear a heavy coat today\." diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index aa94c9d3..79dc5f53 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -13,8 +13,8 @@ When you deploy updates to your function directly with the Lambda API or with a The Lambda runtime needs permission to read the files in your deployment package\. You can use the `chmod` command to change the file mode\. The following example commands make all files and folders in the current directory readable by any user\. ``` -my-function$ chmod 644 $(find . -type f) -my-function$ chmod 755 $(find . -type d) +chmod 644 $(find . -type f) +chmod 755 $(find . -type d) ``` **Error:** *An error occurred \(RequestEntityTooLargeException\) when calling the UpdateFunctionCode operation* diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 68f4219a..4baab296 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -36,7 +36,7 @@ Runtimes for scripting languages include the AWS SDK and are periodically update + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip file archives](java-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index d4a71f52..0c874220 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -2,28 +2,28 @@ When you invoke a Lambda function, Lambda validates the request and checks for scaling capacity before sending the event to your function or, for asynchronous invocation, to the event queue\. Invocation errors can be caused by issues with request parameters, event structure, function settings, user permissions, resource permissions, or limits\. -If you invoke your function directly, you see invocation errors in the response from Lambda\. If you invoke your function asynchronously with an event source mapping or through another service, you might find errors in logs, a dead\-letter queue, or a failed\-event destination\. Error handling options and retry behavior vary depending on how you invoke your function and on the type of error\. +If you invoke your function directly, you see any invocation errors in the response from Lambda\. If you invoke your function asynchronously with an event source mapping or through another service, you might find errors in logs, a dead\-letter queue, or a failed\-event destination\. Error handling options and retry behavior vary depending on how you invoke your function and on the type of error\. -For a list of error types that can be returned by the `Invoke` operation, see [Invoke](API_Invoke.md)\. +For a list of error types that the `Invoke` operation can return, see [Invoke](API_Invoke.md)\. **Error:** *User: arn:aws:iam::123456789012:user/developer is not authorized to perform: lambda:InvokeFunction on resource: my\-function* -Your IAM user, or the role that you assume, needs permission to invoke a function\. This requirement also applies to Lambda functions and other compute resources that invoke functions\. Add the **AWSLambdaRole** managed policy, or a custom policy that allows the `lambda:InvokeFunction` action on the target function, to your IAM user\. +Your AWS Identity and Access Management \(IAM\) user, or the role that you assume, must have permission to invoke a function\. This requirement also applies to Lambda functions and other compute resources that invoke functions\. Add the AWS managed policy **AWSLambdaRole** to your IAM user, or add a custom policy that allows the `lambda:InvokeFunction` action on the target function\. **Note** -Unlike other API actions in Lambda, the name of the action in IAM \(`lambda:InvokeFunction`\) doesn't match the name of the API action \(`Invoke`\) for invoking a function\. +Unlike other Lambda API operations, the name of the IAM action \(`lambda:InvokeFunction`\) doesn't match the name of the API operation \(`Invoke`\) for invoking a function\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. **Error:** *ResourceConflictException: The operation cannot be performed at this time\. The function is currently in the following state: Pending* -When you connect a function to a VPC at the time of creation, the function enters a `Pending` state while Lambda creates elastic network interfaces\. During this time, you can't invoke or modify your function\. If you connect your function to a VPC after creation, you can invoke it while the update is pending, but you can't modify its code or configuration\. +When you connect a function to a virtual private cloud \(VPC\) at the time of creation, the function enters a `Pending` state while Lambda creates elastic network interfaces\. During this time, you can't invoke or modify your function\. If you connect your function to a VPC after creation, you can invoke it while the update is pending, but you can't modify its code or configuration\. For more information, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. **Error:** *A function is stuck in the `Pending` state for several minutes\.* -If a function becomes stuck in the `Pending` state for more than six minutes, call one of the following API operations to unblock it\. +If a function is stuck in the `Pending` state for more than six minutes, call one of the following API operations to unblock it: + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [PublishVersion](API_PublishVersion.md) @@ -32,19 +32,40 @@ Lambda cancels the pending operation and puts the function into the `Failed` sta **Issue:** *One function is using all of the available concurrency, causing other functions to be throttled\.* -To divide the available concurrency in a Region into pools, use [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency ensures that a function can always scale to its assigned concurrency, and also that it won't scale beyond its assigned concurrency\. +To divide your AWS account's available concurrency in an AWS Region into pools, use [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency ensures that a function can always scale to its assigned concurrency, and that it doesn't scale beyond its assigned concurrency\. **Issue:** *You can invoke your function directly, but it doesn't run when another service or account invokes it\.* -You grant [other services](lambda-services.md) and accounts permission to invoke a function in the function's [resource\-based policy](access-control-resource-based.md)\. If the invoker is in another account, that user also needs [permission to invoke functions](access-control-identity-based.md)\. +You grant [other services](lambda-services.md) and accounts permission to invoke a function in the function's [resource\-based policy](access-control-resource-based.md)\. If the invoker is in another account, that user must also have [permission to invoke functions](access-control-identity-based.md)\. **Issue:** *Function is invoked continuously in a loop\.* -This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it is possible to create a function that stores an object in an Amazon S3 bucket that is configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, choose **Throttle** on the [function configuration page](configuration-console.md)\. Then identify the code path or configuration error that caused the recursive invocation\. +This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-console.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. + +**Issue:** *You see cold starts after enabling provisioned concurrency\.* + +When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: ++ [Check that provisioned concurrency is enabled](configuration-concurrency.md#configuration-concurrency-provisioned) on the function version or alias\. +**Note** +Provisioned concurrency is not configurable on the [$LATEST version](configuration-images.md#configuration-images-latest)\. ++ Ensure that your triggers invoke the correct function version or alias\. For example, if you're using Amazon API Gateway, check that API Gateway invokes the function version or alias with provisioned concurrency, not $LATEST\. To confirm that provisioned concurrency is being used, you can check the [ProvisionedConcurrencyInvocations Amazon CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that the function is processing invocations on initialized execution environments\. ++ Determine whether your function concurrency exceeds the configured level of provisioned concurrency by checking the [ProvisionedConcurrencySpilloverInvocations CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that all provisioned concurrency is in use and some invocation occurred with a cold start\. ++ Check your [invocation frequency](gettingstarted-limits.md) \(requests per second\)\. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency\. For example, a function configured with 100 provisioned concurrency\. For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second\. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur\. + +**Note** +There is a known issue in which the first invocation on an initialized execution environment reports a non\-zero **Init Duration** metric in CloudWatch Logs, even though no cold start has occurred\. We're developing a fix to correct the reporting to CloudWatch Logs\. + +**Issue:** *You see latency variability on the first invocation after enabling provisioned concurrency\.* + +Depending on your function's runtime and memory configuration, it's possible to see some latency variability on the first invocation on an initialized execution environment\. For example, \.NET and other JIT runtimes can lazily load resources on the first invocation, leading to some latency variability \(typically tens of milliseconds\)\. This variability is more apparent on 128\-MiB functions\. You mitigate this by increasing the function's configured memory\. + +**Issue:** *You see cold starts while deploying new versions of your function\.* + +When you update a function alias, Lambda automatically shifts provisioned concurrency to the new version based on the weights configured on the alias\. **Error:** *KMSDisabledException: Lambda was unable to decrypt the environment variables because the KMS key used is disabled\. Please check the function's KMS key settings\.* -This error can occur if your KMS key is disabled, or if the grant that allows Lambda to use the key is revoked\. If the grant is missing, configure the function to use a different key\. Then reassign the custom key to recreate the grant\. +This error can occur if your AWS Key Management Service \(AWS KMS\) key is disabled, or if the grant that allows Lambda to use the key is revoked\. If the grant is missing, configure the function to use a different key\. Then, reassign the custom key to recreate the grant\. **Error:** *EFSMountFailureException: The function could not mount the EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\.* @@ -54,10 +75,10 @@ The mount request to the function's [file system](configuration-filesystem.md) w The function couldn't establish a connection to the function's [file system](configuration-filesystem.md) with the NFS protocol \(TCP port 2049\)\. Check the [security group and routing configuration](https://docs.aws.amazon.com/efs/latest/ug/network-access.html) for the VPC's subnets\. -**Error:** *EFSMountTimeoutException: The function could not mount the EFS file system with access point \{arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\} due to mount time out* +**Error:** *EFSMountTimeoutException: The function could not mount the EFS file system with access point \{arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\} due to mount time out\.* -The function was able to connect to the function's [file system](configuration-filesystem.md), but the mount operation timed out\. Try again after a short time and consider limiting the function's [concurrency](configuration-concurrency.md) to reduce load on the file system\. +The function could connect to the function's [file system](configuration-filesystem.md), but the mount operation timed out\. Try again after a short time and consider limiting the function's [concurrency](configuration-concurrency.md) to reduce load on the file system\. -**Error:** *EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* +*EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* -A previous invocation timed out and Lambda was unable to terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file +A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 808fbc28..593225cf 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -14,6 +14,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Custom runtime on Amazon Linux 2 \(`provided.al2`\) + Java 11 \(Corretto\) \(`java11`\) + Java 8 \(Corretto\) \(`java8.al2`\) ++ Node\.js 14\.x \(`nodejs14.x`\) + Node\.js 12\.x \(`nodejs12.x`\) + Node\.js 10\.x \(`nodejs10.x`\) + Python 3\.8 \(`python3.8`\) @@ -64,7 +65,7 @@ For a \.zip file archive, you can create an AWS CloudFormation template to simpl You can add an extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. -You add the extension to your function using the same method as you would for any layer\. For more information, see [Configuring a function to use layers](configuration-layers.md#configuration-layers-using)\. +You add the extension to your function using the same method as you would for any layer\. For more information, see [Configure a function to use layers](configuration-layers.md#configuration-layers-using)\. **Add an extension to your function \(console\)** diff --git a/doc_source/with-android-create-package.md b/doc_source/with-android-create-package.md index e03d66b9..f37aa7ac 100644 --- a/doc_source/with-android-create-package.md +++ b/doc_source/with-android-create-package.md @@ -100,4 +100,4 @@ public class HelloPojo { **Dependencies** + `aws-lambda-java-core` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. \ No newline at end of file +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. \ No newline at end of file diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 0d7759f5..b7dae428 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -8,12 +8,17 @@ The mobile application retrieves AWS credentials from an Amazon Cognito identity ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -64,13 +69,13 @@ exports.handler = function(event, context, callback) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name AndroidBackendLambdaFunction \ + aws lambda create-function --function-name AndroidBackendLambdaFunction \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-android-role ``` @@ -90,7 +95,7 @@ Invoke the function manually using the sample event data\. 1. Run the following `invoke` command: ``` - $ aws lambda invoke --function-name AndroidBackendLambdaFunction \ + aws lambda invoke --function-name AndroidBackendLambdaFunction \ --payload file://file-path/input.txt outputfile.txt ``` diff --git a/doc_source/with-cloudtrail-example.md b/doc_source/with-cloudtrail-example.md index e14f3954..d1293e28 100644 --- a/doc_source/with-cloudtrail-example.md +++ b/doc_source/with-cloudtrail-example.md @@ -10,10 +10,10 @@ Use the following instructions to create a Lambda function that notifies you whe ## Requirements -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. Before you begin, make sure that you have the following tools: -+ [Node\.js 8 with `npm`](https://nodejs.org/en/download/releases/)\. ++ [Node\.js 12\.x with `npm`](https://nodejs.org/en/download/releases/)\. + The Bash shell\. For Linux and macOS, this is included by default\. In 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\. + [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. @@ -189,19 +189,19 @@ The following Lambda function processes CloudTrail logs, and sends a notificatio 1. In the *lambda\-cloudtrail* folder, run the following script\. It creates a `package-lock.json` file and a `node_modules` folder, which handle all dependencies\. ``` - $ npm install async + npm install async ``` 1. Run the following script to create a deployment package\. ``` - $ zip -r function.zip . + zip -r function.zip . ``` 1. Create a Lambda function named CloudTrailEventProcessing with the `create-function` command by running the following script\. Make the indicated replacements\. ``` - $ aws lambda create-function --function-name CloudTrailEventProcessing \ + aws lambda create-function --function-name CloudTrailEventProcessing \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x --timeout 10 --memory-size 1024 \ --role arn:aws:iam::123456789012:role/lambda-cloudtrail-role ``` @@ -215,7 +215,7 @@ The Lambda function's resource policy needs permissions to allow Amazon S3 to in 1. Run the following `add-permission` command\. Replace the ARN and account ID with your own\. ``` - $ aws lambda add-permission --function-name CloudTrailEventProcessing \ + aws lambda add-permission --function-name CloudTrailEventProcessing \ --statement-id Id-1 --action "lambda:InvokeFunction" --principal s3.amazonaws.com \ --source-arn arn:aws:s3:::my-bucket \ --source-account 123456789012 @@ -228,7 +228,7 @@ The Lambda function's resource policy needs permissions to allow Amazon S3 to in 1. To view the Lambda function's access policy, run the following `get-policy` command, and replace the function name\. ``` - $ aws lambda get-policy --function-name function-name + aws lambda get-policy --function-name function-name ``` ## Step 6: Configuring notifications on an Amazon S3 bucket diff --git a/doc_source/with-ddb-create-package.md b/doc_source/with-ddb-create-package.md index 35a341e2..2cf7e228 100644 --- a/doc_source/with-ddb-create-package.md +++ b/doc_source/with-ddb-create-package.md @@ -67,7 +67,7 @@ If the handler returns normally without exceptions, Lambda considers the input b + `aws-lambda-java-core` + `aws-lambda-java-events` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. ## C\# diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index 43e12c54..a188584c 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -4,12 +4,17 @@ ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -64,13 +69,13 @@ exports.handler = function(event, context, callback) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name ProcessDynamoDBRecords \ + aws lambda create-function --function-name ProcessDynamoDBRecords \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-dynamodb-role ``` @@ -177,7 +182,7 @@ In this step, you invoke your Lambda function manually using the `invoke` AWS La Run the following `invoke` command\. ``` -$ aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt +aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` The function returns the string `message` in the response body\. @@ -221,7 +226,7 @@ Create an event source mapping in AWS Lambda\. This event source mapping associa Run the following AWS CLI `create-event-source-mapping` command\. After the command runs, note down the UUID\. You'll need this UUID to refer to the event source mapping in any commands, for example, when deleting the event source mapping\. ``` -$ aws lambda create-event-source-mapping --function-name ProcessDynamoDBRecords \ +aws lambda create-event-source-mapping --function-name ProcessDynamoDBRecords \ --batch-size 100 --starting-position LATEST --event-source DynamoDB-stream-arn ``` @@ -230,7 +235,7 @@ $ aws lambda create-event-source-mapping --function-name ProcessDynamoDBRecords You can get the list of event source mappings by running the following command\. ``` -$ aws lambda list-event-source-mappings +aws lambda list-event-source-mappings ``` The list returns all of the event source mappings you created, and for each mapping it shows the `LastProcessingResult`, among other things\. This field is used to provide an informative message if there are any problems\. Values such as `No records processed` \(indicates that AWS Lambda has not started polling or that there are no records in the stream\) and `OK` \(indicates AWS Lambda successfully read records from the stream and invoked your Lambda function\) indicate that there are no issues\. If there are issues, you receive an error message\. @@ -238,7 +243,7 @@ The list returns all of the event source mappings you created, and for each mapp If you have a lot of event source mappings, use the function name parameter to narrow down the results\. ``` -$ aws lambda list-event-source-mappings --function-name ProcessDynamoDBRecords +aws lambda list-event-source-mappings --function-name ProcessDynamoDBRecords ``` ## Test the setup diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 45d67f48..0f447c31 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -79,6 +79,8 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. + **Topics** + [Execution role permissions](#events-dynamodb-permissions) + [Configuring a stream as an event source](#services-dynamodb-eventsourcemapping) @@ -98,6 +100,7 @@ Lambda needs the following permissions to manage resources related to your Dynam + [dynamodb:GetRecords](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetRecords.html) + [dynamodb:GetShardIterator](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) + [dynamodb:ListStreams](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListStreams.html) ++ [dynamodb:ListShards](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListShards.html) The `AWSLambdaDynamoDBExecutionRole` managed policy includes these permissions\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. @@ -127,7 +130,7 @@ Lambda supports the following options for DynamoDB event sources\. **Event source options** + **DynamoDB table** – The DynamoDB table to read records from\. -+ **Batch size** – The number of records to send to the function in each batch, up to 1,000\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. ++ **Batch size** – The number of records to send to the function in each batch, up to 10,000\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. + **Batch window** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. + **Starting position** – Process only new records, or all existing records\. + **Latest** – Process new records that are added to the stream\. @@ -158,8 +161,13 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. ``` -$ aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ +aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ --event-source-arn arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525 +``` + +You should see the following output: + +``` { "UUID": "14e0db71-5d35-4eb5-b481-8945cf9d10c2", "BatchSize": 500, @@ -181,9 +189,14 @@ $ aws lambda create-event-source-mapping --function-name my-function --batch-siz Configure additional options to customize how batches are processed and to specify when to discard records that can't be processed\. The following example updates an event source mapping to send a failure record to an SQS queue after two retry attempts, or if the records are more than an hour old\. ``` -$ aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ +aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ --maximum-retry-attempts 2 --maximum-record-age-in-seconds 3600 --destination-config '{"OnFailure": {"Destination": "arn:aws:sqs:us-east-2:123456789012:dlq"}}' +``` + +You should see this output: + +``` { "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", "BatchSize": 100, @@ -205,7 +218,12 @@ $ aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. Use the `get-event-source-mapping` command to view the current status\. ``` -$ aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b +aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b +``` + +You should see this output: + +``` { "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", "BatchSize": 100, @@ -231,7 +249,7 @@ $ aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449 To process multiple batches concurrently, use the `--parallelization-factor` option\. ``` -$ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ +aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ --parallelization-factor 5 ``` @@ -448,7 +466,7 @@ At the end of your window, Lambda uses final processing for actions on the aggre You can configure tumbling windows when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. To configure a tumbling window, specify the window in seconds\. The following example AWS Command Line Interface \(AWS CLI\) command creates a streaming event source mapping that has a tumbling window of 120 seconds\. The Lambda function defined for aggregation and processing is named `tumbling-window-example-function`\. ``` -$ aws lambda create-event-source-mapping --event-source-arn arn:aws:dynamodb:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 +aws lambda create-event-source-mapping --event-source-arn arn:aws:dynamodb:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 ``` Lambda determines tumbling window boundaries based on the time when records were inserted into the stream\. All records have an approximate timestamp available that Lambda uses in boundary determinations\. @@ -487,7 +505,7 @@ def lambda_handler(event, context): ## Reporting batch item failures -When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries n a successful record\. +When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries in a successful record\. To turn on `ReportBatchItemFailures`, include the enum value **ReportBatchItemFailures** in the `FunctionResponseTypes` list\. This list indicates which response types are enabled for your function\. You can configure this list when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. diff --git a/doc_source/with-kinesis-create-package.md b/doc_source/with-kinesis-create-package.md index e3d1c76a..09ee9978 100644 --- a/doc_source/with-kinesis-create-package.md +++ b/doc_source/with-kinesis-create-package.md @@ -8,13 +8,13 @@ The code on this page does not support [aggregated records](https://docs.aws.ama Sample code is available for the following languages\. **Topics** -+ [Node\.js 8](#with-kinesis-example-deployment-pkg-nodejs) ++ [Node\.js 12\.x](#with-kinesis-example-deployment-pkg-nodejs) + [Java 11](#with-kinesis-example-deployment-pkg-java) + [C\#](#with-kinesis-example-deployment-pkg-dotnet) + [Python 3](#with-kinesis-example-deployment-pkg-python) + [Go](#with-kinesis-example-deployment-pkg-go) -## Node\.js 8 +## Node\.js 12\.x The following example code receives a Kinesis event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. @@ -70,7 +70,7 @@ If the handler returns normally without exceptions, Lambda considers the input b + `aws-lambda-java-events` + `aws-java-sdk` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. ## C\# diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 36310cac..06d5f5b8 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -12,12 +12,17 @@ In this tutorial, you create a Lambda function to consume events from a Kinesis ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -71,13 +76,13 @@ exports.handler = function(event, context) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name ProcessKinesisRecords \ + aws lambda create-function --function-name ProcessKinesisRecords \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-kinesis-role ``` @@ -116,7 +121,7 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a 1. Use the `invoke` command to send the event to the function\. ``` - $ aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt + aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` The response is saved to `out.txt`\. @@ -126,13 +131,18 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a Use the `create-stream ` command to create a stream\. ``` -$ aws kinesis create-stream --stream-name lambda-stream --shard-count 1 +aws kinesis create-stream --stream-name lambda-stream --shard-count 1 ``` Run the following `describe-stream` command to get the stream ARN\. ``` -$ aws kinesis describe-stream --stream-name lambda-stream +aws kinesis describe-stream --stream-name lambda-stream +``` + +You should see the following output: + +``` { "StreamDescription": { "Shards": [ @@ -170,7 +180,7 @@ You use the stream ARN in the next step to associate the stream with your Lambda Run the following AWS CLI `add-event-source` command\. ``` -$ aws lambda create-event-source-mapping --function-name ProcessKinesisRecords \ +aws lambda create-event-source-mapping --function-name ProcessKinesisRecords \ --event-source arn:aws:kinesis:us-west-2:123456789012:stream/lambda-stream \ --batch-size 100 --starting-position LATEST ``` @@ -178,7 +188,7 @@ $ aws lambda create-event-source-mapping --function-name ProcessKinesisRecords \ Note the mapping ID for later use\. You can get a list of event source mappings by running the `list-event-source-mappings` command\. ``` -$ aws lambda list-event-source-mappings --function-name ProcessKinesisRecords \ +aws lambda list-event-source-mappings --function-name ProcessKinesisRecords \ --event-source arn:aws:kinesis:us-west-2:123456789012:stream/lambda-stream ``` @@ -189,8 +199,44 @@ In the response, you can verify the status value is `enabled`\. Event source map To test the event source mapping, add event records to your Kinesis stream\. The `--data` value is a string that the CLI encodes to base64 prior to sending it to Kinesis\. You can run the same command more than once to add multiple records to the stream\. ``` -$ aws kinesis put-record --stream-name lambda-stream --partition-key 1 \ +aws kinesis put-record --stream-name lambda-stream --partition-key 1 \ --data "Hello, this is a test." ``` -Lambda uses the execution role to read records from the stream\. Then it invokes your Lambda function, passing in batches of records\. The function decodes data from each record and logs it, sending the output to CloudWatch Logs\. View the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. \ No newline at end of file +Lambda uses the execution role to read records from the stream\. Then it invokes your Lambda function, passing in batches of records\. The function decodes data from each record and logs it, sending the output to CloudWatch Logs\. View the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the Kinesis stream** + +1. Sign in to the AWS Management Console and open the Kinesis console at [https://console\.aws\.amazon\.com/kinesis](https://console.aws.amazon.com/kinesis)\. + +1. Select the stream you created\. + +1. Choose **Actions**, **Delete**\. + +1. Enter **delete** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 7a3f7eac..fa7e336c 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -10,9 +10,6 @@ To minimize latency and maximize read throughput, you can create a data stream c For details about Kinesis data streams, see [Reading Data from Amazon Kinesis Data Streams](https://docs.aws.amazon.com/kinesis/latest/dev/building-consumers.html)\. -**Note** -Error handling is not available for HTTP/2 stream consumers\. - Lambda reads records from the data stream and invokes your function [synchronously](invocation-sync.md) with an event that contains stream records\. Lambda reads records in batches and invokes your function to process records from the batch\. **Example Kinesis record event** @@ -62,6 +59,8 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. + **Topics** + [Configuring your data stream and function](#services-kinesis-configure) + [Execution role permissions](#events-kinesis-permissions) @@ -84,8 +83,13 @@ For standard iterators, Lambda polls each shard in your Kinesis stream for recor To minimize latency and maximize read throughput, create a data stream consumer with enhanced fan\-out\. Enhanced fan\-out consumers get a dedicated connection to each shard that doesn't impact other applications reading from the stream\. Stream consumers use HTTP/2 to reduce latency by pushing records to Lambda over a long\-lived connection and by compressing request headers\. You can create a stream consumer with the Kinesis [RegisterStreamConsumer](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RegisterStreamConsumer.html) API\. ``` -$ aws kinesis register-stream-consumer --consumer-name con1 \ +aws kinesis register-stream-consumer --consumer-name con1 \ --stream-arn arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream +``` + +You should see the following output: + +``` { "Consumer": { "ConsumerName": "con1", @@ -172,9 +176,14 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat To create the event source mapping with the AWS CLI, use the `create-event-source-mapping` command\. The following example uses the AWS CLI to map a function named `my-function` to a Kinesis data stream\. The data stream is specified by an Amazon Resource Name \(ARN\), with a batch size of 500, starting from the timestamp in Unix time\. ``` -$ aws lambda create-event-source-mapping --function-name my-function \ +aws lambda create-event-source-mapping --function-name my-function \ --batch-size 500 --starting-position AT_TIMESTAMP --starting-position-timestamp 1541139109 \ --event-source-arn arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream +``` + +You should see the following output: + +``` { "UUID": "2b733gdc-8ac3-cdf5-af3a-1827b3b11284", "BatchSize": 500, @@ -198,9 +207,14 @@ To use a consumer, specify the consumer's ARN instead of the stream's ARN\. Configure additional options to customize how batches are processed and to specify when to discard records that can't be processed\. The following example updates an event source mapping to send a failure record to an SQS queue after two retry attempts, or if the records are more than an hour old\. ``` -$ aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ +aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ --maximum-retry-attempts 2 --maximum-record-age-in-seconds 3600 --destination-config '{"OnFailure": {"Destination": "arn:aws:sqs:us-east-2:123456789012:dlq"}}' +``` + +You should see this output: + +``` { "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", "BatchSize": 100, @@ -222,7 +236,12 @@ $ aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. Use the `get-event-source-mapping` command to view the current status\. ``` -$ aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b +aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b +``` + +You should see this output: + +``` { "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", "BatchSize": 100, @@ -248,7 +267,7 @@ $ aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449 To process multiple batches concurrently, use the `--parallelization-factor` option\. ``` -$ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ +aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ --parallelization-factor 5 ``` @@ -396,7 +415,7 @@ At the end of your window, Lambda uses final processing for actions on the aggre You can configure tumbling windows when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. To configure a tumbling window, specify the window in seconds\. The following example AWS Command Line Interface \(AWS CLI\) command creates a streaming event source mapping that has a tumbling window of 120 seconds\. The Lambda function defined for aggregation and processing is named `tumbling-window-example-function`\. ``` -$ aws lambda create-event-source-mapping --event-source-arn arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 +aws lambda create-event-source-mapping --event-source-arn arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 ``` Lambda determines tumbling window boundaries based on the time when records were inserted into the stream\. All records have an approximate timestamp available that Lambda uses in boundary determinations\. @@ -435,7 +454,7 @@ def lambda_handler(event, context): ## Reporting batch item failures -When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries n a successful record\. +When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries in a successful record\. To turn on `ReportBatchItemFailures`, include the enum value **ReportBatchItemFailures** in the `FunctionResponseTypes` list\. This list indicates which response types are enabled for your function\. You can configure this list when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 3b1c539e..f9920a57 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -87,8 +87,6 @@ To read records from an Amazon MQ broker, your Lambda function needs the followi + [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -The AWS managed policy `AWSLambdaMQExecutionRole` includes these permissions\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. - **Note** When using an encrypted customer managed key, add the `[kms:Decrypt](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget)` permission as well\. @@ -145,11 +143,16 @@ The Amazon VPC configuration is discoverable through the [Amazon MQ API](https:/ The following example AWS CLI command creates an event source which maps a Lambda function named `MQ-Example-Function` to an Amazon MQ broker named `ExampleMQBroker`\. The command also provides a Secrets Manager secret named `ExampleMQBrokerUserPassword` that stores the broker credentials\. ``` -$ aws lambda create-event-source-mapping \ +aws lambda create-event-source-mapping \ --event-source-arn arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca \ --function-name MQ-Example-Function \ --source-access-configuration Type=BASIC_AUTH,URI=arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt \ ---queues ExampleQueue +--queues ExampleQueue +``` + +You should see the following output: + +``` { "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", "BatchSize": 100, @@ -174,9 +177,14 @@ $ aws lambda create-event-source-mapping \ Using the `[update\-event\-source\-mapping](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. ``` -$ aws lambda update-event-source-mapping \ +aws lambda update-event-source-mapping \ --uuid 91eaeb7e-c976-1234-9451-8709db01f137 \ --batch-size 2 +``` + +You should see the following output: + +``` { "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", "BatchSize": 2, @@ -192,8 +200,13 @@ $ aws lambda update-event-source-mapping \ Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) command\. ``` -$ aws lambda get-event-source-mapping \ +aws lambda get-event-source-mapping \ --uuid 91eaeb7e-c976-4939-9451-8709db01f137 +``` + +You should see the following output: + +``` { "UUID": "91eaeb7e-c976-4939-9451-8709db01f137", "BatchSize": 2, diff --git a/doc_source/with-s3-example-deployment-pkg.md b/doc_source/with-s3-example-deployment-pkg.md index a75a2cf3..01392350 100644 --- a/doc_source/with-s3-example-deployment-pkg.md +++ b/doc_source/with-s3-example-deployment-pkg.md @@ -1,6 +1,6 @@ # Sample Amazon S3 function code -Sample code is available for the following languages\. +The following sample code is available for the [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md)\. **Topics** + [Node\.js 12\.x](#with-s3-example-deployment-pkg-nodejs) @@ -11,125 +11,134 @@ Sample code is available for the following languages\. The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. +### Create the function code + +Copy the sample code into a file named `index.js` into a new folder named `lambda-s3`\. + **Example index\.js** ``` // dependencies -const AWS = require('aws-sdk'); -const util = require('util'); -const sharp = require('sharp'); - -// get reference to S3 client -const s3 = new AWS.S3(); - -exports.handler = async (event, context, callback) => { - - // Read options from the event parameter. - console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); - const srcBucket = event.Records[0].s3.bucket.name; - // Object key may have spaces or unicode non-ASCII characters. - const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); - const dstBucket = srcBucket + "-resized"; - const dstKey = "resized-" + srcKey; - - // Infer the image type from the file suffix. - const typeMatch = srcKey.match(/\.([^.]*)$/); - if (!typeMatch) { - console.log("Could not determine the image type."); - return; - } - - // Check that the image type is supported - const imageType = typeMatch[1].toLowerCase(); - if (imageType != "jpg" && imageType != "png") { - console.log(`Unsupported image type: ${imageType}`); - return; - } - - // Download the image from the S3 source bucket. - - try { - const params = { - Bucket: srcBucket, - Key: srcKey - }; - var origimage = await s3.getObject(params).promise(); - - } catch (error) { - console.log(error); - return; - } - - // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. - const width = 200; - - // Use the Sharp module to resize the image and save in a buffer. - try { - var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - - } catch (error) { - console.log(error); - return; - } - - // Upload the thumbnail image to the destination bucket - try { - const destparams = { - Bucket: dstBucket, - Key: dstKey, - Body: buffer, - ContentType: "image" - }; - - const putResult = await s3.putObject(destparams).promise(); - - } catch (error) { - console.log(error); - return; - } - - console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); -}; + const AWS = require('aws-sdk'); + const util = require('util'); + const sharp = require('sharp'); + + // get reference to S3 client + const s3 = new AWS.S3(); + + exports.handler = async (event, context, callback) => { + + // Read options from the event parameter. + console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); + const srcBucket = event.Records[0].s3.bucket.name; + // Object key may have spaces or unicode non-ASCII characters. + const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); + const dstBucket = srcBucket + "-resized"; + const dstKey = "resized-" + srcKey; + + // Infer the image type from the file suffix. + const typeMatch = srcKey.match(/\.([^.]*)$/); + if (!typeMatch) { + console.log("Could not determine the image type."); + return; + } + + // Check that the image type is supported + const imageType = typeMatch[1].toLowerCase(); + if (imageType != "jpg" && imageType != "png") { + console.log(`Unsupported image type: ${imageType}`); + return; + } + + // Download the image from the S3 source bucket. + + try { + const params = { + Bucket: srcBucket, + Key: srcKey + }; + var origimage = await s3.getObject(params).promise(); + + } catch (error) { + console.log(error); + return; + } + + // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. + const width = 200; + + // Use the Sharp module to resize the image and save in a buffer. + try { + var buffer = await sharp(origimage.Body).resize(width).toBuffer(); + + } catch (error) { + console.log(error); + return; + } + + // Upload the thumbnail image to the destination bucket + try { + const destparams = { + Bucket: dstBucket, + Key: dstKey, + Body: buffer, + ContentType: "image" + }; + + const putResult = await s3.putObject(destparams).promise(); + + } catch (error) { + console.log(error); + return; + } + + console.log('Successfully resized ' + srcBucket + '/' + srcKey + + ' and uploaded to ' + dstBucket + '/' + dstKey); + }; ``` ++ Review the preceding code and note the following: + + The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg, the code creates a thumbnail and saves it to the target bucket\. + + The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. + + For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. -The deployment package is a \.zip file containing your Lambda function code and dependencies\. +### Create the deployment package -**To create a deployment package** +A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: -1. Create a folder \(`examplefolder`\), and then create a subfolder \(`node_modules`\)\. +**Dependencies** ++ Sharp for node\.js -1. Install dependencies\. The code examples use the following libraries: - + AWS SDK for JavaScript in Node\.js - + Sharp for node\.js +**To create a deployment package** - The AWS Lambda runtime already has the AWS SDK for JavaScript in Node\.js, so you only need to install the Sharp library\. Open a command prompt, navigate to the `examplefolder`, and install the libraries using the `npm` command, which is part of Node\.js\. For Linux, use the following command\. +1. Install the Sharp library with npm\. For Linux, use the following command\. ``` - $ npm install sharp + lambda-s3$ npm install sharp ``` For macOS, use the following command\. ``` - $ npm install --arch=x64 --platform=linux --target=12.13.0 sharp + lambda-s3$ npm install --arch=x64 --platform=linux --target=12.13.0 sharp ``` -1. Save the sample code to a file named index\.js\. +1. After you complete this step, you should have the following folder structure: -1. Review the preceding code and note the following: - + The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg, the code creates a thumbnail and saves it to the target bucket\. - + The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. - + For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. + ``` + lambda-s3 + |- index.js + |- /node_modules/sharp + └ /node_modules/... + ``` -1. Save the file as `index.js` in `examplefolder`\. After you complete this step, you will have the following folder structure: +1. Create a deployment package with the function code and dependencies\. ``` - index.js - /node_modules/sharp + lambda-s3$ zip -r function.zip . ``` -1. Zip the index\.js file and the node\_modules folder as `CreateThumbnail.zip`\. +**To create and test the function** ++ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. ## Java 11 @@ -137,6 +146,10 @@ The following is example Java code that reads incoming Amazon S3 events and crea The `S3Event` type that the handler uses as the input type is one of the predefined classes in the `aws-lambda-java-events`  library that provides methods for you to easily read information from the incoming Amazon S3 event\. The handler returns a string as output\. +### Create the function code + +Copy the sample code into a file named `Handler.java`\. + **Example Handler\.java** ``` @@ -273,19 +286,30 @@ public class Handler implements Amazon S3 invokes your Lambda function using the `Event` invocation type, where AWS Lambda runs the code asynchronously\. What you return does not matter\. However, in this case we are implementing an interface that requires us to specify a return type, so in this example the handler uses `String` as the return type\. +### Create the deployment package + +A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: + **Dependencies** + `aws-lambda-java-core` + `aws-lambda-java-events` + `aws-java-sdk` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +**To create a deployment package** ++ Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. + +**To create and test the function** ++ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. ## Python 3 The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. +### Create the function code + +Copy the sample code into a file named `lambda_function.py`\. + **Example lambda\_function\.py** -Copy the sample code into a file named `lambda_function.py`\. ``` import boto3 @@ -315,8 +339,15 @@ def lambda_handler(event, context): s3_client.upload_file(upload_path, '{}-resized'.format(bucket), key) ``` +### Create the deployment package + +A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: + **Dependencies** + [Pillow](https://pypi.org/project/Pillow/) **To create a deployment package** -+ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow](https://pypi.org/project/Pillow/) library\. \ No newline at end of file ++ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow \(PIL\)](https://pypi.org/project/Pillow/) library\. + +**To create and test the function** ++ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index e18abe3c..816a8c24 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -19,12 +19,17 @@ Upon completing this tutorial, you will have the following Amazon S3, Lambda, an ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -120,6 +125,8 @@ The following example code receives an Amazon S3 event input and processes the m **Note** For sample code in other languages, see [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md)\. +### Create the function code + **Example index\.js** ``` @@ -207,6 +214,8 @@ Review the preceding code and note the following: + The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. + For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. +### Create the deployment package + The deployment package is a \.zip file containing your Lambda function code and dependencies\. **To create a deployment package** @@ -218,13 +227,13 @@ The deployment package is a \.zip file containing your Lambda function code and 1. Install the Sharp library with npm\. For Linux, use the following command\. ``` - lambda-s3$ npm install sharp + npm install sharp ``` For macOS, use the following command\. ``` - lambda-s3$ npm install --arch=x64 --platform=linux --target=12.13.0 sharp + npm install --arch=x64 --platform=linux --target=12.13.0 sharp ``` After you complete this step, you will have the following folder structure: @@ -236,32 +245,36 @@ The deployment package is a \.zip file containing your Lambda function code and └ /node_modules/... ``` -1. Create a deployment package with the function code and dependencies\. +1. Create a deployment package with the function code and dependencies\. Set the \-r \(recursive\) option for the zip command to compress the subfolders\. ``` - lambda-s3$ zip -r function.zip . + zip -r function.zip . ``` +### Create the Lambda function + **To create the function** + Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name CreateThumbnail \ + aws lambda create-function --function-name CreateThumbnail \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --timeout 10 --memory-size 1024 \ --role arn:aws:iam::123456789012:role/lambda-s3-role ``` +**Note** +If you are using AWS CLI version 2, add the following command parameters: -If you are using AWS CLI version 2, add the following command parameters: + ``` + --cli-binary-format raw-in-base64-out + ``` -``` ---cli-binary-format raw-in-base64-out -``` + The Lambda function in the last step uses a Node\.js function handler of `index.handler`\. This name reflects the function name as `handler`, and the file where the handler code is stored in `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. It also specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. For the role parameter, replace the number sequence with your AWS account ID\. The preceding example command specifies a 10\-second timeout value as the function configuration\. Depending on the size of objects you upload, you might need to increase the timeout value using the following AWS CLI command\. ``` -$ aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 +aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 ``` ## Test the Lambda function @@ -316,9 +329,15 @@ In this step, you invoke the Lambda function manually using sample Amazon S3 eve 1. Run the following Lambda CLI `invoke` command to invoke the function\. Note that the command requests asynchronous execution\. You can optionally invoke it synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. ``` - $ aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ + aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ --payload file://inputFile.txt outputfile.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameters: + + ``` + --cli-binary-format raw-in-base64-out + ``` 1. Verify that the thumbnail was created in the target bucket\. @@ -337,7 +356,7 @@ In this step, you add the remaining configuration so that Amazon S3 can publish + The bucket is owned by your account\. If you delete a bucket, it is possible for another account to create a bucket with the same ARN\. ``` - $ aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com \ + aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com \ --statement-id s3invoke --action "lambda:InvokeFunction" \ --source-arn arn:aws:s3:::sourcebucket \ --source-account account-id @@ -346,7 +365,7 @@ In this step, you add the remaining configuration so that Amazon S3 can publish 1. Verify the function's access policy by running the AWS CLI `get-policy` command\. ``` - $ aws lambda get-policy --function-name CreateThumbnail + aws lambda get-policy --function-name CreateThumbnail ``` Add notification configuration on the source bucket to request Amazon S3 to publish object\-created events to Lambda\. diff --git a/doc_source/with-sns-create-package.md b/doc_source/with-sns-create-package.md index 00c7fdb7..8f44c052 100644 --- a/doc_source/with-sns-create-package.md +++ b/doc_source/with-sns-create-package.md @@ -3,12 +3,12 @@ Sample code is available for the following languages\. **Topics** -+ [Node\.js 8](#with-sns-example-deployment-pkg-nodejs) ++ [Node\.js 12\.x](#with-sns-example-deployment-pkg-nodejs) + [Java 11](#with-sns-example-deployment-pkg-java) + [Go](#with-sns-example-deployment-pkg-go) + [Python 3](#with-sns-example-deployment-pkg-python) -## Node\.js 8 +## Node\.js 12\.x The following example processes messages from Amazon SNS, and logs their contents\. @@ -61,7 +61,7 @@ public class LogEvent implements RequestHandler { + `aws-lambda-java-core` + `aws-lambda-java-events` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. ## Go diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index 6be99da0..d9bae04a 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -4,12 +4,17 @@ You can use a Lambda function in one AWS account to subscribe to an Amazon SNS t ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -24,7 +29,7 @@ In the tutorial, you use two accounts\. The AWS CLI commands illustrate this by From account A \(01234567891A\), create the source Amazon SNS topic\. ``` -$ aws sns create-topic --name lambda-x-account --profile accountA +aws sns create-topic --name lambda-x-account --profile accountA ``` Note the topic ARN that is returned by the command\. You will need it when you add permissions to the Lambda function to subscribe to the topic\. @@ -74,13 +79,13 @@ exports.handler = function(event, context, callback) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name SNS-X-Account \ + aws lambda create-function --function-name SNS-X-Account \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::01234567891B:role/service-role/lambda-sns-execution-role \ --timeout 60 --profile accountB @@ -93,23 +98,28 @@ Note the function ARN that is returned by the command\. You will need it when yo From account A \(01234567891A\), grant permission to account B \(01234567891B\) to subscribe to the topic: ``` -$ aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ +aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ --topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ ---action-name Subscribe ListSubscriptionsByTopic Receive --profile accountA +--action-name Subscribe ListSubscriptionsByTopic --profile accountA ``` From account B \(01234567891B\), add the Lambda permission to allow invocation from Amazon SNS\. ``` -$ aws lambda add-permission --function-name SNS-X-Account \ +aws lambda add-permission --function-name SNS-X-Account \ --source-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ --statement-id sns-x-account --action "lambda:InvokeFunction" \ --principal sns.amazonaws.com --profile accountB +``` + +You should see the following output: + +``` { "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": \"arn:aws:sns:us-east-2:12345678901A:lambda-x-account\"}}, \"Action\":[\"lambda:InvokeFunction\"], - \"Resource\":\"arn:aws:lambda:us-east-2:01234567891A:function:SNS-X-Account\", + \"Resource\":\"arn:aws:lambda:us-east-2:01234567891B:function:SNS-X-Account\", \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, \"Sid\":\"sns-x-account1\"}" } @@ -125,10 +135,15 @@ If the account with the SNS topic is hosted in an opt\-in region, you need to sp From account B, subscribe the Lambda function to the topic\. When a message is sent to the `lambda-x-account` topic in account A \(01234567891A\), Amazon SNS invokes the `SNS-X-Account` function in account B \(01234567891B\)\. ``` -$ aws sns subscribe --protocol lambda \ +aws sns subscribe --protocol lambda \ --topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ --notification-endpoint arn:aws:lambda:us-east-2:12345678901B:function:SNS-X-Account \ --profile accountB +``` + +You should see the following output: + +``` { "SubscriptionArn": "arn:aws:sns:us-east-2:12345678901A:lambda-x-account:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" } @@ -141,7 +156,7 @@ The output contains the ARN of the topic subscription\. From account A \(01234567891A\), test the subscription\. Type `Hello World` into a text file and save it as `message.txt`\. Then run the following command: ``` -$ aws sns publish --message file://message.txt --subject Test \ +aws sns publish --message file://message.txt --subject Test \ --topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ --profile accountA ``` @@ -149,3 +164,47 @@ $ aws sns publish --message file://message.txt --subject Test \ This will return a message id with a unique identifier, indicating the message has been accepted by the Amazon SNS service\. Amazon SNS will then attempt to deliver it to the topic's subscribers\. Alternatively, you could supply a JSON string directly to the `message` parameter, but using a text file allows for line breaks in the message\. To learn more about Amazon SNS, see [What is Amazon Simple Notification Service](https://docs.aws.amazon.com/sns/latest/dg/)\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Amazon SNS topic** + +1. Open the [Topics page](https://console.aws.amazon.com/sns/home#topics:) of the Amazon SNS console\. + +1. Select the topic you created\. + +1. Choose **Delete**\. + +1. Enter **delete me** in the text box\. + +1. Choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the Amazon SNS subscription** + +1. Open the [Subscriptions page](https://console.aws.amazon.com/sns/home#subscriptions:) of the Amazon SNS console\. + +1. Select the subscription you created\. + +1. Choose **Delete**, **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md index fea17f30..7e1167be 100644 --- a/doc_source/with-sns.md +++ b/doc_source/with-sns.md @@ -1,6 +1,6 @@ -# Using AWS Lambda with Amazon SNS +# Using Lambda with Amazon SNS -You can use a Lambda function to process Amazon Simple Notification Service notifications\. Amazon SNS supports Lambda functions as a target for messages sent to a topic\. You can subscribe your function to topics in the same account or in other AWS accounts\. +You can use a Lambda function to process Amazon Simple Notification Service \(Amazon SNS\) notifications\. Amazon SNS supports Lambda functions as a target for messages sent to a topic\. You can subscribe your function to topics in the same account or in other AWS accounts\. Amazon SNS invokes your function [asynchronously](invocation-async.md) with an event that contains a message and metadata\. @@ -40,11 +40,18 @@ Amazon SNS invokes your function [asynchronously](invocation-async.md) with an e } ``` -For asynchronous invocation, Lambda queues the message and handles retries\. If Amazon SNS is unable to reach Lambda or the message is rejected, Amazon SNS retries at increasing intervals over several hours\. For details, see [Reliability](https://aws.amazon.com/sns/faqs/#Reliability) in the Amazon SNS FAQ\. +For asynchronous invocation, Lambda queues the message and handles retries\. If Amazon SNS can't reach Lambda or the message is rejected, Amazon SNS retries at increasing intervals over several hours\. For details, see [Reliability](http://aws.amazon.com/sns/faqs/#Reliability) in the Amazon SNS FAQs\. -In order to perform cross account Amazon SNS deliveries to Lambda, you need to authorize your Lambda function to be invoked from Amazon SNS\. In turn, Amazon SNS needs to allow the Lambda account to subscribe to the Amazon SNS topic\. For example, if the Amazon SNS topic is in account A and the Lambda function is in account B, both accounts must grant permissions to the other to access their respective resources\. Since not all the options for setting up cross\-account permissions are available from the AWS console, you use the AWS CLI to set up the entire process\. +To perform cross\-account Amazon SNS deliveries to Lambda, you must authorize Amazon SNS to invoke your Lambda function\. In turn, Amazon SNS must allow the AWS account with the Lambda function to subscribe to the Amazon SNS topic\. For example, if the Amazon SNS topic is in account A and the Lambda function is in account B, both accounts must grant permissions to the other to access their respective resources\. Since not all the options for setting up cross\-account permissions are available from the AWS Management Console, you must use the AWS Command Line Interface \(AWS CLI\) for setup\. -For more information, see [Invoking Lambda functions using Amazon SNS notifications](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) in the *Amazon Simple Notification Service Developer Guide*\. +For more information, see [Fanout to Lambda functions](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda-as-subscriber.html) in the *Amazon Simple Notification Service Developer Guide*\. + +**Input types for Amazon SNS events** + +For input type examples for Amazon SNS events in Java, \.NET, and Go, see the following on the AWS GitHub repository: ++ [SNSEvent\.java](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/SNSEvent.java) ++ [SNSEvent\.cs](https://github.com/aws/aws-lambda-dotnet/blob/main/Libraries/src/Amazon.Lambda.SNSEvents/SNSEvent.cs) ++ [sns\.go](https://github.com/aws/aws-lambda-go/blob/main/events/sns.go) **Topics** + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index 1144ad8f..6723b172 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -13,7 +13,7 @@ Sample code is available for the following languages\. The following is example code that receives an Amazon SQS event message as input and processes it\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. -**Example index\.js \(Node\.js 8\)** +**Example index\.js \(Node\.js 12\)** ``` exports.handler = async function(event, context) { @@ -25,17 +25,6 @@ exports.handler = async function(event, context) { } ``` -**Example index\.js \(Node\.js 6\)** - -``` -event.Records.forEach(function(record) { - var body = record.body; - console.log(body); - }); - callback(null, "message"); -}; -``` - Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. ## Java @@ -70,7 +59,7 @@ public class Handler implements RequestHandler{ + `aws-lambda-java-core` + `aws-lambda-java-events` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. ## C\# diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index 2a3d1c55..efe9beea 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -4,12 +4,17 @@ In this tutorial, you create a Lambda function to consume messages from an [Amaz ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you 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: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -60,13 +65,13 @@ exports.handler = async function(event, context) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name ProcessSQSRecord \ + aws lambda create-function --function-name ProcessSQSRecord \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-sqs-role ``` @@ -105,7 +110,7 @@ If the handler returns normally without exceptions, Lambda considers the message 1. Run the following `invoke` command\. ``` - $ aws lambda invoke --function-name ProcessSQSRecord \ + aws lambda invoke --function-name ProcessSQSRecord \ --payload file://input.txt outputfile.txt ``` @@ -132,14 +137,14 @@ Test the end\-to\-end experience\. As you perform queue updates, Amazon Simple Q To create a mapping between the specified Amazon SQS queue and the Lambda function, run the following AWS CLI `create-event-source-mapping` command\. After the command runs, write down or otherwise record the UUID\. You'll need this UUID to refer to the event source mapping in any other commands, for example, if you choose to delete the event source mapping\. ``` -$ aws lambda create-event-source-mapping --function-name ProcessSQSRecord --batch-size 10 \ +aws lambda create-event-source-mapping --function-name ProcessSQSRecord --batch-size 10 \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue ``` You can get the list of event source mappings by running the following command\. ``` -$ aws lambda list-event-source-mappings --function-name ProcessSQSRecord \ +aws lambda list-event-source-mappings --function-name ProcessSQSRecord \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue ``` @@ -153,4 +158,40 @@ Now you can test the setup as follows: 1. AWS Lambda polls the queue and when it detects updates, it invokes your Lambda function by passing in the event data it finds in the queue\. -1. Your function runs and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. \ No newline at end of file +1. Your function runs and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the Amazon SQS queue** + +1. Sign in to the AWS Management Console and open the Amazon SQS console at [https://console\.aws\.amazon\.com/sqs/](https://console.aws.amazon.com/sqs/)\. + +1. Select the queue you created\. + +1. Choose **Delete**\. + +1. Enter **delete** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index d88bdf10..ea24fdfe 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -1,6 +1,6 @@ # Using AWS Lambda with Amazon SQS -You can use an AWS Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/fifo-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. +You can use an AWS Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. Lambda polls the queue and invokes your Lambda function [synchronously](invocation-sync.md) with an event that contains queue messages\. Lambda reads messages in batches and invokes your function once for each batch\. When your function successfully processes a batch, Lambda deletes its messages from the queue\. The following example shows an event for a batch of two messages\. @@ -132,9 +132,11 @@ Lambda supports the following options for Amazon SQS event sources\. **Event source options** + **SQS queue** – The Amazon SQS queue to read records from\. + **Batch size** – The number of records to send to the function in each batch\. For a standard queue this can be up to 10,000 records\. For a FIFO queue the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) for synchronous invocation \(6 MB\)\. + + Metadata is generated by both Lambda and Amazon SQS for each record\. This additional metadata is counted towards the total payload size and may cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields sent by Amazon SQS can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) documentation in the *Amazon Simple Queue Service API Reference*\. + **Batch window ** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. Only applicable to standard queues\. - If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. Set your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. + If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. Set your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. Lambda processes up to 5 batches at a time\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. **Note** @@ -142,7 +144,7 @@ Amazon SQS has a perpetual free tier for requests\. Beyond the free tier, Amazon To manage the event source configuration later, choose the trigger in the designer\. -Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of 5 concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. +Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of 5 concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. To eliminate the chance of throttling errors, set the [reserved concurrency](configuration-concurrency.md) value to 1000, which is the maximum number of concurrent executions for an Amazon SQS event source\. ## Event source mapping APIs @@ -156,9 +158,14 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat The following example uses the AWS CLI to map a function named `my-function` to an Amazon SQS queue that is specified by its Amazon Resource Name \(ARN\), with a batch size of 5 and a batch window of 60 seconds\. ``` -$ aws lambda create-event-source-mapping --function-name my-function --batch-size 5 \ +aws lambda create-event-source-mapping --function-name my-function --batch-size 5 \ --maximum-batching-window-in-seconds 60 \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue +``` + +You should see the following output: + +``` { "UUID": "2b733gdc-8ac3-cdf5-af3a-1827b3b11284", "BatchSize": 5, From 9974312a9d5483858f15cce24e099f87c0b8e432 Mon Sep 17 00:00:00 2001 From: Anton Klimenko Date: Thu, 25 Feb 2021 08:56:47 +1100 Subject: [PATCH 07/94] Fix typo in adding RIE to the image example There's inconsistency in the example of how to add RIE to the image. Dockerfile `ADD` and `RUN` commands work with `/usr/bin/aws-lambda-rie`. But `entry.sh` script refers to `/usr/local/bin/aws-lambda-rie` that causes issues. Alternatively, Dockerfile `ADD` and `RUN` commands can be updated to work with `/usr/local/bin/aws-lambda-rie`. --- doc_source/go-image.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 4b8e4564..85566819 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -131,7 +131,7 @@ The steps are the same as described for a `provided.al2` base image, with one ad ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie "$@" + exec /usr/bin/aws-lambda-rie "$@" else exec "$@" fi @@ -165,4 +165,4 @@ If you do not want to add the RIE to your image, you can test your image locally This command invokes the function running in the container image and returns a response\. -For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. \ No newline at end of file +For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. From d42b13e80b9fe481f904aa8fb50ceafbaa3c2908 Mon Sep 17 00:00:00 2001 From: Andre F de Miranda Date: Mon, 1 Mar 2021 11:50:44 +1100 Subject: [PATCH 08/94] Fix broken link --- doc_source/golang-handler.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 5acc75f7..e193dc0a 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -90,7 +90,7 @@ And the response would look like this: } ``` -To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/main/events)\. +To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events)\. ### Valid handler signatures @@ -176,4 +176,4 @@ func LambdaHandler() (int, error) { func main() { lambda.Start(LambdaHandler) } -``` \ No newline at end of file +``` From 995561f71c5d014fa5970e4ebe0124fe18bbb6ea Mon Sep 17 00:00:00 2001 From: Tim Mattison Date: Tue, 2 Mar 2021 16:44:49 -0500 Subject: [PATCH 09/94] Fixed reference to iotevents.amazonaws.com that should be iot.amazonaws.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This code snippet references iotevents.amazonaws.com but should reference iot.amazonaws.com. This can be verified in the output JSON below the code that shows the service principal as “iot.amazonaws.com”. --- doc_source/services-iot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md index 66e2c48a..a1e3dfbf 100644 --- a/doc_source/services-iot.md +++ b/doc_source/services-iot.md @@ -24,7 +24,7 @@ You need to grant permission for the AWS IoT service to invoke your Lambda funct ``` aws lambda add-permission --function-name my-function \ ---statement-id iot-events --action "lambda:InvokeFunction" --principal iotevents.amazonaws.com +--statement-id iot-events --action "lambda:InvokeFunction" --principal iot.amazonaws.com ``` You should see the following output: @@ -35,4 +35,4 @@ You should see the following output: } ``` -For more information about how to use Lambda with AWS IoT, see [Creating an AWS Lambda rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html)\. \ No newline at end of file +For more information about how to use Lambda with AWS IoT, see [Creating an AWS Lambda rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html)\. From 197a6ba22400e9a1af13b49cace7df0811693268 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Thu, 4 Mar 2021 15:07:40 +0500 Subject: [PATCH 10/94] fix JSON syntax in example resource-based policy --- doc_source/access-control-resource-based.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 0778a999..0c8b3993 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function” + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" @@ -225,4 +225,4 @@ Use `remove-layer-version-permission` to remove statements from the policy\. ``` aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org -``` \ No newline at end of file +``` From 94b3498206a550763afa3b1a4e60c1cd588e9f07 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Thu, 4 Mar 2021 22:42:11 +0000 Subject: [PATCH 11/94] Periodic update --- doc_source/access-control-identity-based.md | 2 +- doc_source/access-control-resource-based.md | 14 +- doc_source/configuration-aliases.md | 17 +- doc_source/configuration-concurrency.md | 6 +- doc_source/configuration-console.md | 8 +- doc_source/configuration-database.md | 6 +- doc_source/configuration-envvars.md | 12 +- doc_source/configuration-filesystem.md | 2 + doc_source/configuration-layers.md | 121 +++-- doc_source/configuration-tags.md | 2 + doc_source/configuration-versions.md | 10 +- doc_source/configuration-vpc.md | 2 + doc_source/csharp-exceptions.md | 13 +- doc_source/csharp-image.md | 2 +- doc_source/csharp-logging.md | 6 +- doc_source/csharp-tracing.md | 14 +- doc_source/getting-started-create-function.md | 28 +- doc_source/go-image.md | 2 +- doc_source/golang-exceptions.md | 13 +- doc_source/golang-handler.md | 4 +- doc_source/golang-logging.md | 6 +- doc_source/golang-package.md | 6 +- doc_source/golang-tracing.md | 10 +- doc_source/images-test.md | 8 +- doc_source/index.md | 10 +- doc_source/invocation-async.md | 8 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/invocation-sync.md | 2 +- doc_source/java-context.md | 20 +- doc_source/java-exceptions.md | 19 +- doc_source/java-handler.md | 40 +- doc_source/java-logging.md | 8 +- doc_source/java-package.md | 34 +- doc_source/java-samples.md | 4 +- doc_source/java-tracing.md | 14 +- doc_source/kafka-hosting.md | 4 +- doc_source/kafka-smaa.md | 6 +- doc_source/kafka-using-cluster.md | 2 +- doc_source/lambda-intro-execution-role.md | 6 +- doc_source/lambda-kafka.md | 2 +- doc_source/lambda-monitoring.md | 3 +- doc_source/lambda-releases.md | 1 + doc_source/lambda-services.md | 2 +- doc_source/monitoring-insights.md | 6 +- doc_source/monitoring-metrics.md | 2 +- doc_source/monitoring-servicemap.md | 80 ++++ doc_source/nodejs-exceptions.md | 13 +- doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-logging.md | 4 +- doc_source/nodejs-package.md | 14 +- doc_source/nodejs-tracing.md | 16 +- doc_source/powershell-exceptions.md | 13 +- doc_source/powershell-logging.md | 6 +- doc_source/python-exceptions.md | 13 +- doc_source/python-handler.md | 4 +- doc_source/python-logging.md | 4 +- doc_source/python-package-create.md | 452 ++++++++++++++++++ doc_source/python-package-update.md | 216 +++++++++ doc_source/python-package.md | 238 +-------- doc_source/python-tracing.md | 16 +- doc_source/ruby-exceptions.md | 13 +- doc_source/ruby-logging.md | 4 +- doc_source/ruby-package.md | 12 +- doc_source/ruby-tracing.md | 16 +- doc_source/runtimes-modify.md | 6 +- doc_source/samples-blank.md | 16 +- doc_source/samples-errorprocessor.md | 6 +- doc_source/samples-listmanager.md | 10 +- doc_source/services-apigateway-blueprint.md | 12 +- doc_source/services-apigateway-tutorial.md | 2 +- doc_source/services-apigateway.md | 16 +- doc_source/services-cloudformation.md | 2 +- .../services-cloudwatchevents-tutorial.md | 14 +- doc_source/services-cloudwatchevents.md | 2 +- doc_source/services-ec2-tutorial.md | 4 +- doc_source/services-elasticache-tutorial.md | 2 +- doc_source/services-iot.md | 2 +- doc_source/services-msk-topic-add.md | 2 +- doc_source/services-rds-tutorial.md | 4 +- doc_source/services-smaa-topic-add.md | 14 +- doc_source/services-stepfunctions.md | 2 +- doc_source/services-xray.md | 10 +- doc_source/smaa-permissions.md | 10 +- doc_source/troubleshooting-deployment.md | 14 + doc_source/troubleshooting-execution.md | 10 + doc_source/troubleshooting-images.md | 6 + doc_source/troubleshooting-invocation.md | 26 + doc_source/troubleshooting-networking.md | 6 + doc_source/using-extensions.md | 4 +- doc_source/with-ddb-example.md | 2 +- doc_source/with-ddb.md | 4 +- doc_source/with-kinesis-example.md | 2 +- doc_source/with-kinesis.md | 4 +- doc_source/with-mq.md | 4 +- doc_source/with-s3-example.md | 2 +- doc_source/with-sns-example.md | 2 +- doc_source/with-sns.md | 6 +- doc_source/with-sqs-example.md | 2 +- doc_source/with-sqs.md | 2 +- 99 files changed, 1270 insertions(+), 607 deletions(-) create mode 100644 doc_source/monitoring-servicemap.md create mode 100644 doc_source/python-package-create.md create mode 100644 doc_source/python-package-update.md diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 5a6a3318..56270b66 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -170,7 +170,7 @@ The permissions in the policy are organized into statements based on the [resour This policy allows a user to get started with Lambda, without putting other users' resources at risk\. It doesn't allow a user to configure a function to be triggered by or call other AWS services, which requires broader IAM permissions\. It also doesn't include permission to services that don't support limited\-scope policies, like CloudWatch and X\-Ray\. Use the read\-only policies for these services to give the user access to metrics and trace data\. -When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/iam-policies)\. +When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. ## Layer development and use diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 0778a999..19f6734a 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -10,9 +10,9 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc 1. Choose a function\. -1. Choose **Permissions**\. +1. Choose **Configuration** and then choose **Permissions**\. -1. The resource\-based policy shows the permissions that are applied when another account or AWS service attempts to access the function\. The following example shows a statement that allows Amazon S3 to invoke a function named `my-function` for a bucket named `my-bucket` in account `123456789012`\. +1. Scroll down to **Resource\-based policy** and then choose **View policy document**\. The resource\-based policy shows the permissions that are applied when another account or AWS service attempts to access the function\. The following example shows a statement that allows Amazon S3 to invoke a function named `my-function` for a bucket named `my-bucket` in account `123456789012`\. **Example Resource\-based policy** ``` @@ -22,7 +22,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Statement": [ { "Sid": "lambda-allow-s3-my-function", - "Effect": "Allow", + "Effect": "Allow", "Principal": { "Service": "s3.amazonaws.com" }, @@ -31,12 +31,12 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" - }, + }, "ArnLike": { - "AWS:SourceArn": "arn:aws:s3:::my-bucket" + "AWS:SourceArn": "arn:aws:s3:::my-bucket" } - } - } + } + } ] } ``` diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 0fa7f0a8..7876becd 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -6,10 +6,9 @@ You can create one or more aliases for your Lambda function\. A Lambda alias is 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose the name of a function\. +1. Choose a function\. -1. On the function configuration page, choose **Actions**, **Create alias**\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/version-actions.png) +1. Choose **Aliases** and then choose **Create alias**\. 1. On the **Create alias** page, do the following: @@ -23,8 +22,6 @@ You can create one or more aliases for your Lambda function\. A Lambda alias is 1. Choose **Save**\. -To view the aliases that are currently defined for a function, on the function configuration page, choose **Qualifiers**, and then choose the **Aliases** tab\. - ## Managing aliases with the Lambda API To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html) command\. @@ -84,14 +81,14 @@ You can point an alias to a maximum of two Lambda function versions\. The versio + Both versions must be published\. The alias cannot point to `$LATEST`\. **To configure routing on an alias** +**Note** +Verify that the function has at least two published versions\. To create additional versions, follow the instructions in [Lambda function versions](configuration-versions.md)\. 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose the name of a function\. - -1. Verify that the function has at least two published versions\. On the function configuration page, choose **Qualifiers**, and then choose the **Versions** tab to display the list of versions\. To create additional versions, follow the instructions in [Lambda function versions](configuration-versions.md)\. +1. Choose a function\. -1. Choose **Actions**, **Create alias**\. +1. Choose **Aliases** and then choose **Create alias**\. 1. On the **Create alias** page, do the following: @@ -130,7 +127,7 @@ aws lambda update-alias --name routing-alias --function-name my-function \ To route all traffic to version 2, use the `update-alias` command to change the `function-version` property to point the alias to version 2\. The command also resets the routing configuration\. ``` -aws lambda update-alias --name routing-alias --function-name my-function \ +aws lambda update-alias --name routing-alias --function-name my-function \ --function-version 2 --routing-config AdditionalVersionWeights={} ``` diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 03cd0ad3..75406a69 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -36,6 +36,8 @@ To manage reserved concurrency settings for a function, use the Lambda console\. 1. Choose a function\. +1. Choose **Configuration** and then choose **Concurrency**\. + 1. Under **Concurrency**, choose **Edit**\. 1. Choose **Reserve concurrency**\. Enter the amount of concurrency to reserve for the function\. @@ -70,7 +72,9 @@ To manage provisioned concurrency settings for a version or alias, use the Lambd 1. Choose a function\. -1. Under **Provisioned concurrency configurations**, choose **Add**\. +1. Choose **Configuration** and then choose **Concurrency**\. + +1. Under **Provisioned concurrency configurations**, choose **Add configuration**\. 1. Choose an alias or version\. diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md index 9a05cc2c..39af7e6f 100644 --- a/doc_source/configuration-console.md +++ b/doc_source/configuration-console.md @@ -2,18 +2,18 @@ You can use the Lambda console to configure function settings, add triggers and destinations, and update and test your code\. -To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. Under **Aliases**, choose `Latest`\. The function designer is near the top of the page\. +To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. -![\[The function designer in the AWS Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) +![\[The function overview in the AWS Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) -The designer shows an overview of your function and its upstream and downstream resources\. +The function overview shows a visualization of your function and its upstream and downstream resources\. You can use it to configure triggers, layers, and destinations\. + **Triggers** – Triggers are services and resources that you have configured to invoke your function\. Choose **Add trigger** to create a Lambda [event source mapping](invocation-eventsourcemapping.md) or to configure a trigger in another service that the Lambda console integrates with\. For details about these services and others, see [Using AWS Lambda with other services](lambda-services.md)\. + **Layers** – Choose the **Layers** node to add [layers](configuration-layers.md) to your application\. A layer is a \.zip file archive that contains libraries, a custom runtime, or other dependencies\. + **Destinations** – Add a destination to your function to send details about invocation results to another service\. You can send invocation records when your function is invoked [asynchronously](invocation-async.md), or by an [event source mapping](invocation-eventsourcemapping.md) that reads from a stream\. -With the `Latest` function version selected, you can modify the following settings\. +By default you are working with the `Latest` function version\. You can modify the following settings in this version: **Function settings** + **Code** – The code and dependencies of your function\. For scripting languages, you can edit your function code in the embedded [editor](code-editor.md)\. To add libraries, or for languages that the editor doesn't support, or to create a function deployed as a container image, upload a [deployment package](gettingstarted-package.md)\. If your deployment package is larger than 50 MB, choose **Upload a file from Amazon S3**\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index cc56da29..1d84a658 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -8,6 +8,8 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy for 1. Choose a function\. +1. Choose **Configuration** and then choose **Database proxies**\. + 1. Choose **Add database proxy**\. 1. Configure the following options\. @@ -46,7 +48,7 @@ You can create a database proxy that uses the function's IAM credentials for aut The Lambda console adds the required permission \(`rds-db:connect`\) to the execution role\. You can then use the AWS SDK to generate a token that allows it to connect to the proxy\. The following example shows how to configure a database connection with the `mysql2` library in Node\.js\. -**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** +**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** ``` const signer = new AWS.RDS.Signer({ @@ -82,4 +84,4 @@ Sample applications that demonstrate the use of Lambda with an Amazon RDS databa [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) -To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/README.md)\. \ No newline at end of file +To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 5720a4a1..9abf6b67 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -13,7 +13,9 @@ You set environment variables on the unpublished version of your function by spe 1. Choose a function\. -1. Under **Environment variables**, choose **Edit**\. +1. Choose **Code** if it is not already selected\. + +1. Scroll down\. Under **Environment variables**, choose **Edit**\. 1. Choose **Add environment variable**\. @@ -155,7 +157,9 @@ When you provide the key, only users in your account with access to the key can 1. Choose a function\. -1. Under **Environment variables**, choose **Edit**\. +1. Choose **Code** if it is not already selected\. + +1. Scroll down\. Under **Environment variables**, choose **Edit**\. 1. Expand **Encryption configuration**\. @@ -206,7 +210,9 @@ You can also encrypt environment variable values on the client side before sendi 1. Choose a function\. -1. Under **Environment variables**, choose **Edit**\. +1. Choose **Code** if it is not already selected\. + +1. Scroll down\. Under **Environment variables**, choose **Edit**\. 1. Expand **Encryption configuration**\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 29308b57..930b1cc5 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -13,6 +13,8 @@ If your function is not already connected to a VPC, see [Configuring a Lambda fu 1. Choose a function\. +1. Choose **Configuration** and then choose **File systems**\. + 1. Under **File system**, choose **Add file system**\. 1. Configure the following properties: diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 209a0076..6dd8a5d0 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -5,7 +5,7 @@ You can configure your Lambda function to pull in additional code and content in **Note** Functions defined as container images do not support layers\. When you build a container image, you can package your preferred runtimes and dependencies as a part of the image\. -Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB\. +Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB \(and each code file under `512 KB`\)\. **Note** A function can use up to five layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. @@ -200,53 +200,76 @@ When you delete a layer version, you can no longer configure functions to use it ## Include library dependencies in a layer -You can move runtime dependencies out of your Lambda function code by placing them in a layer\. Lambda runtimes include paths in the `/opt` directory to ensure that your function code has access to libraries that are included in layers\. - -To include libraries in a layer, place them in one of the folders that your runtime supports, or modify that path variable for your language\. -+ **Node\.js** – `nodejs/node_modules`, `nodejs/node8/node_modules` \(`NODE_PATH`\) -**Example AWS X\-Ray SDK for Node\.js** - - ``` - xray-sdk.zip - └ nodejs/node_modules/aws-xray-sdk - ``` -+ **Python** – `python`, `python/lib/python3.8/site-packages` \(site directories\) -**Example Pillow** - - ``` - pillow.zip - │ python/PIL - └ python/Pillow-5.3.0.dist-info - ``` -+ **Ruby** – `ruby/gems/2.5.0` \(`GEM_PATH`\), `ruby/lib` \(`RUBYLIB`\) -**Example JSON** - - ``` - json.zip - └ ruby/gems/2.5.0/ - | build_info - | cache - | doc - | extensions - | gems - | └ json-2.1.0 - └ specifications - └ json-2.1.0.gemspec - ``` -+ **Java** – `java/lib` \(classpath\) -**Example Jackson** - - ``` - jackson.zip - └ java/lib/jackson-core-2.2.3.jar - ``` -+ **All** – `bin` \(`PATH`\), `lib` \(`LD_LIBRARY_PATH`\) -**Example JQ** - - ``` - jq.zip - └ bin/jq - ``` +You can move runtime dependencies out of your Lambda function by placing them in a layer\. Each Lambda runtime includes the paths to specific folders in the `/opt` directory\. Define the same folder structure in your layer \.zip archive to ensure that your function code has access to the libraries in that layer\. + +To include libraries in a layer, place them in one of the folders that your runtime supports, or modify that path variable for your language\. The following table lists the folder paths that each runtime supports\. + + +**Layer paths for each Lambda runtime** +[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) + +The following examples show how you can structure the folders for your layer\. + +------ +#### [ Node\.js ] + +**Example file structure for AWS X\-Ray SDK** + +``` +xray-sdk.zip +└ nodejs/node_modules/aws-xray-sdk +``` + +------ +#### [ Python ] + +**Example file structure for the Pillow library** + +``` +pillow.zip +│ python/PIL +└ python/Pillow-5.3.0.dist-info +``` + +------ +#### [ Ruby ] + +**Example file structure for JSON gem** + +``` +json.zip +└ ruby/gems/2.5.0/ + | build_info + | cache + | doc + | extensions + | gems + | └ json-2.1.0 + └ specifications + └ json-2.1.0.gemspec +``` + +------ +#### [ Java ] + +**Example file structure for Jackson jar file** + +``` +jackson.zip +└ java/lib/jackson-core-2.2.3.jar +``` + +------ +#### [ All ] + +**Example file structure for JQ library** + +``` +jq.zip +└ bin/jq +``` + +------ For more information about path settings in the Lambda execution environment, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. @@ -275,7 +298,7 @@ For more examples, see [Granting layer access to other accounts](access-control- To automate the creation and mapping of layers in your application, use AWS SAM in your AWS CloudFormation templates\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Serverless resources** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** ``` AWSTemplateFormatVersion: '2010-09-09' diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 7b97c72a..2232792f 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -8,6 +8,8 @@ You can tag Lambda functions to organize them by owner, project or department\. 1. Choose a function\. +1. Choose **Configuration** and then choose **Tags**\. + 1. Under **Tags**, choose **Manage tags**\. 1. Enter a key and value\. To add additional tags, choose **Add new tag**\. diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index 75d05619..caabb639 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -14,20 +14,14 @@ You can change the function code and settings only on the unpublished version of 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose the name of the function that you want to publish\. +1. Choose a function and then choose **Versions**\. -1. On the function configuration page, choose **Actions**, **Publish new version**\. +1. On the versions configuration page, choose **Publish new version**\. 1. \(Optional\) Enter a version description\. 1. Choose **Publish**\. -After you publish the first version of a function, the Lambda console displays a dropdown list of the available versions\. The **Designer** panel displays a version qualifier at the end of the function name\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/version-1-created.png) - -To view the current versions of a function, on the function configuration page, choose **Qualifiers**, and then choose the **Versions** tab to see a list of versions for the function\. If you haven't published a new version of the function, the list only displays the `$LATEST` version\. - ## Managing versions with the Lambda API To publish a version of a function, use the [PublishVersion](API_PublishVersion.md) API operation\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index a592160d..30056c02 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -67,6 +67,8 @@ To access private resources, connect your function to private subnets\. If your 1. Choose a function\. +1. Choose **Configuration** and then choose **VPC**\. + 1. Under **VPC**, choose **Edit**\. 1. Choose a VPC, subnets, and security groups\. diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index dbb88487..3e1a65f4 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in C\# -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the C\# runtime using the Lambda console and the AWS CLI\. @@ -155,24 +155,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index eabed738..664397c5 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -15,7 +15,7 @@ AWS provides the following base images for \.NET: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/main/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | +| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/master/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | | core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index e939a3ce..7e7df14d 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -13,9 +13,9 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. + To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** ``` public async Task FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) @@ -109,7 +109,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index 37704f8a..835f8e7c 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -33,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your function code to record metadata and trace downstream calls\. To record detail about calls that your function makes to other resources and services, use the X\-Ray SDK for \.NET\. To get the SDK, add the `AWSXRayRecorder` packages to your project file\. -**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** +**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** ``` @@ -57,7 +59,7 @@ You can instrument your function code to record metadata and trace downstream ca To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initialization code\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** ``` static async void initialize() { @@ -102,7 +104,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -116,7 +118,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 77869296..13a9bc44 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -30,23 +30,21 @@ In this getting started exercise, you create a Node\.js Lambda function using th Lambda creates a Node\.js function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. The Lambda function assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. -### Use the designer +### Use the function overview -The **Designer** shows an overview of your function and its upstream and downstream resources\. You can use it to configure triggers, layers, and destinations\. +The **Function overview** shows a visualization of your function and its upstream and downstream resources\. You can use it to jump to trigger, destination, and layer configuration\. ![\[A Lambda function with an Amazon S3 trigger and an Amazon EventBridge destination.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) -Choose **my\-function** in the designer to return to the function's code and configuration\. For scripting languages, Lambda includes sample code that returns a success response\. You can edit your function code with the embedded [AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/welcome.html) editor as long as your source code doesn't exceed the 3 MB limit\. - ### Invoke the Lambda function Invoke your Lambda function using the sample event data provided in the console\. **To invoke a function** -1. In the upper right corner, choose **Test**\. +1. After selecting your function, choose the **Test** tab\. -1. In the **Configure test event** dialog box, choose **Create new test event**\. In **Event template**, leave the default **Hello World** option\. Enter an **Event name** and note the following sample event template: +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter an **Name** and note the following sample event template: ``` { @@ -56,18 +54,16 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` - You can change keys and values in the sample JSON, but don't change the event structure\. If you do change any keys and values, you must update the sample code accordingly\. - -1. Choose **Create**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. Choose **Create event**, and then choose **Invoke**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. 1. Upon successful completion, view the results in the console\. - + The **Execution result** section \(below the **Test** button\) shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. -1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. +1. Run the function \(choose **Invoke**\) a few more times to gather some metrics that you can view in the next step\. 1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) @@ -281,9 +277,9 @@ Invoke your Lambda function using the sample event data provided in the console\ **To invoke a function** -1. In the upper right corner, choose **Test**\. +1. After selecting your function, choose the **Test** tab\. -1. In the **Configure test event** dialog box, choose **Create new test event**\. In **Event template**, leave the default **Hello World** option\. Enter an **Event name** and note the following sample event template: +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter an **Name** and note the following sample event template: ``` { @@ -293,16 +289,16 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` -1. Choose **Create**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. Choose **Create event**, and then choose **Invoke**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. 1. Upon successful completion, view the results in the console\. - + The **Execution result** section \(below the **Test** button\) shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. -1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. +1. Run the function \(choose **Invoke**\) a few more times to gather some metrics that you can view in the next step\. 1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 4b8e4564..98a70933 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -131,7 +131,7 @@ The steps are the same as described for a `provided.al2` base image, with one ad ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie "$@" + exec /usr/bin/aws-lambda-rie "$@" else exec "$@" fi diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index 719cfd9c..0be634ea 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Go -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Go runtime using the Lambda console and the AWS CLI\. @@ -73,24 +73,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 5acc75f7..6d9032d1 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -2,7 +2,7 @@ The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. -A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/main/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. +A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. ``` package main @@ -90,7 +90,7 @@ And the response would look like this: } ``` -To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/main/events)\. +To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events)\. ### Valid handler signatures diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index a6175f9a..c94ebb5b 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -13,9 +13,9 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. + To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. -**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-go/function/main.go) – Logging** +**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-go/function/main.go) – Logging** ``` func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { @@ -94,7 +94,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index 007e8ea5..3db7529a 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -14,7 +14,7 @@ This page describes how to create a \.zip file as your deployment package for th ## Prerequisites -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) @@ -40,7 +40,7 @@ Lambda provides the following sample applications for the Go runtime: ## Creating a \.zip file on macOS and Linux -The following steps demonstrate how to download the [lambda](https://github.com/aws/aws-lambda-go/tree/main/lambda) library from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. +The following steps demonstrate how to download the [lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) library from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. 1. Download the **lambda** library from GitHub\. @@ -78,7 +78,7 @@ The following steps demonstrate how to download the [lambda](https://github.com/ ## Creating a \.zip file on Windows -The following steps demonstrate how to download the [build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/main/cmd/build-lambda-zip) tool for Windows from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. +The following steps demonstrate how to download the [build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip) tool for Windows from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. **Note** If you have not already done so, you must install [git](https://git-scm.com/) and then add the `git` executable to your Windows `%PATH%` environment variable\. diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index ee119846..0b76e3be 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -84,7 +86,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -98,7 +100,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 990b4999..9765af49 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -109,16 +109,16 @@ You install the runtime interface emulator to your local machine\. When you run ``` mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ - https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ - && chmod +x ~/.aws-lambda-rie/aws-lambda-rie + https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ + && chmod +x ~/.aws-lambda-rie/aws-lambda-rie ``` 1. Run your Lambda function using the `docker run` command\. ``` - docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ + docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ --entrypoint /aws-lambda/aws-lambda-rie myfunction:latest \ - <(optional) image command> + <(optional) image command> ``` This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. diff --git a/doc_source/index.md b/doc_source/index.md index 9e959188..cd0d9deb 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -32,7 +32,6 @@ Amazon's trademarks and trade dress may not be used in + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Managing AWS Lambda functions](lambda-functions.md) + [Configuring functions in the console](configuration-console.md) - + [Configuring functions in the AWS Lambda console (preview)](configuration-preview.md) + [Configuring functions defined as container images](configuration-images.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Managing concurrency for a Lambda function](configuration-concurrency.md) @@ -144,9 +143,9 @@ Amazon's trademarks and trade dress may not be used in + [Using Lambda with Amazon MSK](with-msk.md) + [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) + [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) - + [Using Lambda with Self-managed Apache Kafka](kafka-smaa.md) - + [Managing access and permissions for a Self-managed Apache Kafka cluster](smaa-permissions.md) - + [Adding a Self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + + [Using Lambda with self-managed Apache Kafka](kafka-smaa.md) + + [Managing access and permissions for a self-managed Apache Kafka cluster](smaa-permissions.md) + + [Adding a self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) @@ -162,6 +161,8 @@ Amazon's trademarks and trade dress may not be used in + [Building Lambda functions with Python](lambda-python.md) + [AWS Lambda function handler in Python](python-handler.md) + [Deploy Python Lambda functions with .zip file archives](python-package.md) + + [Tutorial: Creating a Lambda function in Python 3.8](python-package-create.md) + + [Updating a Lambda function in Python 3.8](python-package-update.md) + [Deploy Python Lambda functions with container images](python-image.md) + [AWS Lambda context object in Python](python-context.md) + [AWS Lambda function logging in Python](python-logging.md) @@ -216,6 +217,7 @@ Amazon's trademarks and trade dress may not be used in + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + + [Example workflows using other AWS services](monitoring-servicemap.md) + [Security in AWS Lambda](lambda-security.md) + [Data protection in AWS Lambda](security-dataprotection.md) + [Identity and access management for Lambda](security-iam.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index 8fbb60cd..b1611c5d 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -60,6 +60,8 @@ Use the Lambda console to configure error handling settings on a function, a ver 1. Choose a function\. +1. Choose **Configuration** and then choose **Asynchronous invocation**\. + 1. Under **Asynchronous invocation**, choose **Edit**\. 1. Configure the following settings\. @@ -84,7 +86,7 @@ To send events to a destination, your function needs additional permissions\. Ad + **Lambda** – [lambda:InvokeFunction](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html) + **EventBridge** – [events:PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) -Add destinations to your function in the Lambda console's function designer\. +Add destinations to your function in the Lambda console's function visualization\. **To configure a destination for asynchronous invocation records** @@ -92,7 +94,7 @@ Add destinations to your function in the Lambda console's function designer\. 1. Choose a function\. -1. Under **Designer**, choose **Add destination**\. +1. Under **Function overview**, choose **Add destination**\. 1. For **Source**, choose **Asynchronous invocation**\. @@ -221,6 +223,8 @@ After creating the target and updating your function's execution role, add the d 1. Choose a function\. +1. Choose **Configuration** and then choose **Asynchronous invocation**\. + 1. Under **Asynchronous invocation**, choose **Edit**\. 1. Set **DLQ resource** to **Amazon SQS** or **Amazon SNS**\. diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index b66cc774..285b7ef7 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -7,7 +7,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [Self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md index 849c5b15..08a3ff0d 100644 --- a/doc_source/invocation-sync.md +++ b/doc_source/invocation-sync.md @@ -39,7 +39,7 @@ An error occurred (InvalidRequestContentException) when calling the Invoke opera at [Source: (byte[])"value"; line: 1, column: 11] ``` -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/java-context.md b/doc_source/java-context.md index bf682e40..99a60a3e 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -17,13 +17,13 @@ When Lambda runs your function, it passes a context object to the [handler](java The following example shows a function that uses the context object to access the Lambda logger\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.Handler @@ -64,17 +64,17 @@ END RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 REPORT RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Duration: 198.50 ms Billed Duration: 200 ms Memory Size: 512 MB Max Memory Used: 90 MB Init Duration: 524.75 ms ``` -The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/main/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. +The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. -**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/test/java/example/TestContext.java)** +**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/test/java/example/TestContext.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); -import [com\.amazonaws\.services\.lambda\.runtime\.CognitoIdentity](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java); -import [com\.amazonaws\.services\.lambda\.runtime\.ClientContext](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/ClientContext.java); -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); +import [com\.amazonaws\.services\.lambda\.runtime\.CognitoIdentity](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java); +import [com\.amazonaws\.services\.lambda\.runtime\.ClientContext](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/ClientContext.java); +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) public class TestContext implements Context{ public TestContext() {} diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 270b0470..fb8fb869 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Java -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Java runtime using the Lambda console and the AWS CLI\. @@ -68,9 +68,9 @@ For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md# You can create a Lambda function that displays human\-readable error messages to users\. **Note** -To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. +To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. -**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** +**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** ``` import java.util.List; @@ -111,7 +111,7 @@ When the function throws `InputLengthException`, the Java runtime serializes it } ``` -In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. +In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. The return statement in the previous example can also throw a runtime exception\. @@ -135,24 +135,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 5bc8a0b4..842f9360 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -4,13 +4,13 @@ The AWS Lambda function handler is the method in your function code that process In the following example, a class named `Handler` defines a handler method named `handleRequest`\. The handler method takes an event and context object as input and returns a string\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.Handler @@ -42,7 +42,7 @@ You can add [initialization code](gettingstarted-features.md#gettingstarted-feat In the following example, the logger, serializer, and AWS SDK client are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** ``` // Handler value: example.Handler @@ -75,7 +75,7 @@ The GitHub repo for this guide provides easy\-to\-deploy sample applications tha You specify the type of object that the event maps to in the handler method's signature\. In the preceding example, the Java runtime deserializes the event into a type that implements the `Map` interface\. String\-to\-string maps work for flat events like the following: -**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/event.json) – Weather data** +**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/event.json) – Weather data** ``` { @@ -104,15 +104,15 @@ The output type can be an object or `void`\. The runtime serializes return value ## Handler interfaces -The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/main/aws-lambda-java-core) library defines two interfaces for handler methods\. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time\. +The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library defines two interfaces for handler methods\. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time\. **** -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) ++ [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) ++ [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) The `RequestHandler` interface is a generic type that takes two parameters: the input type and the output type\. Both types must be objects\. When you use this interface, the Java runtime deserializes the event into an object with the input type, and serializes the output into text\. Use this interface when the built\-in serialization works with your input and output types\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** ``` // Handler value: example.Handler @@ -125,12 +125,12 @@ To use your own serialization, implement the `RequestStreamHandler` interface\. The following example uses buffered reader and writer types to work with the input and output streams\. It uses the [Gson](https://github.com/google/gson) library for serialization and deserialization\. -**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** +**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** ``` -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.HandlerStream public class HandlerStream implements RequestStreamHandler { @@ -177,11 +177,11 @@ The GitHub repository for this guide includes sample applications that demonstra + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: -+ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. -+ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. -+ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. -+ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. -+ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. -+ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. ++ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. ++ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. ++ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. ++ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. ++ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. ++ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. To test different handler types, just change the handler value in the AWS SAM template\. For detailed instructions, see the sample application's readme file\. \ No newline at end of file diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 8babf997..b7ee6126 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -108,7 +108,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) @@ -222,7 +222,7 @@ To customize log output, support logging during unit tests, and log AWS SDK call To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. -**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** +**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** ``` @@ -269,7 +269,7 @@ SLF4J is a facade library for logging in Java code\. In your function code, you In the following example, the handler class uses SLF4J to retrieve a logger\. -**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** +**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** ``` import org.slf4j.Logger; @@ -295,7 +295,7 @@ public class Handler implements RequestHandler{ The build configuration takes runtime dependencies on the Lambda appender and SLF4J adapter, and implementation dependencies on Log4J 2\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/build.gradle) – Logging dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Logging dependencies** ``` dependencies { diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 2eb8094b..8467b2e1 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -7,14 +7,10 @@ This page describes how to create your deployment package as a \.zip file or Jar **Topics** + [Prerequisites](#java-package-prereqs) + [Tools and libraries](#java-package-libraries) -+ [Building a deployment package with Gradle](#java-package-gradle) -+ [Building a deployment package with Maven](#java-package-maven) -+ [Uploading a deployment package with the Lambda API](#java-package-cli) -+ [Uploading a deployment package with AWS SAM](#java-package-cloudformation) ## Prerequisites -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) @@ -68,7 +64,27 @@ To create a deployment package, compile your function code and dependencies into **Note** To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [Lambda layers](configuration-layers.md)\. -## Building a deployment package with Gradle +You can upload your deployment package by using the Lambda console, the Lambda API, or AWS Serverless Application Model \(AWS SAM\)\. + +**To upload a deployment package with the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Under **Code source**, choose **Upload from**\. + +1. Upload the deployment package\. + +1. Choose **Save**\. + +**Topics** ++ [Building a deployment package with Gradle](#java-package-gradle) ++ [Building a deployment package with Maven](#java-package-maven) ++ [Uploading a deployment package with the Lambda API](#java-package-cli) ++ [Uploading a deployment package with AWS SAM](#java-package-cloudformation) + +### Building a deployment package with Gradle To create a deployment package with your function's code and dependencies, use the `Zip` build type\. @@ -114,7 +130,7 @@ unzip path/to/my/function.zip -d expanded find ./expanded/lib -name '*.jar' | xargs -n1 zipinfo -1 | grep '.*.class' | sort | uniq -c | sort ``` -## Building a deployment package with Maven +### Building a deployment package with Maven To build a deployment package with Maven, use the [Maven Shade plugin](https://maven.apache.org/plugins/maven-shade-plugin/)\. The plugin creates a JAR file that contains the compiled function code and all of its dependencies\. @@ -203,7 +219,7 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf ``` -## Uploading a deployment package with the Lambda API +### Uploading a deployment package with the Lambda API To update a function's code with the AWS Command Line Interface \(AWS CLI\) or AWS SDK, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. For the AWS CLI, use the `update-function-code` command\. The following command uploads a deployment package named `my-function.zip` in the current directory: @@ -268,7 +284,7 @@ You should see the following output: You can use this method to upload function packages up to 250 MB \(decompressed\)\. -## Uploading a deployment package with AWS SAM +### Uploading a deployment package with AWS SAM You can use AWS SAM to automate deployments of your function code, configuration, and dependencies\. AWS SAM is an extension of AWS CloudFormation that provides a simplified syntax for defining serverless applications\. The following example template defines a function with a deployment package in the `build/distributions` directory that Gradle uses: diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 3dc7ed56..4aa16cb4 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -15,7 +15,7 @@ Use the `blank-java` sample app to learn the basics, or as a starting point for The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. -**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** +**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** ``` // Handler value: example.HandlerStream @@ -38,7 +38,7 @@ public class HandlerStream implements RequestStreamHandler { The `java-events` and `java-events-v1sdk` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. For event types like `DynamodbEvent` that require types from the AWS SDK for Java, `java-events-v1sdk` includes the SDK in its build configuration\. -**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** +**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** ``` import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index dd48f6e2..2d3ec9e1 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -33,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio To record detail about calls that your function makes to other resources and services, add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that enable automatic instrumentation of AWS SDK for Java 2\.x clients\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/build.gradle) – Tracing dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Tracing dependencies** ``` dependencies { @@ -85,7 +87,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -99,7 +101,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -116,7 +118,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/kafka-hosting.md b/doc_source/kafka-hosting.md index fe678e3a..096de4b5 100644 --- a/doc_source/kafka-hosting.md +++ b/doc_source/kafka-hosting.md @@ -10,7 +10,7 @@ To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud pro When you create a Kafka cluster using a non\-AWS provider, you receive the connection information for your cluster\. This information includes the Kafka cluster hostname, topic name, Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) user name and password, and bootstrap server host\-port pairs\. -For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md)\. +For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. ## Using Amazon MSK @@ -26,4 +26,4 @@ For more information about using an MSK cluster, see [Using Lambda with Amazon M You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. -For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file +For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file diff --git a/doc_source/kafka-smaa.md b/doc_source/kafka-smaa.md index 11235148..df8fc0ed 100644 --- a/doc_source/kafka-smaa.md +++ b/doc_source/kafka-smaa.md @@ -1,9 +1,9 @@ -# Using Lambda with Self\-managed Apache Kafka +# Using Lambda with self\-managed Apache Kafka You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. This section describes how to use a function with a self\-managed Kafka cluster to process records in an Kafka topic\. **Topics** -+ [Managing access and permissions for a Self\-managed Apache Kafka cluster](smaa-permissions.md) -+ [Adding a Self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file ++ [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md) ++ [Adding a self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file diff --git a/doc_source/kafka-using-cluster.md b/doc_source/kafka-using-cluster.md index 6a02ca8c..62af0c15 100644 --- a/doc_source/kafka-using-cluster.md +++ b/doc_source/kafka-using-cluster.md @@ -17,7 +17,7 @@ When you add your Apache Kafka cluster as a trigger for your Lambda function, th + Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. + Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. -For Amazon MSK and Self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. +For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. ## Event source API operations diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 2213e8af..761f9e58 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -8,7 +8,7 @@ A Lambda function's execution role is an AWS Identity and Access Management \(IA 1. Choose a function\. -1. Choose **Permissions**\. +1. Choose **Configuration** and then choose **Permissions**\. 1. Under **Resource summary**, view the services and resources that the function can access\. The following example shows the CloudWatch Logs permissions that Lambda adds to an execution role when you create it in the Lambda console\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/permissions-executionrole.png) @@ -132,7 +132,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [Self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) -In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/iam-policies)\. \ No newline at end of file +In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-kafka.md b/doc_source/lambda-kafka.md index fbeb3491..0cb6ab64 100644 --- a/doc_source/lambda-kafka.md +++ b/doc_source/lambda-kafka.md @@ -10,4 +10,4 @@ This section describes how to use an AWS or non\-AWS hosted Kafka cluster with L + [Hosting an Apache Kafka cluster](kafka-hosting.md) + [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) + [Using Lambda with Amazon MSK](with-msk.md) -+ [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file ++ [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index c25149b1..a1ebc99f 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -8,4 +8,5 @@ You can use other AWS services to troubleshoot your Lambda functions\. This sect + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) -+ [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) \ No newline at end of file ++ [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) ++ [Example workflows using other AWS services](monitoring-servicemap.md) \ No newline at end of file diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index a9f5e883..9c890a25 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [New Lambda console experience](#lambda-releases) | The Lambda console has been redesigned to improve performance and consistency\. | March 2, 2021 | | [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | | [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | | [ Code signing for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss) | Lambda now supports code signing\. Administrators can configure Lambda functions to accept only signed code on deployment\. Lambda checks the signatures to ensure that the code is not altered or tampered\. Additionally, Lambda ensures that the code is signed by trusted developers before accepting the deployment\. For details, see [Configuring code signing for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss)\. | November 23, 2020 | diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index d8cfce11..960d08e1 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -53,7 +53,7 @@ For services that generate a queue or data stream, you create an [event source m + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [Self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index 69a62cef..377dc64e 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -23,7 +23,7 @@ The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for t ## Pricing -For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see�[Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. +For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. ## Supported runtimes @@ -42,7 +42,7 @@ You can use Lambda Insights with any of the following [Lambda function runtimes] ## Enabling Lambda Insights in the Lambda console -You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. **To enable Lambda Insights in the Lambda console** @@ -60,7 +60,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu ## Enabling Lambda Insights programmatically -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index 97d9062c..a685336f 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -56,7 +56,7 @@ Performance metrics provide performance details about a single invocation\. For **Performance metrics** + `Duration` – The amount of time that your function code spends processing an event\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. -+ `PostRuntimeExecutionDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. ++ `PostRuntimeExtensionsDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. + `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when the stream receives the record and when the event source mapping sends the event to the function\. `Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the P95 statistic shows the maximum duration of 95 percent of executions, excluding the slowest 5 percent\. diff --git a/doc_source/monitoring-servicemap.md b/doc_source/monitoring-servicemap.md new file mode 100644 index 00000000..d377f99b --- /dev/null +++ b/doc_source/monitoring-servicemap.md @@ -0,0 +1,80 @@ +# Example workflows using other AWS services + +AWS Lambda integrates with other AWS services to help you monitor, trace, debug, and troubleshoot your Lambda functions\. This page shows workflows you can use for AWS X\-Ray and CloudWatch ServiceLens to trace and troubleshoot your Lambda functions\. + +**Topics** ++ [Prerequisites](#monitoring-troubleshooting-prereqs) ++ [Pricing](#monitoring-troubleshooting-pricing) ++ [Example AWS X\-Ray workflow to view a service map](#monitoring-servicemap-example) ++ [Example AWS X\-Ray workflow to view trace details](#monitoring-tracing-example) ++ [What's next?](#monitoring-troubleshooting-next-up) + +## Prerequisites + +### Using AWS X\-Ray + +AWS X\-Ray needs to be enabled on the Lambda console to complete the AWS X\-Ray workflows on this page\. If your execution role does not have the required permissions, the Lambda console will attempt to add them to your execution role\. + +**To enable AWS X\-Ray on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose your function\. + +1. Choose the **Configuration** tab\. + +1. On the **Monitoring tools** pane, choose **Edit**\. + +1. Under **AWS X\-Ray**, turn on **Active tracing**\. + +1. Choose **Save**\. + +## Pricing ++ With AWS X\-Ray you pay only for what you use, based on the number of traces recorded, retrieved, and scanned\. For more information, see [AWS X\-Ray Pricing](http://aws.amazon.com/xray/pricing/)\. + +## Example AWS X\-Ray workflow to view a service map + +If you've enabled AWS X\-Ray, you can view a ServiceLens service map on the CloudWatch console\. A service map displays your service endpoints and resources as nodes and highlights the traffic, latency, and errors for each node and its connections\. + +You can choose a node to see detailed insights about the correlated metrics, logs, and traces associated with that part of the service\. This enables you to investigate problems and their effect on an application\. + +**To view service map and traces using the CloudWatch console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Monitoring**\. + +1. Choose **View traces in X\-Ray**\. + +1. Choose **Service map**\. + +1. Choose from the predefined time ranges, or choose a custom time range\. + +1. To troubleshoot requests, choose a filter\. + +## Example AWS X\-Ray workflow to view trace details + +If you've enabled AWS X\-Ray, you can use the single\-function view on the CloudWatch Lambda Insights dashboard to show the distributed trace data of a function invocation error\. For example, if the application logs message shows an error, you can open the ServiceLens traces view to see the distributed trace data and the other services handling the transaction\. + +**To view trace details of a function** + +1. Open the [single\-function view](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions) in the CloudWatch console\. + +1. Choose the **Application logs** tab\. + +1. Use the **Timestamp** or **Message** to identify the invocation request that you want to troubleshoot\. + +1. To show the **Most recent 1000 invocations**, choose the **Invocations** tab\. +![\[Sorting the most recent 1000 invocations by request ID.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambainsights-invocations-request-id.png) + +1. Choose the **Request ID** column to sort entries in ascending alphabetical order\. + +1. In the **Trace** column, choose **View**\. + + The **Trace details** page opens in the ServiceLens traces view\. +![\[Function trace details in the ServiceLens traces view.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-trace-details.png) + +## What's next? ++ Learn more about how to integrate traces, metrics, logs, and alarms in [Using ServiceLens to Monitor the Health of Your Applications](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ServiceLens.html)\. \ No newline at end of file diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 4dbaf14d..0955df5f 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Node\.js -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Node\.js runtime using the Lambda console and the AWS CLI\. @@ -68,24 +68,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index 24c8bd92..b792b973 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -13,7 +13,7 @@ exports.handler = async function(event, context) { } ``` -When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. +When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the exported handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. The runtime passes three arguments to the handler method\. The first argument is the `event` object, which contains information from the invoker\. The invoker passes this information as a JSON\-formatted string when it calls [Invoke](API_Invoke.md), and the runtime converts it to an object\. When an AWS service invokes your function, the event structure [varies by service](lambda-services.md)\. diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 5f73c122..6f0b9f5f 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -13,7 +13,7 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on the [console object](https://developer.mozilla.org/en-US/docs/Web/API/Console), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. + To output logs from your function code, you can use methods on the [console object](https://developer.mozilla.org/en-US/docs/Web/API/Console), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example index\.js file – Logging** @@ -87,7 +87,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index f349ad9d..aaf33bdc 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -2,12 +2,12 @@ Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. -+ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. -+ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. -+ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. +To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. -This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. +This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. **Topics** + [Prerequisites](#node-package-prereqs) @@ -16,7 +16,7 @@ This page describes how to create a \.zip file as your deployment package, and t ## Prerequisites -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) @@ -59,7 +59,7 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U ## Updating a function with additional dependencies -If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. +If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. If any of the libraries use native code, [use an Amazon Linux environment](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) to create the deployment package\. You can add the SDK for JavaScript to the deployment package if you need a newer version than the one [included on the runtime](lambda-nodejs.md), or to ensure that the version doesn't change in the future\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 44827ac0..0132ea20 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -46,7 +48,7 @@ AWSXRay.setContextMissingStrategy(() => {}); You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. -**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/package.json)** +**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/package.json)** ``` { @@ -68,7 +70,7 @@ You can instrument your handler code to record metadata and trace downstream cal To instrument AWS SDK clients, wrap the `aws-sdk` library with the `captureAWS` method\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -119,7 +121,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -133,7 +135,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -150,7 +152,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index 9b9c131d..bddd1d85 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in PowerShell -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Powershell runtime using the Lambda console and the AWS CLI\. @@ -92,24 +92,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 4c265319..e0c81187 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -13,9 +13,9 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. + To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. -**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-powershell/function/Handler.ps1) – Logging** +**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-powershell/function/Handler.ps1) – Logging** ``` #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} @@ -97,7 +97,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index a4f8a519..83ee2cd5 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Python -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Python runtime using the Lambda console and the AWS CLI\. @@ -44,24 +44,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index d4e4c1d3..4a022c55 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -10,7 +10,7 @@ def handler_name(event, context): return some_value ``` -## Naming +## Naming The Lambda function *handler* name specified at the time you create a Lambda function is derived from the following: + the name of the file in which the Lambda handler function is located @@ -108,7 +108,7 @@ The function in this example depends on a successful response \(in `200`\) from ### Returning a calculation -The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. +The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 3211a16b..1d3fe7cb 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -14,7 +14,7 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use the [`print` method](https://docs.python.org/3/library/functions.html#print), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. + To output logs from your function code, you can use the [`print` method](https://docs.python.org/3/library/functions.html#print), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example lambda\_function\.py** @@ -76,7 +76,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md new file mode 100644 index 00000000..46e2f92d --- /dev/null +++ b/doc_source/python-package-create.md @@ -0,0 +1,452 @@ +# Tutorial: Creating a Lambda function in Python 3\.8 + +This tutorial guides you through building the code and assets to create a Lambda function in Python 3\.8 using the AWS Command Line Interface \(AWS CLI\)\. + +**Topics** ++ [Prerequisites](#python-package-create-prereqs) ++ [Creating a function without runtime dependencies](#python-package-create-no-dependency) ++ [Creating a function with runtime dependencies](#python-package-create-with-dependency) + +## Prerequisites + +This section describes the tools and resources required to complete the steps in the tutorial\. + +### Install the AWS CLI + +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +### Create an execution role + +Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AWS Identity and Access Management \(IAM\) role that grants your function permission to access AWS services and resources\. Create an execution role in IAM with [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html) permission\. + +**To create the execution role** + +1. Open a command prompt and use the [create\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/create-role.html) command to create an execution role named `lambda-ex`\. + +------ +#### [ macOS/Linux ] + + ``` + aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' + ``` + +------ +#### [ Windows ] + + ``` + aws iam create-role --role-name lambda-ex --assume-role-policy-document "{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}" + ``` + +------ + + This command produces the following output\. Save the value returned in `Arn`\. + + ``` + { + "Role": { + "Path": "/", + "RoleName": "lambda-ex", + "RoleId": "AROAWNZPPVHULXRJXQJD5", + "Arn": "arn:aws:iam::your-account-id:role/lambda-ex", + "CreateDate": "2021-01-05T18:00:30Z", + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + } + } + } + ``` + +1. Use the [attach\-role\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/attach-role-policy.html) command to add `AWSLambdaBasicExecutionRole` permissions to the role\. + + ``` + $ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole + ``` + + This command produces no output\. + +## Creating a function without runtime dependencies + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + + For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) + +This section describes how to create a Lambda function without runtime dependencies\. + +### Overview + +In this tutorial, you use the [sample code from the AWS SDK for Python \(Boto3\) project on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) to create a Lambda function using the AWS CLI\. You'll learn how to: ++ Set up the directory structure of a deployment package \(\.zip file\)\. ++ Create a deployment package for a Lambda function without any runtime dependencies\. ++ Use the AWS CLI to upload the deployment package and create the Lambda function\. ++ Invoke the Lambda function to return a mathematical calculation\. + +The sample code contains standard math and logging Python libraries, which are used to return a calculation based on user input\. Standard Python libraries are included with the `python3.8` [runtime](lambda-runtimes.md)\. Although the function's code doesn't depend on any other Python libraries and has no additional application dependencies, Lambda still requires a deployment package to create a function\. + +### Create the deployment package + +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. + +Create the \.zip file that Lambda uses as your deployment package\. + +**To create the deployment package** + +1. Open a command prompt and create a `my-math-function` project directory\. For example, on macOS: + + ``` + mkdir my-math-function + ``` + +1. Navigate to the `my-math-function` project directory\. + + ``` + cd my-math-function + ``` + +1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: + + ``` + my-math-function$ + | lambda_function.py + ``` + +1. Add the `lambda_function.py` file to the root of the \.zip file\. + + ``` + zip my-deployment-package.zip lambda_function.py + ``` + + This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: + + ``` + adding: lambda_function.py (deflated 50%) + ``` + +### Create the Lambda function + +Lambda needs to know the [runtime](lambda-runtimes.md) environment to use for your function's code, the [handler](python-handler.md) in your function code, and the [execution role](lambda-intro-execution-role.md) that it can use to invoke your function\. + +Create the Lambda function using the execution role and deployment package that you created in the previous steps\. + +**To create the function** + +1. Navigate to the `my-math-function` project directory\. + + ``` + cd my-math-function + ``` + +1. Create a function named `my-math-function`\. Substitute the value for `role` with the `Arn` you copied in previous steps\. + + ``` + aws lambda create-function --function-name my-math-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.lambda_handler --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex + ``` + + This command produces the following output: + + ``` + { + "FunctionName": "my-math-function", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-math-function", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-ex", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 753, + "Description": "", + "Timeout": 3, + "MemorySize": 128, + "LastModified": "2021-01-05T18:39:44.847+0000", + "CodeSha256": "82RtIE7p1ET5Od6bk4xSleJbUybUnZX52m92x/fEH84=", + "Version": "$LATEST", + "TracingConfig": { + "Mode": "PassThrough" + }, + "RevisionId": "589e5115-f3c0-446c-bc62-4e05cf0a3c85", + "State": "Active", + "LastUpdateStatus": "Successful" + } + ``` + + The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. + +### Invoke the Lambda function + +Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. + +**To invoke the function** ++ Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. + +------ +#### [ macOS/Linux ] + + ``` + aws lambda invoke --function-name my-math-function --payload '{"action": "square","number": 3}' output.txt + ``` + +------ +#### [ Windows ] + + ``` + aws lambda invoke --function-name my-math-function --cli-binary-format raw-in-base64-out --payload "{"action": "square","number": 3}" output.txt + ``` + +------ + + This command produces the following output: + + ``` + { + "StatusCode": 200, + "ExecutedVersion": "$LATEST" + } + ``` + + For the `RequestResponse` invocation type, the status code is `200`\. For more information, see the [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax) API reference\. + + You should see the following mathematical calculation in `output.txt`: + + ``` + {"result": 9} + ``` + +### What's next? ++ Learn how to update your Lambda function, see [Updating a Lambda function in Python 3\.8](python-package-update.md)\. ++ Learn how to show logging events for your Lambda function, see [AWS Lambda function logging in Python](python-logging.md)\. ++ Explore other [AWS SDK examples in Python on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/python/example_code/lambda)\. + +### Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** ++ Use the [delete\-function](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-function.html) command\. + + ``` + aws lambda delete-function --function-name my-function + ``` + + This command produces no output\. + +**To delete the execution role policy** ++ Use the [delete\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-policy.html) command\. + + ``` + aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole + ``` + +**To delete the execution role** ++ Use the [delete\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-role.html) command\. + + ``` + aws iam delete-role --role-name lambda-ex + ``` + +## Creating a function with runtime dependencies + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + +For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) + +This section describes how to create a Lambda function with runtime dependencies\. + +### Overview + +In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://docs\.aws\.amazon\.com/](https://docs.aws.amazon.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. + +You'll learn how to: ++ Set up the directory structure of a deployment package \(\.zip file\)\. ++ Create a deployment package for a Lambda function with runtime dependencies\. ++ Use the AWS CLI to upload the deployment package and create the Lambda function\. ++ Invoke the Lambda function to return the source code\. + +### Create the deployment package + +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. + +Create the \.zip file that Lambda uses as your deployment package\. + +**To create the deployment package** + +1. Open a command prompt and create a `my-sourcecode-function` project directory\. For example, on macOS: + + ``` + mkdir my-sourcecode-function + ``` + +1. Navigate to the `my-sourcecode-function` project directory\. + + ``` + cd my-sourcecode-function + ``` + +1. Copy the contents of the following sample Python code and save it in a new file named `lambda_function.py`: + + ``` + import requests + def main(event, context): + response = requests.get("https://docs.aws.amazon.com") + print(response.text) + return response.text + if __name__ == "__main__": + main('', '') + ``` + + Your directory structure should look like this: + + ``` + my-sourcecode-function$ + | lambda_function.py + ``` + +1. Install the requests library to a new `package` directory\. + + ``` + pip install --target ./package requests + ``` + +1. Create a deployment package with the installed library at the root\. + + ``` + cd package + zip -r ../my-deployment-package.zip . + ``` + + This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: + + ``` + adding: chardet/ (stored 0%) + adding: chardet/enums.py (deflated 58%) + ... + ``` + +1. Add the `lambda_function.py` file to the root of the zip file\. + + ``` + cd .. + zip -g my-deployment-package.zip lambda_function.py + ``` + +### Create the Lambda function + +Lambda needs to know the [runtime](lambda-runtimes.md) environment to use for your function's code, the [handler](python-handler.md) in your function code, and the [execution role](lambda-intro-execution-role.md) that it can use to invoke your function\. + +Create the Lambda function using the execution role and deployment package that you created in the previous steps\. + +**To create the function** + +1. Navigate to the `my-sourcecode-function` project directory\. + + ``` + cd my-sourcecode-function + ``` + +1. Create a function named `my-sourcecode-function`\. Substitute the value for `role` with the `Arn` you copied in previous steps\. + + ``` + aws lambda create-function --function-name my-sourcecode-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.main --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex + ``` + + This command produces the following output: + + ``` + { + "FunctionName": "my-sourcecode-function", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-sourcecode-function", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-ex", + "Handler": "lambda_function.main", + "CodeSize": 753, + "Description": "", + "Timeout": 3, + "MemorySize": 128, + "LastModified": "2021-01-11T18:39:44.847+0000", + "CodeSha256": "82RtIE7p1ET5Od6bk4xSleJbUybUnZX52m92x/fEH84=", + "Version": "$LATEST", + "TracingConfig": { + "Mode": "PassThrough" + }, + "RevisionId": "589e5115-f3c0-446c-bc62-4e05cf0a3c85", + "State": "Active", + "LastUpdateStatus": "Successful" + } + ``` + + The Lambda function in this step uses a function handler of `lambda_function.main`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. + +### Invoke the Lambda function + +Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. + +**To invoke the function** ++ Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. + +------ +#### [ macOS/Linux ] + + ``` + aws lambda invoke --function-name requests-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + ``` + +------ +#### [ Windows ] + + ``` + aws lambda invoke --function-name requests-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + ``` + +------ + + This command produces the following output: + + ``` + { + "StatusCode": 200, + "ExecutedVersion": "$LATEST" + } + ``` + + For the `RequestResponse` invocation type, the status code is `200`\. For more information, see the [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax) API reference\. + + You should see the source code in `output.txt`\. + +### What's next? ++ Learn how to update your Lambda function, see [Updating a Lambda function in Python 3\.8](python-package-update.md)\. ++ Learn how to show logging events for your Lambda function, see [AWS Lambda function logging in Python](python-logging.md)\. ++ Explore other [AWS SDK examples in Python on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/python/example_code/lambda)\. + +### Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** ++ Use the [delete\-function](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-function.html) command\. + + ``` + aws lambda delete-function --function-name my-function + ``` + + This command produces no output\. + +**To delete the execution role policy** ++ Use the [delete\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-policy.html) command\. + + ``` + aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole + ``` + +**To delete the execution role** ++ Use the [delete\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-role.html) command\. + + ``` + aws iam delete-role --role-name lambda-ex + ``` \ No newline at end of file diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md new file mode 100644 index 00000000..3c734766 --- /dev/null +++ b/doc_source/python-package-update.md @@ -0,0 +1,216 @@ +# Updating a Lambda function in Python 3\.8 + +This tutorial guides you through the process of installing a Python library, creating a deployment package, and updating a Lambda function in Python 3\.8 using the AWS Command Line Interface \(AWS CLI\)\. + +The following steps assume that you have created a Lambda function and are updating the \.zip file used as your deployment package\. If you haven't created a function yet, see [Tutorial: Creating a Lambda function in Python 3\.8](python-package-create.md)\. + +**Topics** ++ [Prerequisites](#python-package-update-prereqs) ++ [Updating a function without runtime dependencies](#python-package-update-codeonly) ++ [Updating a function with runtime dependencies](#python-package-update-dependencies) ++ [Using a virtual environment](#python-package-update-venv) + +## Prerequisites + +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +## Updating a function without runtime dependencies + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + +For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. + +The following steps show how to create a deployment package that contains only your function code, and upload it to Lambda using the AWS CLI\. + +**To update a Python function without runtime dependencies** + +1. Add function code files to the root of your deployment package\. + + ``` + ~/my-function$ zip my-deployment-package.zip lambda_function.py + ``` + +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + { + "FunctionName": "mylambdafunction", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 815, + "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", + "Version": "$LATEST", + "RevisionId": "d1e983e3-ca8e-434b-8dc1-7add83d72ebd", + ... + } + ``` + +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. + +## Updating a function with runtime dependencies + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + +For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. + + The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. + +**Note** +If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. + +**To update a Python function with dependencies** + +1. Install libraries in a `package` directory with `pip`'s `--target` option\. + + ``` + ~/my-function$ pip install --target ./package requests + ``` +**Note** +To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) such as Ubuntu, you may need to pass the `--system` option\. + +1. Navigate to the `package` directory\. + + ``` + cd package + ``` + +1. Create a deployment package with the installed libraries at the root\. + + ``` + ~/my-function$ zip -r ../my-deployment-package.zip . + ``` + + The last command saves the deployment package to the root of the `my-function` directory\. + +1. Navigate back to the `my-function` directory\. + + ``` + cd .. + ``` + +1. Add function code files to the root of your deployment package\. + + ``` + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` + + After you complete this step, you should have the following directory structure: + + ``` + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... + ``` + +1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + { + "FunctionName": "mylambdafunction", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 2269409, + "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", + "Version": "$LATEST", + "RevisionId": "a9c05ffd-8ad6-4d22-b6cd-d34a00c1702c", + ... + } + ``` + +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. + +## Using a virtual environment + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + + For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. + + The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. + +**Note** +If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. + +**To update a Python function with a virtual environment** + +1. Activate the virtual environment\. For example: + + ``` + ~/my-function$ source myvenv/bin/activate + ``` + +1. Install libraries with pip\. + + ``` + (myvenv) ~/my-function$ pip install requests + ``` + +1. Deactivate the virtual environment\. + + ``` + (myvenv) ~/my-function$ deactivate + ``` + +1. Create a deployment package with the installed libraries at the root\. + + ``` + ~/my-function$ cd myvenv/lib/python3.8/site-packages + ~/my-function/myvenv/lib/python3.8/site-packages$ cd myvenv/lib/python3.8/site-packages + zip -r ../../../../my-deployment-package.zip . + ``` + + The last command saves the deployment package to the root of the `my-function` directory\. +**Tip** +A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. + +1. Add function code files to the root of your deployment package\. + + ``` + ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` + + After you complete this step, you should have the following directory structure: + + ``` + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... + ``` + +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + { + "FunctionName": "mylambdafunction", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 5912988, + "CodeSha256": "A2P0NUWq1J+LtSbkuP8tm9uNYqs1TAa3M76ptmZCw5g=", + "Version": "$LATEST", + "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", + ... + } + ``` + +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index ceeba98a..b46c5ede 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -2,239 +2,33 @@ Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. -+ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. -+ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. -+ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. +To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. -This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. +This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. **Topics** + [Prerequisites](#python-package-prereqs) -+ [Updating a function with no dependencies](#python-package-codeonly) -+ [Updating a function with additional dependencies](#python-package-dependencies) -+ [Using a virtual environment](#python-package-venv) ++ [What is a runtime dependency?](#python-package-dependencies) ++ [Tutorial: Creating a Lambda function in Python 3\.8](python-package-create.md) ++ [Updating a Lambda function in Python 3\.8](python-package-update.md) ## Prerequisites -The following steps assume that you have created a Lambda function, and are updating the deployment package for your function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. - -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -## Updating a function with no dependencies - -The following steps show how to create a deployment package that contains only your function code, and upload it to Lambda using the AWS CLI\. - -**To update a Python function with no dependencies** - -1. Add function code files to the root of your deployment package\. - - ``` - zip my-deployment-package.zip lambda_function.py - ``` - -1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - ``` - - You should see the following output: - - ``` - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 815, - "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", - "Version": "$LATEST", - "RevisionId": "d1e983e3-ca8e-434b-8dc1-7add83d72ebd", - ... - } - ``` - -The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. - -## Updating a function with additional dependencies - -If your Lambda function depends on libraries other than the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), install the libraries to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package \(\.zip file\)\. - -**Note** -Make sure that the files and directories in the deployment package have their permissions set to be globally readable, so that Lambda can import your Python modules at runtime\. - - The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. - -**Note** -If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. - -**To update a Python function with dependencies** - -1. Install libraries in a `package` directory with `pip`'s `--target` option\. - - ``` - pip install --target ./package requests - ``` -**Note** -To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) such as Ubuntu, you may need to pass the `--system` option\. - -1. Navigate to the `package` directory\. - - ``` - cd package - ``` - -1. Create a deployment package with the installed libraries at the root\. - - ``` - zip -r ../my-deployment-package.zip . - ``` - - The last command saves the deployment package to the root of the `my-function` directory\. - -1. Navigate back to the `my-function` directory\. - - ``` - cd.. - ``` - -1. Add function code files to the root of your deployment package\. - - ``` - zip -g my-deployment-package.zip lambda_function.py - ``` - - After you complete this step, you should have the following directory structure: - - ``` - my-deployment-package.zip$ - │ lambda_function.py - │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ - ... - ``` - -1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - ``` - - You should see the following output: - - ``` - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 2269409, - "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", - "Version": "$LATEST", - "RevisionId": "a9c05ffd-8ad6-4d22-b6cd-d34a00c1702c", - ... - } - ``` - -The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. - -## Using a virtual environment - -If your Lambda function depends on libraries other than the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), install the libraries to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package \(\.zip file\)\. - - The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are using the [virtualenv](https://docs.python.org/3/library/venv.html) module for a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. - -**Note** -If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. - -**To update a Python function with a virtual environment** - -1. Create a virtual environment\. - - ``` - virtualenv myvenv - ``` -**Note** -The [virtualenv](https://docs.python.org/3/library/venv.html) module uses Python 2\.7 by default\. You may need to add a local export path to your command line profile, such as `export VIRTUALENV_PYTHON=/usr/bin/python3.8` when using the *virtualenv* module with Python 3 and pip 3\. - -1. Activate the environment\. - - ``` - source myvenv/bin/activate - ``` - -1. Install libraries with pip\. - - ``` - pip install requests - ``` - -1. Deactivate the virtual environment\. - - ``` - deactivate - ``` - -1. Create a deployment package with the installed libraries at the root\. - - ``` - cd myvenv/lib/python3.8/site-packages - zip -r ../../../../my-deployment-package.zip . - ``` - - The last command saves the deployment package to the root of the `my-function` directory\. -**Tip** -A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. - -1. Add function code files to the root of your deployment package\. - - ``` - cd ../../../../ - zip -g my-deployment-package.zip lambda_function.py - ``` - - After you complete this step, you should have the following directory structure: - - ``` - my-deployment-package.zip$ - │ lambda_function.py - │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ - ... - ``` - -1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. +## What is a runtime dependency? - ``` - aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - ``` +A [deployment package](gettingstarted-package.md) is required to create or update a Lambda function with or without runtime dependencies\. The deployment package acts as the source bundle to run your function's code and dependencies \(if applicable\) on Lambda\. - You should see the following output: +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](#python-package)\. - ``` - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 5912988, - "CodeSha256": "A2P0NUWq1J+LtSbkuP8tm9uNYqs1TAa3M76ptmZCw5g=", - "Version": "$LATEST", - "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", - ... - } - ``` +The following example describes a Lambda function without runtime dependencies: ++ If your function's code is in Python 3\.8, and it depends only on standard Python math and logging libraries, you don't need to include the libraries in your \.zip file\. These libraries are included with the `python3.8` runtime\. ++ If your function's code depends only on the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), you don't need to include the boto3 library in your \.zip file\. These libraries are included with the `python3.8` runtime\. -The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. \ No newline at end of file +For a complete list of AWS SDKs, see [Tools to Build on AWS](http://aws.amazon.com/tools/)\. \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 35b517d7..c6b364fe 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -33,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/function/requirements.txt)** +**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/requirements.txt)** ``` jsonpickle==1.3 @@ -42,7 +44,7 @@ aws-xray-sdk==2.4.3 To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** ``` import boto3 @@ -97,7 +99,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -111,7 +113,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -128,7 +130,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index be98e869..e28640b7 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Ruby -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Ruby runtime using the Lambda console and the AWS CLI\. @@ -69,24 +69,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 1eb563fa..12d7b277 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -13,7 +13,7 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use `puts` statements, or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. + To output logs from your function code, you can use `puts` statements, or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example lambda\_function\.rb** @@ -109,7 +109,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index 7144e0d4..cd066b9e 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -2,12 +2,12 @@ Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. -+ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. -+ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. -+ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. +To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. -This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. +This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. **Topics** + [Prerequisites](#ruby-package-prereqs) @@ -17,7 +17,7 @@ This page describes how to create a \.zip file as your deployment package, and t ## Prerequisites -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index 55ffaa4e..352aea1b 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -33,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Ruby\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/function/Gemfile)** +**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/Gemfile)** ``` # Gemfile @@ -46,7 +48,7 @@ gem 'test-unit', '3.3.5' To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** ``` # lambda_function.rb @@ -99,7 +101,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -113,7 +115,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -130,7 +132,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index 432d4f33..83024158 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -17,7 +17,7 @@ Using language\-specific environment variables is the preferred way to set start The Java virtual machine \(JVM\) tries to locate the class that was specified with the `javaagent` parameter to the JVM, and invoke its `premain` method before the application's entry point\. -The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. +The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. ``` import com.amazonaws.services.lambda.runtime.RequestStreamHandler; @@ -198,7 +198,7 @@ In the following example, you create a wrapper script to start the Python interp 1. Add the layer to your function\. - 1. On the [configuration page](configuration-console.md), choose **Layers**\. + 1. Choose your function, and then choose **Code** if it is not already selected\. 1. Choose **Add a layer**\. @@ -223,7 +223,7 @@ In the following example, you create a wrapper script to start the Python interp 1. Choose **Save**\. - 1. Under **Environment variables**, choose **Manage environment variables**\. + 1. Under **Environment variables**, choose **Edit**\. 1. Choose **Add environment variable**\. diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index a2357ac0..b6f91318 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -39,7 +39,7 @@ Standard charges apply for each service\. For more information, see [AWS Pricing The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Handler code** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Handler code** ``` // Handler @@ -66,7 +66,7 @@ var serialize = function(object) { The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. -The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. +The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ## Deployment automation with AWS CloudFormation and the AWS CLI @@ -78,7 +78,7 @@ The application template uses an AWS Serverless Application Model \(AWS SAM\) re The template defines the resources in the application *stack*\. This includes the function, its execution role, and a Lambda layer that provides the function's library dependencies\. The stack does not include the bucket that the AWS CLI uses during deployment or the CloudWatch Logs log group\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Serverless resources** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** ``` AWSTemplateFormatVersion: '2010-09-09' @@ -152,7 +152,7 @@ In this example, the `Code` property specifies an object in an Amazon S3 bucket\ To upload the project files to Amazon S3, the deployment script uses commands in the AWS CLI\. The `cloudformation package` command preprocesses the template, uploads artifacts, and replaces local paths with Amazon S3 object locations\. The `cloudformation deploy` command deploys the processed template with a AWS CloudFormation change set\. -**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** +**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** ``` #!/bin/bash @@ -164,7 +164,7 @@ aws cloudformation deploy --template-file out.yml --stack-name blank-nodejs --ca The first time you run this script, it creates a AWS CloudFormation stack named `blank-nodejs`\. If you make changes to the function code or template, you can run it again to update the stack\. -The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. +The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. ## Instrumentation with the AWS X\-Ray @@ -176,7 +176,7 @@ The first service node \(`AWS::Lambda`\) represents the Lambda service, which va To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Instrumentation** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -200,7 +200,7 @@ You can include the X\-Ray SDK and other libraries in your function's deployment You can install libraries locally and include them in the deployment package that you upload to Lambda, but this has its drawbacks\. Larger file sizes cause increased deployment times and can prevent you from testing changes to your function code in the Lambda console\. To keep the deployment package small and avoid uploading dependencies that haven't changed, the sample app creates a [Lambda layer](configuration-layers.md) and associates it with the function\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Dependency layer** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependency layer** ``` Resources: @@ -232,7 +232,7 @@ Resources: The `2-build-layer.sh` script installs the function's dependencies with npm and places them in a folder with the [structure required by the Lambda runtime](configuration-layers.md#configuration-layers-path)\. -**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** +**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** ``` #!/bin/bash diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 19a44d70..ad43ed3b 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -5,8 +5,8 @@ The Error Processor sample application demonstrates the use of AWS Lambda to han ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor.png) Function code is available in the following files: -+ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/random-error/index.js) -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/processor/index.js) ++ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/random-error/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/processor/index.js) You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor)\. @@ -84,7 +84,7 @@ The application is implemented in two Node\.js modules and deployed with an AWS + Resource\-based policy – A permission statement on the processor function that allows CloudWatch Logs to invoke it\. + Amazon S3 bucket – A storage location for output from the processor function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) on GitHub\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-stack.png) diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index a7247d54..86415c56 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -7,8 +7,8 @@ The list manager sample application demonstrates the use of AWS Lambda to proces Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/processor/index.js) -+ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/dbadmin/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/processor/index.js) ++ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/dbadmin/index.js) You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager)\. @@ -66,7 +66,7 @@ A *ranking* contains a list of entries where the value is the order in which the A Lambda [event source mapping](invocation-eventsourcemapping.md) read records from the stream in batches and invokes the processor function\. The event that the function handler received contains an array of objects that each contain details about a record, such as when it was received, details about the stream, and an encoded representation of the original record document\. -**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/events/kinesis.json) – Record** +**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/events/kinesis.json) – Record** ``` { @@ -112,9 +112,9 @@ The application is implemented in Node\.js modules and deployed with an AWS Clou + Execution role – An IAM role that grants the functions permission to access other AWS services\. + Lambda event source mapping – Reads records from the data stream and invokes the function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml) on GitHub\. -A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. +A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. **Infrastructure resources** + VPC – A virtual private cloud network with private subnets, a route table, and a VPC endpoint that allows the function to communicate with DynamoDB without an internet connection\. diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md index cb626549..58b86895 100644 --- a/doc_source/services-apigateway-blueprint.md +++ b/doc_source/services-apigateway-blueprint.md @@ -40,9 +40,13 @@ In this step, you will use the console to test the Lambda function\. In addition **To test the API** -1. With your `lambda-microservice` function still open in the console, in the upper right hand corner of the console, choose **Test**\. +1. With your `lambda-microservice` function still open in the console, choose the **Test** tab\. -1. In **Event name**, enter a name for the test event\. +1. Choose **New event**\. + +1. Choose the **Hello World** template\. + +1. In **Name**, enter a name for the test event\. 1. In the text entry panel, replace the existing text with the following: @@ -55,6 +59,6 @@ In this step, you will use the console to test the Lambda function\. In addition } ``` -1. After entering the text above choose **Create**\. +1. After entering the text above choose **Create event**\. -1. Choose the event that you created and choose **Test**\. \ No newline at end of file +1. Choose the event that you created and choose **Invoke**\. \ No newline at end of file diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 344eb18f..a77a1bb0 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -534,7 +534,7 @@ curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\ ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index 0644383b..d0be5212 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -8,9 +8,9 @@ You can create a web API with an HTTP endpoint for your Lambda function by using 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Functional overview**, choose **Add trigger**\. -1. Choose **API Gateway**\. +1. Select **API Gateway**\. 1. For **API**, choose **Create an API**\. @@ -18,10 +18,6 @@ You can create a web API with an HTTP endpoint for your Lambda function by using 1. Choose **Add**\. -With the **API Gateway** trigger selected in the designer, choose the endpoint to invoke the function with API Gateway\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-apig-endpoint.png) - API Gateway APIs are comprised of stages, resources, methods, and integrations\. The stage and resource determine the path of the endpoint: **API path format** @@ -34,7 +30,7 @@ A Lambda integration maps a path and HTTP method combination to a Lambda functio Amazon API Gateway invokes your function [synchronously](invocation-sync.md) with an event that contains a JSON representation of the HTTP request\. For a custom integration, the event is the body of the request\. For a proxy integration, the event has a defined structure\. The following example shows a proxy event from an API Gateway REST API\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** ``` { @@ -79,7 +75,7 @@ API Gateway waits for a response from your function and relays the result to the The following example shows a response object from a Node\.js function\. The response object represents a successful HTTP response that contains a JSON document\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** ``` var response = { @@ -207,7 +203,7 @@ The following example shows an X\-Ray trace map for a request that resulted in a To customize the error response, you must catch errors in your code and format a response in the required format\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/function/index.js) – Error formatting** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Error formatting** ``` var formatError = function(error){ @@ -255,7 +251,7 @@ WebSocket APIs also use the API Gateway version 2 API and support a similar feat HTTP APIs support a simplified event format \(version 2\.0\)\. The following example shows an event from an HTTP API\. -**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** +**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** ``` { diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md index 6b2ba087..6ff099f0 100644 --- a/doc_source/services-cloudformation.md +++ b/doc_source/services-cloudformation.md @@ -56,7 +56,7 @@ AWS CloudFormation provides a library called `cfn-response` that handles sending The following example function invokes a second function\. If the call succeeds, the function sends a success response to AWS CloudFormation, and the stack update continues\. The template uses the [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) resource type provided by AWS Serverless Application Model\. -**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/template.yml) – Custom resource function** +**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) – Custom resource function** ``` Transform: 'AWS::Serverless-2016-10-31' diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index a592cf3a..80f942db 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -45,15 +45,15 @@ Test the function with a sample event provided by the Lambda console\. 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose **lambda\-canary**\. +1. Choose the **lambda\-canary** function\. -1. Next to the **Test** button at the top of the page, choose **Configure test events** from the drop\-down menu\. +1. Choose **Test**\. 1. Create a new event using the **CloudWatch Events** event template\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The output from the function execution is shown at the top of the page\. @@ -113,9 +113,9 @@ Update the function configuration to cause the function to return an error, whic 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose **lambda\-canary**\. +1. Choose the **lambda\-canary** function\. -1. Under **Environment variables**, choose **Edit**\. +1. Scroll down\. Under **Environment variables**, choose **Edit**\. 1. Set **expected** to **404**\. @@ -125,7 +125,7 @@ Wait a minute, and then check your email for a message from Amazon SNS\. ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index 3c131066..cb53ee42 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -56,7 +56,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re 1. Choose a function -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Set the trigger type to **CloudWatch Events/EventBridge**\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index e0f41bf8..701a36a0 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -51,11 +51,11 @@ Standard charges apply for each service\. ## Review the code -Locate the sample project in the guide repository under [sample\-apps/ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot)\. This directory contains Lambda function code, tests, project files, scripts, and a AWS CloudFormation template\. +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/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** +**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; diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index 7d1a7434..356f6507 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -138,7 +138,7 @@ Now that you have created a Lambda function that accesses an ElastiCache cluster ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md index 66e2c48a..366582cc 100644 --- a/doc_source/services-iot.md +++ b/doc_source/services-iot.md @@ -24,7 +24,7 @@ You need to grant permission for the AWS IoT service to invoke your Lambda funct ``` aws lambda add-permission --function-name my-function \ ---statement-id iot-events --action "lambda:InvokeFunction" --principal iotevents.amazonaws.com +--statement-id iot-events --action "lambda:InvokeFunction" --principal iot.amazonaws.com ``` You should see the following output: diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md index 04b9c692..87d49a38 100644 --- a/doc_source/services-msk-topic-add.md +++ b/doc_source/services-msk-topic-add.md @@ -30,7 +30,7 @@ Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger 1. Choose the name of your Lambda function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Under **Trigger configuration**, choose the **MSK** trigger type\. diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index 98f38168..ec9474d1 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -92,7 +92,7 @@ logger = logging.getLogger() logger.setLevel(logging.INFO) try: - conn = pymysql.connect(rds_host, user=name, passwd=password, db=db_name, connect_timeout=5) + conn = pymysql.connect(host=rds_host, user=name, passwd=password, db=db_name, connect_timeout=5) except pymysql.MySQLError as e: logger.error("ERROR: Unexpected error: Could not connect to MySQL instance.") logger.error(e) @@ -173,7 +173,7 @@ Now that you have created a Lambda function that accesses a database in your VPC ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/services-smaa-topic-add.md b/doc_source/services-smaa-topic-add.md index ebbaa92f..0e525069 100644 --- a/doc_source/services-smaa-topic-add.md +++ b/doc_source/services-smaa-topic-add.md @@ -1,4 +1,4 @@ -# Adding a Self\-managed Apache Kafka cluster as an event source +# Adding a self\-managed Apache Kafka cluster as an event source You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. @@ -6,11 +6,11 @@ This section describes how to add your Kafka cluster and topic as a function tri ## Prerequisites + A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](kafka-hosting.md)\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a Self\-managed Apache Kafka cluster](smaa-permissions.md)\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md)\. -## Adding a Self\-managed Apache Kafka cluster using the Lambda console +## Adding a self\-managed Apache Kafka cluster using the Lambda console -Follow these steps to add your Self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. +Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. **To add an Apache Kafka trigger to your Lambda function \(console\)** @@ -18,15 +18,15 @@ Follow these steps to add your Self\-managed Apache Kafka cluster and a Kafka to 1. Choose the name of your Lambda function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Under **Trigger configuration**, choose the **Apache Kafka** trigger type\. 1. Configure the remaining options, and then choose **Add**\. -## Adding a Self\-managed Apache Kafka cluster using the AWS CLI +## Adding a self\-managed Apache Kafka cluster using the AWS CLI -Use the following example AWS CLI commands to create and view a Self\-managed Apache Kafka trigger for your Lambda function\. +Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. ### Using SASL/SCRAM diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md index f17599c6..78802d24 100644 --- a/doc_source/services-stepfunctions.md +++ b/doc_source/services-stepfunctions.md @@ -23,7 +23,7 @@ Step Functions can invoke Lambda functions directly from a `Task` state in an [A You can create a `Task` state that invokes your Lambda function with the input to the state machine or any JSON document\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** ``` { diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index d9294ca1..39fe6edb 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -90,7 +92,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -104,7 +106,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/smaa-permissions.md b/doc_source/smaa-permissions.md index 4f0c5452..7da4dcd6 100644 --- a/doc_source/smaa-permissions.md +++ b/doc_source/smaa-permissions.md @@ -1,4 +1,4 @@ -# Managing access and permissions for a Self\-managed Apache Kafka cluster +# Managing access and permissions for a self\-managed Apache Kafka cluster Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. @@ -25,7 +25,7 @@ Your Lambda function might need permission to describe your Secrets Manager secr ### VPC permissions -If only users within your VPC access your Self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) + [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) @@ -35,9 +35,9 @@ If only users within your VPC access your Self\-managed Apache Kafka cluster, yo ## Adding permissions to your execution role -To access other AWS services that your Self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. -By default, Lambda isn't permitted to perform the required or optional actions for a Self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. +By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. ``` { @@ -67,7 +67,7 @@ By default, IAM users and roles don't have permission to perform [event source A ## Using SASL/SCRAM authentication -User name and password authentication for a Self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. +User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index 79dc5f53..a9eba472 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -4,6 +4,8 @@ When you update your function, Lambda deploys the change by launching new instan When you deploy updates to your function directly with the Lambda API or with a client such as the AWS CLI, you can see errors from Lambda directly in the output\. If you use services like AWS CloudFormation, AWS CodeDeploy, or AWS CodePipeline, look for the response from Lambda in the logs or event stream for that service\. +## General: Permission is denied / Cannot load such file + **Error:** *EACCES: permission denied, open '/var/task/index\.js'* **Error:** *cannot load such file \-\- function* @@ -17,6 +19,8 @@ chmod 644 $(find . -type f) chmod 755 $(find . -type d) ``` +## General: Error occurs when calling the UpdateFunctionCode + **Error:** *An error occurred \(RequestEntityTooLargeException\) when calling the UpdateFunctionCode operation* When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the [S3Bucket and S3Key](API_UpdateFunctionCode.md#SSS-UpdateFunctionCode-request-S3Bucket) parameters\. @@ -24,10 +28,14 @@ When you upload a deployment package or layer archive directly to Lambda, the si **Note** When you upload a file directly with the AWS CLI, AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. +## Amazon S3: Error Code PermanentRedirect\. + **Error:** *Error occurred while GetObject\. S3 Error Code: PermanentRedirect\. S3 Error Message: The bucket is in this region: us\-east\-2\. Please use this region to retry the request* When you upload a function's deployment package from an Amazon S3 bucket, the bucket must be in the same Region as the function\. This issue can occur when you specify an Amazon S3 object in a call to [UpdateFunctionCode](API_UpdateFunctionCode.md), or use the package and deploy commands in the AWS CLI or AWS SAM CLI\. Create a deployment artifact bucket for each Region where you develop applications\. +## General: Cannot find, cannot load, unable to import, class not found, no such file or directory + **Error:** *Cannot find module 'function'* **Error:** *cannot load such file \-\- function* @@ -42,6 +50,8 @@ When you upload a function's deployment package from an Amazon S3 bucket, the bu The name of the file or class in your function's handler configuration doesn't match your code\. See the following entry for more information\. +## General: Undefined method handler + **Error:** *index\.handler is undefined or not exported* **Error:** *Handler 'handler' missing on module 'function'* @@ -63,6 +73,8 @@ For some languages, Lambda provides a library with an interface that expects a h + [Building Lambda functions with C\#](lambda-csharp.md) + [Building Lambda functions with PowerShell](lambda-powershell.md) +## Lambda: InvalidParameterValueException or RequestEntityTooLargeException + **Error:** *InvalidParameterValueException: Lambda was unable to configure your environment variables because the environment variables you have provided exceeded the 4KB limit\. String measured: \{"A1":"uSFeY5cyPiPn7AtnX5BsM\.\.\.* **Error:** *RequestEntityTooLargeException: Request must be smaller than 5120 bytes for the UpdateFunctionConfiguration operation* @@ -87,6 +99,8 @@ The maximum size of the variables object that is stored in the function's config In this example, the object is 39 characters and takes up 39 bytes when it's stored \(without white space\) as the string `{"BUCKET":"my-bucket","KEY":"file.txt"}`\. Standard ASCII characters in environment variable values use one byte each\. Extended ASCII and Unicode characters can use between 2 bytes and 4 bytes per character\. +## Lambda: InvalidParameterValueException + **Error:** *InvalidParameterValueException: Lambda was unable to configure your environment variables because the environment variables you have provided contains reserved keys that are currently not supported for modification\.* Lambda reserves some environment variable keys for internal use\. For example, `AWS_REGION` is used by the runtime to determine the current Region and cannot be overridden\. Other variables, like `PATH`, are used by the runtime but can be extended in your function configuration\. For a full list, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 4baab296..be5f6ba8 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -6,10 +6,14 @@ Function execution errors can be caused by issues with your code, function confi When your function code or the Lambda runtime return an error, the status code in the response from Lambda is 200 OK\. The presence of an error in the response is indicated by a header named `X-Amz-Function-Error`\. 400 and 500\-series status codes are reserved for [invocation errors](troubleshooting-invocation.md)\. +## Lambda: Execution takes too long + **Issue:** *Function execution takes too long\.* If your code takes much longer to run in Lambda than on your local machine, it may be constrained by the memory or processing power available to the function\. [Configure the function with additional memory](configuration-console.md) to increase both memory and CPU\. +## Lambda: Logs or traces don't appear + **Issue:** *Logs don't appear in CloudWatch Logs\.* **Issue:** *Traces don't appear in AWS X\-Ray\.* @@ -20,6 +24,8 @@ Your function needs permission to call CloudWatch Logs and X\-Ray\. Update its [ When you add permissions to your function, make an update to its code or configuration as well\. This forces running instances of your function, which have out\-of\-date credentials, to stop and be replaced\. +## Lambda: The function returns before execution finishes + **Issue: \(Node\.js\)** *Function returns before code finishes executing* Many libraries, including the AWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. @@ -28,6 +34,8 @@ To wait for the promise to resolve into a response, use the `await` keyword\. Th Some libraries don't return promises but can be wrapped in code that does\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. +## AWS SDK: Versions and updates + **Issue:** *The AWS SDK included on the runtime is not the latest version* **Issue:** *The AWS SDK included on the runtime updates automatically* @@ -41,6 +49,8 @@ Runtimes for scripting languages include the AWS SDK and are periodically update + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) +## Python: Libraries load incorrectly + **Issue:** \(Python\) *Some libraries don't load correctly from the deployment package* Libraries with extension modules written in C or C\+\+ must be compiled in an environment with the same processor architecture as Lambda \(Amazon Linux\)\. For more information, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md index c02eca30..dbfc8d50 100644 --- a/doc_source/troubleshooting-images.md +++ b/doc_source/troubleshooting-images.md @@ -1,13 +1,19 @@ # Troubleshoot container image issues in Lambda +## Container: Error occurs on runtime InvalidEntrypoint + **Issue:** *You receive a Runtime\.ExitError error message, or an error message with `"errorType": "Runtime.InvalidEntrypoint"`\.* Verify that the ENTRYPOINT to your container image includes the absolute path as the location\. Also verify that the image does not contain a symlink as the ENTRYPOINT\. +## Lambda: System provisioning additonal capacity + **Error:** *“Error: We currently do not have sufficient capacity in the region you requested\. Our system will be working on provisioning additional capacity\.* Retry the function invocation\. If the retry fails, validate that the files required to run the function code can be read by any user\. Lambda defines a default Linux user with least\-privileged permissions\. You need to verify that your application code does not rely on files that are restricted by other Linux users for execution\. +## CloudFormation: ENTRYPOINT is being overridden with a null or empty value + **Error:** *You are using an AWS CloudFormation template, and your container ENTRYPOINT is being overridden with a null or empty value\.* Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. \ No newline at end of file diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 0c874220..0ac5dda8 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -6,6 +6,8 @@ If you invoke your function directly, you see any invocation errors in the respo For a list of error types that the `Invoke` operation can return, see [Invoke](API_Invoke.md)\. +## IAM: lambda:InvokeFunction not authorized + **Error:** *User: arn:aws:iam::123456789012:user/developer is not authorized to perform: lambda:InvokeFunction on resource: my\-function* Your AWS Identity and Access Management \(IAM\) user, or the role that you assume, must have permission to invoke a function\. This requirement also applies to Lambda functions and other compute resources that invoke functions\. Add the AWS managed policy **AWSLambdaRole** to your IAM user, or add a custom policy that allows the `lambda:InvokeFunction` action on the target function\. @@ -15,12 +17,16 @@ Unlike other Lambda API operations, the name of the IAM action \(`lambda:InvokeF For more information, see [AWS Lambda permissions](lambda-permissions.md)\. +## Lambda: Operation cannot be performed ResourceConflictException + **Error:** *ResourceConflictException: The operation cannot be performed at this time\. The function is currently in the following state: Pending* When you connect a function to a virtual private cloud \(VPC\) at the time of creation, the function enters a `Pending` state while Lambda creates elastic network interfaces\. During this time, you can't invoke or modify your function\. If you connect your function to a VPC after creation, you can invoke it while the update is pending, but you can't modify its code or configuration\. For more information, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. +## Lambda: Function is stuck in Pending + **Error:** *A function is stuck in the `Pending` state for several minutes\.* If a function is stuck in the `Pending` state for more than six minutes, call one of the following API operations to unblock it: @@ -30,18 +36,26 @@ If a function is stuck in the `Pending` state for more than six minutes, call on Lambda cancels the pending operation and puts the function into the `Failed` state\. You can then delete the function and recreate it, or attempt another update\. +## Lambda: One function is using all concurrency + **Issue:** *One function is using all of the available concurrency, causing other functions to be throttled\.* To divide your AWS account's available concurrency in an AWS Region into pools, use [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency ensures that a function can always scale to its assigned concurrency, and that it doesn't scale beyond its assigned concurrency\. +## General: Cannot invoke function with other accounts or services + **Issue:** *You can invoke your function directly, but it doesn't run when another service or account invokes it\.* You grant [other services](lambda-services.md) and accounts permission to invoke a function in the function's [resource\-based policy](access-control-resource-based.md)\. If the invoker is in another account, that user must also have [permission to invoke functions](access-control-identity-based.md)\. +## General: Function invocation is looping + **Issue:** *Function is invoked continuously in a loop\.* This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-console.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. +## Lambda: Cold starts with provisioned concurrency + **Issue:** *You see cold starts after enabling provisioned concurrency\.* When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: @@ -55,10 +69,14 @@ Provisioned concurrency is not configurable on the [$LATEST version](configurati **Note** There is a known issue in which the first invocation on an initialized execution environment reports a non\-zero **Init Duration** metric in CloudWatch Logs, even though no cold start has occurred\. We're developing a fix to correct the reporting to CloudWatch Logs\. +## Lambda: Latency variability with provisioned concurrency + **Issue:** *You see latency variability on the first invocation after enabling provisioned concurrency\.* Depending on your function's runtime and memory configuration, it's possible to see some latency variability on the first invocation on an initialized execution environment\. For example, \.NET and other JIT runtimes can lazily load resources on the first invocation, leading to some latency variability \(typically tens of milliseconds\)\. This variability is more apparent on 128\-MiB functions\. You mitigate this by increasing the function's configured memory\. +## Lambda: Cold starts with new versions + **Issue:** *You see cold starts while deploying new versions of your function\.* When you update a function alias, Lambda automatically shifts provisioned concurrency to the new version based on the weights configured on the alias\. @@ -67,18 +85,26 @@ When you update a function alias, Lambda automatically shifts provisioned concur This error can occur if your AWS Key Management Service \(AWS KMS\) key is disabled, or if the grant that allows Lambda to use the key is revoked\. If the grant is missing, configure the function to use a different key\. Then, reassign the custom key to recreate the grant\. +## EFS: Function could not mount the EFS file system + **Error:** *EFSMountFailureException: The function could not mount the EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\.* The mount request to the function's [file system](configuration-filesystem.md) was rejected\. Check the function's permissions, and confirm that its file system and access point exist and are ready for use\. +## EFS: Function could not connect to the EFS file system + **Error:** *EFSMountConnectivityException: The function couldn't connect to the Amazon EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\. Check your network configuration and try again\.* The function couldn't establish a connection to the function's [file system](configuration-filesystem.md) with the NFS protocol \(TCP port 2049\)\. Check the [security group and routing configuration](https://docs.aws.amazon.com/efs/latest/ug/network-access.html) for the VPC's subnets\. +## EFS: Function could not mount the EFS file system due to timeout + **Error:** *EFSMountTimeoutException: The function could not mount the EFS file system with access point \{arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\} due to mount time out\.* The function could connect to the function's [file system](configuration-filesystem.md), but the mount operation timed out\. Try again after a short time and consider limiting the function's [concurrency](configuration-concurrency.md) to reduce load on the file system\. +## Lambda: Lambda detected an IO process that was taking too long + *EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-networking.md b/doc_source/troubleshooting-networking.md index 6436661f..b5bf14db 100644 --- a/doc_source/troubleshooting-networking.md +++ b/doc_source/troubleshooting-networking.md @@ -4,6 +4,8 @@ By default, Lambda runs your functions in an internal virtual private cloud \(VP Network connectivity errors can result from issues in routing configuration, security group rules, role permissions, network address translation, or the availability of resources such as IP addresses or network interfaces\. They may result in a specific error or, if a request can't reach its destination, a timeout\. +## VPC: Function loses internet access or times out + **Issue:** *Function loses internet access after connecting to a VPC* **Error:** *Error: connect ETIMEDOUT 176\.32\.98\.189:443* @@ -12,10 +14,14 @@ Network connectivity errors can result from issues in routing configuration, sec When you connect a function to a VPC, all outbound requests go through your VPC\. To connect to the internet, configure your VPC to send outbound traffic from the function's subnet to a NAT gateway in a public subnet\. For more information and sample VPC configurations, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +## VPC: Function needs access to AWS services without using the internet + **Issue:** *Function needs access to AWS services without using the internet* To connect to AWS services from a private subnet with no internet access, use VPC endpoints\. For a sample template with VPC endpoints for DynamoDB and Amazon S3, see [Sample VPC configurations](configuration-vpc.md#vpc-samples)\. +## VPC: Limit was reached for the function's VPC + **Error:** *ENILimitReachedException: The elastic network interface limit was reached for the function's VPC\.* When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of subnet and security group attached to the function\. These network interfaces are limited to 250 per VPC, but this limit can be increased\. To request an increase, use the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 593225cf..6e5c559a 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -73,9 +73,9 @@ You add the extension to your function using the same method as you would for an 1. Choose a function\. -1. Under **Designer**, choose **Layers**\. +1. Choose the **Code** tab if it is not already selected\. -1. Under **Layers**, choose **Add a layer**\. +1. Under **Layers**, choose **Edit**\. 1. For **Choose a layer**, choose **Specify an ARN**\. diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index a188584c..f60ffb50 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -258,7 +258,7 @@ Test the end\-to\-end experience\. As you perform table updates, DynamoDB writes ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 0f447c31..27af38ec 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -120,7 +120,7 @@ To configure your function to read from DynamoDB Streams in the Lambda console, 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. @@ -269,7 +269,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. 1. Choose a function\. -1. Under **Designer**, choose **Add destination**\. +1. Under **Function overview**, choose **Add destination**\. 1. For **Source**, choose **Stream invocation**\. diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 06d5f5b8..5b834fd6 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -207,7 +207,7 @@ Lambda uses the execution role to read records from the stream\. Then it invokes ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the execution role** diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index fa7e336c..8ed04e40 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -133,7 +133,7 @@ To configure your function to read from Kinesis in the Lambda console, create a 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. @@ -287,7 +287,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. 1. Choose a function\. -1. Under **Designer**, choose **Add destination**\. +1. Under **Function overview**, choose **Add destination**\. 1. For **Source**, choose **Stream invocation**\. diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index f9920a57..629953a6 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -102,7 +102,7 @@ To configure your function to read from Amazon MQ, create an **MQ** trigger in t 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. @@ -115,7 +115,7 @@ Lambda supports the following options for Amazon MQ event sources: + **Source access configuration** – Select the AWS Secrets Manager secret that stores your broker credentials\. + **Enable trigger** – Disable the trigger to stop processing records\. -To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in the [designer](getting-started-create-function.md#get-started-designer)\. To reconfigure the trigger, use the event source mapping API operations\. +To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in the designer\. To reconfigure the trigger, use the event source mapping API operations\. ## Event source mapping API diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 816a8c24..f6e46ff1 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -401,7 +401,7 @@ Now you can test the setup as follows: ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index d9bae04a..5af476de 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -167,7 +167,7 @@ To learn more about Amazon SNS, see [What is Amazon Simple Notification Service] ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Amazon SNS topic** diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md index 7e1167be..c9564cb0 100644 --- a/doc_source/with-sns.md +++ b/doc_source/with-sns.md @@ -49,9 +49,9 @@ For more information, see [Fanout to Lambda functions](https://docs.aws.amazon.c **Input types for Amazon SNS events** For input type examples for Amazon SNS events in Java, \.NET, and Go, see the following on the AWS GitHub repository: -+ [SNSEvent\.java](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/SNSEvent.java) -+ [SNSEvent\.cs](https://github.com/aws/aws-lambda-dotnet/blob/main/Libraries/src/Amazon.Lambda.SNSEvents/SNSEvent.cs) -+ [sns\.go](https://github.com/aws/aws-lambda-go/blob/main/events/sns.go) ++ [SNSEvent\.java](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/SNSEvent.java) ++ [SNSEvent\.cs](https://github.com/aws/aws-lambda-dotnet/blob/master/Libraries/src/Amazon.Lambda.SNSEvents/SNSEvent.cs) ++ [sns\.go](https://github.com/aws/aws-lambda-go/blob/master/events/sns.go) **Topics** + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index efe9beea..be7557a0 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -162,7 +162,7 @@ Now you can test the setup as follows: ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the execution role** diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index ea24fdfe..d2f55610 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -121,7 +121,7 @@ To configure your function to read from Amazon SQS in the Lambda console, create 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. From 98e81c60494c26cdd8cab485d54193b5c1d7d673 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Thu, 4 Mar 2021 22:43:04 +0000 Subject: [PATCH 12/94] Periodic update --- doc_source/go-image.md | 2 +- doc_source/golang-handler.md | 2 +- doc_source/services-iot.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 85566819..98a70933 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -165,4 +165,4 @@ If you do not want to add the RIE to your image, you can test your image locally This command invokes the function running in the container image and returns a response\. -For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. +For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. \ No newline at end of file diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 807c222f..6d9032d1 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -176,4 +176,4 @@ func LambdaHandler() (int, error) { func main() { lambda.Start(LambdaHandler) } -``` +``` \ No newline at end of file diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md index a1e3dfbf..366582cc 100644 --- a/doc_source/services-iot.md +++ b/doc_source/services-iot.md @@ -35,4 +35,4 @@ You should see the following output: } ``` -For more information about how to use Lambda with AWS IoT, see [Creating an AWS Lambda rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html)\. +For more information about how to use Lambda with AWS IoT, see [Creating an AWS Lambda rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html)\. \ No newline at end of file From 3de4c5101e2e04739ec1b10a50fc3e91f90bb264 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Wed, 10 Mar 2021 12:13:38 -0800 Subject: [PATCH 13/94] update Handler.java in java-basic sample to address issues #247 and #248 --- sample-apps/java-basic/src/main/java/example/Handler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/java-basic/src/main/java/example/Handler.java b/sample-apps/java-basic/src/main/java/example/Handler.java index 5d8d9ab2..94834f20 100644 --- a/sample-apps/java-basic/src/main/java/example/Handler.java +++ b/sample-apps/java-basic/src/main/java/example/Handler.java @@ -16,13 +16,13 @@ public class Handler implements RequestHandler, String>{ public String handleRequest(Map event, Context context) { LambdaLogger logger = context.getLogger(); - String response = new String("200 OK"); + String response = "200 OK"; // log execution details logger.log("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); logger.log("CONTEXT: " + gson.toJson(context)); // process event logger.log("EVENT: " + gson.toJson(event)); - logger.log("EVENT TYPE: " + event.getClass().toString()); + logger.log("EVENT TYPE: " + event.getClass()); return response; } } \ No newline at end of file From 3778e90ec0e3e0ae151ddc63145b20ef188a9121 Mon Sep 17 00:00:00 2001 From: Alex Hedley Date: Thu, 11 Mar 2021 12:17:43 +0000 Subject: [PATCH 14/94] Update python formatting --- doc_source/with-sqs-create-package.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index 6723b172..46650be2 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -144,11 +144,12 @@ Follow the instructions to create a AWS Lambda function deployment package\. ``` from __future__ import print_function + def lambda_handler(event, context): for record in event['Records']: - print ("test") - payload=record["body"] - print(str(payload)) + print("test") + payload = record["body"] + print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. From 0e9f498baaba549788f3c90c1396d37fdcb5c45e Mon Sep 17 00:00:00 2001 From: JamesJJ Date: Sat, 13 Mar 2021 12:30:15 +0800 Subject: [PATCH 15/94] Improve Go code example --- doc_source/services-apigateway-code.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index 594b4580..c8d5fd7a 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -119,11 +119,19 @@ The following example processes messages from API Gateway, and logs information **Example LambdaFunctionOverHttps\.go** ``` +package main + import ( - "strings" + "context" + "fmt" "github.com/aws/aws-lambda-go/events" + runtime "github.com/aws/aws-lambda-go/lambda" ) +func main() { + runtime.Start(handleRequest) +} + func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestID) fmt.Printf("Body size = %d.\n", len(request.Body)) @@ -133,7 +141,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) ( fmt.Printf(" %s: %s\n", key, value) } - return events.APIGatewayProxyResponse { Body: request.Body, StatusCode: 200 }, nil + return events.APIGatewayProxyResponse{Body: request.Body, StatusCode: 200}, nil } ``` From 9cddb205087dc9739a3e83c66258715c7f53a783 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 19 Mar 2021 09:50:56 -0700 Subject: [PATCH 16/94] Documentation updates --- doc_source/API_AccountLimit.md | 2 +- doc_source/API_AccountUsage.md | 2 +- doc_source/API_AddLayerVersionPermission.md | 6 +- doc_source/API_AddPermission.md | 2 +- doc_source/API_AliasConfiguration.md | 2 +- doc_source/API_AliasRoutingConfiguration.md | 2 +- doc_source/API_AllowedPublishers.md | 2 +- doc_source/API_CodeSigningConfig.md | 2 +- doc_source/API_CodeSigningPolicies.md | 2 +- doc_source/API_Concurrency.md | 2 +- doc_source/API_CreateAlias.md | 2 +- doc_source/API_CreateCodeSigningConfig.md | 2 +- doc_source/API_CreateEventSourceMapping.md | 88 +++++++++-- doc_source/API_CreateFunction.md | 101 ++++++++++-- doc_source/API_DeadLetterConfig.md | 2 +- doc_source/API_DeleteAlias.md | 2 +- doc_source/API_DeleteCodeSigningConfig.md | 2 +- doc_source/API_DeleteEventSourceMapping.md | 45 +++++- doc_source/API_DeleteFunction.md | 2 +- .../API_DeleteFunctionCodeSigningConfig.md | 2 +- doc_source/API_DeleteFunctionConcurrency.md | 2 +- .../API_DeleteFunctionEventInvokeConfig.md | 2 +- doc_source/API_DeleteLayerVersion.md | 2 +- .../API_DeleteProvisionedConcurrencyConfig.md | 2 +- doc_source/API_DestinationConfig.md | 2 +- doc_source/API_Environment.md | 2 +- doc_source/API_EnvironmentError.md | 2 +- doc_source/API_EnvironmentResponse.md | 2 +- .../API_EventSourceMappingConfiguration.md | 41 ++++- doc_source/API_FileSystemConfig.md | 2 +- doc_source/API_FunctionCode.md | 9 +- doc_source/API_FunctionCodeLocation.md | 12 +- doc_source/API_FunctionConfiguration.md | 35 ++++- doc_source/API_FunctionEventInvokeConfig.md | 2 +- doc_source/API_GetAccountSettings.md | 2 +- doc_source/API_GetAlias.md | 2 +- doc_source/API_GetCodeSigningConfig.md | 2 +- doc_source/API_GetEventSourceMapping.md | 45 +++++- doc_source/API_GetFunction.md | 24 ++- .../API_GetFunctionCodeSigningConfig.md | 2 +- doc_source/API_GetFunctionConcurrency.md | 2 +- doc_source/API_GetFunctionConfiguration.md | 49 +++++- .../API_GetFunctionEventInvokeConfig.md | 2 +- doc_source/API_GetLayerVersion.md | 8 +- doc_source/API_GetLayerVersionByArn.md | 8 +- doc_source/API_GetLayerVersionPolicy.md | 2 +- doc_source/API_GetPolicy.md | 2 +- .../API_GetProvisionedConcurrencyConfig.md | 2 +- doc_source/API_ImageConfig.md | 4 +- doc_source/API_ImageConfigError.md | 2 +- doc_source/API_ImageConfigResponse.md | 2 +- doc_source/API_Invoke.md | 2 +- doc_source/API_InvokeAsync.md | 2 +- doc_source/API_Layer.md | 14 +- doc_source/API_LayerVersionContentInput.md | 2 +- doc_source/API_LayerVersionContentOutput.md | 12 +- doc_source/API_LayerVersionsListItem.md | 4 +- doc_source/API_LayersListItem.md | 2 +- doc_source/API_ListAliases.md | 2 +- doc_source/API_ListCodeSigningConfigs.md | 2 +- doc_source/API_ListEventSourceMappings.md | 11 +- .../API_ListFunctionEventInvokeConfigs.md | 2 +- doc_source/API_ListFunctions.md | 27 +++- .../API_ListFunctionsByCodeSigningConfig.md | 2 +- doc_source/API_ListLayerVersions.md | 4 +- doc_source/API_ListLayers.md | 4 +- .../API_ListProvisionedConcurrencyConfigs.md | 2 +- doc_source/API_ListTags.md | 2 +- doc_source/API_ListVersionsByFunction.md | 20 ++- doc_source/API_OnFailure.md | 2 +- doc_source/API_OnSuccess.md | 2 +- doc_source/API_Operations.md | 9 ++ ...PI_ProvisionedConcurrencyConfigListItem.md | 2 +- doc_source/API_PublishLayerVersion.md | 10 +- doc_source/API_PublishVersion.md | 49 +++++- .../API_PutFunctionCodeSigningConfig.md | 2 +- doc_source/API_PutFunctionConcurrency.md | 2 +- .../API_PutFunctionEventInvokeConfig.md | 2 +- .../API_PutProvisionedConcurrencyConfig.md | 2 +- .../API_RemoveLayerVersionPermission.md | 2 +- doc_source/API_RemovePermission.md | 2 +- doc_source/API_SelfManagedEventSource.md | 2 +- doc_source/API_SourceAccessConfiguration.md | 20 ++- doc_source/API_TagResource.md | 2 +- doc_source/API_TracingConfig.md | 2 +- doc_source/API_TracingConfigResponse.md | 2 +- doc_source/API_Types.md | 7 + doc_source/API_UntagResource.md | 2 +- doc_source/API_UpdateAlias.md | 2 +- doc_source/API_UpdateCodeSigningConfig.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 73 +++++++-- doc_source/API_UpdateFunctionCode.md | 72 ++++++++- doc_source/API_UpdateFunctionConfiguration.md | 77 +++++++-- .../API_UpdateFunctionEventInvokeConfig.md | 2 +- doc_source/API_VpcConfig.md | 2 +- doc_source/API_VpcConfigResponse.md | 2 +- doc_source/access-control-resource-based.md | 4 +- doc_source/applications-tutorial.md | 1 - doc_source/code-editor.md | 36 ++++- doc_source/configuration-aliases.md | 15 +- doc_source/configuration-database.md | 21 ++- doc_source/configuration-envvars.md | 146 ++++++++++-------- doc_source/configuration-filesystem.md | 17 +- doc_source/configuration-images.md | 24 ++- doc_source/configuration-layers.md | 2 +- doc_source/configuration-memory.md | 16 +- doc_source/configuration-preview.md | 96 ------------ doc_source/configuration-tags.md | 14 +- doc_source/configuration-versions.md | 12 +- doc_source/configuration-vpc-endpoints.md | 5 + doc_source/configuration-vpc.md | 8 +- doc_source/csharp-handler.md | 4 +- doc_source/gettingstarted-limits.md | 2 +- doc_source/golang-envvars.md | 2 +- doc_source/index.md | 19 ++- doc_source/invocation-retries.md | 2 +- doc_source/java-package-eclipse.md | 6 + doc_source/kafka-using-cluster.md | 4 + doc_source/lambda-api-permissions-ref.md | 2 + doc_source/lambda-rolling-deployments.md | 2 + doc_source/lambda-services.md | 1 + doc_source/logging-using-cloudtrail.md | 2 + doc_source/monitoring-servicemap.md | 31 +++- doc_source/runtimes-avx2.md | 2 + doc_source/runtimes-context.md | 2 + doc_source/runtimes-custom.md | 2 +- doc_source/runtimes-extensions-api.md | 6 +- doc_source/security_iam_troubleshoot.md | 4 +- doc_source/services-apigateway-code.md | 2 - doc_source/services-apigateway-tutorial.md | 2 + .../services-cloudwatchevents-tutorial.md | 6 +- doc_source/services-cloudwatchevents.md | 5 +- doc_source/services-connect.md | 41 +++++ doc_source/services-ec2-tutorial.md | 2 + doc_source/stepfunctions-patterns.md | 1 + doc_source/troubleshooting-deployment.md | 2 +- doc_source/with-ddb.md | 2 +- doc_source/with-kinesis.md | 2 +- doc_source/with-sqs-create-package.md | 3 +- 139 files changed, 1152 insertions(+), 446 deletions(-) delete mode 100644 doc_source/configuration-preview.md create mode 100644 doc_source/services-connect.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md index 5f40217b..e59478cf 100644 --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -35,5 +35,5 @@ Required: No 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/AccountLimit) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AccountLimit) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md index 5ca7c5ad..6f70e7c4 100644 --- a/doc_source/API_AccountUsage.md +++ b/doc_source/API_AccountUsage.md @@ -19,5 +19,5 @@ Required: No 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/AccountUsage) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AccountUsage) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index cb84d5e2..b327715e 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -1,6 +1,6 @@ # AddLayerVersionPermission -Adds permissions to the resource\-based policy of a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all AWS accounts, or all accounts in an organization\. +Adds permissions to the resource\-based policy of a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. To revoke permission, call [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. @@ -52,7 +52,7 @@ Pattern: `o-[a-z0-9]{10,32}` Required: No ** [Principal](#API_AddLayerVersionPermission_RequestSyntax) ** -An account ID, or `*` to grant permission to all AWS accounts\. +An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts \(if `organizationId` is not specified\)\. For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer\. Type: String Pattern: `\d{12}|\*|arn:(aws[a-zA-Z-]*):iam::\d{12}:root` Required: Yes @@ -127,7 +127,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index 35f57f17..01452a8c 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -149,7 +149,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md index c4850463..c2be5893 100644 --- a/doc_source/API_AliasConfiguration.md +++ b/doc_source/API_AliasConfiguration.md @@ -45,5 +45,5 @@ Required: No 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/AliasConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AliasConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md index 04330b69..641fc0c9 100644 --- a/doc_source/API_AliasRoutingConfiguration.md +++ b/doc_source/API_AliasRoutingConfiguration.md @@ -17,5 +17,5 @@ Required: No 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/AliasRoutingConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AliasRoutingConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md index 125a3a0e..808b7807 100644 --- a/doc_source/API_AllowedPublishers.md +++ b/doc_source/API_AllowedPublishers.md @@ -16,5 +16,5 @@ Required: Yes 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/AllowedPublishers) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md index 9014e737..c787444c 100644 --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -43,5 +43,5 @@ Required: Yes 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/CodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md index 82ca2b40..2d49743f 100644 --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -16,5 +16,5 @@ Required: No 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/CodeSigningPolicies) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md index 68753c1d..2fb185a9 100644 --- a/doc_source/API_Concurrency.md +++ b/doc_source/API_Concurrency.md @@ -13,5 +13,5 @@ Required: No 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/Concurrency) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/Concurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md index 0bef67af..33ef85bd 100644 --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -152,7 +152,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md index e7f55a0a..01be275e 100644 --- a/doc_source/API_CreateCodeSigningConfig.md +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -92,7 +92,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index ad941e89..7c9f4ba5 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -8,6 +8,7 @@ For details about each event source type, see the following topics\. + [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) + [Using AWS Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html) + [Using AWS Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) ++ [Using AWS Lambda with Self\-Managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. @@ -36,11 +37,17 @@ Content-type: application/json "Enabled": boolean, "EventSourceArn": "string", "FunctionName": "string", + "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -49,7 +56,8 @@ Content-type: application/json ], "StartingPosition": "string", "StartingPositionTimestamp": number, - "Topics": [ "string" ] + "Topics": [ "string" ], + "TumblingWindowInSeconds": number } ``` @@ -65,8 +73,9 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. Max 10\. ++ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. ++ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -94,7 +103,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: Yes +Required: No ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. @@ -110,8 +119,15 @@ 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 + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` +Required: No + ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -140,14 +156,17 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` +Required: No + + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** +The Self\-Managed Apache Kafka cluster to send records\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** @@ -162,11 +181,17 @@ Type: Timestamp Required: No ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** - \(MSK\) The name of the Kafka topic\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` +Required: No + + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No ## Response Syntax @@ -188,6 +213,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -195,15 +221,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -237,6 +271,12 @@ The ARN of the Lambda 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-_]+))?` + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -246,7 +286,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -272,12 +312,23 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. + + ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -288,12 +339,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -327,7 +383,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index f87bbbec..12105e88 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -1,6 +1,6 @@ # CreateFunction -Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. +Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. When you create 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 or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. @@ -8,6 +8,8 @@ A function has an unpublished version, and can have published versions and alias The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. +You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. + If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. @@ -20,11 +22,13 @@ Content-type: application/json { "Code": { + "ImageUri": "string", "S3Bucket": "string", "S3Key": "string", "S3ObjectVersion": "string", "ZipFile": blob }, + "CodeSigningConfigArn": "string", "DeadLetterConfig": { "TargetArn": "string" }, @@ -42,9 +46,15 @@ Content-type: application/json ], "FunctionName": "string", "Handler": "string", + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, + "PackageType": "string", "Publish": boolean, "Role": "string", "Runtime": "string", @@ -75,6 +85,13 @@ The code for the function\. Type: [FunctionCode](API_FunctionCode.md) object Required: Yes + ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** +To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. +Type: String +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` +Required: No + ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** 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 @@ -115,7 +132,12 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` -Required: Yes +Required: No + + ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** + [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Dockerfile\. +Type: [ImageConfig](API_ImageConfig.md) object +Required: No ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** 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\. @@ -131,9 +153,15 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_CreateFunction_RequestSyntax) ** -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\. +The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. +Required: No + + ** [PackageType](#API_CreateFunction_RequestSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. +Type: String +Valid Values:` Zip | Image` Required: No ** [Publish](#API_CreateFunction_RequestSyntax) ** @@ -150,8 +178,8 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** 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: Yes +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Required: No ** [Tags](#API_CreateFunction_RequestSyntax) ** A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. @@ -205,6 +233,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -213,14 +252,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -286,6 +330,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** 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 @@ -307,7 +355,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -319,9 +367,14 @@ 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_CreateFunction_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_CreateFunction_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -335,7 +388,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** 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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -349,7 +412,7 @@ Type: String ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** 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` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_CreateFunction_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -372,8 +435,20 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + **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 + + **CodeVerificationFailedException** +The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. +HTTP Status Code: 400 + + **InvalidCodeSignatureException** +The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** @@ -403,7 +478,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md index 091cb236..e958b423 100644 --- a/doc_source/API_DeadLetterConfig.md +++ b/doc_source/API_DeadLetterConfig.md @@ -15,5 +15,5 @@ Required: No 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/DeadLetterConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeadLetterConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md index f114deeb..3ecd3ad8 100644 --- a/doc_source/API_DeleteAlias.md +++ b/doc_source/API_DeleteAlias.md @@ -69,7 +69,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md index 73ee4ae7..af2018a0 100644 --- a/doc_source/API_DeleteCodeSigningConfig.md +++ b/doc_source/API_DeleteCodeSigningConfig.md @@ -57,7 +57,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 44f1d88c..759438f1 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -41,6 +41,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -48,15 +49,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -90,6 +99,12 @@ The ARN of the Lambda 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-_]+))?` + ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -99,7 +114,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -125,12 +140,23 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. + + ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -141,12 +167,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -180,7 +211,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md index 96f3b3f4..f2ce995b 100644 --- a/doc_source/API_DeleteFunction.md +++ b/doc_source/API_DeleteFunction.md @@ -74,7 +74,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md index e1044a4d..3727e079 100644 --- a/doc_source/API_DeleteFunctionCodeSigningConfig.md +++ b/doc_source/API_DeleteFunctionCodeSigningConfig.md @@ -71,7 +71,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md index 9cd0fd8f..38f30490 100644 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ b/doc_source/API_DeleteFunctionConcurrency.md @@ -67,7 +67,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md index 95012343..5b686b74 100644 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -70,7 +70,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md index 3ae903a4..7efc4d20 100644 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -53,7 +53,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md index f108599a..7781aacb 100644 --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ b/doc_source/API_DeleteProvisionedConcurrencyConfig.md @@ -73,7 +73,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md index 9230f2cb..6e7375b2 100644 --- a/doc_source/API_DestinationConfig.md +++ b/doc_source/API_DestinationConfig.md @@ -19,5 +19,5 @@ Required: No 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/DestinationConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DestinationConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md index 9e140772..d7d1c480 100644 --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -15,5 +15,5 @@ Required: No 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 Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md index 58d1e16f..94ce5d75 100644 --- a/doc_source/API_EnvironmentError.md +++ b/doc_source/API_EnvironmentError.md @@ -19,5 +19,5 @@ Required: No 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/EnvironmentError) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/EnvironmentError) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md index 625bfee0..7bbc27d4 100644 --- a/doc_source/API_EnvironmentResponse.md +++ b/doc_source/API_EnvironmentResponse.md @@ -20,5 +20,5 @@ Required: No 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/EnvironmentResponse) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/EnvironmentResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 9e78f5c5..f82fb0fe 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -30,6 +30,13 @@ Required: No The ARN of the Lambda 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-_]+))?` +Required: No + + **FunctionResponseTypes** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` Required: No **LastModified** @@ -43,7 +50,7 @@ Type: String Required: No **MaximumBatchingWindowInSeconds** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -72,14 +79,28 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` +Required: No + + **SelfManagedEventSource** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No **SourceAccessConfigurations** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. +Required: No + + **StartingPosition** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` +Required: No + + **StartingPositionTimestamp** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp Required: No **State** @@ -93,11 +114,17 @@ Type: String Required: No **Topics** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` +Required: No + + **TumblingWindowInSeconds** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No **UUID** @@ -110,5 +137,5 @@ Required: No 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/EventSourceMappingConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md index 2a18b234..4aa62f56 100644 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -23,5 +23,5 @@ Required: Yes 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/FileSystemConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index 8487a2d7..6ebb6ed3 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -1,9 +1,14 @@ # FunctionCode -The code for the Lambda function\. You can specify either an object in Amazon S3, or upload a deployment package directly\. +The code for the Lambda function\. You can specify either an object in Amazon S3, upload a \.zip file archive deployment package directly, or specify the URI of a container image\. ## Contents + **ImageUri** +URI of a container image in the Amazon ECR registry\. +Type: String +Required: No + **S3Bucket** An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Type: String @@ -33,5 +38,5 @@ Required: No 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/FunctionCode) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FunctionCode) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md index 850b4594..59c99331 100644 --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -4,6 +4,11 @@ Details about a function's deployment package\. ## Contents + **ImageUri** +URI of a container image in the Amazon ECR registry\. +Type: String +Required: No + **Location** A presigned URL that you can use to download the deployment package\. Type: String @@ -12,6 +17,11 @@ Required: No **RepositoryType** The service that's hosting the file\. Type: String +Required: No + + **ResolvedImageUri** +The resolved URI for the image\. +Type: String Required: No ## See Also @@ -19,5 +29,5 @@ Required: No 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/FunctionCodeLocation) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FunctionCodeLocation) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 2fa66b1c..be995ce7 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -54,6 +54,11 @@ The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` +Required: No + + **ImageConfigResponse** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object Required: No **KMSKeyArn** @@ -81,7 +86,7 @@ Required: No **LastUpdateStatusReasonCode** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No **Layers** @@ -96,9 +101,15 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi Required: No **MemorySize** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. +Required: No + + **PackageType** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` Required: No **RevisionId** @@ -115,7 +126,19 @@ Required: No **Runtime** 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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Required: No + + **SigningJobArn** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: No + + **SigningProfileVersionArn** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No **State** @@ -132,7 +155,7 @@ Required: No **StateReasonCode** 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` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No **Timeout** @@ -163,5 +186,5 @@ Required: No 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/FunctionConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md index e4236102..e2ca486e 100644 --- a/doc_source/API_FunctionEventInvokeConfig.md +++ b/doc_source/API_FunctionEventInvokeConfig.md @@ -41,5 +41,5 @@ Required: No 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/FunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md index e87f8194..a2da9476 100644 --- a/doc_source/API_GetAccountSettings.md +++ b/doc_source/API_GetAccountSettings.md @@ -68,7 +68,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md index 4b13be19..b6e3e516 100644 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -115,7 +115,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md index 3910db03..459415c7 100644 --- a/doc_source/API_GetCodeSigningConfig.md +++ b/doc_source/API_GetCodeSigningConfig.md @@ -75,7 +75,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index f073a04e..fb1c29a7 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -39,6 +39,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -46,15 +47,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -88,6 +97,12 @@ The ARN of the Lambda 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-_]+))?` + ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -97,7 +112,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -123,12 +138,23 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. + + ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -139,12 +165,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -174,7 +205,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index 247f695e..ee3d29e0 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -41,8 +41,10 @@ Content-type: application/json { "Code": { + "ImageUri": "string", "Location": "string", - "RepositoryType": "string" + "RepositoryType": "string", + "ResolvedImageUri": "string" }, "Concurrency": { "ReservedConcurrentExecutions": number @@ -72,6 +74,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -80,14 +93,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -155,7 +173,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md index 2a4604df..3e3c1b64 100644 --- a/doc_source/API_GetFunctionCodeSigningConfig.md +++ b/doc_source/API_GetFunctionCodeSigningConfig.md @@ -89,7 +89,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md index c0e7e63a..143a3c22 100644 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -75,7 +75,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 4d3a9dc4..8fc54d45 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -66,6 +66,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -74,14 +85,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -147,6 +163,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** 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 @@ -168,7 +188,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -180,9 +200,14 @@ 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_GetFunctionConfiguration_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -196,7 +221,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** 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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -210,7 +245,7 @@ Type: String ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** 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` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -256,7 +291,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md index 171a7824..a1ff02fc 100644 --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -117,7 +117,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index d0469dc3..61c5fcd7 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -37,7 +37,9 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string" + "Location": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" }, "CreatedDate": "string", "Description": "string", @@ -58,7 +60,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. @@ -119,7 +121,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index 46aaf325..e4c3cf0d 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -33,7 +33,9 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string" + "Location": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" }, "CreatedDate": "string", "Description": "string", @@ -54,7 +56,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. @@ -115,7 +117,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index 5f080c3f..8a6f1f17 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -77,7 +77,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md index 35421479..7e9d820e 100644 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -84,7 +84,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md index 0f08ee63..4248db3d 100644 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -113,7 +113,7 @@ For more information about using this API in one of the language\-specific AWS S + [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 Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [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) diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md index 1b4f1fdd..ac7ed0bb 100644 --- a/doc_source/API_ImageConfig.md +++ b/doc_source/API_ImageConfig.md @@ -1,6 +1,6 @@ # ImageConfig -Configuration values that override the container image Dockerfile settings\. See [Container settings](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html)\. +Configuration values that override the container image Dockerfile settings\. See [Container settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms)\. ## Contents @@ -27,5 +27,5 @@ Required: No 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/ImageConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md index b43ac4bc..2e0f10d5 100644 --- a/doc_source/API_ImageConfigError.md +++ b/doc_source/API_ImageConfigError.md @@ -19,5 +19,5 @@ Required: No 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/ImageConfigError) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md index 4b19ddeb..a71f8502 100644 --- a/doc_source/API_ImageConfigResponse.md +++ b/doc_source/API_ImageConfigResponse.md @@ -19,5 +19,5 @@ Required: No 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/ImageConfigResponse) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index e982a0f1..294589d9 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -216,7 +216,7 @@ For more information about using this API in one of the language\-specific AWS S + [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 Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md index f7246f81..69395006 100644 --- a/doc_source/API_InvokeAsync.md +++ b/doc_source/API_InvokeAsync.md @@ -81,7 +81,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index df0d9d16..80c3a729 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -14,6 +14,18 @@ Required: No **CodeSize** The size of the layer archive in bytes\. Type: Long +Required: No + + **SigningJobArn** +The Amazon Resource Name \(ARN\) of a signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: No + + **SigningProfileVersionArn** +The Amazon Resource Name \(ARN\) for a signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No ## See Also @@ -21,5 +33,5 @@ Required: No 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/Layer) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/Layer) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md index df236db4..8f946fc3 100644 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -33,5 +33,5 @@ Required: No 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/LayerVersionContentInput) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/LayerVersionContentInput) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index 09f64516..b0ead36e 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -17,6 +17,16 @@ Required: No **Location** A link to the layer archive in Amazon S3 that is valid for 10 minutes\. Type: String +Required: No + + **SigningJobArn** +The Amazon Resource Name \(ARN\) of a signing job\. +Type: String +Required: No + + **SigningProfileVersionArn** +The Amazon Resource Name \(ARN\) for a signing profile version\. +Type: String Required: No ## See Also @@ -24,5 +34,5 @@ Required: No 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/LayerVersionContentOutput) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/LayerVersionContentOutput) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 2e858f4a..f2df4764 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -8,7 +8,7 @@ Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lam The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **CreatedDate** @@ -45,5 +45,5 @@ Required: No 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/LayerVersionsListItem) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/LayerVersionsListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md index 96e5e748..8748e7b8 100644 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -28,5 +28,5 @@ Required: No 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/LayersListItem) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/LayersListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md index 6440d010..355812a0 100644 --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -104,7 +104,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md index 517dbaf5..2317b88d 100644 --- a/doc_source/API_ListCodeSigningConfigs.md +++ b/doc_source/API_ListCodeSigningConfigs.md @@ -79,7 +79,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 803b3be6..7ff4f8fe 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -64,6 +64,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -71,15 +72,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ], @@ -126,7 +135,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md index 4b865687..b689c65c 100644 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -103,7 +103,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index ae21f90a..e99ef63e 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -2,7 +2,10 @@ Returns a list of Lambda functions, with the version\-specific configuration of each\. Lambda returns up to 50 functions per call\. -Set `FunctionVersion` to `ALL` to include all published versions of each function in addition to the unpublished version\. To get more information about a function or version, use [GetFunction](API_GetFunction.md)\. +Set `FunctionVersion` to `ALL` to include all published versions of each function in addition to the unpublished version\. + +**Note** +The `ListFunctions` action returns a subset of the [FunctionConfiguration](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [GetFunction](API_GetFunction.md)\. ## Request Syntax @@ -26,7 +29,7 @@ For Lambda@Edge functions, the AWS Region of the master function\. For example, Pattern: `ALL|[a-z]{2}(-gov)?-[a-z]+-\d{1}` ** [MaxItems](#API_ListFunctions_RequestSyntax) ** -The maximum number of functions to return\. +The maximum number of functions to return in the response\. Note that `ListFunctions` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. ## Request Body @@ -66,6 +69,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -74,14 +88,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -136,7 +155,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md index 39443594..a2cc5696 100644 --- a/doc_source/API_ListFunctionsByCodeSigningConfig.md +++ b/doc_source/API_ListFunctionsByCodeSigningConfig.md @@ -77,7 +77,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index 1e38e5f3..eacec069 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. @@ -93,7 +93,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index cf6939f7..4adf853d 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. @@ -87,7 +87,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md index 5cb586fe..77a1530d 100644 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -96,7 +96,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md index e5e7d1d5..d2dc7f0b 100644 --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -69,7 +69,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListTags) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index cfdddb83..a6bb06e9 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -69,6 +69,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -77,14 +88,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -142,7 +158,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md index 144e32dc..46402c85 100644 --- a/doc_source/API_OnFailure.md +++ b/doc_source/API_OnFailure.md @@ -16,5 +16,5 @@ Required: No 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/OnFailure) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/OnFailure) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md index 97935571..ae14a7ea 100644 --- a/doc_source/API_OnSuccess.md +++ b/doc_source/API_OnSuccess.md @@ -16,5 +16,5 @@ Required: No 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/OnSuccess) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/OnSuccess) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md index 4dedc902..70a90b0c 100644 --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -4,19 +4,24 @@ The following actions are supported: + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) ++ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) ++ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) ++ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) ++ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) ++ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -28,9 +33,11 @@ The following actions are supported: + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) ++ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) ++ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -38,6 +45,7 @@ The following actions are supported: + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) ++ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -46,6 +54,7 @@ The following actions are supported: + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) ++ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md index 7325b710..73d4e84e 100644 --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ b/doc_source/API_ProvisionedConcurrencyConfigListItem.md @@ -49,5 +49,5 @@ Required: No 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/ProvisionedConcurrencyConfigListItem) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index fcbe9f72..21b6f62a 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -41,7 +41,7 @@ The request accepts the following data in JSON format\. A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. -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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -75,7 +75,9 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string" + "Location": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" }, "CreatedDate": "string", "Description": "string", @@ -96,7 +98,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. @@ -161,7 +163,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 4e1749f3..d361190c 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -86,6 +86,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -94,14 +105,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -167,6 +183,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** 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 @@ -188,7 +208,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -200,9 +220,14 @@ 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_PublishVersion_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_PublishVersion_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -216,7 +241,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** 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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -230,7 +265,7 @@ Type: String ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** 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` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_PublishVersion_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -288,7 +323,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md index 18cc1352..8263662a 100644 --- a/doc_source/API_PutFunctionCodeSigningConfig.md +++ b/doc_source/API_PutFunctionCodeSigningConfig.md @@ -109,7 +109,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md index c1ec66a8..367942bc 100644 --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -94,7 +94,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index 7de52ada..ec123c06 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -156,7 +156,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md index 09083ef0..5123b441 100644 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -124,7 +124,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md index 0bad24c5..529e3980 100644 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -74,7 +74,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md index 6f877055..f7533bc9 100644 --- a/doc_source/API_RemovePermission.md +++ b/doc_source/API_RemovePermission.md @@ -81,7 +81,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md index 5ea2260c..cdf08843 100644 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -19,5 +19,5 @@ Required: No 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/SelfManagedEventSource) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 8a21b665..06601520 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -1,21 +1,25 @@ # SourceAccessConfiguration - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +You can specify the authentication protocol, or the VPC components to secure access to your event source\. ## Contents **Type** -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +The type of authentication protocol or the VPC components for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. ++ `BASIC_AUTH` \- \(MQ\) The Secrets Manager secret that stores your broker credentials\. ++ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your Self\-Managed Apache Kafka cluster\. ++ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your Self\-Managed Apache Kafka brokers\. ++ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your Self\-Managed Apache Kafka brokers\. ++ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your Self\-Managed Apache Kafka brokers\. Type: String -Valid Values:` BASIC_AUTH` +Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH` Required: No **URI** -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +The value for your chosen configuration in `Type`\. For example: `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`\. Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Length Constraints: Minimum length of 1\. Maximum length of 200\. +Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` Required: No ## See Also @@ -23,5 +27,5 @@ Required: No 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/SourceAccessConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md index 7c144f26..81d0c506 100644 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -72,7 +72,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/TagResource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 40bef909..653b1917 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -15,5 +15,5 @@ Required: No 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/TracingConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/TracingConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md index 97f01023..acfdfabb 100644 --- a/doc_source/API_TracingConfigResponse.md +++ b/doc_source/API_TracingConfigResponse.md @@ -15,5 +15,5 @@ Required: No 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/TracingConfigResponse) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/TracingConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index ebedf4f7..aaa9f473 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -5,6 +5,9 @@ The following data types are supported: + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) ++ [AllowedPublishers](API_AllowedPublishers.md) ++ [CodeSigningConfig](API_CodeSigningConfig.md) ++ [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -17,6 +20,9 @@ The following data types are supported: + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) ++ [ImageConfig](API_ImageConfig.md) ++ [ImageConfigError](API_ImageConfigError.md) ++ [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) @@ -25,6 +31,7 @@ The following data types are supported: + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) ++ [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md index b1e30427..eb23ed5e 100644 --- a/doc_source/API_UntagResource.md +++ b/doc_source/API_UntagResource.md @@ -64,7 +64,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md index 609444f5..e1d3748f 100644 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -158,7 +158,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md index c7f21012..a12662bc 100644 --- a/doc_source/API_UpdateCodeSigningConfig.md +++ b/doc_source/API_UpdateCodeSigningConfig.md @@ -102,7 +102,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index c6a09e35..4e6263f3 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -28,6 +28,7 @@ Content-type: application/json }, "Enabled": boolean, "FunctionName": "string", + "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, @@ -37,7 +38,8 @@ Content-type: application/json "Type": "string", "URI": "string" } - ] + ], + "TumblingWindowInSeconds": number } ``` @@ -57,8 +59,9 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. Max 10\. ++ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. ++ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -90,10 +93,17 @@ The length constraint applies only to the full ARN\. If you specify only the fun Type: String 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: No + + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` Required: No ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -117,11 +127,15 @@ Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. +Required: No + + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No ## Response Syntax @@ -143,6 +157,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -150,15 +165,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -192,6 +215,12 @@ The ARN of the Lambda 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-_]+))?` + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -201,7 +230,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -227,12 +256,23 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. + + ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -243,12 +283,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -286,7 +331,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index f0f55d47..8f181f19 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -1,9 +1,12 @@ # UpdateFunctionCode -Updates a Lambda function's code\. +Updates a Lambda function's code\. If code signing is enabled for the function, the code package must be signed by a trusted publisher\. For more information, see [Configuring code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html)\. 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\. +**Note** +For a function defined as a container image, Lambda resolves the image tag to an image digest\. In Amazon ECR, if you update the image tag to a new image, Lambda does not automatically update the function\. + ## Request Syntax ``` @@ -12,6 +15,7 @@ Content-type: application/json { "DryRun": boolean, + "ImageUri": "string", "Publish": boolean, "RevisionId": "string", "S3Bucket": "string", @@ -44,6 +48,11 @@ The request accepts the following data in JSON format\. ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean +Required: No + + ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** +URI of a container image in the Amazon ECR registry\. +Type: String Required: No ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** @@ -111,6 +120,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -119,14 +139,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -192,6 +217,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** 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 @@ -213,7 +242,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -225,9 +254,14 @@ 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) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -241,7 +275,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** 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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -255,7 +299,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** 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` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -278,8 +322,20 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + **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 + + **CodeVerificationFailedException** +The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. +HTTP Status Code: 400 + + **InvalidCodeSignatureException** +The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** @@ -313,7 +369,7 @@ For more information about using this API in one of the language\-specific AWS S + [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 Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index f4b2ea77..f828bcfe 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -31,6 +31,11 @@ Content-type: application/json } ], "Handler": "string", + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, @@ -95,6 +100,11 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` +Required: No + + ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** + [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Dockerfile\. +Type: [ImageConfig](API_ImageConfig.md) object Required: No ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -111,9 +121,9 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** -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\. +The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -130,7 +140,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -180,6 +190,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -188,14 +209,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -261,6 +287,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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 @@ -282,7 +312,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -294,9 +324,14 @@ 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) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -310,7 +345,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -324,7 +369,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -347,6 +392,18 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + + **CodeVerificationFailedException** +The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. +HTTP Status Code: 400 + + **InvalidCodeSignatureException** +The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. +HTTP Status Code: 400 + **InvalidParameterValueException** One of the parameters in the request is invalid\. HTTP Status Code: 400 @@ -378,7 +435,7 @@ For more information about using this API in one of the language\-specific AWS S + [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 Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) + [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) diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index 33509a9b..3a5cb783 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -154,7 +154,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md index 8b29a124..d2610bb6 100644 --- a/doc_source/API_VpcConfig.md +++ b/doc_source/API_VpcConfig.md @@ -21,5 +21,5 @@ Required: No 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/VpcConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/VpcConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md index 37a49bed..b68675f5 100644 --- a/doc_source/API_VpcConfigResponse.md +++ b/doc_source/API_VpcConfigResponse.md @@ -26,5 +26,5 @@ Required: No 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/VpcConfigResponse) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/VpcConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 1f95f955..4d4d82de 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function”, "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" @@ -225,4 +225,4 @@ Use `remove-layer-version-permission` to remove statements from the policy\. ``` aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org -``` +``` \ No newline at end of file diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 7c4c9ddb..e017d02d 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -63,7 +63,6 @@ Create an application in the Lambda console\. In Lambda, an application is an AW 1. Configure application settings\. + **Application name** – **my\-app**\. - + **Application description** – **my application**\. + **Runtime** – **Node\.js 10\.x**\. + **Source control service** – **CodeCommit**\. + **Repository name** – **my\-app\-repo**\. diff --git a/doc_source/code-editor.md b/doc_source/code-editor.md index 6812db13..2472dcff 100644 --- a/doc_source/code-editor.md +++ b/doc_source/code-editor.md @@ -4,6 +4,8 @@ The Lambda console provides a code editor for languages that do not require comp The code editor includes the *menu bar*, *windows*, and the *editor pane*\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. @@ -26,6 +28,8 @@ You can use the **Environment** window in the code editor to create, open, and m ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) + + **To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. **To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. @@ -33,9 +37,13 @@ You can use the **Environment** window in the code editor to create, open, and m **To create a new file**, do one of the following: + In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. + Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -+ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. ++ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) + + **To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. **To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. @@ -48,6 +56,8 @@ You can use the **Environment** window in the code editor to create, open, and m **To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) **To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. @@ -58,17 +68,27 @@ Use the editor pane in the code editor to view and write code\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) + + ### Working with tab buttons Use the *tab buttons bar* to select, view, and create files\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) + + **To display an open file's contents**, do one of the following: + Choose the file's tab\. -+ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. ++ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) + + **To close an open file**, do one of the following: + Choose the **X** icon in the file's tab\. + Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. @@ -83,12 +103,20 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) + + **To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) + + **To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) **To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. @@ -99,6 +127,8 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) + + ## Working in fullscreen mode You can expand the code editor to get more room to work with your code\. @@ -107,6 +137,8 @@ To expand the code editor to the edges of the web browser window, choose the **T ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) + + To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 7876becd..9af84539 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -2,6 +2,17 @@ You can create one or more aliases for your Lambda function\. A Lambda alias is like a pointer to a specific function version\. Users can access the function version using the alias Amazon Resource Name \(ARN\)\. +**Topics** ++ [Creating a function alias \(Console\)](#configuration-aliases-config) ++ [Managing aliases with the Lambda API](#versioning-aliases-api) ++ [Using aliases](#using-aliases) ++ [Resource policies](#versioning-permissions-alias) ++ [Alias routing configuration](#configuring-alias-routing) + +## Creating a function alias \(Console\) + +You can create a function alias using the Lambda console\. + **To create an alias** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -143,4 +154,6 @@ When you configure traffic weights between two function versions, there are two `19:44:37 START RequestId: request id Version: $version ` For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. -+ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. \ No newline at end of file ++ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. + + \ No newline at end of file diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index 1d84a658..8e42e650 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -1,6 +1,15 @@ # Configuring database access for a Lambda function -You can use the Lambda console to create an Amazon RDS Proxy database proxy for your function\. A database proxy manages a pool of database connections and relays queries from a function\. This enables a function to reach high [concurrency](gettingstarted-concepts.md#gettingstarted-concepts-concurrency) levels without exhausting database connections\. +You can create an Amazon RDS Proxy database proxy for your function\. A database proxy manages a pool of database connections and relays queries from a function\. This enables a function to reach high [concurrency](gettingstarted-concepts.md#gettingstarted-concepts-concurrency) levels without exhausting database connections\. + +**Topics** ++ [Creating a database proxy \(console\)](#configuration-database-config) ++ [Using the function's permissions for authentication](#configuration-database-auth) ++ [Sample application](#configuration-database-sample) + +## Creating a database proxy \(console\) + +You can use the Lambda console to create an Amazon RDS Proxy database proxy\. **To create a database proxy** @@ -20,9 +29,9 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy for ``` { - "username": "admin", - "password": "e2abcecxmpldc897" - } + "username": "admin", + "password": "e2abcecxmpldc897" + } ``` + **IAM role** – An IAM role with permission to use the secret, and a trust policy that allows Amazon RDS to assume the role\. + **Authentication** – The authentication and authorization method for connecting to the proxy from your function code\. @@ -36,10 +45,6 @@ Proxy creation takes a few minutes\. When the proxy is available, configure your Standard [Amazon RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/) applies\. For more information, see [Managing connections with the Amazon RDS Proxy](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-proxy.html) in the Amazon Aurora User Guide\. -**Topics** -+ [Using the function's permissions for authentication](#configuration-database-auth) -+ [Sample application](#configuration-database-sample) - ## Using the function's permissions for authentication By default, you can connect to a proxy with the same username and password that it uses to connect to the database\. The only difference in your function code is the endpoint that the database client connects to\. The drawback of this method is that you must expose the password to your function code, either by configuring it in a secure environment variable or by retrieving it from Secrets Manager\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 9abf6b67..cf46ef31 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -5,7 +5,22 @@ You can use environment variables to adjust your function's behavior without upd **Note** To increase database security, we recommend that you use AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. -You set environment variables on the unpublished version of your function by specifying a key and value\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-console.md)\. +Environment variables are not evaluated prior to the function invocation\. Any value you define is considered a literal string and not expanded\. Perform the variable evaluation in your function code\. + +**Topics** ++ [Configuring environment variables](#configuration-envvars-config) ++ [Configuring environment variables with the API](#configuration-envvars-api) ++ [Example scenario for environment variables](#configuration-envvars-example) ++ [Retrieve environment variables](#configuration-envvars-retrieve) ++ [Defined runtime environment variables](#configuration-envvars-runtime) ++ [Securing environment variables](#configuration-envvars-encryption) ++ [Sample code and templates](#configuration-envvars-samples) + +## Configuring environment variables + +You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-console.md)\. + +You create an environment variable on your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\. **To set environment variables in the Lambda console** @@ -13,9 +28,9 @@ You set environment variables on the unpublished version of your function by spe 1. Choose a function\. -1. Choose **Code** if it is not already selected\. +1. Choose **Configuration**, then choose **Environment variables**\. -1. Scroll down\. Under **Environment variables**, choose **Edit**\. +1. Under **Environment variables**, choose **Edit**\. 1. Choose **Add environment variable**\. @@ -29,7 +44,59 @@ You set environment variables on the unpublished version of your function by spe 1. Choose **Save**\. -Use environment variables to pass environment\-specific settings to your code\. For example, you can have two functions with the same code but different configuration\. One function connects to a test database, and the other connects to a production database\. In this situation, you use environment variables to tell the function the hostname and other connection details for the database\. +## Configuring environment variables with the API + +To manage environment variables with the AWS CLI or AWS SDK, use the following API operations\. ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [CreateFunction](API_CreateFunction.md) + +The following example sets two environment variables on a function named `my-function`\. + +``` +aws lambda update-function-configuration --function-name my-function \ + --environment "Variables={BUCKET=my-bucket,KEY=file.txt}" +``` + +When you apply environment variables with the `update-function-configuration` command, the entire contents of the `Variables` structure is replaced\. To retain existing environment variables when you add a new one, include all existing values in your request\. + +To get the current configuration, use the `get-function-configuration` command\. + +``` +aws lambda get-function-configuration --function-name my-function +``` + +You should see the following output: + +``` +{ + "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", + "Environment": { + "Variables": { + "BUCKET": "my-bucket", + "KEY": "file.txt" + } + }, + "RevisionId": "0894d3c1-2a3d-4d48-bf7f-abade99f3c15", + ... +} +``` + +To ensure that the values don't change between when you read the configuration and when you update it, you can pass the revision ID from the output of `get-function-configuration` as a parameter to `update-function-configuration`\. + +To configure a function's encryption key, set the `KMSKeyARN` option\. + +``` +aws lambda update-function-configuration --function-name my-function \ + --kms-key-arn arn:aws:kms:us-east-2:123456789012:key/055efbb4-xmpl-4336-ba9c-538c7d31f599 +``` + +## Example scenario for environment variables + +You can use environment variables to customize function behavior in your test environment and production environment\. For example, you can create two functions with the same code but different configurations\. One function connects to a test database, and the other connects to a production database\. In this situation, you use environment variables to tell the function the hostname and other connection details for the database\. The following example shows how to define the database host and database name as environment variables\. @@ -37,8 +104,7 @@ The following example shows how to define the database host and database name as If you want your test environment to generate more debug information than the production environment, you could set an environment variable to configure your test environment to use more verbose logging or more detailed tracing\. -**Note** -Environment variables are not evaluated prior to the function invocation\. Any value you define is considered a literal string and not expanded\. Perform the variable evaluation in the function code\. +## Retrieve environment variables To retrieve environment variables in your function code, use the standard method for your programming language\. @@ -54,7 +120,7 @@ let region = process.env.AWS_REGION ``` import os -region = os.environ['AWS_REGION'] + region = os.environ['AWS_REGION'] ``` **Note** @@ -103,13 +169,7 @@ $region = $env:AWS_REGION Lambda stores environment variables securely by encrypting them at rest\. You can [configure Lambda to use a different encryption key](#configuration-envvars-encryption), encrypt environment variable values on the client side, or set environment variables in an AWS CloudFormation template with AWS Secrets Manager\. -**Topics** -+ [Runtime environment variables](#configuration-envvars-runtime) -+ [Securing environment variables](#configuration-envvars-encryption) -+ [Configuring environment variables with the Lambda API](#configuration-envvars-api) -+ [Sample code and templates](#configuration-envvars-samples) - -## Runtime environment variables +## Defined runtime environment variables Lambda [runtimes](lambda-runtimes.md) set several environment variables during initialization\. Most of the environment variables provide information about the function or runtime\. The keys for these environment variables are *reserved* and cannot be set in your function configuration\. @@ -157,9 +217,9 @@ When you provide the key, only users in your account with access to the key can 1. Choose a function\. -1. Choose **Code** if it is not already selected\. +1. Choose **Configuration**, then choose **Environment variables**\. -1. Scroll down\. Under **Environment variables**, choose **Edit**\. +1. Under **Environment variables**, choose **Edit**\. 1. Expand **Encryption configuration**\. @@ -210,9 +270,9 @@ You can also encrypt environment variable values on the client side before sendi 1. Choose a function\. -1. Choose **Code** if it is not already selected\. +1. Choose **Configuration**, then choose **Environment variables**\. -1. Scroll down\. Under **Environment variables**, choose **Edit**\. +1. Under **Environment variables**, choose **Edit**\. 1. Expand **Encryption configuration**\. @@ -229,56 +289,6 @@ To view sample code for your function's language, choose **Code** next to an env Another option is to store passwords in AWS Secrets Manager secrets\. You can reference the secret in your AWS CloudFormation templates to set passwords on databases\. You can also set the value of an environment variable on the Lambda function\. For an example, see the next section\. -## Configuring environment variables with the Lambda API - -To manage environment variables with the AWS CLI or AWS SDK, use the following API operations\. -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example sets two environment variables on a function named `my-function`\. - -``` -aws lambda update-function-configuration --function-name my-function \ - --environment "Variables={BUCKET=my-bucket,KEY=file.txt}" -``` - -When you apply environment variables with the `update-function-configuration` command, the entire contents of the `Variables` structure is replaced\. To retain existing environment variables when you add a new one, include all existing values in your request\. - -To get the current configuration, use the `get-function-configuration` command\. - -``` -aws lambda get-function-configuration --function-name my-function -``` - -You should see the following output: - -``` -{ - "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", - "Environment": { - "Variables": { - "BUCKET": "my-bucket", - "KEY": "file.txt" - } - }, - "RevisionId": "0894d3c1-2a3d-4d48-bf7f-abade99f3c15", - ... -} -``` - -To ensure that the values don't change between when you read the configuration and when you update it, you can pass the revision ID from the output of `get-function-configuration` as a parameter to `update-function-configuration`\. - -To configure a function's encryption key, set the `KMSKeyARN` option\. - -``` -aws lambda update-function-configuration --function-name my-function \ - --kms-key-arn arn:aws:kms:us-east-2:123456789012:key/055efbb4-xmpl-4336-ba9c-538c7d31f599 -``` - ## Sample code and templates Sample applications in this guide's GitHub repository demonstrate the use of environment variables in function code and AWS CloudFormation templates\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 930b1cc5..d11a0713 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -2,6 +2,16 @@ You can configure a function to mount an Amazon Elastic File System \(Amazon EFS\) file system to a local directory\. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency\. +**Topics** ++ [Connecting to a file system \(console\)](#configuration-filesystem-config) ++ [Configuring a file system and access point](#configuration-filesystem-setup) ++ [Execution role and user permissions](#configuration-filesystem-permissions) ++ [Configuring file system access with the Lambda API](#configuration-filesystem-api) ++ [AWS CloudFormation and AWS SAM](#configuration-filesystem-cloudformation) ++ [Sample applications](#configuration-filesystem-samples) + +## Connecting to a file system \(console\) + A function connects to a file system over the local network in a VPC\. The subnets that your function connects to can be the same subnets that contain mount points for your file system, or subnets in the same Availability Zone that can route NFS traffic \(port 2049\) to the file system\. **Note** @@ -27,13 +37,6 @@ Lambda charges for data transfer between VPCs\. This only applies if your functi For more information about Lambda's integration with Amazon EFS, see [Using Amazon EFS with Lambda](services-efs.md)\. -**Topics** -+ [Configuring a file system and access point](#configuration-filesystem-setup) -+ [Execution role and user permissions](#configuration-filesystem-permissions) -+ [Configuring file system access with the Lambda API](#configuration-filesystem-api) -+ [AWS CloudFormation and AWS SAM](#configuration-filesystem-cloudformation) -+ [Sample applications](#configuration-filesystem-samples) - ## Configuring a file system and access point Create a file system in Amazon EFS with a mount target in every Availability Zone that your function connects to\. For performance and resilience, use at least two Availability Zones\. For example, in a simple configuration you could have a VPC with two private subnets in separate Availability Zones\. The function connects to both subnets and a mount target is available in each\. Ensure that NFS traffic \(port 2049\) is allowed by the security groups used by the function and mount targets\. diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 5c252be0..10bf3d74 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -42,19 +42,17 @@ For example, use the IAM console to create a role with the following policy: ``` { "Version": "2012-10-17", - "Statement": { - [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": [ - "ecr:SetRepositoryPolicy", - "ecr:GetRepositoryPolicy" - ], - "Resource": "arn:aws:ecr:::repository//" - } - ] - } + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": [ + "ecr:SetRepositoryPolicy", + "ecr:GetRepositoryPolicy" + ], + "Resource": "arn:aws:ecr:::repository//" + } + ] } ``` diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 6dd8a5d0..a91abe0e 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -271,7 +271,7 @@ jq.zip ------ -For more information about path settings in the Lambda execution environment, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. +For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. ## Layer permissions diff --git a/doc_source/configuration-memory.md b/doc_source/configuration-memory.md index ee80ac23..b88d5251 100644 --- a/doc_source/configuration-memory.md +++ b/doc_source/configuration-memory.md @@ -4,7 +4,11 @@ Lambda allocates CPU power in proportion to the amount of memory configured\. *M This page describes how to update the memory allotted to your function in the Lambda console\. -## Configuring function memory in the Lambda console +**Topics** ++ [Configuring function memory \(console\)](#configuration-memory-console) ++ [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept) + +## Configuring function memory \(console\) You can configure the memory of your function in the Lambda console\. @@ -14,13 +18,15 @@ You can configure the memory of your function in the Lambda console\. 1. Choose a function\. -1. On the [function configuration page](configuration-console.md), on the **Basic settings** pane, choose **Edit**\. +1. Choose **Configuration** and then choose **General configuration** + +1. Under **General configuration**, choose **Edit**\. 1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\. 1. Choose **Save**\. -## Accepting function memory recommendations on the Lambda console +## Accepting function memory recommendations \(console\) If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. @@ -32,7 +38,9 @@ When you've opted in and your [Lambda function meets Compute Optimizer requireme 1. Choose a function\. -1. On the [function configuration page](configuration-console.md), on the **Basic settings** pane, choose **Edit**\. +1. Choose **Configuration** and then choose **General configuration** + +1. Under **General configuration**, choose **Edit**\. 1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\. diff --git a/doc_source/configuration-preview.md b/doc_source/configuration-preview.md deleted file mode 100644 index 2bebab89..00000000 --- a/doc_source/configuration-preview.md +++ /dev/null @@ -1,96 +0,0 @@ -# Configuring functions in the AWS Lambda console \(preview\) - - -**Public preview** - -| | -| --- | -| Public preview The updated AWS Lambda console is in preview release and is subject to change\. The preview is available to AWS accounts on a region by region basis\. The changes include a new function\-level configuration page, increased visibility into versions and aliases, and a dedicated section for your code\. To provide feedback, visit the updated console \([https://console\.aws\.amazon\.com/lambda/](https://console.aws.amazon.com/lambda/)\) and select **Tell us what you think**\. | - - You can use the Lambda console to configure function settings, add triggers and destinations, and edit and update your code\. The following sections will cover how to perform those workflows in the updated Lambda console\. - -**Topics** -+ [Configure function settings](#configuration-preview-settings) -+ [Add and edit triggers and destinations](#configuration-preview-triggers) -+ [Edit and update code](#configuration-preview-code) - -## Configure function settings - -To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. This will take you to the function visualization\. - -Choose **Latest configuration** to view and manage your version's current configuration\. - -![\[The Latest configuration section of the updated console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/latest-config.png) - -Areas of configuration are broken into five sections, which encapsulate the following: - -**General** -Basic settings -Asynchronous invocation -Monitoring tools -VPC -Database proxies -File system -Concurrency - -**Runtime** -Environment variables -Layers - -**Triggers** -A list of existing triggers and options to create, enable, disable, fix, and delete triggers\. - -**Permissions** -Execution role -Resource summary -Resource\-based policy -Auditing and compliance - -**Destinations** -A list of existing destinations and options to create, remove, and edit destinations\. - -## Add and edit triggers and destinations - -Triggers and destinations now exist as subsets of your function's greater configuration settings\. Both resources are still visible in the function visualization, but are no longer accessed through interacting with it\. - -To see your lists of existing triggers or destinations, choose **Latest configuration** when viewing a version of your function and select either **Triggers** or **Destinations** from the left\-hand sections\. - -**To add a new trigger** - -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. - -1. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. - -1. Choose **Latest configuration** and then **Triggers**\. - -1. Choose **Add trigger** and select the type of trigger from the list of available options\. - -1. The fields associated with that trigger will load in below\. Fill them in and choose **Add**\. - -1. To verify your trigger has been added, choose **Overview** and note the new trigger in the **Function visualization**\. - -To enable, disable, fix, or delete a trigger, choose the item in the list of triggers provided when you visit the **Triggers** section of **Latest configuration**\. To reconfigure the trigger, use the event source mapping API commands\. - -**To add a new destination** - -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. - -1. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. - -1. Choose **Latest configuration** and then **Destinations**\. - -1. Choose **Add destination**\. - -1. Fill in the required fields and then choose **Save**\. - -1. To verify your destination has been added, choose **Overview** and note the new destination in the **Function visualization**\. - -To edit or remove the destination, choose the item in the list of destinations provided when you choose the **Destinations** section of **Latest configuration**\. - -## Edit and update code - -Function code now has its own primary section within your function's details\. To access your function code, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. This will take you to the function visualization\. - -Choose **Code** to view and manage your version's current code\. From this view you can edit inline, where possible, or choose **Upload from** to upload from a source\. - -Functionality has not changed for the development environment and test events\. \ No newline at end of file diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 2232792f..1cd6d2af 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -2,6 +2,14 @@ You can tag Lambda functions to organize them by owner, project or department\. Tags are freeform key\-value pairs that are supported across AWS services for use in filtering resources and adding detail to billing reports\. +**Topics** ++ [Adding tags to a function \(console\)](#configuration-tags-config) ++ [Using tags to filter functions \(console\)](#configuration-tags-filter) ++ [Using Tags with the AWS CLI](#configuration-tags-cli) ++ [Tag Key and Value Requirements](#configuration-tags-restrictions) + +## Adding tags to a function \(console\) + **To add tags to a function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -17,6 +25,8 @@ You can tag Lambda functions to organize them by owner, project or department\. 1. Choose **Save**\. +## Using tags to filter functions \(console\) + You can filter functions based on the presence or value of a tag with the Lambda console or with the AWS Resource Groups API\. Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that is snapshotted when you publish a version\. **To filter functions with tags** @@ -35,10 +45,6 @@ The search bar also supports searching for tag keys\. Type `tag` to see just a l With AWS Billing and Cost Management, you can use tags to customize billing reports and create cost\-allocation reports\. For more information, see see [Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. -**Topics** -+ [Using Tags with the AWS CLI](#configuration-tags-cli) -+ [Tag Key and Value Requirements](#configuration-tags-restrictions) - ## Using Tags with the AWS CLI When you create a new Lambda function, you can include tags with the `--tags` option\. diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index caabb639..6ba8a250 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -8,9 +8,19 @@ A function version includes the following information: + All of the function settings, including the environment variables\. + A unique Amazon Resource Name \(ARN\) to identify the specific version of the function\. +**Topics** ++ [Creating function versions](#configuration-versions-config) ++ [Managing versions with the Lambda API](#versioning-versions-api) ++ [Using versions](#versioning-versions-using) ++ [Granting permissions](#versioning-permissions) + +## Creating function versions + You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring functions in the console](configuration-console.md)\. -**To create a new version of a function** +You can create a function version using the Lambda console\. + +**To create a new function version** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 7ac4795d..1ca577fe 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -6,6 +6,11 @@ To establish a private connection between your VPC and Lambda, create an [interf Each interface endpoint is represented by one or more [elastic network interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in your subnets\. A network interface provides a private IP address that serves as an entry point for traffic to Lambda\. +**Topics** ++ [Considerations for Lambda interface endpoints](#vpc-endpoint-considerations) ++ [Creating an interface endpoint for Lambda](#vpc-endpoint-create) ++ [Creating an interface endpoint policy for Lambda](#vpc-endpoint-policy) + ## Considerations for Lambda interface endpoints Before you set up an interface endpoint for Lambda, be sure to review [Interface endpoint properties and limitations](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#vpce-interface-limitations) in the *Amazon VPC User Guide*\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 30056c02..c05e249b 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -14,8 +14,8 @@ Lambda functions can't connect directly to a VPC with [ dedicated instance tenan **Topics** + [Execution role and user permissions](#vpc-permissions) -+ [Configuring VPC access with the Lambda console](#vpc-configuring) -+ [Configuring VPC access with the Lambda API](#vpc-configuring-api) ++ [Configuring VPC access \(console\)](#vpc-configuring) ++ [Configuring VPC access \(API\)](#vpc-configuring-api) + [Using IAM condition keys for VPC settings](#vpc-conditions) + [Internet and service access for VPC\-connected functions](#vpc-internet) + [VPC tutorials](#vpc-tutorials) @@ -39,7 +39,7 @@ When you configure VPC connectivity, Lambda uses your permissions to verify netw + **ec2:DescribeSubnets** + **ec2:DescribeVpcs** -## Configuring VPC access with the Lambda console +## Configuring VPC access \(console\) If your [IAM permissions](#vpc-conditions) allow you only to create Lambda functions that connect to your VPC, you must configure the VPC when you create the function\. If your IAM permissions allow you to create functions that aren't connected to your VPC, you can add the VPC configuration after you create the function\. @@ -77,7 +77,7 @@ To access private resources, connect your function to private subnets\. If your 1. Choose **Save**\. -## Configuring VPC access with the Lambda API +## Configuring VPC access \(API\) To connect a Lambda function to a VPC, you can use the following API operations: + [CreateFunction](API_CreateFunction.md) diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 04b6de39..9739305d 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -90,7 +90,7 @@ public class ProductService{ ``` **Note** -If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/0eff7ab687bbfc1e026feee1de336849e0315bc6/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. +If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. ## Handler signatures @@ -130,7 +130,7 @@ If the method specified in your handler string is overloaded, you must provide t For any Lambda functions that use input or output types other than a `Stream` object, you will need to add a serialization library to your application\. You can do this in the following ways: + Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses JSON\.NET to handle serialization\. **Note** -If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/0eff7ab687bbfc1e026feee1de336849e0315bc6/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. +If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. + Create your own serialization library by implementing the `ILambdaSerializer` interface, which is available as part of the `Amazon.Lambda.Core` library\. The interface defines two methods: + `T Deserialize(Stream requestStream);` diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index f6bca081..2af77154 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -7,7 +7,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | | Function and layer storage \(\.zip file archives\) | 75 GB | Terabytes | -| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. diff --git a/doc_source/golang-envvars.md b/doc_source/golang-envvars.md index d7cbc73f..ad97c3f5 100644 --- a/doc_source/golang-envvars.md +++ b/doc_source/golang-envvars.md @@ -19,4 +19,4 @@ func main() { } ``` -For a list of environment variables that are set by the Lambda runtime, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file +For a list of environment variables that are set by the Lambda runtime, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index cd0d9deb..66fdcf1d 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -1,7 +1,7 @@ # AWS Lambda Developer Guide ----- -*****Copyright © 2020 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** +*****Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** ----- Amazon's trademarks and trade dress may not be used in @@ -99,6 +99,7 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with AWS CodePipeline](services-codepipeline.md) + [Using AWS Lambda with Amazon Cognito](services-cognito.md) + [Using AWS Lambda with AWS Config](services-config.md) + + [Using Lambda with Amazon Connect](services-connect.md) + [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) + [Sample function code](with-ddb-create-package.md) @@ -240,19 +241,24 @@ Amazon's trademarks and trade dress may not be used in + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) + + [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) + + [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) + + [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) + + [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) + + [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -264,9 +270,11 @@ Amazon's trademarks and trade dress may not be used in + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) + + [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) + + [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -274,6 +282,7 @@ Amazon's trademarks and trade dress may not be used in + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) + + [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -282,6 +291,7 @@ Amazon's trademarks and trade dress may not be used in + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) + + [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) @@ -291,6 +301,9 @@ Amazon's trademarks and trade dress may not be used in + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) + + [AllowedPublishers](API_AllowedPublishers.md) + + [CodeSigningConfig](API_CodeSigningConfig.md) + + [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -303,6 +316,9 @@ Amazon's trademarks and trade dress may not be used in + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) + + [ImageConfig](API_ImageConfig.md) + + [ImageConfigError](API_ImageConfigError.md) + + [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) @@ -311,6 +327,7 @@ Amazon's trademarks and trade dress may not be used in + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) + + [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/invocation-retries.md b/doc_source/invocation-retries.md index 7f165662..649fd7ad 100644 --- a/doc_source/invocation-retries.md +++ b/doc_source/invocation-retries.md @@ -9,7 +9,7 @@ Issues with the request, caller, or account can cause invocation errors\. Invoca + **Caller** – The user or service doesn't have permission to invoke the function\. + **Account** – The maximum number of function instances are already running, or requests are being made too quickly\. -Clients such as the AWS CLI and the AWS SDK retry on client timeouts, throttling errors \(429\), and other errors that aren't caused by a bad request \(500 series\)\. For a full list of invocation errors, see [Invoke](API_Invoke.md)\. +Clients such as the AWS CLI and the AWS SDK retry on client timeouts, throttling errors \(429\), and other errors that aren't caused by a bad request\. For a full list of invocation errors, see [Invoke](API_Invoke.md)\. Function errors occur when your function code or the runtime that it uses return an error\. diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md index 5a74dc55..03935add 100644 --- a/doc_source/java-package-eclipse.md +++ b/doc_source/java-package-eclipse.md @@ -59,8 +59,12 @@ If you are following other tutorial topics in this guide, the specific tutorials 1. Open the context \(right\-click\) menu for the `src/main/java` subdirectory in the project, choose **New**, and then choose **Class**\. 1. In the **New Java Class** window, type the following values: + + + **Package**: **example** + **Name**: **Hello** + + **Note** If you are following other tutorial topics in this guide, the specific tutorials might recommend different package name or class name\. @@ -79,6 +83,8 @@ The resulting \.jar, `lambda-java-example-0.0.1-SNAPSHOT.jar`, is not the final 1. Open the context \(right\-click\) menu for the `pom.xml` file, choose **Maven**, and then choose **Add Plugin**\. 1. In the **Add Plugin** window, type the following values: + + + **Group Id:** org\.apache\.maven\.plugins + **Artifact Id:** maven\-shade\-plugin + **Version:** 3\.2\.2 diff --git a/doc_source/kafka-using-cluster.md b/doc_source/kafka-using-cluster.md index 62af0c15..61272809 100644 --- a/doc_source/kafka-using-cluster.md +++ b/doc_source/kafka-using-cluster.md @@ -1,5 +1,7 @@ # Using an Apache Kafka cluster as an event source for Lambda + + You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. This page describes how to use your Kafka cluster as an event source for your Lambda function\. @@ -10,6 +12,8 @@ This page describes how to use your Kafka cluster as an event source for your La ## How it works + + When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. + If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. + If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index 93ea4ae9..942b41f8 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -82,6 +82,8 @@ When making Lambda API calls, users can specify a version or alias by passing a You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. + + ### Best practices for using Deny statements with functions The following table summarizes the resources to use in Deny effects\. In the **Resource** column, `MyFunction` is the name of the function, `:1` refers to version 1 of the function, and `MyAlias` is the name of a function alias\. diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md index 4375f047..ba58d856 100644 --- a/doc_source/lambda-rolling-deployments.md +++ b/doc_source/lambda-rolling-deployments.md @@ -16,6 +16,8 @@ In a rolling deployment, AWS SAM performs these tasks: + It detects when you create a new version of your Lambda function\. + It triggers CodeDeploy to start the deployment of the new version\. + + ## Example AWS SAM Lambda template The following example shows an [AWS SAM template](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) for a simple rolling deployment\. diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 960d08e1..e8c051a1 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -61,6 +61,7 @@ Other services invoke your function directly\. You grant the other service permi **Services that invoke Lambda functions synchronously** + [Elastic Load Balancing \(Application Load Balancer\)](services-alb.md) + [Amazon Cognito](services-cognito.md) ++ [Amazon connect](services-connect.md) + [Amazon Lex](services-lex.md) + [Amazon Alexa](services-alexa.md) + [Amazon API Gateway](services-apigateway.md) diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md index 18f76a39..2e8afa81 100644 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -15,6 +15,7 @@ For an ongoing record of events in your AWS account, including events for AWS La + [Receiving CloudTrail log files from multiple regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail log files from multiple accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html) AWS Lambda supports logging the following actions as events in CloudTrail log files: ++ [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) @@ -25,6 +26,7 @@ AWS Lambda supports logging the following actions as events in CloudTrail log fi + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) + [GetPolicy](API_GetPolicy.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctions](API_ListFunctions.md) diff --git a/doc_source/monitoring-servicemap.md b/doc_source/monitoring-servicemap.md index d377f99b..efa356d5 100644 --- a/doc_source/monitoring-servicemap.md +++ b/doc_source/monitoring-servicemap.md @@ -1,16 +1,19 @@ # Example workflows using other AWS services -AWS Lambda integrates with other AWS services to help you monitor, trace, debug, and troubleshoot your Lambda functions\. This page shows workflows you can use for AWS X\-Ray and CloudWatch ServiceLens to trace and troubleshoot your Lambda functions\. +AWS Lambda integrates with other AWS services to help you monitor, trace, debug, and troubleshoot your Lambda functions\. This page shows workflows you can use with AWS X\-Ray, AWS Trusted Advisor and CloudWatch ServiceLens to trace and troubleshoot your Lambda functions\. **Topics** + [Prerequisites](#monitoring-troubleshooting-prereqs) + [Pricing](#monitoring-troubleshooting-pricing) + [Example AWS X\-Ray workflow to view a service map](#monitoring-servicemap-example) + [Example AWS X\-Ray workflow to view trace details](#monitoring-tracing-example) ++ [Example AWS Trusted Advisor workflow to view recommendations](#monitoring-ta-example) + [What's next?](#monitoring-troubleshooting-next-up) ## Prerequisites +The following section describes the steps to using AWS X\-Ray and Trusted Advisor to troubleshoot your Lambda functions\. + ### Using AWS X\-Ray AWS X\-Ray needs to be enabled on the Lambda console to complete the AWS X\-Ray workflows on this page\. If your execution role does not have the required permissions, the Lambda console will attempt to add them to your execution role\. @@ -29,8 +32,17 @@ AWS X\-Ray needs to be enabled on the Lambda console to complete the AWS X\-Ray 1. Choose **Save**\. +### Using AWS Trusted Advisor + +AWS Trusted Advisor inspects your AWS environment and makes recommendations on ways you can save money, improve system availability and performance, and help close security gaps\. You can use Trusted Advisor checks to evaluate the Lambda functions and applications in your AWS account\. The checks provide recommended steps to take and resources for more information\. ++ For more information on AWS support plans for Trusted Advisor checks, see [Support plans](https://console.aws.amazon.com/support/plans/home?#/)\. ++ For more information about the checks for Lambda, see [AWS Trusted Advisor best practice checklist](http://aws.amazon.com/premiumsupport/technology/trusted-advisor/best-practice-checklist/)\. ++ For more information on how to use the Trusted Advisor console, see [Get started with AWS Trusted Advisor](https://docs.aws.amazon.com/awssupport/latest/user/get-started-with-aws-trusted-advisor.html)\. ++ For instructions on how to allow and deny console access to Trusted Advisor, see [IAM policy examples](https://docs.aws.amazon.com/awssupport/latest/user/security-trusted-advisor.html#iam-policy-examples-trusted-advisor)\. + ## Pricing + With AWS X\-Ray you pay only for what you use, based on the number of traces recorded, retrieved, and scanned\. For more information, see [AWS X\-Ray Pricing](http://aws.amazon.com/xray/pricing/)\. ++ Trusted Advisor cost optimization checks are included with AWS Business and Enterprise support subscriptions\. For more information, see [AWS Trusted Advisor Pricing](http://aws.amazon.com/premiumsupport/pricing/)\. ## Example AWS X\-Ray workflow to view a service map @@ -76,5 +88,20 @@ If you've enabled AWS X\-Ray, you can use the single\-function view on the Cloud The **Trace details** page opens in the ServiceLens traces view\. ![\[Function trace details in the ServiceLens traces view.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-trace-details.png) +## Example AWS Trusted Advisor workflow to view recommendations + +Trusted Advisor checks Lambda functions in all AWS Regions to identify functions with the highest potential cost savings, and deliver actionable recommendations for optimization\. It analyzes your Lambda usage data such as function execution time, billed duration, memory used, memory configured, timeout configuration and errors\. + +For example, the *Lambda Functions with High Error Rate* check recommends that you use AWS X\-Ray or CloudWatch to detect errors with your Lambda functions\. + +**To check for functions with high error rates** + +1. Open the [Trusted Advisor](https://console.aws.amazon.com/trustedadvisor) console\. + +1. Choose the **Cost Optimization** category\. + +1. Scroll down to **AWS Lambda Functions with High Error Rates**\. Expand the section to see the results and the recommended actions\. + ## What's next? -+ Learn more about how to integrate traces, metrics, logs, and alarms in [Using ServiceLens to Monitor the Health of Your Applications](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ServiceLens.html)\. \ No newline at end of file ++ Learn more about how to integrate traces, metrics, logs, and alarms in [Using ServiceLens to Monitor the Health of Your Applications](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ServiceLens.html)\. ++ Learn more about how to get a list of Trusted Advisor checks in [Using Trusted Advisor as a web service](https://docs.aws.amazon.com/awssupport/latest/user/trustedadvisor.html)\. \ No newline at end of file diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md index 7c0f280c..a3fa3b30 100644 --- a/doc_source/runtimes-avx2.md +++ b/doc_source/runtimes-avx2.md @@ -40,6 +40,8 @@ For more information about Intel MKL and similar libraries, see [Math Kernel Lib If you don't use C or C\+\+ libraries and don't build with Intel MKL, you can still get some AVX2 performance improvement for your applications\. Note that the actual improvement depends on the compiler or interpreter's ability to utilize the AVX2 capabilities on your code\. + + Python Python users generally use SciPy and NumPy libraries for compute\-intensive workloads\. You can compile these libraries to enable AVX2, or you can use the Intel MKL\-enabled versions of the libraries\. diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index 50268a89..d0b9384c 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -4,6 +4,8 @@ Lambda invokes your function in an execution environment, which provides a secur The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages from the function by subscribing to logs using the [Logs API](runtimes-logs-api.md)\. + + ![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) When you create your Lambda function, you specify configuration information, such as the amount of memory available and the maximum execution time allowed for your function\. Lambda uses this information to set up the execution environment\. diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md index 49e9db3b..2c973af3 100644 --- a/doc_source/runtimes-custom.md +++ b/doc_source/runtimes-custom.md @@ -46,7 +46,7 @@ Your runtime code is responsible for completing some initialization tasks\. Then + `LAMBDA_TASK_ROOT` – The directory that contains the function code\. + `AWS_LAMBDA_RUNTIME_API` – The host and port of the runtime API\. - See [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime) for a full list of available variables\. + See [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime) for a full list of available variables\. + **Initialize the function** – Load the handler file and run any global or static code that it contains\. Functions should create static resources like SDK clients and database connections once, and reuse them for multiple invocations\. + **Handle errors** – If an error occurs, call the [initialization error](runtimes-api.md#runtimes-api-initerror) API and exit immediately\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index c498b4ab..233db4c2 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -49,6 +49,8 @@ Each phase starts with an event from the Lambda service to the runtime and to al ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Full-Sequence.png) + + **Topics** + [Init phase](#runtimes-extensions-api-reg) + [Invoke phase](#runtimes-lifecycle-invoke) @@ -322,4 +324,6 @@ The extension uses this method to report an error to Lambda before exiting\. Cal + 202 – Accepted + 400 – Bad Request + 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. \ No newline at end of file ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. + + \ No newline at end of file diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md index e2e7810d..a4ca44a0 100644 --- a/doc_source/security_iam_troubleshoot.md +++ b/doc_source/security_iam_troubleshoot.md @@ -61,6 +61,8 @@ Lambda has introduced two new AWS managed policies: + The **AWSLambda\_ReadOnlyAccess** policy grants read\-only access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaReadOnlyAccess**\. + The **AWSLambda\_FullAccess** policy grants full access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaFullAccess**\. + + ### Using the AWS managed policies We recommend using the newly launched managed policies to grant users, groups, and roles access to Lambda; however, review the permissions granted in the policies to ensure they meet your requirements\. @@ -80,6 +82,6 @@ You can create a role that users in other accounts or people outside of your org To learn more, consult the following: + To learn whether Lambda supports these features, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. + To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*\. -+ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing ccess to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. ++ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing access to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. + To learn how to provide access through identity federation, see [Providing access to externally authenticated users \(identity federation\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*\. + To learn the difference between using roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index c8d5fd7a..eefdfd5f 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -119,8 +119,6 @@ The following example processes messages from API Gateway, and logs information **Example LambdaFunctionOverHttps\.go** ``` -package main - import ( "context" "fmt" diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index a77a1bb0..85b8b5b7 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -25,6 +25,8 @@ The request payload you send in the `POST` request identifies the DynamoDB opera ``` + The following is a sample request payload for a DynamoDB read item operation: + + ``` { "operation": "read", diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 80f942db..58b5bfdb 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -17,13 +17,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an 1. Choose **Create function**\. -1. Choose **Blueprints**\. +1. Choose **Use a blueprint**\. 1. Enter **canary** in the search bar\. Choose the **lambda\-canary** blueprint, and then choose **Configure**\. 1. Configure the following settings\. + **Name** – **lambda\-canary**\. - + **Role** – **Create a new role from one or more templates**\. + + **Role** – **Create a new role from AWS policy templates**\. + **Role name** – **lambda\-apigateway\-role**\. + **Policy templates** – **Simple microservice permissions**\. + **Rule** – **Create a new rule**\. @@ -105,6 +105,8 @@ Configure an alarm in Amazon CloudWatch that monitors the Lambda function and se + Threshold – **Whenever Errors is >=****1**\. + **Send notification to** – **lambda\-canary\-notifications**\. + + ## Test the alarm Update the function configuration to cause the function to return an error, which triggers the alarm\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index cb53ee42..030e742a 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -37,6 +37,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re ``` { + "version": "0", "account": "123456789012", "region": "us-east-2", "detail": {}, @@ -45,7 +46,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re "time": "2019-03-01T01:23:45Z", "id": "cdc73f9d-aea9-11e3-9d5a-835b769c0d9c", "resources": [ - "arn:aws:events:us-east-1:123456789012:rule/my-schedule" + "arn:aws:events:us-east-2:123456789012:rule/my-schedule" ] } ``` @@ -58,7 +59,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re 1. Under **Function overview**, choose **Add trigger**\. -1. Set the trigger type to **CloudWatch Events/EventBridge**\. +1. Set the trigger type to **EventBridge\(CloudWatch Events\)**\. 1. For **Rule**, choose **Create a new rule**\. diff --git a/doc_source/services-connect.md b/doc_source/services-connect.md new file mode 100644 index 00000000..ca2777ef --- /dev/null +++ b/doc_source/services-connect.md @@ -0,0 +1,41 @@ +# Using Lambda with Amazon Connect + +You can use a Lambda function to process requests from Amazon Connect\. + +Amazon Connect invokes your Lambda function synchronously with an event that contains the request body and metadata\. + +**Example Amazon Connect request event** + +``` +{ + "Details": { + "ContactData": { + "Attributes": {}, + "Channel": "VOICE", + "ContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX", + "CustomerEndpoint": { + "Address": "+1234567890", + "Type": "TELEPHONE_NUMBER" + }, + "InitialContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX", + "InitiationMethod": "INBOUND | OUTBOUND | TRANSFER | CALLBACK", + "InstanceARN": "arn:aws:connect:aws-region:1234567890:instance/c8c0e68d-2200-4265-82c0-XXXXXXXXXX", + "PreviousContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX", + "Queue": { + "ARN": "arn:aws:connect:eu-west-2:111111111111:instance/cccccccc-bbbb-dddd-eeee-ffffffffffff/queue/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "Name": "PasswordReset" + }, + "SystemEndpoint": { + "Address": "+1234567890", + "Type": "TELEPHONE_NUMBER" + } + }, + "Parameters": { + "sentAttributeKey": "sentAttributeValue" + } + }, + "Name": "ContactFlowEvent" +} +``` + +For information about how to use Amazon Connect with Lambda, see [ Invoke Lambda functions](https://docs.aws.amazon.com/connect/latest/adminguide/connect-lambda-functions.html) in the *Amazon Connect administrator guide*\. \ No newline at end of file diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 701a36a0..a3a578c3 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -8,6 +8,8 @@ This tutorial provides code that performs these tasks and a sample application t 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\. + + ## Prerequisites To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md index 9e48472f..a38cdde0 100644 --- a/doc_source/stepfunctions-patterns.md +++ b/doc_source/stepfunctions-patterns.md @@ -110,6 +110,7 @@ The following Amazon States Language definition of the `WhichCoat` state machine } ``` + **Example Python function** The following Lambda function in Python \(`wear_heavy_coat`\) can be invoked for the state machine defined in the previous example\. If the `WhichCoat` state machine equals a string value of `FREEZING`, the `wear_heavy_coat` function is invoked from Lambda, and the user receives the message that corresponds with the function: "You should wear a heavy coat today\." diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index a9eba472..a0c24ba6 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -103,4 +103,4 @@ In this example, the object is 39 characters and takes up 39 bytes when it's sto **Error:** *InvalidParameterValueException: Lambda was unable to configure your environment variables because the environment variables you have provided contains reserved keys that are currently not supported for modification\.* -Lambda reserves some environment variable keys for internal use\. For example, `AWS_REGION` is used by the runtime to determine the current Region and cannot be overridden\. Other variables, like `PATH`, are used by the runtime but can be extended in your function configuration\. For a full list, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file +Lambda reserves some environment variable keys for internal use\. For example, `AWS_REGION` is used by the runtime to determine the current Region and cannot be overridden\. Other variables, like `PATH`, are used by the runtime but can be extended in your function configuration\. For a full list, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 27af38ec..ff9e2917 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -563,7 +563,7 @@ public class ProcessDynamodbRecords implements RequestHandler batchItemFailures = new ArrayList<*gt;(); + List batchItemFailures = new ArrayList<*>(); String curRecordSequenceNumber = ""; for (DynamodbEvent.DynamodbEventRecord dynamodbEventRecord : input.getRecords()) { diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 8ed04e40..b1e09fd7 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -512,7 +512,7 @@ public class ProcessKinesisRecords implements RequestHandler batchItemFailures = new ArrayList<*gt;(); + List batchItemFailures = new ArrayList<*>(); String curRecordSequenceNumber = ""; for (KinesisEvent.KinesisEventRecord kinesisEventRecord : input.getRecords()) { diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index 46650be2..953a7226 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -144,7 +144,6 @@ Follow the instructions to create a AWS Lambda function deployment package\. ``` from __future__ import print_function - def lambda_handler(event, context): for record in event['Records']: print("test") @@ -152,4 +151,4 @@ def lambda_handler(event, context): print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file From 202e90007ec50076dadd8daed32a6bad6a933581 Mon Sep 17 00:00:00 2001 From: marianoc84 Date: Tue, 23 Mar 2021 09:14:25 +0100 Subject: [PATCH 17/94] Rephrasing to reflect new Lambda UI Renamed the steps needed to upload a .zip file to reflect changes in the Lambda's UI --- doc_source/gettingstarted-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index 388e7af3..b3db0b03 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -36,7 +36,7 @@ The following steps demonstrate how to upload a \.zip file as your deployment pa 1. Select a function\. -1. Choose **Actions**, **Upload a \.zip file** in the **Function code** pane\. +1. Choose **Upload from**, **\.zip file** in the **Code Source** pane\. 1. Choose **Upload** to select your local \.zip file\. @@ -81,4 +81,4 @@ If your deployment package is larger than 50 MB, we recommend uploading your fun You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS Command Line Interface \(AWS CLI\)\. -To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. \ No newline at end of file +To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. From e6b04bc71de399058e77fb43e32af8c02c973f81 Mon Sep 17 00:00:00 2001 From: juankb1024 Date: Fri, 26 Mar 2021 20:18:00 -0500 Subject: [PATCH 18/94] Update template.yml After March 1, 2021, the AWS managed policies AWSLambdaReadOnlyAccess and AWSLambdaFullAccess will be deprecated and can no longer be attached to new IAM users. Info: https://docs.aws.amazon.com/lambda/latest/dg/security_iam_troubleshoot.html Without this, the 3-deploy.sh script will always fail. --- sample-apps/s3-java/template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/s3-java/template.yml b/sample-apps/s3-java/template.yml index 3ffd1620..a576f664 100644 --- a/sample-apps/s3-java/template.yml +++ b/sample-apps/s3-java/template.yml @@ -17,7 +17,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole - AmazonS3FullAccess @@ -42,4 +42,4 @@ Resources: Description: Dependencies for the Java S3 sample app. ContentUri: build/s3-java-lib.zip CompatibleRuntimes: - - java8 \ No newline at end of file + - java8 From 815331b7c608bc577e7f3475ba3e4e193f8eb245 Mon Sep 17 00:00:00 2001 From: juankb1024 Date: Fri, 26 Mar 2021 20:20:31 -0500 Subject: [PATCH 19/94] Update template-mvn.yml After March 1, 2021, the AWS managed policies AWSLambdaReadOnlyAccess and AWSLambdaFullAccess will be deprecated and can no longer be attached to new IAM users. Info: https://docs.aws.amazon.com/lambda/latest/dg/security_iam_troubleshoot.html Without this, the 3-deploy.sh script will always fail. --- sample-apps/s3-java/template-mvn.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/s3-java/template-mvn.yml b/sample-apps/s3-java/template-mvn.yml index e8e77b37..dff099bc 100644 --- a/sample-apps/s3-java/template-mvn.yml +++ b/sample-apps/s3-java/template-mvn.yml @@ -17,7 +17,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole - AmazonS3FullAccess @@ -32,4 +32,4 @@ Resources: S3Key: Rules: - Name: prefix - Value: inbound/ \ No newline at end of file + Value: inbound/ From 4964623b1c185caa0a53246890d3eda9795a9078 Mon Sep 17 00:00:00 2001 From: bryamcastle Date: Sun, 28 Mar 2021 11:42:33 -0500 Subject: [PATCH 20/94] Update template.yml --- sample-apps/blank-python/template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sample-apps/blank-python/template.yml b/sample-apps/blank-python/template.yml index 7b14daf2..7d8e59d7 100644 --- a/sample-apps/blank-python/template.yml +++ b/sample-apps/blank-python/template.yml @@ -13,7 +13,8 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess +# - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: From 076a5bdedda5df37c595ce5a0d60afff0aafea47 Mon Sep 17 00:00:00 2001 From: Carl Manaster Date: Mon, 29 Mar 2021 11:01:49 -0700 Subject: [PATCH 21/94] Update with-sqs-create-package.md "a AWS Lambda" --> "an AWS Lambda" --- doc_source/with-sqs-create-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index 953a7226..cfb1164d 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -137,7 +137,7 @@ Build the executable with `go build` and create a deployment package\. For instr The following is example Python code that accepts an Amazon SQS record as input and processes it\. For illustration, the code writes to some of the incoming event data to CloudWatch Logs\. -Follow the instructions to create a AWS Lambda function deployment package\. +Follow the instructions to create an AWS Lambda function deployment package\. **Example ProcessSQSRecords\.py** @@ -151,4 +151,4 @@ def lambda_handler(event, context): print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. From 5077aa18c8fdf6479eeca0403f2be54f61f0624f Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 29 Mar 2021 14:20:13 -0700 Subject: [PATCH 22/94] IAM policy AWSLambdaReadOnlyAccess is now AWSLambda_ReadOnlyAccess --- sample-apps/blank-csharp/template.yml | 2 +- sample-apps/blank-go/template.yml | 2 +- sample-apps/blank-java/template-mvn.yml | 2 +- sample-apps/blank-java/template.yml | 2 +- sample-apps/blank-nodejs/template.yml | 2 +- sample-apps/blank-powershell/template.yml | 2 +- sample-apps/blank-python/template.yml | 1 - sample-apps/blank-ruby/template-2.7.yml | 2 +- sample-apps/blank-ruby/template.yml | 2 +- sample-apps/java-basic/template-mvn.yml | 2 +- sample-apps/java-basic/template.yml | 2 +- sample-apps/java-events-v1sdk/template-mvn.yml | 2 +- sample-apps/java-events-v1sdk/template.yml | 2 +- sample-apps/java-events/template-mvn.yml | 2 +- sample-apps/java-events/template.yml | 2 +- sample-apps/nodejs-apig/template.yml | 2 +- 16 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sample-apps/blank-csharp/template.yml b/sample-apps/blank-csharp/template.yml index 190dd823..17836497 100644 --- a/sample-apps/blank-csharp/template.yml +++ b/sample-apps/blank-csharp/template.yml @@ -14,6 +14,6 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active diff --git a/sample-apps/blank-go/template.yml b/sample-apps/blank-go/template.yml index 007eb42b..841d6623 100644 --- a/sample-apps/blank-go/template.yml +++ b/sample-apps/blank-go/template.yml @@ -13,6 +13,6 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active diff --git a/sample-apps/blank-java/template-mvn.yml b/sample-apps/blank-java/template-mvn.yml index d6cefd07..a2c3d5d6 100644 --- a/sample-apps/blank-java/template-mvn.yml +++ b/sample-apps/blank-java/template-mvn.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/blank-java/template.yml b/sample-apps/blank-java/template.yml index fce3ade2..748d3b7e 100644 --- a/sample-apps/blank-java/template.yml +++ b/sample-apps/blank-java/template.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/blank-nodejs/template.yml b/sample-apps/blank-nodejs/template.yml index 26659b40..fbef2c5c 100644 --- a/sample-apps/blank-nodejs/template.yml +++ b/sample-apps/blank-nodejs/template.yml @@ -13,7 +13,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: diff --git a/sample-apps/blank-powershell/template.yml b/sample-apps/blank-powershell/template.yml index 9b11775f..cbae139c 100644 --- a/sample-apps/blank-powershell/template.yml +++ b/sample-apps/blank-powershell/template.yml @@ -14,6 +14,6 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active diff --git a/sample-apps/blank-python/template.yml b/sample-apps/blank-python/template.yml index 7d8e59d7..d2b27aee 100644 --- a/sample-apps/blank-python/template.yml +++ b/sample-apps/blank-python/template.yml @@ -13,7 +13,6 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole -# - AWSLambdaReadOnlyAccess - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active diff --git a/sample-apps/blank-ruby/template-2.7.yml b/sample-apps/blank-ruby/template-2.7.yml index 1a6410f1..39f2fe93 100644 --- a/sample-apps/blank-ruby/template-2.7.yml +++ b/sample-apps/blank-ruby/template-2.7.yml @@ -13,7 +13,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Environment: diff --git a/sample-apps/blank-ruby/template.yml b/sample-apps/blank-ruby/template.yml index 00f841ad..9cd53133 100644 --- a/sample-apps/blank-ruby/template.yml +++ b/sample-apps/blank-ruby/template.yml @@ -13,7 +13,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Environment: diff --git a/sample-apps/java-basic/template-mvn.yml b/sample-apps/java-basic/template-mvn.yml index 0eafe8e7..0fdaaf91 100644 --- a/sample-apps/java-basic/template-mvn.yml +++ b/sample-apps/java-basic/template-mvn.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-basic/template.yml b/sample-apps/java-basic/template.yml index 5a760a43..5cec6e28 100644 --- a/sample-apps/java-basic/template.yml +++ b/sample-apps/java-basic/template.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-events-v1sdk/template-mvn.yml b/sample-apps/java-events-v1sdk/template-mvn.yml index ee250ed0..6cabcd01 100644 --- a/sample-apps/java-events-v1sdk/template-mvn.yml +++ b/sample-apps/java-events-v1sdk/template-mvn.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-events-v1sdk/template.yml b/sample-apps/java-events-v1sdk/template.yml index 40b167f1..b1f59be5 100644 --- a/sample-apps/java-events-v1sdk/template.yml +++ b/sample-apps/java-events-v1sdk/template.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-events/template-mvn.yml b/sample-apps/java-events/template-mvn.yml index 5fdfbe50..62078b99 100644 --- a/sample-apps/java-events/template-mvn.yml +++ b/sample-apps/java-events/template-mvn.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-events/template.yml b/sample-apps/java-events/template.yml index def7925a..4b1ee18a 100644 --- a/sample-apps/java-events/template.yml +++ b/sample-apps/java-events/template.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/nodejs-apig/template.yml b/sample-apps/nodejs-apig/template.yml index 8b2d575f..998a9c22 100644 --- a/sample-apps/nodejs-apig/template.yml +++ b/sample-apps/nodejs-apig/template.yml @@ -19,7 +19,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Events: From 973b1bbee38f70d4deda18c45ce79ce778f485e6 Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Date: Mon, 29 Mar 2021 16:17:56 -0700 Subject: [PATCH 23/94] clarify that context can be set by the caller there isn't anything specific to "mobile application" when context is set --- doc_source/nodejs-context.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/nodejs-context.md b/doc_source/nodejs-context.md index 8740b68a..c5a9f578 100644 --- a/doc_source/nodejs-context.md +++ b/doc_source/nodejs-context.md @@ -27,7 +27,7 @@ When Lambda runs your function, it passes a context object to the [handler](node + `env.make` + `env.model` + `env.locale` - + `Custom` – Custom values that are set by the mobile application\. + + `Custom` – Custom values that are set by the caller\. + `callbackWaitsForEmptyEventLoop` – Set to false to send the response right away when the [callback](nodejs-handler.md#nodejs-handler-sync) runs, instead of waiting for the Node\.js event loop to be empty\. If this is false, any outstanding events continue to run during the next invocation\. The following example function logs context information and returns the location of the logs\. @@ -40,4 +40,4 @@ exports.handler = async function(event, context) { console.log('Function name: ', context.functionName) return context.logStreamName } -``` \ No newline at end of file +``` From ab3d7a8578bc6af980e2877c34b199bce5bd5e79 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 5 Apr 2021 08:56:07 -0700 Subject: [PATCH 24/94] periodic update --- .DS_Store | Bin 0 -> 8196 bytes doc_source/.DS_Store | Bin 133124 -> 129028 bytes doc_source/API_AddLayerVersionPermission.md | 2 + doc_source/API_AddPermission.md | 3 +- doc_source/API_CodeSigningConfig.md | 2 +- doc_source/API_CodeSigningPolicies.md | 2 +- doc_source/API_CreateEventSourceMapping.md | 28 +- doc_source/API_CreateFunction.md | 16 +- doc_source/API_DeleteEventSourceMapping.md | 12 +- doc_source/API_Environment.md | 4 +- .../API_EventSourceMappingConfiguration.md | 12 +- doc_source/API_FileSystemConfig.md | 2 +- doc_source/API_FunctionCode.md | 2 +- doc_source/API_FunctionConfiguration.md | 4 +- doc_source/API_GetEventSourceMapping.md | 12 +- doc_source/API_GetFunctionConfiguration.md | 4 +- doc_source/API_ListVersionsByFunction.md | 2 +- doc_source/API_PublishVersion.md | 4 +- doc_source/API_TracingConfig.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 14 +- doc_source/API_UpdateFunctionCode.md | 4 +- doc_source/API_UpdateFunctionConfiguration.md | 10 +- doc_source/access-control-identity-based.md | 4 +- doc_source/best-practices.md | 2 + doc_source/configuration-database.md | 4 +- doc_source/configuration-images.md | 6 +- doc_source/configuration-layers.md | 2 +- doc_source/csharp-handler.md | 2 +- doc_source/csharp-logging.md | 2 +- doc_source/csharp-tracing.md | 6 +- doc_source/deploying-lambda-apps.md | 2 + doc_source/gettingstarted-package.md | 4 +- doc_source/golang-handler.md | 2 +- doc_source/golang-logging.md | 2 +- doc_source/golang-tracing.md | 2 +- doc_source/index.md | 6 +- doc_source/java-context.md | 4 +- doc_source/java-exceptions.md | 6 +- doc_source/java-handler.md | 24 +- doc_source/java-logging.md | 6 +- doc_source/java-package.md | 2 +- doc_source/java-samples.md | 4 +- doc_source/java-tracing.md | 6 +- doc_source/lambda-functions.md | 4 +- doc_source/lambda-monitoring.md | 2 + doc_source/lambda-nodejs.md | 3 + doc_source/lambda-permissions.md | 2 + doc_source/lambda-python.md | 22 +- doc_source/lambda-releases.md | 40 +- doc_source/lambda-ruby.md | 3 + doc_source/lambda-runtimes.md | 9 + doc_source/lambda-security.md | 2 + doc_source/lambda-services.md | 2 + doc_source/lambda-troubleshooting.md | 2 + doc_source/nodejs-context.md | 4 +- doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-tracing.md | 8 +- doc_source/powershell-logging.md | 2 +- doc_source/python-context.md | 5 +- doc_source/python-exceptions.md | 3 + doc_source/python-handler.md | 21 +- doc_source/python-image.md | 3 + doc_source/python-logging.md | 3 + doc_source/python-package-create.md | 12 +- doc_source/python-package-update.md | 16 +- doc_source/python-package.md | 3 + doc_source/python-tracing.md | 11 +- doc_source/ruby-handler.md | 2 +- doc_source/ruby-tracing.md | 8 +- doc_source/runtime-support-policy.md | 46 +- doc_source/runtimes-context.md | 2 +- doc_source/samples-blank.md | 18 +- doc_source/samples-errorprocessor.md | 6 +- doc_source/samples-listmanager.md | 10 +- doc_source/services-apigateway-code.md | 2 +- doc_source/services-apigateway-tutorial.md | 10 +- doc_source/services-apigateway.md | 8 +- doc_source/services-cloudformation.md | 2 +- .../services-cloudwatchevents-expressions.md | 2 +- doc_source/services-ec2-tutorial.md | 4 +- doc_source/services-xray.md | 2 +- doc_source/welcome.md | 2 + doc_source/with-android-example.md | 6 + doc_source/with-ddb-example.md | 7 + doc_source/with-kinesis-example.md | 6 + doc_source/with-s3-example-deployment-pkg.md | 353 --------- doc_source/with-s3-example.md | 524 +++++-------- doc_source/with-s3-tutorial.md | 712 ++++++++++++++++++ doc_source/with-s3.md | 4 +- doc_source/with-sqs-create-package.md | 4 +- doc_source/with-sqs-example.md | 6 + doc_source/with-sqs.md | 10 + 92 files changed, 1238 insertions(+), 941 deletions(-) create mode 100644 .DS_Store delete mode 100644 doc_source/with-s3-example-deployment-pkg.md create mode 100644 doc_source/with-s3-tutorial.md diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..46177358ce517fc9065e0a719a965ecfd3892489 GIT binary patch literal 8196 zcmeHMS!@+m82-OfU}g&Rl&#AExzflI3bq(1Ws%zrsX#z)OUrt>_s#$lr!)1=+*_d3 z)S%G^193@=+Y9;z(I*TsKDk0PCdS4s(U|z=lkv?Mm;cO}vK0E@3z#q`Ip;s;{QrNJ zZ@xL_{&R^49VM%UsE&v<&QgjhE^d>gUgld;Mcgx;CD@-RAfHN9qypKuSSK9`0to^M z0to^M0to{D2L$-emPwo9-dEbBOb|#AxF->i=R=CKl<8QGDH$CdTtp!N%S!H!64yBn zhFmSajPcY<;!#4{s~P!P?|eyPZukXAA& z69f_jZbd-G?gm*Lw-+dTWBi^U4ufB7!cx$YD;|)oJ-P6BKCburzI&~n%kOpU;jEb7>3d<$@$6#c>{vFN9PD>I%OCFW zOP&=(<7AXV*L6+Lin@`Jme$s$)Y=VgqfM!iw$_%WRO{Nd(NSHiy}xBk&ym5Cr$$bX zKKZKJAL28DsweIDwW&611qCQ-ZUPP6s4{yVF?MFf+%j)+ z_fY8gUa;3L1}w9pI$&UW3ck0eXiI&6!FNl8UXT?vg`8U`xw+78cioJ0$_@rX`$Q;f z`vboic1DI-AxeS$n9X)h+3sTNV8G$wq?v$zVb+4hOP8%`Ubk^;*ZAx?)xt35&F?Qe zfs=RbeYv1udzRxJ>l=2g@c4el)eD`Yj$PFC8eH!6a)b7`SXf(E-(Z@`=DN?sC5-<iX0IFdSkjd=88u3w1zL8 z?R1boVhzz5dY;bGIeMMmri=6*eL$bl6}n1a&{y;W{Y<~o@AN1AMSs&j(69gtQHOdg z#Tq<-X0+iUY(+adumgMWC^G29ArxTYD2`zWCvXxYIE`m;7U%FHUcwu=fQxts@8U8( z#7FoTpWsV;jd8WUiV1G-iq{(p{K%E5s2jh?6^Cy}-G=UM#`e2I-S1~fzShj0H-EvB z#ucmAwr*~}_FN}D$r~vZ@kkLRBG3duqDOfXE5{>Z8;cfCF!?&S71#TifA$GYl1R){ z)(!V9)tEOzi<`@qbMum@h?+*jswSN&ET+XnH@9d^Rxw>^jdkmFrn9JwwHr6Fc88cT zUSC_caEr0k5G3C^JsxWrA8-GiiRbA8y-%Og=gh!w=qLJxexpACRG|j75&ITl36^68 zR$>)aV?A220UNOy-PneQ(ZgKqMIZKJ0Q(~@+RQ}@W==kZGk6-$;yJt!aq?xn ziSu}C5(9fCG4SG43@m4gp6h$ZSU6rPV=)3v*M_lN!Mg1fXD#f62ff1sd+LZR9UwM~4GzY2zuSYY{i(G**y zrZF*LGa)BUY-wxalOlK%=LP7}#=c-}G1?bX%j%}6(R8Uk)EDcyNKCaz)jK(J&)hrb zyWgDo=G@^C%W!sGNC<)I!H&2v_>M-KKxs1cuy-Fn3=82DVt`wh=oX!#IGK3& zZj%wn=Ambs@Qgg|x5(Cu+hiitq`NI%vmP=31bv-ld{Q<{#iYG1qc=>wW0F;=C>`m* zqTHG)lx3+$OdX;_##(~%T5BGB^5s;aJ~rE=sfH#Lfp)zBuUY(c%EWwBzi@GnCO^6C zmf;1Tj1F9tSH98Mua+OSdgX7YbM?XWW=*-azyo=BDIlA(x$^PsV=}%_x-!Kj9oc|> zZ0VeR)Q(4~xeA$42fAf(w&vDZ>Ld`+C~AV6<}`Sys~SaA;6hAZ>CG6ozcq*>s9Fxe3T&WM5~Wme6k!@mB53BXgy`#295H^9 z!SYn(Blv-Qa-PL~RC0!6?@{m1BOeH>8)>*WqjVyRTC!e8y_`LJgnHu8{;EqpW3hBwenwOsxQ@5(qVw%=l6436(XVM{6Kcbo7PM0&hNV9f zy$UG<$ERlEh-wt7n9-ABBA_p7&GN0FWEBiJl=wzC>X@Cx$( z5bx@&JSv;SoSiPuun^{sL!%4Z@St*>KojI_sC&)e++|&;OQ#UD(XI(RK|gx2NV_Lc zPMRN9#olL-RU4jL6UIv{sfSdjjx$yjuIEEd1@(xj%9Ig3e<(m7Ok&{9Fp3rVy^Wf` zz`ZoK9YNZ13B`t&NB#3Cm*c@jDw)R+9h=1Po#BW@U9N6^j`wV8dOI{I#{zypVLunj z60QcF+^?Bh;?qz}b$j7ab>HGst2+NQVoJsVAXY(xSpIm%CDXgTbb1Gdp&JZ@Q8!j|?o9rv|fBVlG^uq+Ddl(fR~^-GvEF=A6Atj=X1) zRk2JtKAI(KM<0;I7w1w@5Le~4(K!a;)eFbkH90x5_WJ8LDe}tjWQf9Lu*%}eCCwVb zbYKaFDB_0m({woPa$9WW&0N&vKv1>Wu^yzXa8bGwK6+^>b7~22D&AT&nUUzeCA&w3 z(;%5MgnViZVI4JOFcogau*%6mrj0rrm_t{5$i1x$ud2vKIp~>1tUW#tYn7t{nf3(@ zVlUUhUe0BM$QDNEuMfXbLk{u>k`n}0-ic0l zfHZ3C3+m1PscDboFaL9DtviMzEf?|Bhd%XA2%zJ-e~rd&m1n*LYG z$<$Pfg{sYnp^D_e2CA+%ilq(@Yk7YsZLi4Tr0wGMzf)=0>QxsHa>ht&#NG74*Z5f_ zHe!<|6MbnjlIJGQ=298iX;IM^u?Ez392Tk~*y-SMlqp9O&S>(S%QqwGF3Nfni`B+s zSO&Usk_)Z21p#?HX_zuT=Rz}fs-y)eHu*?u?~K)WrpqsUij)3r6fvmD74U+Pk6cyM zjxVk9Ts%Knqr3nenKpNFR>b>$TXPT^u+hv&V0Q3Hd+#<+EG0>f_*wzZ*+9N;VF+QE3fOs^thtbF%)@Bvjs|cdI<(6gP$RnYR53& zj4>Net^;OrTt@zVJi3hOHT5wOXAt~;855AfI5Zh=fPwwjaQGT-oW{lg6!g?()X+m^ L*l=Pqx=eoo3{>SD diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index b327715e..e5c0a23a 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -42,12 +42,14 @@ The request accepts the following data in JSON format\. ** [Action](#API_AddLayerVersionPermission_RequestSyntax) ** The API action that grants access to the layer\. For example, `lambda:GetLayerVersion`\. Type: String +Length Constraints: Maximum length of 22\. Pattern: `lambda:GetLayerVersion` Required: Yes ** [OrganizationId](#API_AddLayerVersionPermission_RequestSyntax) ** With the principal set to `*`, grant permission to all accounts in the specified organization\. Type: String +Length Constraints: Maximum length of 34\. Pattern: `o-[a-z0-9]{10,32}` Required: No diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index 01452a8c..cd2857b7 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -64,7 +64,7 @@ Required: No ** [Principal](#API_AddPermission_RequestSyntax) ** The AWS service or account that invokes the function\. If you specify a service, use `SourceArn` or `SourceAccount` to limit who can invoke the function through that service\. Type: String -Pattern: `.*` +Pattern: `[^\s]+` Required: Yes ** [RevisionId](#API_AddPermission_RequestSyntax) ** @@ -75,6 +75,7 @@ Required: No ** [SourceAccount](#API_AddPermission_RequestSyntax) ** For Amazon S3, the ID of the account that owns the resource\. Use this together with `SourceArn` to ensure that the resource is owned by the specified account\. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account\. Type: String +Length Constraints: Maximum length of 12\. Pattern: `\d{12}` Required: No diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md index c787444c..adcc72ca 100644 --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -1,6 +1,6 @@ # CodeSigningConfig -Details about a Code signing configuration\. +Details about a [Code signing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html)\. ## Contents diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md index 2d49743f..d35e8561 100644 --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -1,6 +1,6 @@ # CodeSigningPolicies -Code signing configuration policies specifies the validation failure action for signature mismatch or expiry\. +Code signing configuration [policies](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html#config-codesigning-policies) specify the validation failure action for signature mismatch or expiry\. ## Contents diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 7c9f4ba5..61a802c8 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -2,13 +2,13 @@ Creates a mapping between an event source and an AWS Lambda function\. Lambda reads items from the event source and triggers the function\. -For details about each event source type, see the following topics\. -+ [Using AWS Lambda with Amazon DynamoDB](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html) -+ [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html) -+ [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) -+ [Using AWS Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html) -+ [Using AWS Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) -+ [Using AWS Lambda with Self\-Managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) +For details about each event source type, see the following topics\. In particular, each of the topics describes the required and optional parameters for the specific event source\. ++ [ Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) ++ [ Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) ++ [ Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) ++ [ Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) ++ [ Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) ++ [ Configuring Self\-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. @@ -122,7 +122,7 @@ Required: Yes ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No @@ -254,11 +254,11 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object ** [EventSourceArn](#API_CreateEventSourceMapping_ResponseSyntax) ** @@ -274,7 +274,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** @@ -291,17 +291,17 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 12105e88..90ff763a 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -2,6 +2,10 @@ Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. +You set the package type to `Image` if the deployment package is a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)\. For a container image, the code property must include the URI of a container image in the Amazon ECR registry\. You do not need to specify the handler and runtime properties\. + +You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. + When you create 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 or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. A function has an unpublished version, and can have published versions and aliases\. The unpublished version changes when you update your function's code and configuration\. A published version is a snapshot of your function code and configuration that can't be changed\. An alias is a named resource that maps to a version, and can be changed to map to a different version\. Use the `Publish` parameter to create version `1` of your function from its initial configuration\. @@ -135,7 +139,7 @@ Pattern: `[^\s]+` Required: No ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** - [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Dockerfile\. +Container image [configuration values](https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-settings) that override the values in the container image Dockerfile\. Type: [ImageConfig](API_ImageConfig.md) object Required: No @@ -153,7 +157,7 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_CreateFunction_RequestSyntax) ** -The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. +The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No @@ -187,13 +191,13 @@ Type: String to string map Required: No ** [Timeout](#API_CreateFunction_RequestSyntax) ** -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\. +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\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No ** [TracingConfig](#API_CreateFunction_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with AWS X\-Ray\. +Set `Mode` to `Active` to sample and trace a subset of incoming requests with [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. Type: [TracingConfig](API_TracingConfig.md) object Required: No @@ -305,11 +309,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_CreateFunction_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_CreateFunction_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 759438f1..85797869 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -82,11 +82,11 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object ** [EventSourceArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** @@ -102,7 +102,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** @@ -119,17 +119,17 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md index d7d1c480..97ce945c 100644 --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -1,11 +1,11 @@ # Environment -A function's environment variable settings\. +A function's environment variable settings\. You can use environment variables to adjust your function's behavior without updating code\. An environment variable is a pair of strings that are stored in a function's version\-specific configuration\. ## Contents **Variables** -Environment variable key\-value pairs\. +Environment variable key\-value pairs\. For more information, see [Using Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: String to string map Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` Required: No diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index f82fb0fe..8c6aca49 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -11,12 +11,12 @@ Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No **BisectBatchOnFunctionError** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean Required: No **DestinationConfig** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object Required: No @@ -35,7 +35,7 @@ Required: No **FunctionResponseTypes** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No @@ -56,19 +56,19 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No **MaximumRecordAgeInSeconds** -\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No **MaximumRetryAttempts** -\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No **ParallelizationFactor** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md index 4aa62f56..4e3ecc1f 100644 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -1,6 +1,6 @@ # FileSystemConfig -Details about the connection between a Lambda function and an Amazon EFS file system\. +Details about the connection between a Lambda function and an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. ## Contents diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index 6ebb6ed3..ea8dcf57 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -5,7 +5,7 @@ The code for the Lambda function\. You can specify either an object in Amazon S3 ## Contents **ImageUri** -URI of a container image in the Amazon ECR registry\. +URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry\. Type: String Required: No diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index be995ce7..c6105cf6 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -26,12 +26,12 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No **Environment** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object Required: No **FileSystemConfigs** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index fb1c29a7..eb182d3f 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -80,11 +80,11 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object ** [EventSourceArn](#API_GetEventSourceMapping_ResponseSyntax) ** @@ -100,7 +100,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** @@ -117,17 +117,17 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 8fc54d45..5ed5e329 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -138,11 +138,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_GetFunctionConfiguration_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index a6bb06e9..87a9b031 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -28,7 +28,7 @@ Required: Yes Specify the pagination token that's returned by a previous request to retrieve the next page of results\. ** [MaxItems](#API_ListVersionsByFunction_RequestSyntax) ** -The maximum number of versions to return\. +The maximum number of versions to return\. Note that `ListVersionsByFunction` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. ## Request Body diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index d361190c..a70135ce 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -158,11 +158,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_PublishVersion_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_PublishVersion_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 653b1917..517a7d18 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -1,6 +1,6 @@ # TracingConfig -The function's AWS X\-Ray tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. +The function's [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. ## Contents diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 4e6263f3..c238265e 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -98,7 +98,7 @@ Required: No ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No @@ -198,11 +198,11 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object ** [EventSourceArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** @@ -218,7 +218,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** @@ -235,17 +235,17 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 8f181f19..d266387b 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -192,11 +192,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index f828bcfe..d01c5d7b 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -121,7 +121,7 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. +The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No @@ -144,13 +144,13 @@ Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodej Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** -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\. +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\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with AWS X\-Ray\. +Set `Mode` to `Active` to sample and trace a subset of incoming requests with [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. Type: [TracingConfig](API_TracingConfig.md) object Required: No @@ -262,11 +262,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 56270b66..1e738dce 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -6,8 +6,8 @@ Lambda provides AWS managed policies that grant access to Lambda API actions and **Note** The AWS managed policies **AWSLambdaFullAccess** and **AWSLambdaReadOnlyAccess** will be [deprecated](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-deprecated.html) on March 1, 2021\. After this date, you cannot attach these policies to new IAM users\. For more information, see the related [troubleshooting topic](security_iam_troubleshoot.md#security_iam_troubleshoot-admin-deprecation)\. -+ **AWSLambdaFullAccess** – Grants full access to Lambda actions and other AWS services used to develop and maintain Lambda resources\. -+ **AWSLambdaReadOnlyAccess** – Grants read\-only access to Lambda resources\. ++ **AWSLambda\_FullAccess** – Grants full access to Lambda actions and other AWS services used to develop and maintain Lambda resources\. This policy was created by scoping down the previous policy **AWSLambdaFullAccess**\. ++ **AWSLambda\_ReadOnlyAccess** – Grants read\-only access to Lambda resources\. This policy was created by scoping down the previous policy **AWSLambdaReadOnlyAccess**\. + **AWSLambdaRole** – Grants permissions to invoke Lambda functions\. AWS managed policies grant permission to API actions without restricting the Lambda functions or layers that a user can modify\. For finer\-grained control, you can create your own policies that limit the scope of a user's permissions\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index 9e01a7db..e765485d 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -8,6 +8,8 @@ The following are recommended best practices for using AWS Lambda: + [Metrics and alarms](#alarming-metrics) + [Working with streams](#stream-events) +For more information about best practices for Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. + ## Function code + **Separate the Lambda handler from your core logic\.** This allows you to make a more unit\-testable function\. In Node\.js this may look like: diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index 8e42e650..f1a0a47b 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -53,7 +53,7 @@ You can create a database proxy that uses the function's IAM credentials for aut The Lambda console adds the required permission \(`rds-db:connect`\) to the execution role\. You can then use the AWS SDK to generate a token that allows it to connect to the proxy\. The following example shows how to configure a database connection with the `mysql2` library in Node\.js\. -**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** +**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** ``` const signer = new AWS.RDS.Signer({ @@ -89,4 +89,4 @@ Sample applications that demonstrate the use of Lambda with an Amazon RDS databa [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) -To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/README.md)\. \ No newline at end of file +To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 10bf3d74..5a38bfd5 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -189,12 +189,12 @@ In the `AWS::Lambda::Function` resource, set the following properties to create + Code – Enter your container image URI in the `ImageUri` field\. + ImageConfig – \(Optional\) Override the container image configuration properties\. -The `AWS::Lambda::Function::ImageConfig` resource contains the following fields: +The `ImageConfig` property in `AWS::Lambda::Function` contains the following fields: + Command – Specifies parameters that you want to pass in with `EntryPoint`\. + EntryPoint – Specifies the entry point to the application\. + WorkingDirectory – Specifies the working directory\. **Note** -If you declare an `ImageConfig` resource in your AWS CloudFormation template, you must provide values for all three of the `ImageConfig` properties\. +If you declare an `ImageConfig` property in your AWS CloudFormation template, you must provide values for all three of the `ImageConfig` properties\. -For information about the `ImageConfig` resource, see [ImageConfig](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-imageconfig.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file +For more information, see [ImageConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig) in the *AWS CloudFormation User Guide*\. \ No newline at end of file diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index a91abe0e..63b7254a 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -316,7 +316,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 9739305d..88ff9be2 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in C\# -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current invocation, such as the name of the current function, the memory limit, execution time remaining, and logging\. diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index 7e7df14d..2e53e534 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -15,7 +15,7 @@ This page describes how to produce log output from your Lambda function's code, To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** ``` public async Task FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index 835f8e7c..c01fbf94 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -35,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your function code to record metadata and trace downstream calls\. To record detail about calls that your function makes to other resources and services, use the X\-Ray SDK for \.NET\. To get the SDK, add the `AWSXRayRecorder` packages to your project file\. -**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** +**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** ``` @@ -59,7 +59,7 @@ You can instrument your function code to record metadata and trace downstream ca To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initialization code\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** ``` static async void initialize() { @@ -118,7 +118,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index 5e2b25a1..eba01d7e 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -10,6 +10,8 @@ The [AWS CLI](gettingstarted-tools.md#gettingstarted-tools-awscli) and [SAM CLI] When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [What are connections?](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. +For more information about designing Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. + **Topics** + [Managing applications in the AWS Lambda console](applications-console.md) + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index b3db0b03..787224a9 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -36,7 +36,7 @@ The following steps demonstrate how to upload a \.zip file as your deployment pa 1. Select a function\. -1. Choose **Upload from**, **\.zip file** in the **Code Source** pane\. +1. In the **Code Source** pane, choose **Upload from** and then **\.zip file**\. 1. Choose **Upload** to select your local \.zip file\. @@ -81,4 +81,4 @@ If your deployment package is larger than 50 MB, we recommend uploading your fun You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS Command Line Interface \(AWS CLI\)\. -To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. +To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. \ No newline at end of file diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 6d9032d1..c3c80996 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in Go -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index c94ebb5b..5f8da42a 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -15,7 +15,7 @@ This page describes how to produce log output from your Lambda function's code, To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. -**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-go/function/main.go) – Logging** +**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go/function/main.go) – Logging** ``` func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 0b76e3be..c479b6f0 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -100,7 +100,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/index.md b/doc_source/index.md index 66fdcf1d..6b01b909 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -121,8 +121,8 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with Amazon RDS](services-rds.md) + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + [Using AWS Lambda with Amazon S3](with-s3.md) - + [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md) - + [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md) + + [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) + + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + [Using AWS Lambda with Amazon SES](services-ses.md) @@ -160,7 +160,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda function errors in Node.js](nodejs-exceptions.md) + [Instrumenting Node.js code in AWS Lambda](nodejs-tracing.md) + [Building Lambda functions with Python](lambda-python.md) - + [AWS Lambda function handler in Python](python-handler.md) + + [Lambda function handler in Python](python-handler.md) + [Deploy Python Lambda functions with .zip file archives](python-package.md) + [Tutorial: Creating a Lambda function in Python 3.8](python-package-create.md) + [Updating a Lambda function in Python 3.8](python-package-update.md) diff --git a/doc_source/java-context.md b/doc_source/java-context.md index 99a60a3e..c249fff6 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -17,7 +17,7 @@ When Lambda runs your function, it passes a context object to the [handler](java The following example shows a function that uses the context object to access the Lambda logger\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; @@ -66,7 +66,7 @@ REPORT RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Duration: 198.50 ms Bille The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. -**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/test/java/example/TestContext.java)** +**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/test/java/example/TestContext.java)** ``` package example; diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index fb8fb869..cf8cadf2 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -68,9 +68,9 @@ For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md# You can create a Lambda function that displays human\-readable error messages to users\. **Note** -To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. +To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. -**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** +**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** ``` import java.util.List; @@ -111,7 +111,7 @@ When the function throws `InputLengthException`, the Java runtime serializes it } ``` -In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. +In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. The return statement in the previous example can also throw a runtime exception\. diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 842f9360..81125f55 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -1,10 +1,10 @@ # AWS Lambda function handler in Java -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. In the following example, a class named `Handler` defines a handler method named `handleRequest`\. The handler method takes an event and context object as input and returns a string\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; @@ -42,7 +42,7 @@ You can add [initialization code](gettingstarted-features.md#gettingstarted-feat In the following example, the logger, serializer, and AWS SDK client are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** ``` // Handler value: example.Handler @@ -75,7 +75,7 @@ The GitHub repo for this guide provides easy\-to\-deploy sample applications tha You specify the type of object that the event maps to in the handler method's signature\. In the preceding example, the Java runtime deserializes the event into a type that implements the `Map` interface\. String\-to\-string maps work for flat events like the following: -**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/event.json) – Weather data** +**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/event.json) – Weather data** ``` { @@ -112,7 +112,7 @@ The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/m The `RequestHandler` interface is a generic type that takes two parameters: the input type and the output type\. Both types must be objects\. When you use this interface, the Java runtime deserializes the event into an object with the input type, and serializes the output into text\. Use this interface when the built\-in serialization works with your input and output types\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** ``` // Handler value: example.Handler @@ -125,7 +125,7 @@ To use your own serialization, implement the `RequestStreamHandler` interface\. The following example uses buffered reader and writer types to work with the input and output streams\. It uses the [Gson](https://github.com/google/gson) library for serialization and deserialization\. -**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** +**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** ``` import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) @@ -177,11 +177,11 @@ The GitHub repository for this guide includes sample applications that demonstra + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: -+ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. -+ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. -+ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. -+ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. -+ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. -+ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. ++ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. ++ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. ++ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. ++ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. ++ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. ++ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. To test different handler types, just change the handler value in the AWS SAM template\. For detailed instructions, see the sample application's readme file\. \ No newline at end of file diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index b7ee6126..c8da6366 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -222,7 +222,7 @@ To customize log output, support logging during unit tests, and log AWS SDK call To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. -**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** +**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** ``` @@ -269,7 +269,7 @@ SLF4J is a facade library for logging in Java code\. In your function code, you In the following example, the handler class uses SLF4J to retrieve a logger\. -**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** +**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** ``` import org.slf4j.Logger; @@ -295,7 +295,7 @@ public class Handler implements RequestHandler{ The build configuration takes runtime dependencies on the Lambda appender and SLF4J adapter, and implementation dependencies on Log4J 2\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Logging dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/build.gradle) – Logging dependencies** ``` dependencies { diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 8467b2e1..bbc574e0 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -307,7 +307,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 4aa16cb4..31985ad9 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -15,7 +15,7 @@ Use the `blank-java` sample app to learn the basics, or as a starting point for The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. -**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** +**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** ``` // Handler value: example.HandlerStream @@ -38,7 +38,7 @@ public class HandlerStream implements RequestStreamHandler { The `java-events` and `java-events-v1sdk` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. For event types like `DynamodbEvent` that require types from the AWS SDK for Java, `java-events-v1sdk` includes the SDK in its build configuration\. -**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** +**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** ``` import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 2d3ec9e1..6da3fdad 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -35,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio To record detail about calls that your function makes to other resources and services, add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that enable automatic instrumentation of AWS SDK for Java 2\.x clients\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Tracing dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/build.gradle) – Tracing dependencies** ``` dependencies { @@ -101,7 +101,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -118,7 +118,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index b474f5e5..35371776 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -10,4 +10,6 @@ As you add libraries and other dependencies to your function, creating and uploa To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. -To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file +To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. + +For more information about designing Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index a1ebc99f..caa57e8d 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -4,6 +4,8 @@ AWS Lambda integrates with other AWS services to help you monitor and troublesho You can use other AWS services to troubleshoot your Lambda functions\. This section describes how to use these AWS services to monitor, trace, debug, and troubleshoot your Lambda functions and applications\. +For more information about monitoring Lambda applications, see [Monitoring and observability](https://docs.aws.amazon.com/lambda/latest/operatorguide/monitoring-observability.html) in the *Lambda operator guide*\. + **Topics** + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 66466169..c3e5aa0b 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -13,6 +13,9 @@ Lambda supports the following Node\.js runtimes\. | Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | | Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | +**Note** +For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. + Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. **To create an execution role** diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md index 7f3c461d..3c4cbbbf 100644 --- a/doc_source/lambda-permissions.md +++ b/doc_source/lambda-permissions.md @@ -15,6 +15,8 @@ You can restrict user permissions by the resource an action affects and, in some For more information about IAM, see [What is IAM?](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) in the *IAM User Guide*\. +For more information about applying security principles to Lambda applications, see [Security](https://docs.aws.amazon.com/lambda/latest/operatorguide/security-ops.html) in the *Lambda operator guide*\. + **Topics** + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource\-based policies for AWS Lambda](access-control-resource-based.md) diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 87978144..aa915f24 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -4,6 +4,9 @@ You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtim Lambda supports the following Python runtimes\. +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + **Python runtimes** @@ -14,23 +17,6 @@ Lambda supports the following Python runtimes\. | Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | | Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | -Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **Lambda**\. - + **Permissions** – **AWSLambdaBasicExecutionRole**\. - + **Role name** – **lambda\-role**\. - - The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. - -You can add permissions to the role later, or swap it out for a different role that's specific to a single function\. - **To create a Python function** 1. Open the [Lambda console](https://console.aws.amazon.com/lambda)\. @@ -71,7 +57,7 @@ The function runtime passes a context object to the handler, in addition to the Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](python-logging.md) during invocation\. If your function [returns an error](python-exceptions.md), Lambda formats the error and returns it to the invoker\. **Topics** -+ [AWS Lambda function handler in Python](python-handler.md) ++ [Lambda function handler in Python](python-handler.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Python Lambda functions with container images](python-image.md) + [AWS Lambda context object in Python](python-context.md) diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 9c890a25..d5b2158b 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -11,7 +11,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Preview: Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss) | Lambda now supports the Runtime Logs API\. Lambda extensions can use the Logs API to subscribe to log streams in the execution environment\. For details, see [Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss)\. | November 12, 2020 | | [New event source to for Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ as an event source\. Use a Lambda function to process records from your Amazon MQ message broker\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | November 5, 2020 | | [Preview: Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | Use Lambda extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | October 8, 2020 | -| [Support for Java 8 and custom runtimes on AL2](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports Java 8 and custom runtimes on Amazon Linux 2\. For details, see [AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 12, 2020 | +| [Support for Java 8 and custom runtimes on AL2](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports Java 8 and custom runtimes on Amazon Linux 2\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 12, 2020 | | [New event source for Amazon Managed Streaming for Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MSK as an event source\. Use a Lambda function with Amazon MSK to process records in a Kafka topic\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | August 11, 2020 | | [IAM condition keys for Amazon VPC settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss) | You can now use Lambda\-specific condition keys for VPC settings\. For example, you can require that all functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the function's users can and can't use\. For details, see [Configuring VPC for IAM functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss)\. | August 10, 2020 | | [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | @@ -19,21 +19,21 @@ The following table describes the important changes to the *AWS Lambda Developer | [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | | [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | | [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | -| [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using AWS Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | +| [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | -| [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | AWS Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | +| [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | | [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](https://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | | [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/API_FunctionConfiguration.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConfiguration.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | | [Provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss) | You can now allocate provisioned concurrency for a function version or alias\. Provisioned concurrency enables a function to scale without fluctuations in latency\. For details, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Create a database proxy](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss) | You can now use the Lambda console to create a database proxy for a Lambda function\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. For details, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Percentiles support for the duration metric](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | You can now filter the duration metric based on percentiles\. For details, see [AWS Lambda metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | November 26, 2019 | -| [Increased concurrency for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | A new option for [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings enables you to process more than one batch at a time from each shard\. When you increase the number of concurrent batches per shard, your function's concurrency can be up to 10 times the number of shards in your stream\. For details, see [AWS Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | +| [Increased concurrency for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | A new option for [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings enables you to process more than one batch at a time from each shard\. When you increase the number of concurrent batches per shard, your function's concurrency can be up to 10 times the number of shards in your stream\. For details, see [Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | | [Function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | When you create or update a function, it enters a pending state while Lambda provisions resources to support it\. If you connect your function to a VPC, Lambda can create a shared elastic network interface right away, instead of creating network interfaces when your function is invoked\. This results in better performance for VPC\-connected functions, but might require an update to your automation\. For details, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | | [Error handling options for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-errors) | New configuration options are available for asynchronous invocation\. You can configure Lambda to limit retries and set a maximum event age\. For details, see [Configuring error handling for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-errors)\. | November 25, 2019 | -| [Error handling for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | New configuration options are available for event source mappings that read from streams\. You can configure [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings to limit retries and set a maximum record age\. When errors occur, you can configure the event source mapping to split batches before retrying, and to send invocation records for failed batches to a queue or topic\. For details, see [AWS Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | +| [Error handling for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | New configuration options are available for event source mappings that read from streams\. You can configure [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings to limit retries and set a maximum record age\. When errors occur, you can configure the event source mapping to split batches before retrying, and to send invocation records for failed batches to a queue or topic\. For details, see [Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | | [Destinations for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-destinations) | You can now configure Lambda to send records of asynchronous invocations to another service\. Invocation records contain details about the event, context, and function response\. You can send invocation records to an SQS queue, SNS topic, Lambda function, or EventBridge event bus\. For details, see [Configuring destinations for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-destinations)\. | November 25, 2019 | -| [New runtimes for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtimes are available for Node\.js 12, Python 3\.8, and Java 11\. For details, see [AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | -| [FIFO queue support for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss) | You can now create an event source mapping that reads from a first\-in, first\-out \(FIFO\) queue\. Previously, only standard queues were supported\. For details, see [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | +| [New runtimes for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtimes are available for Node\.js 12, Python 3\.8, and Java 11\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | +| [FIFO queue support for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss) | You can now create an event source mapping that reads from a first\-in, first\-out \(FIFO\) queue\. Previously, only standard queues were supported\. For details, see [Using Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | | [Create applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | Application creation in the Lambda console is now generally available\. For instructions, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | October 31, 2019 | | [Create applications in the Lambda console \(beta\)](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | You can now create a Lambda application with an integrated continuous delivery pipeline in the Lambda console\. The console provides sample applications that you can use as a starting point for your own project\. Choose between AWS CodeCommit and GitHub for source control\. Each time you push changes to your repository, the included pipeline builds and deploys them automatically\. For instructions, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | October 3, 2019 | | [Performance improvements for VPC\-connected functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss) | Lambda now uses a new type of elastic network interface that is shared by all functions in a virtual private cloud \(VPC\) subnet\. When you connect a function to a VPC, Lambda creates a network interface for each combination of security group and subnet that you choose\. When the shared network interfaces are available, the function no longer needs to create additional network interfaces as it scales up\. This dramatically improves startup times\. For details, see [Configuring a Lambda function to access resources in a VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss)\. | September 3, 2019 | @@ -43,16 +43,16 @@ The following table describes the important changes to the *AWS Lambda Developer | [Node\.js 10](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | A new runtime is available for Node\.js 10, nodejs10\.x\. This runtime uses Node\.js 10\.15 and will be updated with the latest point release of Node\.js 10 periodically\. Node\.js 10 is also the first runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | May 13, 2019 | | [GetLayerVersionByArn API](https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersionByArn.html?icmpid=docs_lambda_rss) | Use the [GetLayerVersionByArn](https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersionByArn.html?icmpid=docs_lambda_rss) API to download layer version information with the version ARN as input\. Compared to GetLayerVersion, GetLayerVersionByArn lets you use the ARN directly instead of parsing it to get the layer name and version number\. | April 25, 2019 | | [Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Ruby 2\.5 with a new runtime\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | With Lambda layers, you can package and deploy libraries, custom runtimes, and other dependencies separately from your function code\. Share your layers with your other accounts or the whole world\. For details, see [AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Custom runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss) | Build a custom runtime to run Lambda functions in your favorite programming language\. For details, see [Custom AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | +| [Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | With Lambda layers, you can package and deploy libraries, custom runtimes, and other dependencies separately from your function code\. Share your layers with your other accounts or the whole world\. For details, see [Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | +| [Custom runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss) | Build a custom runtime to run Lambda functions in your favorite programming language\. For details, see [Custom Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | | [Application Load Balancer triggers](https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html?icmpid=docs_lambda_rss) | Elastic Load Balancing now supports Lambda functions as a target for Application Load Balancers\. For details, see [Using Lambda with application load balancers](https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using AWS Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | +| [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | -| [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [AWS Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | +| [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | | [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. For details, see [AWS GovCloud \(US\-East\) now open](https://aws.amazon.com/blogs/aws/aws-govcloud-us-east-now-open/?icmpid=docs_lambda_rss) on the AWS blog\. | November 12, 2018 | | [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | | [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | -| [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [AWS Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | +| [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | | [Support for PowerShell Core language in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | | [Support for \.NET Core 2\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | | [Updates now available over RSS](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | You can now subscribe to an RSS feed to follow releases for this guide\. | July 5, 2018 | @@ -84,19 +84,19 @@ The following table describes the important changes in each release of the *AWS | AWS Lambda support for the \.NET runtime, Lambda@Edge \(Preview\), Dead Letter Queues and automated deployment of serverless applications\. | AWS Lambda added support for C\#\. For more information, see [Building Lambda functions with C\#](lambda-csharp.md)\. Lambda@Edge allows you to run Lambda functions at the AWS Edge locations in response to CloudFront events\. For more information, see [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md)\. | December 3, 2016 | | AWS Lambda adds Amazon Lex as a supported event source\. | Using Lambda and Amazon Lex, you can quickly build chat bots for various services like Slack and Facebook\. For more information, see [Using AWS Lambda with Amazon Lex](services-lex.md)\. | November 30, 2016 | | US West \(N\. California\) Region | AWS Lambda is now available in the US West \(N\. California\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | November 21, 2016 | -| Introduced the AWS Serverless Application Model for creating and deploying Lambda\-based applications and using environment variables for Lambda function configuration settings\. | AWS Serverless Application Model: You can now use the AWS SAM to define the syntax for expressing resources within a serverless application\. In order to deploy your application, simply specify the resources you need as part of your application, along with their associated permissions policies in a AWS CloudFormation template file \(written in either JSON or YAML\), package your deployment artifacts, and deploy the template\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. Environment variables: You can use environment variables to specify configuration settings for your Lambda function outside of your function code\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. | November 18, 2016 | +| Introduced the AWS SAM for creating and deploying Lambda\-based applications and using environment variables for Lambda function configuration settings\. | AWS SAM: You can now use the AWS SAM to define the syntax for expressing resources within a serverless application\. In order to deploy your application, simply specify the resources you need as part of your application, along with their associated permissions policies in a AWS CloudFormation template file \(written in either JSON or YAML\), package your deployment artifacts, and deploy the template\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. Environment variables: You can use environment variables to specify configuration settings for your Lambda function outside of your function code\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. | November 18, 2016 | | Asia Pacific \(Seoul\) Region | AWS Lambda is now available in the Asia Pacific \(Seoul\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | August 29, 2016 | | Asia Pacific \(Sydney\) Region | Lambda is now available in the Asia Pacific \(Sydney\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | June 23, 2016 | | Updates to the Lambda console | The Lambda console has been updated to simplify the role\-creation process\. For more information, see [Create a Lambda function with the console](getting-started-create-function.md)\. | June 23, 2016 | | AWS Lambda now supports Node\.js runtime v4\.3 | AWS Lambda added support for Node\.js runtime v4\.3\. For more information, see [Building Lambda functions with Node\.js](lambda-nodejs.md)\. | April 07, 2016 | | Europe \(Frankfurt\) region | Lambda is now available in the Europe \(Frankfurt\) region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | March 14, 2016 | | VPC support | You can now configure a Lambda function to access resources in your VPC\. For more information, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. | February 11, 2016 | -| AWS Lambda runtime has been updated\. | The [execution environment](lambda-runtimes.md) has been updated\. | November 4, 2015 | -| Versioning support, Python for developing code for Lambda functions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up AWS Lambda to invoke your code on a regular, scheduled basis using the AWS Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | +| Lambda runtime has been updated\. | The [execution environment](lambda-runtimes.md) has been updated\. | November 4, 2015 | +| Versioning support, Python for developing code for Lambdafunctions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up Lambda to invoke your code on a regular, scheduled basis using the Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | | Support for DynamoDB Streams | DynamoDB Streams is now generally available and you can use it in all the regions where DynamoDB is available\. You can enable DynamoDB Streams for your table and use a Lambda function as a trigger for the table\. Triggers are custom actions you take in response to updates made to the DynamoDB table\. For an example walkthrough, see [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) \. | July 14, 2015 | -| AWS Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, AWS Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | -| The AWS Lambda console now provides blueprints to easily create Lambda functions and test them\. | AWS Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the AWS Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with Lambda](getting-started.md)\. | July 09, 2015 | -| AWS Lambda now supports Java to author your Lambda functions\. | You can now author Lambda code in Java\. For more information, see [Building Lambda functions with Java](lambda-java.md)\. | June 15, 2015 | -| AWS Lambda now supports specifying an Amazon S3 object as the function \.zip when creating or updating a Lambda function\. | You can upload a Lambda function deployment package \(\.zip file\) to an Amazon S3 bucket in the same region where you want to create a Lambda function\. Then, you can specify the bucket name and object key name when you create or update a Lambda function\. | May 28, 2015 | -| AWS Lambda now generally available with added support for mobile backends | AWS Lambda is now generally available for production use\. The release also introduces new features that make it easier to build mobile, tablet, and Internet of Things \(IoT\) backends using AWS Lambda that scale automatically without provisioning or managing infrastructure\. AWS Lambda now supports both real\-time \(synchronous\) and asynchronous events\. Additional features include easier event source configuration and management\. The permission model and the programming model have been simplified by the introduction of resource policies for your Lambda functions\. The documentation has been updated accordingly\. For information, see the following topics: [Getting started with Lambda](getting-started.md) [AWS Lambda](https://aws.amazon.com/lambda/) | April 9, 2015 | +| Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | +| The Lambda console now provides blueprints to easily create Lambda functions and test them\. | Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with Lambda](getting-started.md)\. | July 09, 2015 | +| Lambda now supports Java to author your Lambda functions\. | You can now author Lambda code in Java\. For more information, see [Building Lambda functions with Java](lambda-java.md)\. | June 15, 2015 | +| Lambda now supports specifying an Amazon S3 object as the function \.zip when creating or updating a Lambda function\. | You can upload a Lambda function deployment package \(\.zip file\) to an Amazon S3 bucket in the same region where you want to create a Lambda function\. Then, you can specify the bucket name and object key name when you create or update a Lambda function\. | May 28, 2015 | +| Lambda now generally available with added support for mobile backends | Lambda is now generally available for production use\. The release also introduces new features that make it easier to build mobile, tablet, and Internet of Things \(IoT\) backends using Lambda that scale automatically without provisioning or managing infrastructure\. Lambda now supports both real\-time \(synchronous\) and asynchronous events\. Additional features include easier event source configuration and management\. The permission model and the programming model have been simplified by the introduction of resource policies for your Lambda functions\. The documentation has been updated accordingly\. For information, see the following topics: [Getting started with Lambda](getting-started.md) [AWS Lambda](https://aws.amazon.com/lambda/) | April 9, 2015 | | Preview release | Preview release of the *AWS Lambda Developer Guide*\. | November 13, 2014 | \ No newline at end of file diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index ce4963c7..62807c1a 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -12,6 +12,9 @@ Lambda supports the following Ruby runtimes\. | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | | Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | +**Note** +For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. + Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. **To create an execution role** diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 93d6a5b7..d58ef247 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -25,6 +25,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | | Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | +**Note** +For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. + **Python runtimes** @@ -35,6 +38,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | | Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +**Important** +Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. + **Ruby runtimes** @@ -43,6 +49,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | | Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | +**Note** +For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. + **Java runtimes** diff --git a/doc_source/lambda-security.md b/doc_source/lambda-security.md index 738703b2..9cebf5f4 100644 --- a/doc_source/lambda-security.md +++ b/doc_source/lambda-security.md @@ -8,6 +8,8 @@ Security is a shared responsibility between AWS and you\. The [shared responsibi 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\. +For more information about applying security principles to Lambda applications, see [Security](https://docs.aws.amazon.com/lambda/latest/operatorguide/security-ops.html) in the *Lambda operator guide*\. + **Topics** + [Data protection in AWS Lambda](security-dataprotection.md) + [Identity and access management for Lambda](security-iam.md) diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index e8c051a1..5bac8e85 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -58,6 +58,8 @@ For services that generate a queue or data stream, you create an [event source m Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. +For more information about Lambda service architectures, see [Event driven architectures](https://docs.aws.amazon.com/lambda/latest/operatorguide/event-driven-architectures.html) in the *Lambda operator guide*\. + **Services that invoke Lambda functions synchronously** + [Elastic Load Balancing \(Application Load Balancer\)](services-alb.md) + [Amazon Cognito](services-cognito.md) diff --git a/doc_source/lambda-troubleshooting.md b/doc_source/lambda-troubleshooting.md index 61a9711e..927c5b35 100644 --- a/doc_source/lambda-troubleshooting.md +++ b/doc_source/lambda-troubleshooting.md @@ -4,6 +4,8 @@ The following topics provide troubleshooting advice for errors and issues that y For more troubleshooting advice and answers to common support questions, visit the [AWS Knowledge Center](https://aws.amazon.com/premiumsupport/knowledge-center/#AWS_Lambda)\. +For more information about debugging and troubleshooting Lambda applications, see [Debugging](https://docs.aws.amazon.com/lambda/latest/operatorguide/debugging-ops.html) in the *Lambda operator guide*\. + **Topics** + [Troubleshoot deployment issues in Lambda](troubleshooting-deployment.md) + [Troubleshoot invocation issues in Lambda](troubleshooting-invocation.md) diff --git a/doc_source/nodejs-context.md b/doc_source/nodejs-context.md index c5a9f578..7a1e562f 100644 --- a/doc_source/nodejs-context.md +++ b/doc_source/nodejs-context.md @@ -27,7 +27,7 @@ When Lambda runs your function, it passes a context object to the [handler](node + `env.make` + `env.model` + `env.locale` - + `Custom` – Custom values that are set by the caller\. + + `Custom` – Custom values that are set by the client application\. + `callbackWaitsForEmptyEventLoop` – Set to false to send the response right away when the [callback](nodejs-handler.md#nodejs-handler-sync) runs, instead of waiting for the Node\.js event loop to be empty\. If this is false, any outstanding events continue to run during the next invocation\. The following example function logs context information and returns the location of the logs\. @@ -40,4 +40,4 @@ exports.handler = async function(event, context) { console.log('Function name: ', context.functionName) return context.logStreamName } -``` +``` \ No newline at end of file diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index b792b973..406c5f25 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in Node\.js -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. The following example function logs the contents of the event object and returns the location of the logs\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 0132ea20..43c7fc2c 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -48,7 +48,7 @@ AWSXRay.setContextMissingStrategy(() => {}); You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. -**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/package.json)** +**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/package.json)** ``` { @@ -70,7 +70,7 @@ You can instrument your handler code to record metadata and trace downstream cal To instrument AWS SDK clients, wrap the `aws-sdk` library with the `captureAWS` method\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -135,7 +135,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -152,7 +152,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index e0c81187..1c5ab1ea 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -15,7 +15,7 @@ This page describes how to produce log output from your Lambda function's code, To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. -**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-powershell/function/Handler.ps1) – Logging** +**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell/function/Handler.ps1) – Logging** ``` #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} diff --git a/doc_source/python-context.md b/doc_source/python-context.md index b0770e46..332f2077 100644 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -1,6 +1,9 @@ # AWS Lambda context object in Python -When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [AWS Lambda function handler in Python](python-handler.md)\. +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + +When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [Lambda function handler in Python](python-handler.md)\. **Context methods** + `get_remaining_time_in_millis` – Returns the number of milliseconds left before the execution times out\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index 83ee2cd5..ef389967 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,5 +1,8 @@ # AWS Lambda function errors in Python +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Python runtime using the Lambda console and the AWS CLI\. diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index 4a022c55..9849eb94 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -1,6 +1,9 @@ -# AWS Lambda function handler in Python +# Lambda function handler in Python -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. You can use the following general syntax when creating a function handler in Python: @@ -12,19 +15,19 @@ def handler_name(event, context): ## Naming -The Lambda function *handler* name specified at the time you create a Lambda function is derived from the following: -+ the name of the file in which the Lambda handler function is located -+ the name of the Python handler function +The Lambda function handler name specified at the time that you create a Lambda function is derived from: ++ The name of the file in which the Lambda handler function is located\. ++ The name of the Python handler function\. -A function handler can be any name; however, the default on the Lambda console is `lambda_function.lambda_handler`\. This name reflects the function name as `lambda_handler`, and the file where the handler code is stored in `lambda_function.py`\. +A function handler can be any name; however, the default name in the Lambda console is `lambda_function.lambda_handler`\. This function handler name reflects the function name \(`lambda_handler`\) and the file where the handler code is stored \(`lambda_function.py`\)\. -If you choose a different name for your function handler on the Lambda console, you must update the name on the **Runtime settings** pane\. The following example shows the Lambda function handler on the Lambda console: +To change the function handler name in the Lambda console, on the **Runtime settings** pane, choose **Edit**\. -![\[The following image shows the function handler on the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/python-console-handler.png) +![\[A function handler name in the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/python-console-handler.png) ## How it works -When your function handler is invoked by Lambda, the [Lambda runtime](lambda-runtimes.md) passes two arguments to the function handler: +When Lambda invokes your function handler, the [Lambda runtime](lambda-runtimes.md) passes two arguments to the function handler: + The first argument is the [event object](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-concepts.html#gettingstarted-concepts-event)\. An event is a JSON\-formatted document that contains data for a Lambda function to process\. The [Lambda runtime](lambda-runtimes.md) converts the event to an object and passes it to your function code\. It is usually of the Python `dict` type\. It can also be `list`, `str`, `int`, `float`, or the `NoneType` type\. The event object contains information from the invoking service\. When you invoke a function, you determine the structure and contents of the event\. When an AWS service invokes your function, the service defines the event structure\. For more information about events from AWS services, see [Using AWS Lambda with other services](lambda-services.md)\. diff --git a/doc_source/python-image.md b/doc_source/python-image.md index 0f5b3e34..5b7c5dc1 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -1,5 +1,8 @@ # Deploy Python Lambda functions with container images +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Python function: + AWS base images for Lambda diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 1d3fe7cb..c8d3710a 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -1,5 +1,8 @@ # AWS Lambda function logging in Python +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 46e2f92d..04cb9e72 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -186,22 +186,16 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i **To invoke the function** + Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. ------- -#### [ macOS/Linux ] - ``` aws lambda invoke --function-name my-math-function --payload '{"action": "square","number": 3}' output.txt ``` - ------- -#### [ Windows ] +**Note** +If you are using AWS CLI version 2, add the following command parameter: ``` - aws lambda invoke --function-name my-math-function --cli-binary-format raw-in-base64-out --payload "{"action": "square","number": 3}" output.txt + --cli-binary-format raw-in-base64-out ``` ------- - This command produces the following output: ``` diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index 3c734766..0ea280f5 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -105,10 +105,10 @@ To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa my-deployment-package.zip$ │ lambda_function.py │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ ... ``` @@ -188,10 +188,10 @@ A library may appear in `site-packages` or `dist-packages` and the first folder my-deployment-package.zip$ │ lambda_function.py │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ ... ``` diff --git a/doc_source/python-package.md b/doc_source/python-package.md index b46c5ede..743f475e 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -1,5 +1,8 @@ # Deploy Python Lambda functions with \.zip file archives +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index c6b364fe..83b40b55 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -1,5 +1,8 @@ # Instrumenting Python code in AWS Lambda +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. @@ -35,7 +38,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/requirements.txt)** +**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/requirements.txt)** ``` jsonpickle==1.3 @@ -44,7 +47,7 @@ aws-xray-sdk==2.4.3 To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** ``` import boto3 @@ -113,7 +116,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -130,7 +133,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md index ad7ff752..fe3c6e88 100644 --- a/doc_source/ruby-handler.md +++ b/doc_source/ruby-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in Ruby -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. In the following example, the file `function.rb` defines a handler method named `handler`\. The handler function takes two objects as input and returns a JSON document\. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index 352aea1b..2f08c9dd 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -35,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Ruby\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/Gemfile)** +**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/Gemfile)** ``` # Gemfile @@ -48,7 +48,7 @@ gem 'test-unit', '3.3.5' To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** ``` # lambda_function.rb @@ -115,7 +115,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -132,7 +132,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index c03b0a65..fb8835f3 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -1,36 +1,42 @@ # Runtime support policy -[Lambda runtimes](lambda-runtimes.md) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When a component of a runtime is no longer supported for security updates, Lambda deprecates the runtime\. +[Lambda runtimes](lambda-runtimes.md) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When security updates are no longer available for a component of a runtime, Lambda deprecates the runtime\. -Deprecation occurs in two phases\. During the first phase, you can no longer create functions that use the deprecated runtime\. For at least 30 days, you can continue to update existing functions that use the deprecated runtime\. After this period, both function creation and updates are disabled permanently\. However, the function continues to be available to process invocation events\. +Deprecation \(end of support\) for a runtime occurs in two phases\. In phase 1, Lambda no longer applies security patches or other updates to the runtime\. You can no longer create functions that use the runtime, but you can continue to update existing functions\. Note that existing functions that use the runtime are no longer eligible for technical support\. -**Note** -Python 2\.7 reached end of life on January 1, 2020\. However, the Python 2\.7 runtime is still supported and is not scheduled to be deprecated at this time\. For details, see [Continued support for Python 2\.7 on AWS Lambda](http://aws.amazon.com/blogs/compute/continued-support-for-python-2-7-on-aws-lambda/) on the AWS Compute Blog\. +In phase 2, which starts at least 30 days after the start of phase 1, you can no longer create or update functions that use the runtime\. However, existing functions that use the runtime remain available to process invocation events\. -The following runtimes have been deprecated: +**Important** +Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. +The following runtimes have reached or are scheduled for end of support: -**Deprecated runtimes** -| Name | Identifier | Operating system | Deprecation completed date | -| --- | --- | --- | --- | -| \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | July 30, 2019 | -| \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | May 30, 2019 | -| Node\.js 0\.10 | `nodejs` | Amazon Linux | October 31, 2016 | -| Node\.js 4\.3 | `nodejs4.3` | Amazon Linux | March 6, 2020 | -| Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | April 30, 2019 | -| Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | August 12, 2019 | -| Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | March 6, 2020 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | May 28, 2021 | +**Runtime end of support dates** -In most cases, the end\-of\-life date of a language version or operating system is known well in advance\. If you have functions running on a runtime that will be deprecated in the next 60 days, Lambda notifies you by email that you should prepare by migrating your function to a supported runtime\. In some cases, such as security issues that require a backwards\-incompatible update, or software that doesn't support a long\-term support \(LTS\) schedule, advance notice might not be possible\. +| Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | +| --- | --- | --- | --- | --- | +| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | +| Ruby 2\.5 | `ruby2.5` | Amazon Linux | May 31, 2021 | June 30, 2021 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | May 31, 2021 | June 30, 2021 | +| Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | +| Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | +| Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | +| Node\.js 4\.3 | `nodejs4.3` | Amazon Linux | | March 6, 2020 | +| Node\.js 0\.10 | `nodejs` | Amazon Linux | | October 31, 2016 | +| \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | | May 30, 2019 | +| \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | | July 30, 2019 | + +In most cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. + +In some cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. **Language and framework support policies** + **Node\.js** – [github\.com](https://github.com/nodejs/Release#release-schedule) + **Python** – [devguide\.python\.org](https://devguide.python.org/#status-of-python-branches) + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) -+ **Java** – [www\.oracle\.com](https://www.oracle.com/technetwork/java/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) -+ **Go** – [golang\.org](https://golang.org/s/release) ++ **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) ++ **Go** – [golang\.org](https://golang.org/doc/devel/release.html) + **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) -After a runtime is deprecated, Lambda might retire it completely at any time by disabling invocation\. Deprecated runtimes aren't eligible for security updates or technical support\. Before retiring a runtime, Lambda sends additional notifications to affected customers\. No runtimes are scheduled to be retired at this time\. \ No newline at end of file +After ending support for a runtime, Lambda might retire it completely at any time by disabling invocation\. Before retiring a runtime, Lambda sends additional notifications to affected customers\. No runtimes are scheduled for retirement at this time\. \ No newline at end of file diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index d0b9384c..cc75571a 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -47,7 +47,7 @@ The function's timeout setting limits the duration of the entire `Invoke` phase\ The invoke phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. -If there is a failure during `Invoke`, Lambda resets the execution environment\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime\. Then Lambda sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If another `Invoke` event results in this execution environment being reused, Lambda initializes the runtime and extensions as part of the next invocation\. +If the Lambda function crashes or times out during the `Invoke` phase, Lambda resets the execution environment\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime\. Then Lambda sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If another `Invoke` event results in this execution environment being reused, Lambda initializes the runtime and extensions as part of the next invocation\. ![\[This is my image.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index b6f91318..38688e57 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -39,7 +39,7 @@ Standard charges apply for each service\. For more information, see [AWS Pricing The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Handler code** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Handler code** ``` // Handler @@ -66,7 +66,7 @@ var serialize = function(object) { The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. -The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. +The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ## Deployment automation with AWS CloudFormation and the AWS CLI @@ -96,7 +96,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: @@ -152,7 +152,7 @@ In this example, the `Code` property specifies an object in an Amazon S3 bucket\ To upload the project files to Amazon S3, the deployment script uses commands in the AWS CLI\. The `cloudformation package` command preprocesses the template, uploads artifacts, and replaces local paths with Amazon S3 object locations\. The `cloudformation deploy` command deploys the processed template with a AWS CloudFormation change set\. -**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** +**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** ``` #!/bin/bash @@ -164,7 +164,7 @@ aws cloudformation deploy --template-file out.yml --stack-name blank-nodejs --ca The first time you run this script, it creates a AWS CloudFormation stack named `blank-nodejs`\. If you make changes to the function code or template, you can run it again to update the stack\. -The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. +The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. ## Instrumentation with the AWS X\-Ray @@ -176,7 +176,7 @@ The first service node \(`AWS::Lambda`\) represents the Lambda service, which va To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Instrumentation** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -200,7 +200,7 @@ You can include the X\-Ray SDK and other libraries in your function's deployment You can install libraries locally and include them in the deployment package that you upload to Lambda, but this has its drawbacks\. Larger file sizes cause increased deployment times and can prevent you from testing changes to your function code in the Lambda console\. To keep the deployment package small and avoid uploading dependencies that haven't changed, the sample app creates a [Lambda layer](configuration-layers.md) and associates it with the function\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependency layer** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Dependency layer** ``` Resources: @@ -215,7 +215,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: @@ -232,7 +232,7 @@ Resources: The `2-build-layer.sh` script installs the function's dependencies with npm and places them in a folder with the [structure required by the Lambda runtime](configuration-layers.md#configuration-layers-path)\. -**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** +**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** ``` #!/bin/bash diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index ad43ed3b..67e825cc 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -5,8 +5,8 @@ The Error Processor sample application demonstrates the use of AWS Lambda to han ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor.png) Function code is available in the following files: -+ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/random-error/index.js) -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/processor/index.js) ++ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/random-error/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/processor/index.js) You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor)\. @@ -84,7 +84,7 @@ The application is implemented in two Node\.js modules and deployed with an AWS + Resource\-based policy – A permission statement on the processor function that allows CloudWatch Logs to invoke it\. + Amazon S3 bucket – A storage location for output from the processor function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/template.yml) on GitHub\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-stack.png) diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 86415c56..7225177f 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -7,8 +7,8 @@ The list manager sample application demonstrates the use of AWS Lambda to proces Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/processor/index.js) -+ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/dbadmin/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/processor/index.js) ++ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/dbadmin/index.js) You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager)\. @@ -66,7 +66,7 @@ A *ranking* contains a list of entries where the value is the order in which the A Lambda [event source mapping](invocation-eventsourcemapping.md) read records from the stream in batches and invokes the processor function\. The event that the function handler received contains an array of objects that each contain details about a record, such as when it was received, details about the stream, and an encoded representation of the original record document\. -**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/events/kinesis.json) – Record** +**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/events/kinesis.json) – Record** ``` { @@ -112,9 +112,9 @@ The application is implemented in Node\.js modules and deployed with an AWS Clou + Execution role – An IAM role that grants the functions permission to access other AWS services\. + Lambda event source mapping – Reads records from the data stream and invokes the function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/template.yml) on GitHub\. -A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. +A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. **Infrastructure resources** + VPC – A virtual private cloud network with private subnets, a route table, and a VPC endpoint that allows the function to communicate with DynamoDB without an internet connection\. diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index eefdfd5f..ec13c87c 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -58,7 +58,7 @@ exports.handler = function(event, context, callback) { callback(null, "pong"); break; default: - callback('Unknown operation: ${operation}'); + callback(`Unknown operation: ${operation}`); } }; ``` diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 85b8b5b7..667e3e63 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -179,7 +179,7 @@ exports.handler = function(event, context, callback) { callback(null, "pong"); break; default: - callback('Unknown operation: ${operation}'); + callback(`Unknown operation: ${operation}`); } }; ``` @@ -224,7 +224,13 @@ Invoke the function manually using the sample event data\. We recommend that you ``` aws lambda invoke --function-name LambdaFunctionOverHttps \ - --payload fileb://input.txt outputfile.txt + --payload file://input.txt outputfile.txt + ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out ``` ## Create an API using Amazon API Gateway diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index d0be5212..1b99debe 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -30,7 +30,7 @@ A Lambda integration maps a path and HTTP method combination to a Lambda functio Amazon API Gateway invokes your function [synchronously](invocation-sync.md) with an event that contains a JSON representation of the HTTP request\. For a custom integration, the event is the body of the request\. For a proxy integration, the event has a defined structure\. The following example shows a proxy event from an API Gateway REST API\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** ``` { @@ -75,7 +75,7 @@ API Gateway waits for a response from your function and relays the result to the The following example shows a response object from a Node\.js function\. The response object represents a successful HTTP response that contains a JSON document\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** ``` var response = { @@ -203,7 +203,7 @@ The following example shows an X\-Ray trace map for a request that resulted in a To customize the error response, you must catch errors in your code and format a response in the required format\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Error formatting** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/function/index.js) – Error formatting** ``` var formatError = function(error){ @@ -251,7 +251,7 @@ WebSocket APIs also use the API Gateway version 2 API and support a similar feat HTTP APIs support a simplified event format \(version 2\.0\)\. The following example shows an event from an HTTP API\. -**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** +**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** ``` { diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md index 6ff099f0..5a68656f 100644 --- a/doc_source/services-cloudformation.md +++ b/doc_source/services-cloudformation.md @@ -56,7 +56,7 @@ AWS CloudFormation provides a library called `cfn-response` that handles sending The following example function invokes a second function\. If the call succeeds, the function sends a success response to AWS CloudFormation, and the stack update continues\. The template uses the [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) resource type provided by AWS Serverless Application Model\. -**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) – Custom resource function** +**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/template.yml) – Custom resource function** ``` Transform: 'AWS::Serverless-2016-10-31' diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md index 2f1a84ca..eb06bd91 100644 --- a/doc_source/services-cloudwatchevents-expressions.md +++ b/doc_source/services-cloudwatchevents-expressions.md @@ -39,4 +39,4 @@ Note the following: + If you are using the Lambda console, do not include the `cron` prefix in your expression\. + One of the day\-of\-month or day\-of\-week values must be a question mark \(`?`\)\. -For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html) in the *CloudWatch Events User Guide*\. \ No newline at end of file +For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schedule-expressions.html) in the *EventBridge User Guide*\. \ No newline at end of file diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index a3a578c3..194c346a 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -57,7 +57,7 @@ Locate the sample project in the guide repository under [sample\-apps/ec2\-spot] 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)** +**Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** ``` using Amazon.EC2; @@ -86,7 +86,7 @@ using Amazon.EC2; 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)** +**Example [Function\.cs – RequestSpotInstance](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L59)** ``` using Amazon; diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 39fe6edb..35da3661 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -106,7 +106,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 4d93f4fa..54e8030d 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -6,6 +6,8 @@ You can use Lambda to run your code in response to events, such as changes to da You can also build serverless applications composed of functions that are triggered by events, and automatically deploy them using AWS CodePipeline and AWS CodeBuild\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. +For more information about designing, operating, and troubleshooting Lambda\-based applications, see [Introduction](https://docs.aws.amazon.com/lambda/latest/operatorguide/intro.html) in the *Lambda operator guide*\. + **Topics** + [When should I use AWS Lambda?](#when-to-use-cloud-functions) + [Are you a first\-time user of AWS Lambda?](#welcome-first-time-user) diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index b7dae428..2c2cb972 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -98,6 +98,12 @@ Invoke the function manually using the sample event data\. aws lambda invoke --function-name AndroidBackendLambdaFunction \ --payload file://file-path/input.txt outputfile.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` ## Create an Amazon Cognito identity pool diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index f60ffb50..7c711bb4 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -185,6 +185,13 @@ Run the following `invoke` command\. aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + +``` +--cli-binary-format raw-in-base64-out +``` + The function returns the string `message` in the response body\. Verify the output in the `outputfile.txt` file\. diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 5b834fd6..6e39e0bb 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -123,6 +123,12 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a ``` aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` The response is saved to `out.txt`\. diff --git a/doc_source/with-s3-example-deployment-pkg.md b/doc_source/with-s3-example-deployment-pkg.md deleted file mode 100644 index 01392350..00000000 --- a/doc_source/with-s3-example-deployment-pkg.md +++ /dev/null @@ -1,353 +0,0 @@ -# Sample Amazon S3 function code - -The following sample code is available for the [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md)\. - -**Topics** -+ [Node\.js 12\.x](#with-s3-example-deployment-pkg-nodejs) -+ [Java 11](#with-s3-example-deployment-pkg-java) -+ [Python 3](#with-s3-example-deployment-pkg-python) - -## Node\.js 12\.x - -The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. - -### Create the function code - -Copy the sample code into a file named `index.js` into a new folder named `lambda-s3`\. - -**Example index\.js** - -``` -// dependencies - const AWS = require('aws-sdk'); - const util = require('util'); - const sharp = require('sharp'); - - // get reference to S3 client - const s3 = new AWS.S3(); - - exports.handler = async (event, context, callback) => { - - // Read options from the event parameter. - console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); - const srcBucket = event.Records[0].s3.bucket.name; - // Object key may have spaces or unicode non-ASCII characters. - const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); - const dstBucket = srcBucket + "-resized"; - const dstKey = "resized-" + srcKey; - - // Infer the image type from the file suffix. - const typeMatch = srcKey.match(/\.([^.]*)$/); - if (!typeMatch) { - console.log("Could not determine the image type."); - return; - } - - // Check that the image type is supported - const imageType = typeMatch[1].toLowerCase(); - if (imageType != "jpg" && imageType != "png") { - console.log(`Unsupported image type: ${imageType}`); - return; - } - - // Download the image from the S3 source bucket. - - try { - const params = { - Bucket: srcBucket, - Key: srcKey - }; - var origimage = await s3.getObject(params).promise(); - - } catch (error) { - console.log(error); - return; - } - - // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. - const width = 200; - - // Use the Sharp module to resize the image and save in a buffer. - try { - var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - - } catch (error) { - console.log(error); - return; - } - - // Upload the thumbnail image to the destination bucket - try { - const destparams = { - Bucket: dstBucket, - Key: dstKey, - Body: buffer, - ContentType: "image" - }; - - const putResult = await s3.putObject(destparams).promise(); - - } catch (error) { - console.log(error); - return; - } - - console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); - }; -``` -+ Review the preceding code and note the following: - + The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg, the code creates a thumbnail and saves it to the target bucket\. - + The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. - + For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. - -### Create the deployment package - -A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: - -**Dependencies** -+ Sharp for node\.js - -**To create a deployment package** - -1. Install the Sharp library with npm\. For Linux, use the following command\. - - ``` - lambda-s3$ npm install sharp - ``` - - For macOS, use the following command\. - - ``` - lambda-s3$ npm install --arch=x64 --platform=linux --target=12.13.0 sharp - ``` - -1. After you complete this step, you should have the following folder structure: - - ``` - lambda-s3 - |- index.js - |- /node_modules/sharp - └ /node_modules/... - ``` - -1. Create a deployment package with the function code and dependencies\. - - ``` - lambda-s3$ zip -r function.zip . - ``` - -**To create and test the function** -+ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. - -## Java 11 - -The following is example Java code that reads incoming Amazon S3 events and creates a thumbnail\. Note that it implements the `RequestHandler` interface provided in the `aws-lambda-java-core` library\. Therefore, at the time you create a Lambda function you specify the class as the handler \(that is, `example.handler`\)\. For more information about using interfaces to provide a handler, see [Handler interfaces](java-handler.md#java-handler-interfaces)\. - -The `S3Event` type that the handler uses as the input type is one of the predefined classes in the `aws-lambda-java-events`  library that provides methods for you to easily read information from the incoming Amazon S3 event\. The handler returns a string as output\. - -### Create the function code - -Copy the sample code into a file named `Handler.java`\. - -**Example Handler\.java** - -``` -package example; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.imageio.ImageIO; - -import com.amazonaws.AmazonServiceException; -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.S3Event; -import com.amazonaws.services.s3.AmazonS3; -import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord; -import com.amazonaws.services.s3.model.GetObjectRequest; -import com.amazonaws.services.s3.model.ObjectMetadata; -import com.amazonaws.services.s3.model.S3Object; -import com.amazonaws.services.s3.AmazonS3ClientBuilder; - -public class Handler implements - RequestHandler { - private static final float MAX_WIDTH = 100; - private static final float MAX_HEIGHT = 100; - private final String JPG_TYPE = (String) "jpg"; - private final String JPG_MIME = (String) "image/jpeg"; - private final String PNG_TYPE = (String) "png"; - private final String PNG_MIME = (String) "image/png"; - - public String handleRequest(S3Event s3event, Context context) { - try { - S3EventNotificationRecord record = s3event.getRecords().get(0); - - String srcBucket = record.getS3().getBucket().getName(); - - // Object key may have spaces or unicode non-ASCII characters. - String srcKey = record.getS3().getObject().getUrlDecodedKey(); - - String dstBucket = srcBucket + "-resized"; - String dstKey = "resized-" + srcKey; - - // Sanity check: validate that source and destination are different - // buckets. - if (srcBucket.equals(dstBucket)) { - System.out - .println("Destination bucket must not match source bucket."); - return ""; - } - - // Infer the image type. - Matcher matcher = Pattern.compile(".*\\.([^\\.]*)").matcher(srcKey); - if (!matcher.matches()) { - System.out.println("Unable to infer image type for key " - + srcKey); - return ""; - } - String imageType = matcher.group(1); - if (!(JPG_TYPE.equals(imageType)) && !(PNG_TYPE.equals(imageType))) { - System.out.println("Skipping non-image " + srcKey); - return ""; - } - - // Download the image from S3 into a stream - AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); - S3Object s3Object = s3Client.getObject(new GetObjectRequest( - srcBucket, srcKey)); - InputStream objectData = s3Object.getObjectContent(); - - // Read the source image - BufferedImage srcImage = ImageIO.read(objectData); - int srcHeight = srcImage.getHeight(); - int srcWidth = srcImage.getWidth(); - // Infer the scaling factor to avoid stretching the image - // unnaturally - float scalingFactor = Math.min(MAX_WIDTH / srcWidth, MAX_HEIGHT - / srcHeight); - int width = (int) (scalingFactor * srcWidth); - int height = (int) (scalingFactor * srcHeight); - - BufferedImage resizedImage = new BufferedImage(width, height, - BufferedImage.TYPE_INT_RGB); - Graphics2D g = resizedImage.createGraphics(); - // Fill with white before applying semi-transparent (alpha) images - g.setPaint(Color.white); - g.fillRect(0, 0, width, height); - // Simple bilinear resize - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, - RenderingHints.VALUE_INTERPOLATION_BILINEAR); - g.drawImage(srcImage, 0, 0, width, height, null); - g.dispose(); - - // Re-encode image to target format - ByteArrayOutputStream os = new ByteArrayOutputStream(); - ImageIO.write(resizedImage, imageType, os); - InputStream is = new ByteArrayInputStream(os.toByteArray()); - // Set Content-Length and Content-Type - ObjectMetadata meta = new ObjectMetadata(); - meta.setContentLength(os.size()); - if (JPG_TYPE.equals(imageType)) { - meta.setContentType(JPG_MIME); - } - if (PNG_TYPE.equals(imageType)) { - meta.setContentType(PNG_MIME); - } - - // Uploading to S3 destination bucket - System.out.println("Writing to: " + dstBucket + "/" + dstKey); - try { - s3Client.putObject(dstBucket, dstKey, is, meta); - } - catch(AmazonServiceException e) - { - System.err.println(e.getErrorMessage()); - System.exit(1); - } - System.out.println("Successfully resized " + srcBucket + "/" - + srcKey + " and uploaded to " + dstBucket + "/" + dstKey); - return "Ok"; - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} -``` - -Amazon S3 invokes your Lambda function using the `Event` invocation type, where AWS Lambda runs the code asynchronously\. What you return does not matter\. However, in this case we are implementing an interface that requires us to specify a return type, so in this example the handler uses `String` as the return type\. - -### Create the deployment package - -A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: - -**Dependencies** -+ `aws-lambda-java-core` -+ `aws-lambda-java-events` -+ `aws-java-sdk` - -**To create a deployment package** -+ Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. - -**To create and test the function** -+ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. - -## Python 3 - -The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. - -### Create the function code - -Copy the sample code into a file named `lambda_function.py`\. - -**Example lambda\_function\.py** - -``` -import boto3 -import os -import sys -import uuid -from urllib.parse import unquote_plus -from PIL import Image -import PIL.Image - -s3_client = boto3.client('s3') - -def resize_image(image_path, resized_path): - with Image.open(image_path) as image: - image.thumbnail(tuple(x / 2 for x in image.size)) - image.save(resized_path) - -def lambda_handler(event, context): - for record in event['Records']: - bucket = record['s3']['bucket']['name'] - key = unquote_plus(record['s3']['object']['key']) - tmpkey = key.replace('/', '') - download_path = '/tmp/{}{}'.format(uuid.uuid4(), tmpkey) - upload_path = '/tmp/resized-{}'.format(tmpkey) - s3_client.download_file(bucket, key, download_path) - resize_image(download_path, upload_path) - s3_client.upload_file(upload_path, '{}-resized'.format(bucket), key) -``` - -### Create the deployment package - -A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: - -**Dependencies** -+ [Pillow](https://pypi.org/project/Pillow/) - -**To create a deployment package** -+ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow \(PIL\)](https://pypi.org/project/Pillow/) library\. - -**To create and test the function** -+ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index f6e46ff1..89663759 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -1,403 +1,251 @@ -# Tutorial: Using AWS Lambda with Amazon S3 +# Tutorial: Using an Amazon S3 trigger to invoke a Lambda function -Suppose you want to create a thumbnail for each image file that is uploaded to a bucket\. You can create a Lambda function \(`CreateThumbnail`\) that Amazon S3 can invoke when objects are created\. Then, the Lambda function can read the image object from the source bucket and create a thumbnail image to save in the target bucket\. +In this tutorial, you use the console to create a Lambda function and configure a trigger for Amazon Simple Storage Service \(Amazon S3\)\. The trigger invokes your function every time that you add an object to your Amazon S3 bucket\. -Upon completing this tutorial, you will have the following Amazon S3, Lambda, and IAM resources in your account: +We recommend that you complete this console\-based tutorial before you try the [tutorial to create thumbnail images](with-s3-tutorial.md)\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/s3-admin-iser-walkthrough-10.png) +## Prerequisites -**Lambda resources** -+ A Lambda function\. -+ An access policy associated with your Lambda function that grants Amazon S3 permission to invoke the Lambda function\. +To use Lambda, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) -**IAM resources** -+ An execution role that grants permissions that your Lambda function needs through the permissions policy associated with this role\. - -**Amazon S3 resources** -+ A source bucket with a notification configuration that invokes the Lambda function\. -+ A target bucket where the function saves resized images\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -## Prerequisites +## Create a bucket and upload a sample object -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +Create an Amazon S3 bucket and upload a test file to your new bucket\. Your Lambda function retrieves information about this file when you test the function from the console\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: +**To create an Amazon S3 bucket using the console** -``` -this is a command -``` +1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. -You should see the following output: +1. Choose **Create bucket**\. -``` -this is output -``` +1. Under **General configuration**, do the following: -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. + 1. For **Bucket name**, enter a unique name\. -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\. + 1. For **AWS Region**, choose a Region\. Note that you must create your Lambda function in the same Region\. -Install npm to manage the function's dependencies\. +1. Choose **Create bucket**\. -The tutorial uses AWS CLI commands to create and invoke the Lambda function\. Install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) +After creating the bucket, Amazon S3 opens the **Buckets** page, which displays a list of all buckets in your account in the current Region\. -## Create buckets and upload a sample object +**To upload a test object using the Amazon S3 console** -Follow the steps to create buckets and upload an object\. +1. On the [Buckets page](https://console.aws.amazon.com/s3/home) of the Amazon S3 console, choose the name of the bucket that you created\. -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. +1. On the **Objects** tab, choose **Upload**\. -1. Create two buckets\. The target bucket name must be *source* followed by **\-resized**, where *source* is the name of the bucket you want to use for the source\. For example, `mybucket` and `mybucket-resized`\. +1. Drag a test file from your local machine to the **Upload **page\. -1. In the source bucket, upload a \.jpg object, `HappyFace.jpg`\. +1. Choose **Upload**\. - When you invoke the Lambda function manually before you connect to Amazon S3, you pass sample event data to the function that specifies the source bucket and `HappyFace.jpg` as the newly created object so you need to create this sample object first\. +## Create the Lambda function -## Create the IAM Policy +Use a [function blueprint](gettingstarted-features.md#gettingstarted-features-blueprints) to create the Lambda function\. A blueprint provides a sample function that demonstrates how to use Lambda with other AWS services\. Also, a blueprint includes sample code and function configuration presets for a certain runtime\. For this tutorial, you can choose the blueprint for the Node\.js or Python runtime\. -Create an IAM policy that defines the permissions for the Lambda function\. The required permissions include: -+ Get the object from the source S3 bucket\. -+ Put the resized object into the target S3 bucket\. -+ Permissions related to the CloudWatch Logs\. +**To create a Lambda function from a blueprint in the console** -**To create an IAM Policy** +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) in the IAM Console\. +1. Choose **Create function**\. -1. Choose **Create policy** +1. On the **Create function** page, choose **Use a blueprint**\. -1. Under the **JSON** tab, copy the following policy\. Make sure the source and target bucket names match the bucket names that you created previously\. +1. Under **Blueprints**, enter **s3** in the search box\. - ``` - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "logs:PutLogEvents", - "logs:CreateLogGroup", - "logs:CreateLogStream" - ], - "Resource": "arn:aws:logs:*:*:*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:GetObject" - ], - "Resource": "arn:aws:s3:::mybucket/*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:PutObject" - ], - "Resource": "arn:aws:s3:::mybucket-resized/*" - } - ] - } - ``` +1. In the search results, do one of the following: + + For a Node\.js function, choose **s3\-get\-object**\. + + For a Python function, choose **s3\-get\-object\-python**\. -1. Choose **Review policy**, specify the policy name as `AWSLambdaS3Policy`, and create the policy\. +1. Choose **Configure**\. -## Create the execution role +1. Under **Basic information**, do the following: -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. + 1. For **Function name**, enter **my\-s3\-function**\. -**To create an execution role** + 1. For **Execution role**, choose **Create a new role from AWS policy templates**\. -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. + 1. For **Role name**, enter **my\-s3\-function\-role**\. -1. Choose **Create role**\. +1. Under **S3 trigger**, choose the S3 bucket that you created previously\. -1. Create a role with the following properties\. - + **Trusted entity** – **AWS Lambda**\. - + **Permissions** – **AWSLambdaS3Policy**\. - + **Role name** – **lambda\-s3\-role**\. + When you configure an S3 trigger using the Lambda console, the console modifies your function's [resource\-based policy](access-control-resource-based.md) to allow Amazon S3 to invoke the function\. -The **AWSLambdaS3Policy** policy has the permissions that the function needs to manage objects in Amazon S3 and write logs to CloudWatch Logs\. +1. Choose **Create function**\. -## Create the function +## Review the function code -The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. +The Lambda function retrieves the source S3 bucket name and the key name of the uploaded object from the event parameter that it receives\. The function uses the Amazon S3 `getObject` API to retrieve the content type of the object\. -**Note** -For sample code in other languages, see [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md)\. +While viewing your function in the [Lambda console](https://console.aws.amazon.com/lambda), you can review the function code on the **Code** tab, under **Code source**\. The code looks like the following: -### Create the function code +------ +#### [ Node\.js ] **Example index\.js** ``` -// dependencies -const AWS = require('aws-sdk'); -const util = require('util'); -const sharp = require('sharp'); - -// get reference to S3 client -const s3 = new AWS.S3(); - -exports.handler = async (event, context, callback) => { - - // Read options from the event parameter. - console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); - const srcBucket = event.Records[0].s3.bucket.name; - // Object key may have spaces or unicode non-ASCII characters. - const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); - const dstBucket = srcBucket + "-resized"; - const dstKey = "resized-" + srcKey; - - // Infer the image type from the file suffix. - const typeMatch = srcKey.match(/\.([^.]*)$/); - if (!typeMatch) { - console.log("Could not determine the image type."); - return; - } +console.log('Loading function'); + +const aws = require('aws-sdk'); - // Check that the image type is supported - const imageType = typeMatch[1].toLowerCase(); - if (imageType != "jpg" && imageType != "png") { - console.log(`Unsupported image type: ${imageType}`); - return; - } +const s3 = new aws.S3({ apiVersion: '2006-03-01' }); - // Download the image from the S3 source bucket. +exports.handler = async (event, context) => { + //console.log('Received event:', JSON.stringify(event, null, 2)); + // Get the object from the event and show its content type + const bucket = event.Records[0].s3.bucket.name; + const key = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, ' ')); + const params = { + Bucket: bucket, + Key: key, + }; try { - const params = { - Bucket: srcBucket, - Key: srcKey - }; - var origimage = await s3.getObject(params).promise(); - - } catch (error) { - console.log(error); - return; - } - - // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. - const width = 200; - - // Use the Sharp module to resize the image and save in a buffer. - try { - var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - - } catch (error) { - console.log(error); - return; - } - - // Upload the thumbnail image to the destination bucket - try { - const destparams = { - Bucket: dstBucket, - Key: dstKey, - Body: buffer, - ContentType: "image" - }; - - const putResult = await s3.putObject(destparams).promise(); - - } catch (error) { - console.log(error); - return; - } - - console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); + const { ContentType } = await s3.getObject(params).promise(); + console.log('CONTENT TYPE:', ContentType); + return ContentType; + } catch (err) { + console.log(err); + const message = `Error getting object ${key} from bucket ${bucket}. Make sure they exist and your bucket is in the same region as this function.`; + console.log(message); + throw new Error(message); + } }; ``` -Review the preceding code and note the following: -+ The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg or a \.png, the code creates a thumbnail and saves it to the target bucket\. -+ The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. -+ For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. - -### Create the deployment package - -The deployment package is a \.zip file containing your Lambda function code and dependencies\. - -**To create a deployment package** - -1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. - -1. Save the function code as `index.js` in a folder named `lambda-s3`\. - -1. Install the Sharp library with npm\. For Linux, use the following command\. - - ``` - npm install sharp - ``` - - For macOS, use the following command\. - - ``` - npm install --arch=x64 --platform=linux --target=12.13.0 sharp - ``` - - After you complete this step, you will have the following folder structure: - - ``` - lambda-s3 - |- index.js - |- /node_modules/sharp - └ /node_modules/... - ``` - -1. Create a deployment package with the function code and dependencies\. Set the \-r \(recursive\) option for the zip command to compress the subfolders\. - - ``` - zip -r function.zip . - ``` - -### Create the Lambda function - -**To create the function** -+ Create a Lambda function with the `create-function` command\. - - ``` - aws lambda create-function --function-name CreateThumbnail \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --timeout 10 --memory-size 1024 \ - --role arn:aws:iam::123456789012:role/lambda-s3-role - ``` -**Note** -If you are using AWS CLI version 2, add the following command parameters: - - ``` - --cli-binary-format raw-in-base64-out - ``` - - The Lambda function in the last step uses a Node\.js function handler of `index.handler`\. This name reflects the function name as `handler`, and the file where the handler code is stored in `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. It also specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. +------ +#### [ Python ] -For the role parameter, replace the number sequence with your AWS account ID\. The preceding example command specifies a 10\-second timeout value as the function configuration\. Depending on the size of objects you upload, you might need to increase the timeout value using the following AWS CLI command\. +**Example lambda\-function\.py** ``` -aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 -``` - -## Test the Lambda function - -In this step, you invoke the Lambda function manually using sample Amazon S3 event data\. +import json +import urllib.parse +import boto3 -**To test the Lambda function** +print('Loading function') -1. Save the following Amazon S3 sample event data in a file and save it as `inputFile.txt`\. You need to update the JSON by providing your *sourcebucket* name and a \.jpg object key\. +s3 = boto3.client('s3') - ``` - { - "Records":[ - { - "eventVersion":"2.0", - "eventSource":"aws:s3", - "awsRegion":"us-west-2", - "eventTime":"1970-01-01T00:00:00.000Z", - "eventName":"ObjectCreated:Put", - "userIdentity":{ - "principalId":"AIDAJDPLRKLG7UEXAMPLE" - }, - "requestParameters":{ - "sourceIPAddress":"127.0.0.1" - }, - "responseElements":{ - "x-amz-request-id":"C3D13FE58DE4C810", - "x-amz-id-2":"FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD" - }, - "s3":{ - "s3SchemaVersion":"1.0", - "configurationId":"testConfigRule", - "bucket":{ - "name":"sourcebucket", - "ownerIdentity":{ - "principalId":"A3NL1KOZZKExample" - }, - "arn":"arn:aws:s3:::sourcebucket" - }, - "object":{ - "key":"HappyFace.jpg", - "size":1024, - "eTag":"d41d8cd98f00b204e9800998ecf8427e", - "versionId":"096fKKXTRTtl3on89fVO.nfljtsv6qko" - } - } - } - ] - } - ``` -1. Run the following Lambda CLI `invoke` command to invoke the function\. Note that the command requests asynchronous execution\. You can optionally invoke it synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. +def lambda_handler(event, context): + #print("Received event: " + json.dumps(event, indent=2)) - ``` - aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ - --payload file://inputFile.txt outputfile.txt - ``` -**Note** -If you are using AWS CLI version 2, add the following command parameters: - - ``` - --cli-binary-format raw-in-base64-out - ``` - -1. Verify that the thumbnail was created in the target bucket\. - -## Configure Amazon S3 to publish events - -In this step, you add the remaining configuration so that Amazon S3 can publish object\-created events to AWS Lambda and invoke your Lambda function\. You do the following in this step: -+ Add permissions to the Lambda function access policy to allow Amazon S3 to invoke the function\. -+ Add notification configuration to your source bucket\. In the notification configuration, you provide the following: - + Event type for which you want Amazon S3 to publish events\. For this tutorial, you specify the `s3:ObjectCreated:*` event type so that Amazon S3 publishes events when objects are created\. - + Lambda function to invoke\. - -**To add permissions to the function policy** - -1. Run the following Lambda CLI `add-permission` command to grant Amazon S3 service principal \(`s3.amazonaws.com`\) permissions to perform the `lambda:InvokeFunction` action\. Note that permission is granted to Amazon S3 to invoke the function only if the following conditions are met: - + An object\-created event is detected on a specific bucket\. - + The bucket is owned by your account\. If you delete a bucket, it is possible for another account to create a bucket with the same ARN\. - - ``` - aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com \ - --statement-id s3invoke --action "lambda:InvokeFunction" \ - --source-arn arn:aws:s3:::sourcebucket \ - --source-account account-id - ``` + # Get the object from the event and show its content type + bucket = event['Records'][0]['s3']['bucket']['name'] + key = urllib.parse.unquote_plus(event['Records'][0]['s3']['object']['key'], encoding='utf-8') + try: + response = s3.get_object(Bucket=bucket, Key=key) + print("CONTENT TYPE: " + response['ContentType']) + return response['ContentType'] + except Exception as e: + print(e) + print('Error getting object {} from bucket {}. Make sure they exist and your bucket is in the same region as this function.'.format(key, bucket)) + raise e +``` -1. Verify the function's access policy by running the AWS CLI `get-policy` command\. +------ + +## Test in the console + +Invoke the Lambda function manually using sample Amazon S3 event data\. + +**To test the Lambda function using the console** + +1. On the **Code** tab, under **Code source**, choose the arrow next to **Test**, and then choose **Configure test events** from the dropdown list\. + +1. In the **Configure test event** window, do the following: + + 1. Choose **Create new test event**\. + + 1. For **Event template**, choose **Amazon S3 Put** \(**s3\-put**\)\. + + 1. For **Event name**, enter a name for the test event\. For example, **mys3testevent**\. + + 1. In the test event JSON, replace the S3 bucket name \(`example-bucket`\) and object key \(`test/key`\) with your bucket name and test file name\. Your test event should look similar to the following: + + ``` + { + { + "Records": [ + { + "eventVersion": "2.0", + "eventSource": "aws:s3", + "awsRegion": "us-west-2", + "eventTime": "1970-01-01T00:00:00.000Z", + "eventName": "ObjectCreated:Put", + "userIdentity": { + "principalId": "EXAMPLE" + }, + "requestParameters": { + "sourceIPAddress": "127.0.0.1" + }, + "responseElements": { + "x-amz-request-id": "EXAMPLE123456789", + "x-amz-id-2": "EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH" + }, + "s3": { + "s3SchemaVersion": "1.0", + "configurationId": "testConfigRule", + "bucket": { + "name": "my-s3-bucket", + "ownerIdentity": { + "principalId": "EXAMPLE" + }, + "arn": "arn:aws:s3:::example-bucket" + }, + "object": { + "key": "HappyFace.jpg", + "size": 1024, + "eTag": "0123456789abcdef0123456789abcdef", + "sequencer": "0A1B2C3D4E5F678901" + } + } + } + ] + } + ``` + + 1. Choose **Create**\. + +1. To invoke the function with your test event, under **Code source**, choose **Test**\. + + The **Execution results** tab displays the response, function logs, and request ID, similar to the following: ``` - aws lambda get-policy --function-name CreateThumbnail + Response + "image/jpeg" + + Function Logs + START RequestId: 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 Version: $LATEST + 2021-02-18T21:40:59.280Z 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 INFO INPUT BUCKET AND KEY: { Bucket: 'my-s3-bucket', Key: 'HappyFace.jpg' } + 2021-02-18T21:41:00.215Z 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 INFO CONTENT TYPE: image/jpeg + END RequestId: 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 + REPORT RequestId: 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 Duration: 976.25 ms Billed Duration: 977 ms Memory Size: 128 MB Max Memory Used: 90 MB Init Duration: 430.47 ms + + Request ID + 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 ``` -Add notification configuration on the source bucket to request Amazon S3 to publish object\-created events to Lambda\. - -**Important** -This procedure configures the bucket to invoke your function every time an object is created in it\. Ensure that you configure this option only on the source bucket and do not create objects in the source bucket from the function that is triggered\. Otherwise, your function could cause itself to be [invoked continuously in a loop](with-s3.md#services-s3-runaway)\. - -**To configure notifications** - -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. Choose the source bucket\. +## Test with the S3 trigger -1. Choose **Properties**\. +Invoke your function when you upload a file to the Amazon S3 source bucket\. -1. Under **Events**, configure a notification with the following settings\. - + **Name** – **lambda\-trigger**\. - + **Events** – **All object create events**\. - + **Send to** – **Lambda function**\. - + **Lambda** – **CreateThumbnail**\. +**To test the Lambda function using the S3 trigger** -For more information on event configuration, see [Enabling event notifications](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/enable-event-notifications.html) in the *Amazon Simple Storage Service Console User Guide*\. +1. On the [Buckets page](https://console.aws.amazon.com/s3/home) of the Amazon S3 console, choose the name of the source bucket that you created earlier\. -## Test the setup +1. On the **Upload** page, upload a few \.jpg or \.png image files to the bucket\. -Now you can test the setup as follows: +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Upload \.jpg or \.png objects to the source bucket using the Amazon S3 console\. +1. Choose the name of your function \(**my\-s3\-function**\)\. -1. Verify that the thumbnail was created in the target bucket using the `CreateThumbnail` function\. +1. Choose the **Monitor** tab, then verify that the function ran once for each file that you uploaded\. -1. View logs in the CloudWatch console\. +1. \(Optional\) To view the logs in the CloudWatch console, choose **View logs in CloudWatch**\. Choose a log stream to view the logs output for one of the function invocations\. ## Clean up your resources @@ -413,13 +261,13 @@ You can now delete the resources that you created for this tutorial, unless you 1. Choose **Delete**\. -**To delete the policy that you created** +**To delete the IAM policy** -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the AWS Identity and Access Management \(IAM\) console\. -1. Select the policy that you created\. +1. Select the policy that Lambda created for you\. The policy name begins with **AWSLambdaS3ExecutionRole\-**\. -1. From **Policy actions**, choose **Delete**\. +1. Choose **Policy actions**, **Delete**\. 1. Choose **Delete**\. @@ -433,14 +281,18 @@ You can now delete the resources that you created for this tutorial, unless you 1. Choose **Yes, delete**\. -**To delete the S3 buckets** +**To delete the S3 bucket** 1. Open the [Amazon S3 console\.](https://console.aws.amazon.com/s3/home#) -1. Select the source bucket you created\. +1. Select the bucket you created\. 1. Choose **Delete**\. -1. Enter the name of the source bucket in the text box\. +1. Enter the name of the bucket in the text box\. + +1. Choose **Confirm**\. + +## Next steps -1. Choose **Confirm**\. \ No newline at end of file +Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. \ No newline at end of file diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md new file mode 100644 index 00000000..c1ca9ecc --- /dev/null +++ b/doc_source/with-s3-tutorial.md @@ -0,0 +1,712 @@ +# Tutorial: Using an Amazon S3 trigger to create thumbnail images + +In this tutorial, you create a Lambda function and configure a trigger for Amazon Simple Storage Service \(Amazon S3\)\. Amazon S3 invokes the `CreateThumbnail` function for each image file that is uploaded to an S3 bucket\. The function reads the image object from the source S3 bucket and creates a thumbnail image to save in a target S3 bucket\. + +**Note** +This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We recommend that you first try [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md)\. + + In this tutorial, you use the AWS Command Line Interface \(AWS CLI\) to create the following AWS resources: + +**Lambda resources** ++ A Lambda function\. You can choose Node\.js, Python, or Java for the function code\. ++ A \.zip file archive deployment package for the function\. ++ An access policy that grants Amazon S3 permission to invoke the function\. + +**AWS Identity and Access Management \(IAM\) resources** ++ An execution role with an associated permissions policy to grant permissions that your function needs\. + +**Amazon S3 resources** ++ A source S3 bucket with a notification configuration that invokes the function\. ++ A target S3 bucket where the function saves the resized images\. + +**Topics** ++ [Prerequisites](#with-s3-tutorial-prepare) ++ [Step 1\. Create S3 buckets and upload a sample object](#with-s3-tutorial-prepare-create-buckets) ++ [Step 2\. Create the IAM policy](#with-s3-tutorial-create-policy) ++ [Step 3\. Create the execution role](#with-s3-tutorial-create-execution-role) ++ [Step 4\. Create the function code](#with-s3-tutorial-create-function-code) ++ [Step 5\. Create the deployment package](#with-s3-tutorial-create-function-package) ++ [Step 6\. Create the Lambda function](#with-s3-tutorial-create-function-createfunction) ++ [Step 7\. Test the Lambda function](#s3-tutorial-events-adminuser-create-test-function-upload-zip-test-manual-invoke) ++ [Step 8\. Configure Amazon S3 to publish events](#with-s3-tutorial-configure-event-source) ++ [Step 9\. Test using the S3 trigger](#with-s3-tutorial-configure-event-source-test-end-to-end) ++ [Step 10\. Clean up your resources](#s3-tutorial-cleanup) + +## Prerequisites ++ AWS account + + To use Lambda, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) ++ Command line + + To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + + ``` + this is a command + ``` + + You should see the following output: + + ``` + 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\. ++ AWS CLI + + In this tutorial, you use AWS CLI commands to create and invoke the Lambda function\. [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)\. ++ Language tools + + Install the language support tools and a package manager for the language that you want to use: Node\.js, Python, or Java\. For suggested tools, see [Code authoring tools](gettingstarted-tools.md#lambda-app-author)\. + +## Step 1\. Create S3 buckets and upload a sample object + +Follow these steps to create S3 buckets and upload an object\. + +1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. + +1. [Create two S3 buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)\. The target bucket must be named ***source*\-resized**, where *source* is the name of the source bucket\. For example, a source bucket named `mybucket` and a target bucket named `mybucket-resized`\. + +1. In the source bucket, [upload](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html) a \.jpg object, for example, `HappyFace.jpg`\. + + You must create this sample object before you test your Lambda function\. When you test the function manually using the Lambda invoke command, you pass sample event data to the function that specifies the source bucket name and `HappyFace.jpg` as the newly created object\. + +## Step 2\. Create the IAM policy + +Create an IAM policy that defines the permissions for the Lambda function\. The function must have permissions to: ++ Get the object from the source S3 bucket\. ++ Put the resized object into the target S3 bucket\. ++ Write logs to Amazon CloudWatch Logs\. + +**To create an IAM policy** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) in the IAM console\. + +1. Choose **Create policy**\. + +1. Choose the **JSON** tab, and then paste the following policy\. Be sure to replace *mybucket* with the name of the source bucket that you created previously\. + + ``` + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:PutLogEvents", + "logs:CreateLogGroup", + "logs:CreateLogStream" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:GetObject" + ], + "Resource": "arn:aws:s3:::mybucket/*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject" + ], + "Resource": "arn:aws:s3:::mybucket-resized/*" + } + ] + } + ``` + +1. Choose **Next: Tags**\. + +1. Choose **Next: Review**\. + +1. Under **Review policy**, for **Name**, enter **AWSLambdaS3Policy**\. + +1. Choose **Create policy**\. + +## Step 3\. Create the execution role + +Create the [execution role](lambda-intro-execution-role.md) that gives your Lambda function permission to access AWS resources\. + +**To create an execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. + +1. Choose **Create role**\. + +1. Create a role with the following properties: + + **Trusted entity** – **Lambda** + + **Permissions policy** – **AWSLambdaS3Policy** + + **Role name** – **lambda\-s3\-role** + +## Step 4\. Create the function code + +In the following code examples, the Amazon S3 event contains the source S3 bucket name and the object key name\. If the object is a \.jpg or a \.png image file, it reads the image from the source bucket, generates a thumbnail image, and then saves the thumbnail to the target S3 bucket\. + +Note the following: ++ The code assumes that the target bucket exists and that its name is a concatenation of the source bucket name and `-resized`\. ++ For each thumbnail file created, the Lambda function code derives the object key name as a concatenation of `resized-` and the source object key name\. For example, if the source object key name is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. + +------ +#### [ Node\.js ] + +Copy the following code example into a file named `index.js`\. + +**Example index\.js** + +``` +// dependencies +const AWS = require('aws-sdk'); +const util = require('util'); +const sharp = require('sharp'); + +// get reference to S3 client +const s3 = new AWS.S3(); + +exports.handler = async (event, context, callback) => { + + // Read options from the event parameter. + console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); + const srcBucket = event.Records[0].s3.bucket.name; + // Object key may have spaces or unicode non-ASCII characters. + const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); + const dstBucket = srcBucket + "-resized"; + const dstKey = "resized-" + srcKey; + + // Infer the image type from the file suffix. + const typeMatch = srcKey.match(/\.([^.]*)$/); + if (!typeMatch) { + console.log("Could not determine the image type."); + return; + } + + // Check that the image type is supported + const imageType = typeMatch[1].toLowerCase(); + if (imageType != "jpg" && imageType != "png") { + console.log(`Unsupported image type: ${imageType}`); + return; + } + + // Download the image from the S3 source bucket. + + try { + const params = { + Bucket: srcBucket, + Key: srcKey + }; + var origimage = await s3.getObject(params).promise(); + + } catch (error) { + console.log(error); + return; + } + + // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. + const width = 200; + + // Use the sharp module to resize the image and save in a buffer. + try { + var buffer = await sharp(origimage.Body).resize(width).toBuffer(); + + } catch (error) { + console.log(error); + return; + } + + // Upload the thumbnail image to the destination bucket + try { + const destparams = { + Bucket: dstBucket, + Key: dstKey, + Body: buffer, + ContentType: "image" + }; + + const putResult = await s3.putObject(destparams).promise(); + + } catch (error) { + console.log(error); + return; + } + + console.log('Successfully resized ' + srcBucket + '/' + srcKey + + ' and uploaded to ' + dstBucket + '/' + dstKey); +}; +``` + +------ +#### [ Python ] + +Copy the following code example into a file named `lambda_function.py`\. + +**Example lambda\_function\.py** + +``` +import boto3 +import os +import sys +import uuid +from urllib.parse import unquote_plus +from PIL import Image +import PIL.Image + +s3_client = boto3.client('s3') + +def resize_image(image_path, resized_path): + with Image.open(image_path) as image: + image.thumbnail(tuple(x / 2 for x in image.size)) + image.save(resized_path) + +def lambda_handler(event, context): + for record in event['Records']: + bucket = record['s3']['bucket']['name'] + key = unquote_plus(record['s3']['object']['key']) + tmpkey = key.replace('/', '') + download_path = '/tmp/{}{}'.format(uuid.uuid4(), tmpkey) + upload_path = '/tmp/resized-{}'.format(tmpkey) + s3_client.download_file(bucket, key, download_path) + resize_image(download_path, upload_path) + s3_client.upload_file(upload_path, '{}-resized'.format(bucket), key) +``` + +------ +#### [ Java ] + +The Java code implements the `RequestHandler` interface provided in the `aws-lambda-java-core` library\. When you create a Lambda function, you specify the class as the handler \(in this code example, `example.handler`\)\. For more information about using interfaces to provide a handler, see [Handler interfaces](java-handler.md#java-handler-interfaces)\. + +The handler uses `S3Event` as the input type, which provides convenient methods for your function code to read information from the incoming Amazon S3 event\. Amazon S3 invokes your Lambda function asynchronously\. Because you are implementing an interface that requires you to specify a return type, the handler uses `String` as the return type\. + +Copy the following code example into a file named `Handler.java`\. + +**Example Handler\.java** + +``` +package example; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.imageio.ImageIO; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.events.S3Event; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord; +import com.amazonaws.services.s3.model.GetObjectRequest; +import com.amazonaws.services.s3.model.ObjectMetadata; +import com.amazonaws.services.s3.model.S3Object; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; + +public class Handler implements + RequestHandler { + private static final float MAX_WIDTH = 100; + private static final float MAX_HEIGHT = 100; + private final String JPG_TYPE = (String) "jpg"; + private final String JPG_MIME = (String) "image/jpeg"; + private final String PNG_TYPE = (String) "png"; + private final String PNG_MIME = (String) "image/png"; + + public String handleRequest(S3Event s3event, Context context) { + try { + S3EventNotificationRecord record = s3event.getRecords().get(0); + + String srcBucket = record.getS3().getBucket().getName(); + + // Object key may have spaces or unicode non-ASCII characters. + String srcKey = record.getS3().getObject().getUrlDecodedKey(); + + String dstBucket = srcBucket + "-resized"; + String dstKey = "resized-" + srcKey; + + // Sanity check: validate that source and destination are different + // buckets. + if (srcBucket.equals(dstBucket)) { + System.out + .println("Destination bucket must not match source bucket."); + return ""; + } + + // Infer the image type. + Matcher matcher = Pattern.compile(".*\\.([^\\.]*)").matcher(srcKey); + if (!matcher.matches()) { + System.out.println("Unable to infer image type for key " + + srcKey); + return ""; + } + String imageType = matcher.group(1); + if (!(JPG_TYPE.equals(imageType)) && !(PNG_TYPE.equals(imageType))) { + System.out.println("Skipping non-image " + srcKey); + return ""; + } + + // Download the image from S3 into a stream + AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); + S3Object s3Object = s3Client.getObject(new GetObjectRequest( + srcBucket, srcKey)); + InputStream objectData = s3Object.getObjectContent(); + + // Read the source image + BufferedImage srcImage = ImageIO.read(objectData); + int srcHeight = srcImage.getHeight(); + int srcWidth = srcImage.getWidth(); + // Infer the scaling factor to avoid stretching the image + // unnaturally + float scalingFactor = Math.min(MAX_WIDTH / srcWidth, MAX_HEIGHT + / srcHeight); + int width = (int) (scalingFactor * srcWidth); + int height = (int) (scalingFactor * srcHeight); + + BufferedImage resizedImage = new BufferedImage(width, height, + BufferedImage.TYPE_INT_RGB); + Graphics2D g = resizedImage.createGraphics(); + // Fill with white before applying semi-transparent (alpha) images + g.setPaint(Color.white); + g.fillRect(0, 0, width, height); + // Simple bilinear resize + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BILINEAR); + g.drawImage(srcImage, 0, 0, width, height, null); + g.dispose(); + + // Re-encode image to target format + ByteArrayOutputStream os = new ByteArrayOutputStream(); + ImageIO.write(resizedImage, imageType, os); + InputStream is = new ByteArrayInputStream(os.toByteArray()); + // Set Content-Length and Content-Type + ObjectMetadata meta = new ObjectMetadata(); + meta.setContentLength(os.size()); + if (JPG_TYPE.equals(imageType)) { + meta.setContentType(JPG_MIME); + } + if (PNG_TYPE.equals(imageType)) { + meta.setContentType(PNG_MIME); + } + + // Uploading to S3 destination bucket + System.out.println("Writing to: " + dstBucket + "/" + dstKey); + try { + s3Client.putObject(dstBucket, dstKey, is, meta); + } + catch(AmazonServiceException e) + { + System.err.println(e.getErrorMessage()); + System.exit(1); + } + System.out.println("Successfully resized " + srcBucket + "/" + + srcKey + " and uploaded to " + dstBucket + "/" + dstKey); + return "Ok"; + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} +``` + +------ + +## Step 5\. Create the deployment package + +The deployment package is a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip) containing your Lambda function code and its dependencies\. + +------ +#### [ Node\.js ] + +The sample function must include the sharp module in the deployment package\. + +**To create a deployment package** + +1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. + +1. Save the function code as `index.js` in a directory named `lambda-s3`\. + +1. Install the sharp library with npm\. For Linux, use the following command: + + ``` + npm install sharp + ``` + + After this step, you have the following directory structure: + + ``` + lambda-s3 + |- index.js + |- /node_modules/sharp + └ /node_modules/... + ``` + +1. Create a deployment package with the function code and its dependencies\. Set the \-r \(recursive\) option for the zip command to compress the subfolders\. + + ``` + zip -r function.zip . + ``` + +------ +#### [ Python ] + +**Dependencies** ++ [Pillow](https://pypi.org/project/Pillow/) + +**To create a deployment package** ++ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow \(PIL\)](https://pypi.org/project/Pillow/) library\. + +------ +#### [ Java ] + +**Dependencies** ++ `aws-lambda-java-core` ++ `aws-lambda-java-events` ++ `aws-java-sdk` + +**To create a deployment package** ++ Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. + +------ + +## Step 6\. Create the Lambda function + +**To create the function** ++ Create a Lambda function with the create\-function command\. + +------ +#### [ Node\.js ] + + ``` + aws lambda create-function --function-name CreateThumbnail \ + --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ + --timeout 10 --memory-size 1024 \ + --role arn:aws:iam::123456789012:role/lambda-s3-role + ``` + +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` + + The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. + +------ +#### [ Python ] + + ``` + aws lambda create-function --function-name CreateThumbnail \ + --zip-file fileb://function.zip --handler lambda_function.lambda_handler --runtime python3.8 \ + --timeout 10 --memory-size 1024 \ + --role arn:aws:iam::123456789012:role/lambda-s3-role + ``` + +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` + + The create\-function command specifies the function handler as `lambda_function.lambda_handler`\. This handler name reflects the function name as `lambda_handler`, and the name of the file where the handler code is stored as `lambda_function.py`\. For more information, see [Lambda function handler in Python](python-handler.md)\. The command specifies a runtime of `python3.8`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. + +------ +#### [ Java ] + + ``` + aws lambda create-function --function-name CreateThumbnail \ + --zip-file fileb://function.zip --handler example.handler --runtime java11 \ + --timeout 10 --memory-size 1024 \ + --role arn:aws:iam::123456789012:role/lambda-s3-role + ``` + +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` + + The create\-function command specifies the function handler as `example.handler`\. The function can use the abbreviated handler format of `package.Class` because the function implements a handler interface\. For more information, see [AWS Lambda function handler in Java](java-handler.md)\. The command specifies a runtime of `java11`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. + +------ + +For the role parameter, replace *123456789012* with your [AWS account ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html)\. The preceding example command specifies a 10\-second timeout value as the function configuration\. Depending on the size of objects that you upload, you might need to increase the timeout value using the following AWS CLI command: + +``` +aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 +``` + +## Step 7\. Test the Lambda function + +Invoke the Lambda function manually using sample Amazon S3 event data\. + +**To test the Lambda function** + +1. Save the following Amazon S3 sample event data in a file named `inputFile.txt`\. Be sure to replace *sourcebucket* and *HappyFace\.jpg* with your source S3 bucket name and a \.jpg object key, respectively\. + + ``` + { + "Records":[ + { + "eventVersion":"2.0", + "eventSource":"aws:s3", + "awsRegion":"us-west-2", + "eventTime":"1970-01-01T00:00:00.000Z", + "eventName":"ObjectCreated:Put", + "userIdentity":{ + "principalId":"AIDAJDPLRKLG7UEXAMPLE" + }, + "requestParameters":{ + "sourceIPAddress":"127.0.0.1" + }, + "responseElements":{ + "x-amz-request-id":"C3D13FE58DE4C810", + "x-amz-id-2":"FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD" + }, + "s3":{ + "s3SchemaVersion":"1.0", + "configurationId":"testConfigRule", + "bucket":{ + "name":"sourcebucket", + "ownerIdentity":{ + "principalId":"A3NL1KOZZKExample" + }, + "arn":"arn:aws:s3:::sourcebucket" + }, + "object":{ + "key":"HappyFace.jpg", + "size":1024, + "eTag":"d41d8cd98f00b204e9800998ecf8427e", + "versionId":"096fKKXTRTtl3on89fVO.nfljtsv6qko" + } + } + } + ] + } + ``` + +1. Invoke the function with the following invoke command\. Note that the command requests asynchronous execution \(`--invocation-type Event`\)\. Optionally, you can invoke the function synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. + + ``` + aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ + --payload file://inputFile.txt outputfile.txt + ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` + +1. Verify that the thumbnail is created in the target S3 bucket\. + +## Step 8\. Configure Amazon S3 to publish events + +Complete the configuration so that Amazon S3 can publish object\-created events to Lambda and invoke your Lambda function\. In this step, you do the following: ++ Add permissions to the function access policy to allow Amazon S3 to invoke the function\. ++ Add a notification configuration to your source S3 bucket\. In the notification configuration, you provide the following: + + The event type for which you want Amazon S3 to publish events\. For this tutorial, specify the `s3:ObjectCreated:*` event type so that Amazon S3 publishes events when objects are created\. + + The function to invoke\. + +**To add permissions to the function policy** + +1. Run the following add\-permission command to grant Amazon S3 service principal \(`s3.amazonaws.com`\) permissions to perform the `lambda:InvokeFunction` action\. Note that Amazon S3 is granted permission to invoke the function only if the following conditions are met: + + An object\-created event is detected on a specific S3 bucket\. + + The S3 bucket is owned by your AWS account\. If you delete a bucket, it is possible for another AWS account to create a bucket with the same Amazon Resource Name \(ARN\)\. + + ``` + aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com \ + --statement-id s3invoke --action "lambda:InvokeFunction" \ + --source-arn arn:aws:s3:::sourcebucket \ + --source-account account-id + ``` + +1. Verify the function's access policy by running the get\-policy command\. + + ``` + aws lambda get-policy --function-name CreateThumbnail + ``` + +To have Amazon S3 publish object\-created events to Lambda, add a notification configuration on the source S3 bucket\. + +**Important** +This procedure configures the S3 bucket to invoke your function every time that an object is created in the bucket\. Be sure to configure this option only on the source bucket\. Do not have your function create objects in the source bucket, or your function could cause itself to be [invoked continuously in a loop](with-s3.md#services-s3-runaway)\. + +**To configure notifications** + +1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. + +1. Choose the name of the source S3 bucket\. + +1. Choose the **Properties** tab\. + +1. Under **Event notifications**, choose **Create event notification** to configure a notification with the following settings: + + **Event name** – **lambda\-trigger** + + **Event types** – **All object create events** + + **Destination** – **Lambda function** + + **Lambda function** – **CreateThumbnail** + +For more information on event configuration, see [Enabling and configuring event notifications using the Amazon S3 console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html) in the *Amazon Simple Storage Service Console User Guide*\. + +## Step 9\. Test using the S3 trigger + +Test the setup as follows: + +1. Upload \.jpg or \.png objects to the source S3 bucket using the [Amazon S3 console](https://console.aws.amazon.com/s3)\. + +1. Verify for each image object that a thumbnail is created in the target S3 bucket using the `CreateThumbnail` Lambda function\. + +1. View logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. + +## Step 10\. Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the policy that you created** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. + +1. Select the policy that you created \(**AWSLambdaS3Policy**\)\. + +1. Choose **Policy actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the S3 bucket** + +1. Open the [Amazon S3 console\.](https://console.aws.amazon.com/s3/home#) + +1. Select the bucket you created\. + +1. Choose **Delete**\. + +1. Enter the name of the bucket in the text box\. + +1. Choose **Confirm**\. \ No newline at end of file diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md index 544463a5..29b23cba 100644 --- a/doc_source/with-s3.md +++ b/doc_source/with-s3.md @@ -55,6 +55,6 @@ To invoke your function, Amazon S3 needs permission from the function's [resourc If your function uses the AWS SDK to manage Amazon S3 resources, it also needs Amazon S3 permissions in its [execution role](lambda-intro-execution-role.md)\. **Topics** -+ [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md) -+ [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md) ++ [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) ++ [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) \ No newline at end of file diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index cfb1164d..acdd5447 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -137,8 +137,6 @@ Build the executable with `go build` and create a deployment package\. For instr The following is example Python code that accepts an Amazon SQS record as input and processes it\. For illustration, the code writes to some of the incoming event data to CloudWatch Logs\. -Follow the instructions to create an AWS Lambda function deployment package\. - **Example ProcessSQSRecords\.py** ``` @@ -151,4 +149,4 @@ def lambda_handler(event, context): print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index be7557a0..d555bd08 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -113,6 +113,12 @@ If the handler returns normally without exceptions, Lambda considers the message aws lambda invoke --function-name ProcessSQSRecord \ --payload file://input.txt outputfile.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` 1. Verify the output in the `outputfile.txt` file\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index d2f55610..96f42fa1 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -79,6 +79,16 @@ For FIFO queues, records contain additional attributes that are related to dedup When Lambda reads a batch, the messages stay in the queue but become hidden for the length of the queue's [visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)\. If your function successfully processes the batch, Lambda deletes the messages from the queue\. If your function is [throttled](invocation-scaling.md), returns an error, or doesn't respond, the message becomes visible again\. All messages in a failed batch return to the queue, so your function code must be able to process the same message multiple times without side effects\. +**Topics** ++ [Scaling and processing](#events-sqs-scaling) ++ [Configuring a queue to use with Lambda](#events-sqs-queueconfig) ++ [Execution role permissions](#events-sqs-permissions) ++ [Configuring a queue as an event source](#events-sqs-eventsource) ++ [Event source mapping APIs](#services-dynamodb-api) ++ [Tutorial: Using AWS Lambda with Amazon Simple Queue Service](with-sqs-example.md) ++ [Sample Amazon SQS function code](with-sqs-create-package.md) ++ [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + ## Scaling and processing For standard queues, Lambda uses [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html) to poll a queue until it becomes active\. When messages are available, Lambda reads up to 5 batches and sends them to your function\. If messages are still available, Lambda increases the number of processes that are reading batches by up to 60 more instances per minute\. The maximum number of batches that can be processed simultaneously by an event source mapping is 1000\. From 2ab2173eb7d0d86ef25fc585c17f75a5d6e5c849 Mon Sep 17 00:00:00 2001 From: Darren Garvey Date: Wed, 7 Apr 2021 11:13:17 +0100 Subject: [PATCH 25/94] Update with-s3-example.md Fix example `Records` payload by removing extraneous `{`. --- doc_source/with-s3-example.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 89663759..0d38b65a 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -168,7 +168,6 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. ``` { - { "Records": [ { "eventVersion": "2.0", @@ -295,4 +294,4 @@ You can now delete the resources that you created for this tutorial, unless you ## Next steps -Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. \ No newline at end of file +Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. From 9467b96ae1770df238c0bc36a9a83f840ed498c1 Mon Sep 17 00:00:00 2001 From: "Stan Silas(Vivek Mangipudi)" Date: Wed, 7 Apr 2021 21:55:39 -0500 Subject: [PATCH 26/94] fix arn the arn is wrong. It should be the account number and now the keyword aws --- doc_source/access-control-identity-based.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 1e738dce..bfe47929 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -157,7 +157,7 @@ The permissions in the policy are organized into statements based on the [resour "iam:GetPolicy", "iam:GetPolicyVersion" ], - "Resource": "arn:aws:iam::aws:policy/*" + "Resource": "arn:aws:iam::accountNumber:policy/*" ``` + `ViewLogs` – Use CloudWatch Logs to view logs for functions that are prefixed with `intern-`\. @@ -243,4 +243,4 @@ For more information, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/Use You can use condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For example, you can enforce that all Lambda functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the functions are allowed to use, or are denied from using\. -For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. \ No newline at end of file +For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. From 9fb2bb8143d4f0f3891012ec3699ca4b75cca4a9 Mon Sep 17 00:00:00 2001 From: talianassi921 Date: Fri, 9 Apr 2021 14:32:17 -0700 Subject: [PATCH 27/94] updating getting started docs to include deploy --- doc_source/getting-started-create-function.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 13a9bc44..396df7cc 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. (Note that AWS Lambda natively supports Java, Go, PowerShell, Node.js, C#, Python, and Ruby code, and provides a Runtime API which allows you to use any additional programming languages to author your functions.) 1. Choose **Create function**\. @@ -42,9 +42,11 @@ Invoke your Lambda function using the sample event data provided in the console\ **To invoke a function** -1. After selecting your function, choose the **Test** tab\. +1. In the console, open the file with the lambda function. For this Node\.js app, it's called index\.js. -1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter an **Name** and note the following sample event template: +1. Click on the orange **Test** button to create a new test event. Each user can create up to 10 test events per function\. Those test events are not available to other users\. + +1. Enter an **Event name** and note the following sample event template: ``` { @@ -54,18 +56,17 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` -1. Choose **Create event**, and then choose **Invoke**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. Choose **Create**, and then choose **Test** again to run the function\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. 1. Upon successful completion, view the results in the console\. - + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. - + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. - + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. + + The **Execution results** tab shows the execution status as **succeeded**\. Here you will also see **Function Logs**\. -1. Run the function \(choose **Invoke**\) a few more times to gather some metrics that you can view in the next step\. +1. To make changes to your lambda function, edit the `index.js` file, and choose **Deploy**\. This will store those changes in S3. Then, choose **Test** again to run the function. + -1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. From e93b276e8ebe6e28926076c0949fba3d805b3be9 Mon Sep 17 00:00:00 2001 From: talianassi921 Date: Fri, 9 Apr 2021 15:52:31 -0700 Subject: [PATCH 28/94] update role creation for api-gateway tutorial --- doc_source/services-apigateway-tutorial.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 667e3e63..c15120cc 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -88,9 +88,12 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func 1. Choose **Create role**\. 1. Create a role with the following properties\. - + **Trusted entity** – Lambda\. - + **Role name** – **lambda\-apigateway\-role**\. - + **Permissions** – Custom policy with permission to DynamoDB and CloudWatch Logs\. + + **Trusted entity** – AWS Service\. + + **Use Case** – **Lambda**\. + +1. Choose Next: Permissions + + Choose **Create policy**\. This will open a new tab\. + + Choose the **JSON** tab and paste this custom policy with permission to DynamoDB and CloudWatch Logs\. ``` { From 4fa612461e55d5f21b47c8241579a331fa217f16 Mon Sep 17 00:00:00 2001 From: talianassi921 Date: Fri, 9 Apr 2021 16:01:15 -0700 Subject: [PATCH 29/94] adding missing steps --- doc_source/services-apigateway-tutorial.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index c15120cc..96a96ad4 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -126,6 +126,15 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func } ``` +1. Choose **Next: Tags**\. + + Tags are key-value pairs that you can add to AWS resources to help identify, organize, or search for resources. Note that this is optional. + +1. Choose **Next: Review**\. + + Enter a **Name** for your policy\. + + Verify that you see write access for CloudWatch Logs and both read and write access for DynamoDB\. + +1. Choose **Create Policy**\. + The custom policy has the permissions that the function needs to write data to DynamoDB and upload logs\. Note the Amazon Resource Name \(ARN\) of the role for later use\. ## Create the function From 771f9a952600abc817eeb45cabccb48879b05641 Mon Sep 17 00:00:00 2001 From: Rohan Deshpande Date: Sun, 11 Apr 2021 01:07:33 -0700 Subject: [PATCH 30/94] Fix typo --- doc_source/nodejs-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index aaf33bdc..aefc9a08 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -73,7 +73,7 @@ As an alternative, you can create the deployment package using an Amazon EC2 ins 1. Open a command line terminal or shell\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. -1. Create a folder for the deployment package\. The following steps assume that the folder is named `my-function>`\. +1. Create a folder for the deployment package\. The following steps assume that the folder is named `my-function`\. 1. Install libraries in the node\_modules directory using the `npm install` command\. @@ -126,4 +126,4 @@ As an alternative, you can create the deployment package using an Amazon EC2 ins } ``` -In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. \ No newline at end of file +In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. From 27558c569ee196f9567b087e8b30a7f2e4d2153b Mon Sep 17 00:00:00 2001 From: Bulat Usmanov Date: Tue, 20 Apr 2021 12:58:40 +0300 Subject: [PATCH 31/94] Remove excess cd command --- doc_source/python-package-update.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index 0ea280f5..79d06776 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -167,8 +167,7 @@ If you are creating a deployment package used in a layer, see [Include library d ``` ~/my-function$ cd myvenv/lib/python3.8/site-packages - ~/my-function/myvenv/lib/python3.8/site-packages$ cd myvenv/lib/python3.8/site-packages - zip -r ../../../../my-deployment-package.zip . + ~/my-function/myvenv/lib/python3.8/site-packages$ zip -r ../../../../my-deployment-package.zip . ``` The last command saves the deployment package to the root of the `my-function` directory\. @@ -213,4 +212,4 @@ A library may appear in `site-packages` or `dist-packages` and the first folder } ``` -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. \ No newline at end of file +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. From ba29cdd1ee7e98a7f0f091ece2c818e19d66249d Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 22 Apr 2021 10:45:32 -0700 Subject: [PATCH 32/94] Documentation updates --- doc_source/access-control-identity-based.md | 20 +-- doc_source/configuration-images.md | 5 +- doc_source/configuration-layers.md | 167 +++++++++++------- doc_source/csharp-image.md | 6 + doc_source/deploying-lambda-apps.md | 4 +- doc_source/getting-started-create-function.md | 33 ++-- doc_source/getting-started.md | 1 - doc_source/gettingstarted-concepts.md | 88 ++++----- doc_source/gettingstarted-features.md | 4 +- doc_source/go-image.md | 10 +- doc_source/index.md | 2 +- doc_source/java-image.md | 7 + doc_source/lambda-intro-execution-role.md | 14 ++ ...ngstarted-tools.md => lambda-settingup.md} | 47 ++--- doc_source/monitoring-insights.md | 13 +- doc_source/nodejs-image.md | 6 + doc_source/nodejs-package.md | 2 +- doc_source/python-package-create.md | 6 + doc_source/python-package-update.md | 6 +- doc_source/ruby-image.md | 6 + doc_source/runtime-support-policy.md | 4 +- doc_source/runtimes-logs-api.md | 2 +- doc_source/services-apigateway-tutorial.md | 105 ++++++----- .../services-cloudwatchevents-expressions.md | 4 +- doc_source/services-cloudwatchlogs.md | 2 +- doc_source/with-s3-example.md | 4 +- doc_source/with-s3-tutorial.md | 4 +- 27 files changed, 326 insertions(+), 246 deletions(-) rename doc_source/{gettingstarted-tools.md => lambda-settingup.md} (57%) diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index bfe47929..829053aa 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -78,15 +78,6 @@ The following shows an example of a permissions policy with limited scope\. It a ], "Resource": "arn:aws:iam::*:role/intern-lambda-execution-role" }, - { - "Sid": "ViewExecutionRolePolicies", - "Effect": "Allow", - "Action": [ - "iam:GetPolicy", - "iam:GetPolicyVersion" - ], - "Resource": "arn:aws:iam::aws:policy/*" - }, { "Sid": "ViewLogs", "Effect": "Allow", @@ -150,15 +141,6 @@ The permissions in the policy are organized into statements based on the [resour ], "Resource": "arn:aws:iam::*:role/intern-lambda-execution-role" ``` -+ `ViewExecutionRolePolicies` – View the AWS managed policies that are attached to the execution role\. This lets you view the function's permissions in the console, but doesn't include permission to view policies that were created by other users in the account\. - - ``` - "Action": [ - "iam:GetPolicy", - "iam:GetPolicyVersion" - ], - "Resource": "arn:aws:iam::accountNumber:policy/*" - ``` + `ViewLogs` – Use CloudWatch Logs to view logs for functions that are prefixed with `intern-`\. ``` @@ -243,4 +225,4 @@ For more information, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/Use You can use condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For example, you can enforce that all Lambda functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the functions are allowed to use, or are denied from using\. -For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. +For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 5a38bfd5..afcfaddc 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -35,7 +35,7 @@ When you deploy code as a container image to a Lambda function, the image underg ## Update the user permissions -Make sure that the permissions for the AWS Identity and Access Management \(IAM\) user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. +Make sure that the permissions for the AWS Identity and Access Management \(IAM\) user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy`, `SetRepositoryPolicy`, and `InitiateLayerUpload`\. For example, use the IAM console to create a role with the following policy: @@ -48,7 +48,8 @@ For example, use the IAM console to create a role with the following policy: "Effect": "Allow", "Action": [ "ecr:SetRepositoryPolicy", - "ecr:GetRepositoryPolicy" + "ecr:GetRepositoryPolicy", + "ecr:InitiateLayerUpload" ], "Resource": "arn:aws:ecr:::repository//" } diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 63b7254a..ac89a471 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -1,80 +1,30 @@ # Lambda layers -You can configure your Lambda function to pull in additional code and content in the form of layers\. A *layer* is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. +You use layers with functions that use \.zip file archives for deployment\. For a function defined as a container image, you package your preferred runtime and all code dependencies when you [create the container image](runtimes-custom.md)\. For more information, see [ Working with Lambda layers and extensions in container images]( https://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. -**Note** -Functions defined as container images do not support layers\. When you build a container image, you can package your preferred runtimes and dependencies as a part of the image\. +You can use Lambda layers to share code in your functions\. A *layer* contains code libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. Layers help to reduce your \.zip archive deployment package size, because layers are not included in the deployment package\. -Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB \(and each code file under `512 KB`\)\. - -**Note** A function can use up to five layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. -You can create layers, or use layers that AWS or an AWS customer has published\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html), or all accounts\. - -Layers are extracted to the `/opt` directory in the function execution environment\. Each runtime looks for libraries in a different location under `/opt`, depending on the language\. [Structure your layer](#configuration-layers-path) so that function code can access libraries without additional configuration\. +You can create your own layers, or use layers that AWS or an AWS customer has published\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html), or all accounts\. You can also use the AWS Serverless Application Model \(AWS SAM\) to manage layers and your function's layer configuration\. For instructions, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. **Topics** -+ [Configure a function to use layers](#configuration-layers-using) + [Create layers](#configuration-layers-create) + [Manage layers](#configuration-layers-manage) + [Include library dependencies in a layer](#configuration-layers-path) + [Layer permissions](#configuration-layers-permissions) ++ [Configure a function to use layers](#configuration-layers-using) ++ [Add an updated layer version to your function](#configuration-layers-script) + [AWS CloudFormation and AWS SAM](#configuration-layers-cloudformation) + [Sample applications](#configuration-layers-samples) -## Configure a function to use layers - -You can specify up to five layers in your Lambda function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, update your function's configuration\. - -To add layers to your function, use the `update-function-configuration` command\. The following example adds two layers: one from the same account as the function, and one from a different account\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ -arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 -``` - -You should see the following output: - -``` -{ - "FunctionName": "test-layers", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", - "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", - "Layers": [ - { - "Arn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3", - "CodeSize": 169 - }, - { - "Arn": "arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2", - "CodeSize": 169 - } - ], - "RevisionId": "81cc64f5-5772-449a-b63e-12330476bcc4", - ... -} -``` - -You must specify the version of each layer to use by providing the full Amazon Resource Name \(ARN\) of the layer version\. When you add layers to a function that already has layers, the new list overwrites the previous list\. Include all layers every time that you update the layer configuration\. To remove all layers, specify an empty list\. - -``` -aws lambda update-function-configuration --function-name my-function --layers [] -``` - -While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. - -The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. - ## Create layers -You can create new layers in the Lambda console or using the Lambda API\. +When you create a new layer, Lambda creates the layer as version 1\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. -**To create a layer in the console** +**To create a layer \(console\)** 1. Open the [Layers page](https://console.aws.amazon.com/lambda/home#/layers) of the Lambda console\. @@ -94,13 +44,14 @@ You can create new layers in the Lambda console or using the Lambda API\. 1. Choose **Create**\. -**To create a layer using the API** +**To create a layer \(API\)** To create a layer, use the `publish-layer-version` command with a name, description, \.zip file archive, and a list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional, but it makes the layer easier to discover\. ``` -aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ ---content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip --compatible-runtimes python3.6 python3.7 +aws lambda publish-layer-version --layer-name my-layer --description "My layer" \ +--license-info "MIT" --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip \ + --compatible-runtimes python3.6 python3.7 python3.8 ``` You should see the following output: @@ -126,7 +77,7 @@ You should see the following output: } ``` -Each time that you call `publish-layer-version`, you create a new version\. Functions that use the layer refer directly to a layer version\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. +Each time that you call `publish-layer-version`, you create a new version of the layer\. ## Manage layers @@ -200,15 +151,15 @@ When you delete a layer version, you can no longer configure functions to use it ## Include library dependencies in a layer -You can move runtime dependencies out of your Lambda function by placing them in a layer\. Each Lambda runtime includes the paths to specific folders in the `/opt` directory\. Define the same folder structure in your layer \.zip archive to ensure that your function code has access to the libraries in that layer\. +Each Lambda runtime adds specific `/opt` directory folders to the PATH variable\. If the layer uses the same folder structure, your function code can access the layer content without the need to specify the path\. -To include libraries in a layer, place them in one of the folders that your runtime supports, or modify that path variable for your language\. The following table lists the folder paths that each runtime supports\. +The following table lists the folder paths that each runtime supports\. **Layer paths for each Lambda runtime** [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) -The following examples show how you can structure the folders for your layer\. +The following examples show how you can structure the folders in your layer \.zip archive\. ------ #### [ Node\.js ] @@ -275,7 +226,9 @@ For more information about path settings in the Lambda execution environment, se ## Layer permissions -Layer usage permissions are managed on the resource\. To configure a Lambda function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md) or from the function's [resource\-based policy](access-control-resource-based.md)\. To use a layer in another account, you need permission on your user policy, and the owner of the other account must grant your account permission with a resource\-based policy\. +To configure a Lambda function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md)\. + +To use a layer in another account, the owner of the other account must grant your account permission in a [resource\-based policy](access-control-resource-based.md)\. To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. @@ -294,6 +247,88 @@ Permissions apply only to a single version of a layer\. Repeat the process each For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. +## Configure a function to use layers + +You can specify up to five layers in your Lambda function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, you can update your function's configuration\. + +To add layers to your function, use the `update-function-configuration` command\. The following example adds two layers: one from the same account as the function, and one from a different account\. + +``` +aws lambda update-function-configuration --function-name my-function \ +--layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ +arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 +``` + +You should see the following output: + +``` +{ + "FunctionName": "test-layers", + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", + "Layers": [ + { + "Arn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3", + "CodeSize": 169 + }, + { + "Arn": "arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2", + "CodeSize": 169 + } + ], + "RevisionId": "81cc64f5-5772-449a-b63e-12330476bcc4", + ... +} +``` + +You must specify the version of each layer to use by providing the full Amazon Resource Name \(ARN\) of the layer version\. When you add layers to a function that already has layers, the new list overwrites the previous list\. Include all layers every time that you update the layer configuration\. To remove all layers, specify an empty list\. + +``` +aws lambda update-function-configuration --function-name my-function --layers [] +``` + +While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. + +The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. + +## Add an updated layer version to your function + + Use the `update-function-configuration` command to add an updated layer version to your function\. + +The `layers` parameter for this command is a list of all of the layer versions to add to the function\. If the function already has layers, the new list overwrites the previous list\. If you want to update only one of the layer versions, the `layers` parameter needs to include the ARNs of the existing layer versions\. + +The following procedure assumes that you have packaged the updated layer code into a local file named `layer.zip`\. + +**Add an updated layer version to your function** + +1. \(Optional\) If the new layer version is not published yet, publish the new version\. + + ``` + aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ + --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 + ``` + +1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. + + ``` + aws lambda get-function-config --function-name my-function --query 'Layers[*].Arn' --output yaml + ``` + + \(Optional\) You can also get the latest version of a layer based on the layer name\. + + ``` + aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn' + ``` + +1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`\. + + ``` + aws lambda update-function-configuration --function-name my-function \ + --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ + arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 + ``` + ## AWS CloudFormation and AWS SAM To automate the creation and mapping of layers in your application, use AWS SAM in your AWS CloudFormation templates\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. @@ -331,7 +366,7 @@ Resources: - nodejs12.x ``` -When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. If you deploy changes to your code without modifying your dependencies, AWS SAM skips the layer update, saving upload time\. +When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. ## Sample applications diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 664397c5..66353c8d 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -23,6 +23,12 @@ Docker Hub repository: amazon/aws\-lambda\-dotnet Amazon ECR repository: gallery\.ecr\.aws/lambda/dotnet +## Using a \.NET base image + +For instructions on how to use a \.NET base image, choose the **usage** tab on [AWS Lambda base images for \.NET](https://gallery.ecr.aws/lambda/dotnet) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for \.NET](https://hub.docker.com/r/amazon/aws-lambda-dotnet) in the *Docker Hub repository*\. + ## \.NET runtime interface clients Download the \.NET runtime interface client from the [AWS Lambda for \.NET Core](https://github.com/aws/aws-lambda-dotnet) repository on GitHub\. \ No newline at end of file diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index eba01d7e..19cd514e 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -4,9 +4,9 @@ An AWS Lambda application is a combination of Lambda functions, event sources, a The [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/) provides a collection of Lambda applications that you can deploy in your account with a few clicks\. The repository includes both ready\-to\-use applications and samples that you can use as a starting point for your own projects\. You can also submit your own projects for inclusion\. -[AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html) enables you to create a template that defines your application's resources and lets you manage the application as a *stack*\. You can more safely add or modify resources in your application stack\. If any part of an update fails, AWS CloudFormation automatically rolls back to the previous configuration\. With AWS CloudFormation parameters, you can create multiple environments for your application from the same template\. [AWS SAM](gettingstarted-tools.md#gettingstarted-tools-awssam) extends AWS CloudFormation with a simplified syntax focused on Lambda application development\. +[AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html) enables you to create a template that defines your application's resources and lets you manage the application as a *stack*\. You can more safely add or modify resources in your application stack\. If any part of an update fails, AWS CloudFormation automatically rolls back to the previous configuration\. With AWS CloudFormation parameters, you can create multiple environments for your application from the same template\. [AWS SAM](lambda-settingup.md#lambda-settingup-awssam) extends AWS CloudFormation with a simplified syntax focused on Lambda application development\. -The [AWS CLI](gettingstarted-tools.md#gettingstarted-tools-awscli) and [SAM CLI](gettingstarted-tools.md#gettingstarted-tools-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates and testing locally\. +The [AWS CLI](lambda-settingup.md#lambda-settingup-awscli) and [SAM CLI](lambda-settingup.md#lambda-settingup-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates and testing locally\. When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [What are connections?](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 396df7cc..6373c1ff 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. (Note that AWS Lambda natively supports Java, Go, PowerShell, Node.js, C#, Python, and Ruby code, and provides a Runtime API which allows you to use any additional programming languages to author your functions.) + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell,C\#\) Go, Java, Node\.js, Python, and Ruby\. 1. Choose **Create function**\. @@ -32,9 +32,9 @@ Lambda creates a Node\.js function and an [execution role](lambda-intro-executio ### Use the function overview -The **Function overview** shows a visualization of your function and its upstream and downstream resources\. You can use it to jump to trigger, destination, and layer configuration\. +The **Function overview** shows a visualization of your function, including any triggers, destinations, and layer that you have configured for the function\. -![\[A Lambda function with an Amazon S3 trigger and an Amazon EventBridge destination.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) +![\[A Lambda function with no triggers, destinations or layers.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) ### Invoke the Lambda function @@ -42,11 +42,9 @@ Invoke your Lambda function using the sample event data provided in the console\ **To invoke a function** -1. In the console, open the file with the lambda function. For this Node\.js app, it's called index\.js. - -1. Click on the orange **Test** button to create a new test event. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. After selecting your function, choose the **Test** tab\. -1. Enter an **Event name** and note the following sample event template: +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: ``` { @@ -56,15 +54,16 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` -1. Choose **Create**, and then choose **Test** again to run the function\. +1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. 1. Upon successful completion, view the results in the console\. - + The **Execution results** tab shows the execution status as **succeeded**\. Here you will also see **Function Logs**\. + + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. -1. To make changes to your lambda function, edit the `index.js` file, and choose **Deploy**\. This will store those changes in S3. Then, choose **Test** again to run the function. - +1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. 1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) @@ -232,7 +231,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. ### Update the user permissions -Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about access policies, see [ Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the *IAM User Guide* +Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy`, `SetRepositoryPolicy`, and `InitiateLayerUpload`\. For information about access policies, see [ Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the *IAM User Guide* For example, use the IAM console to create a role with the following policy: @@ -243,7 +242,7 @@ For example, use the IAM console to create a role with the following policy: { "Sid": "VisualEditor0", "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload], "Resource": "arn:aws:ecr:::repository//" } ] @@ -280,7 +279,7 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. After selecting your function, choose the **Test** tab\. -1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter an **Name** and note the following sample event template: +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: ``` { @@ -290,7 +289,7 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` -1. Choose **Create event**, and then choose **Invoke**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. @@ -299,9 +298,9 @@ Invoke your Lambda function using the sample event data provided in the console\ + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. -1. Run the function \(choose **Invoke**\) a few more times to gather some metrics that you can view in the next step\. +1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. -1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md index 5348ee05..7e77bf67 100644 --- a/doc_source/getting-started.md +++ b/doc_source/getting-started.md @@ -19,5 +19,4 @@ You deploy your function code to Lambda using a deployment package\. Lambda supp + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + [Lambda deployment packages](gettingstarted-package.md) -+ [Tools for working with Lambda](gettingstarted-tools.md) + [Lambda quotas](gettingstarted-limits.md) \ No newline at end of file diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index b9e05f9f..c5ac3406 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -4,15 +4,15 @@ With Lambda, you run functions to process events\. To send events to your functi **Topics** + [Function](#gettingstarted-concepts-function) -+ [Qualifier](#gettingstarted-concepts-qualifier) ++ [Trigger](#gettingstarted-concepts-trigger) ++ [Event](#gettingstarted-concepts-event) + [Execution environment](#gettingstarted-concepts-ee) + [Deployment package](#gettingstarted-concepts-dp) -+ [Layer](#gettingstarted-concepts-layer) + [Runtime](#gettingstarted-concepts-runtime) ++ [Layer](#gettingstarted-concepts-layer) + [Extension](#gettingstarted-concepts-extensions) -+ [Event](#gettingstarted-concepts-event) + [Concurrency](#gettingstarted-concepts-concurrency) -+ [Trigger](#gettingstarted-concepts-trigger) ++ [Qualifier](#gettingstarted-concepts-qualifier) ## Function @@ -20,45 +20,9 @@ A *function* is a resource that you can invoke to run your code in Lambda\. A fu For more information, see [Managing AWS Lambda functions](lambda-functions.md)\. -## Qualifier - -When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that you can update to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. - -For more information, see [Lambda function versions](configuration-versions.md)\. - -## Execution environment - -An *execution environment* provides a secure and isolated runtime environment for your Lambda function\. An execution environment manages the processes and resources that are required to run the function\. The execution environment provides lifecycle support for the function and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. - -For more information, see [AWS Lambda execution environment](runtimes-context.md)\. - -## Deployment package - -You deploy your Lambda function code using a *deployment package*\. Lambda supports two types of deployment packages: -+ A \.zip file archive that contains your function code and its dependencies\. Lambda provides the operating system and runtime for your function\. -+ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. You add your function code and dependencies to the image\. You must also include the operating system and a Lambda runtime\. - -For more information, see [Lambda deployment packages](gettingstarted-package.md)\. - -## Layer - -A Lambda layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. You can use a layer to distribute a dependency to multiple functions\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. - -For more information, see [Lambda layers](configuration-layers.md)\. - -## Runtime - -The *runtime* provides a language\-specific environment that runs in an execution environment\. The runtime relays invocation events, context information, and responses between Lambda and the function\. You can use runtimes that Lambda provides, or build your own\. If you package your code as a \.zip file archive, you must configure your function to use a runtime that matches your programming language\. For a container image, you include the runtime when you build the image\. - -For more information, see [Lambda runtimes](lambda-runtimes.md)\. - -## Extension - -Lambda *extensions* enable you to augment your functions\. For example, you can use extensions to integrate your functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. - -An internal extension runs in the runtime process and shares the same lifecycle as the runtime\. An external extension runs as a separate process in the execution environment\. The external extension is initialized before the function is invoked, runs in parallel with the function's runtime, and continues to run after the function invocation is complete\. +## Trigger -For more information, see [Using Lambda extensions](using-extensions.md)\. +A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that you can configure to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. ## Event @@ -93,12 +57,48 @@ When an AWS service invokes your function, the service defines the shape of the For more information about events from AWS services, see [Using AWS Lambda with other services](lambda-services.md)\. +## Execution environment + +An *execution environment* provides a secure and isolated runtime environment for your Lambda function\. An execution environment manages the processes and resources that are required to run the function\. The execution environment provides lifecycle support for the function and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. + +For more information, see [AWS Lambda execution environment](runtimes-context.md)\. + +## Deployment package + +You deploy your Lambda function code using a *deployment package*\. Lambda supports two types of deployment packages: ++ A \.zip file archive that contains your function code and its dependencies\. Lambda provides the operating system and runtime for your function\. ++ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. You add your function code and dependencies to the image\. You must also include the operating system and a Lambda runtime\. + +For more information, see [Lambda deployment packages](gettingstarted-package.md)\. + +## Runtime + +The *runtime* provides a language\-specific environment that runs in an execution environment\. The runtime relays invocation events, context information, and responses between Lambda and the function\. You can use runtimes that Lambda provides, or build your own\. If you package your code as a \.zip file archive, you must configure your function to use a runtime that matches your programming language\. For a container image, you include the runtime when you build the image\. + +For more information, see [Lambda runtimes](lambda-runtimes.md)\. + +## Layer + +A Lambda layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. You can use a layer to distribute a dependency to multiple functions\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. + +For more information, see [Lambda layers](configuration-layers.md)\. + +## Extension + +Lambda *extensions* enable you to augment your functions\. For example, you can use extensions to integrate your functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. + +An internal extension runs in the runtime process and shares the same lifecycle as the runtime\. An external extension runs as a separate process in the execution environment\. The external extension is initialized before the function is invoked, runs in parallel with the function's runtime, and continues to run after the function invocation is complete\. + +For more information, see [Using Lambda extensions](using-extensions.md)\. + ## Concurrency *Concurrency* is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda provisions an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function's concurrency\. Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region level\. You can configure individual functions to limit their concurrency, or to enable them to reach a specific level of concurrency\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. -## Trigger +## Qualifier + +When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that you can update to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. -A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that you can configure to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +For more information, see [Lambda function versions](configuration-versions.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 2c676ff4..a40b35da 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -95,13 +95,13 @@ For more information, see [Configuring destinations for asynchronous invocation] When you create a function in the Lambda console, you can choose to start from scratch, use a blueprint, use a [container image](gettingstarted-package.md#gettingstarted-package-images), or deploy an application from the [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html)\. A blueprint provides sample code that shows how to use Lambda with an AWS service or a popular third\-party application\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. -Blueprints are provided for use under the [Creative Commons Zero](https://spdx.org/licenses/CC0-1.0.html) license\. They are available only in the Lambda console\. +Blueprints are provided for use under the [Amazon Software License](https://aws.amazon.com/asl/)\. They are available only in the Lambda console\. ## Testing and deployment tools Lambda supports deploying code as is or as [container images](gettingstarted-package.md#gettingstarted-package-images)\. You can use a rich tools ecosystem for authoring, building, and deploying your Lambda functions using AWS and popular community tools like the Docker command line interface \(CLI\)\. -For more information, see [Tools for working with Lambda](gettingstarted-tools.md)\. +To set up the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. For an introduction to using Docker with AWS, see [Getting started with Amazon ECR using the AWS CLI](https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html) in the *Amazon Elastic Container Registry User Guide*\. ## Application templates diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 98a70933..b1b2d290 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -11,6 +11,7 @@ You can deploy your Lambda function code as a [container image](images-create.md **Topics** + [AWS base images for Go](#go-image-base) + [Go runtime interface clients](#go-image-clients) ++ [Using the Go:1\.x base image](#go-image-v1) + [Deploying Go with the `provided.al2` base image](#go-image-al2) + [Deploying Go with an alternative base image](#go-image-other) @@ -31,6 +32,12 @@ Amazon ECR repository: gallery\.ecr\.aws/lambda/go AWS does not provide a separate runtime interface client for Go\. The `aws-lambda-go/lambda` package includes an implementation of the runtime interface\. +## Using the Go:1\.x base image + +For instructions on how to use the base image for Go:1\.x, choose the **usage** tab on [AWS Lambda base images for Go](https://gallery.ecr.aws/lambda/go) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for Go](https://hub.docker.com/r/amazon/aws-lambda-go) in the *Docker Hub repository*\. + ## Deploying Go with the `provided.al2` base image To build a container image for Go that runs on Amazon Linux 2, use the `provided.al2` base image\. For more information about this base image, see [provided](https://gallery.ecr.aws/lambda/provided) in the Amazon ECR public gallery\. @@ -99,9 +106,10 @@ You can build a container image for Go from an alternative base image\. The foll FROM alpine as build # install build tools RUN apk add go git +RUN go env -w GOPROXY=direct # cache dependencies ADD go.mod go.sum ./ -RUN go mod download GOPROXY=direct +RUN go mod download # build ADD . . RUN go build -o /main diff --git a/doc_source/index.md b/doc_source/index.md index 6b01b909..42811c25 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -15,6 +15,7 @@ Amazon's trademarks and trade dress may not be used in ----- ## Contents + [What is AWS Lambda?](welcome.md) ++ [Setting up with Lambda](lambda-settingup.md) + [Getting started with Lambda](getting-started.md) + [Create a Lambda function with the console](getting-started-create-function.md) + [Creating functions using the AWS Lambda console editor](code-editor.md) @@ -22,7 +23,6 @@ Amazon's trademarks and trade dress may not be used in + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + [Lambda deployment packages](gettingstarted-package.md) - + [Tools for working with Lambda](gettingstarted-tools.md) + [Lambda quotas](gettingstarted-limits.md) + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 8ae09915..8e1c2457 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -10,6 +10,7 @@ You can deploy your Lambda function code as a [container image](images-create.md **Topics** + [AWS base images for Java](#java-image-base) ++ [Using a Java base image](#java-image-instructions) + [Java runtime interface clients](#java-image-clients) ## AWS base images for Java @@ -27,6 +28,12 @@ Docker Hub repository: amazon/aws\-lambda\-java Amazon ECR repository: gallery\.ecr\.aws/lambda/java +## Using a Java base image + +For instructions on how to use a Java base image, choose the **usage** tab on [AWS Lambda base images for Java](https://gallery.ecr.aws/lambda/java) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for Java](https://hub.docker.com/r/amazon/aws-lambda-java) in the *Docker Hub repository*\. + ## Java runtime interface clients Install the runtime interface client for Java using the Apache Maven package manager\. Add the following to your `pom.xml` file: diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 761f9e58..c738417e 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -19,6 +19,12 @@ You can add or remove permissions from a function's execution role at any time, When you add permissions to your function, make an update to its code or configuration as well\. This forces running instances of your function, which have out\-of\-date credentials, to stop and be replaced\. +**Topics** ++ [Creating an execution role in the IAM console](#permissions-executionrole-console) ++ [Grant least privilege access to your Lambda execution role](#permissions-executionrole-least-privilege) ++ [Managing roles with the IAM API](#permissions-executionrole-api) ++ [AWS managed policies for Lambda features](#permissions-executionrole-features) + ## Creating an execution role in the IAM console By default, Lambda creates an execution role with minimal permissions when you [create a function in the Lambda console](getting-started-create-function.md)\. You can also create an execution role in the IAM console\. @@ -45,6 +51,14 @@ By default, Lambda creates an execution role with minimal permissions when you [ For detailed instructions, see [Creating a role for an AWS service \(console\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html#roles-creatingrole-service-console) in the *IAM User Guide*\. +## Grant least privilege access to your Lambda execution role + +When you first create an IAM role for your Lambda function during the development phase, you might sometimes grant permissions beyond what is required\. Before publishing your function in the production environment, best practice is to adjust the policy to include only the required permissions\. For more information, see [granting least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege)\. + +Use IAM Access Analyzer to help identify the required permissions for the IAM execution role policy\. IAM Access Analyzer reviews your AWS CloudTrail logs over the date range that you specify and generates a policy template with only the permissions that the function used during that time\. You can use the template to create a managed policy with fine\-grained permissions, and then attach it to the IAM role\. That way, you grant only the permissions that the role needs to interact with AWS resources for your specific use case\. + +To learn more, see [Generate policies based on access activity](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_generate-policy.html) in the *IAM User Guide*\. + ## Managing roles with the IAM API To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the `create-role` command\. diff --git a/doc_source/gettingstarted-tools.md b/doc_source/lambda-settingup.md similarity index 57% rename from doc_source/gettingstarted-tools.md rename to doc_source/lambda-settingup.md index dcae16df..09907139 100644 --- a/doc_source/gettingstarted-tools.md +++ b/doc_source/lambda-settingup.md @@ -1,17 +1,24 @@ -# Tools for working with Lambda +# Setting up with Lambda -In addition to the Lambda console, you can use the following tools to manage and invoke Lambda resources\. +To use AWS Lambda, you need an AWS account\. If you plan to configure and use Lambda functions from the command line, set up the AWS CLI\. You can set up other development and build tools as required for the environment and language that you are planning to use\. **Topics** -+ [AWS CLI](#gettingstarted-tools-awscli) -+ [AWS SAM](#gettingstarted-tools-awssam) -+ [AWS SAM CLI](#gettingstarted-tools-samcli) -+ [Tools for container images](#gettingstarted-tools-docker) -+ [Code authoring tools](#lambda-app-author) ++ [AWS Account](#lambda-settingup-account) ++ [AWS CLI](#lambda-settingup-awscli) ++ [AWS SAM](#lambda-settingup-awssam) ++ [AWS SAM CLI](#lambda-settingup-samcli) ++ [Tools for container images](#lambda-settingup-docker) ++ [Code authoring tools](#lambda-settingup-author) -## AWS CLI +## AWS Account -To manage and use Lambda functions from the command line, install the AWS Command Line Interface \(AWS CLI\)\. Tutorials in this guide use the AWS CLI, which has commands for all Lambda API operations\. Some functionality is not available in the Lambda console and can be accessed only with the AWS CLI or the AWS SDKs\. +To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) + +As a best practice, create an AWS Identity and Access Management \(IAM\) user with administrator permissions, and then use that IAM user for all work that does not require root credentials\. Create a password for console access, and create access keys to use command line tools\. For instructions, see [Creating your first IAM admin user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html) in the *IAM User Guide*\. + +## AWS CLI + +If you plan to configure and use Lambda functions from the command line, install the AWS Command Line Interface \(AWS CLI\)\. Tutorials in this guide use the AWS CLI, which has commands for all Lambda API operations\. Some functionality is not available in the Lambda console and can be accessed only with the AWS CLI or the AWS SDKs\. To set up the AWS CLI, see the following topics in the *AWS Command Line Interface User Guide*\. + [Installing, updating, and uninstalling the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) @@ -23,25 +30,25 @@ To verify that the AWS CLI is configured correctly, run the `list-functions` com aws lambda list-functions ``` -## AWS SAM +## AWS SAM The AWS Serverless Application Model \(AWS SAM\) is an extension for the AWS CloudFormation template language that lets you define serverless applications at a higher level\. AWS SAM abstracts away common tasks such as function role creation, making it easier to write templates\. AWS SAM is supported directly by AWS CloudFormation, and includes additional functionality through the AWS CLI and AWS SAM CLI\. For more information about AWS SAM templates, see the [AWS SAM specification](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification.html) in the *AWS Serverless Application Model Developer Guide*\. -## AWS SAM CLI +## AWS SAM CLI The AWS SAM CLI is a separate command line tool that you can use to manage and test AWS SAM applications\. In addition to commands for uploading artifacts and launching AWS CloudFormation stacks that are also available in the AWS CLI, the AWS SAM CLI provides commands for validating templates and running applications locally in a Docker container\. You can use the AWS SAM CLI to build functions deployed as \.zip file archives or container images\. To set up the AWS SAM CLI, see [Installing the AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) in the *AWS Serverless Application Model Developer Guide*\. -## Tools for container images +## Tools for container images To create and test functions deployed as container images, you can use native container tools such as the Docker CLI\. To set up the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. For an introduction to using Docker with AWS, see [Getting started with Amazon ECR using the AWS CLI](https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html) in the *Amazon Elastic Container Registry User Guide*\. -## Code authoring tools +## Code authoring tools You can author your Lambda function code in the languages that Lambda supports\. For a list of supported languages, see [Lambda runtimes](lambda-runtimes.md)\. There are tools for authoring code, such as the Lambda console, Eclipse integrated development environment \(IDE\), and Visual Studio IDE\. But the available tools and options depend on: + The language that you use to write your Lambda function code\. @@ -54,10 +61,10 @@ The following table lists the languages that Lambda supports, and the tools and | Language | Tools and options for authoring code | | --- | --- | -| Node\.js | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| Java | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| C\# | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| Python | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| Ruby | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| Go | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| PowerShell | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | \ No newline at end of file +| Node\.js | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| Java | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| C\# | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| Python | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| Ruby | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| Go | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| PowerShell | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | \ No newline at end of file diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index 377dc64e..d8dead06 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -27,18 +27,7 @@ For each Lambda function enabled for Lambda Insights, you only pay for what you ## Supported runtimes -You can use Lambda Insights with any of the following [Lambda function runtimes](lambda-runtimes.md): -+ \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) -+ Custom runtime \(`provided`\) -+ Custom runtime on Amazon Linux 2 \(`provided.al2`\) -+ Java 11 \(Corretto\) \(`java11`\) -+ Java 8 \(Corretto\) \(`java8.al2`\) -+ Node\.js 12\.x \(`nodejs12.x`\) -+ Node\.js 10\.x \(`nodejs10.x`\) -+ Python 3\.8 \(`python3.8`\) -+ Python 3\.7 \(`python3.7`\) -+ Ruby 2\.7 \(`ruby2.7`\) -+ Ruby 2\.5 \(`ruby2.5`\) +You can use Lambda Insights with any of the runtimes that support [Lambda extensions](runtimes-extensions-api.md)\. ## Enabling Lambda Insights in the Lambda console diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 98044798..49d69fcc 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -23,6 +23,12 @@ Docker Hub repository: amazon/aws\-lambda\-nodejs Amazon ECR repository: gallery\.ecr\.aws/lambda/nodejs +## Using a Node\.js base image + +For instructions on how to use a Node\.js base image, choose the **usage** tab on [AWS Lambda base images for Node\.js](https://gallery.ecr.aws/lambda/nodejs) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for Node\.js](https://hub.docker.com/r/amazon/aws-lambda-nodejs) in the *Docker Hub repository*\. + ## Node\.js runtime interface clients Install the runtime interface client for Node\.js using the npm package manager: diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index aefc9a08..2bbfd1d6 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -126,4 +126,4 @@ As an alternative, you can create the deployment package using an Amazon EC2 ins } ``` -In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. +In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. \ No newline at end of file diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 04cb9e72..786bcf9f 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -399,6 +399,12 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i ``` ------ +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` This command produces the following output: diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index 79d06776..f6ba930e 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -166,8 +166,8 @@ If you are creating a deployment package used in a layer, see [Include library d 1. Create a deployment package with the installed libraries at the root\. ``` - ~/my-function$ cd myvenv/lib/python3.8/site-packages - ~/my-function/myvenv/lib/python3.8/site-packages$ zip -r ../../../../my-deployment-package.zip . + ~/my-function$cd myvenv/lib/python3.8/site-packages + zip -r ../../../../my-deployment-package.zip . ``` The last command saves the deployment package to the root of the `my-function` directory\. @@ -212,4 +212,4 @@ A library may appear in `site-packages` or `dist-packages` and the first folder } ``` -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. \ No newline at end of file diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index d5eb5be9..29d147cb 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -22,6 +22,12 @@ Docker Hub repository: amazon/aws\-lambda\-ruby Amazon ECR repository: gallery\.ecr\.aws/lambda/ruby +## Using a Ruby base image + +For instructions on how to use a Ruby base image, choose the **usage** tab on [AWS Lambda base images for Ruby](https://gallery.ecr.aws/lambda/ruby) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for Ruby](https://hub.docker.com/r/amazon/aws-lambda-ruby) in the *Docker Hub repository*\. + ## Ruby runtime interface clients Install the runtime interface client for Ruby using the RubyGems\.org package manager: diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index fb8835f3..d191b0b7 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -17,8 +17,8 @@ The following runtimes have reached or are scheduled for end of support: | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | | Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | -| Ruby 2\.5 | `ruby2.5` | Amazon Linux | May 31, 2021 | June 30, 2021 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | May 31, 2021 | June 30, 2021 | +| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Aug 30, 2021 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index 4b41d6af..c9712d97 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -52,7 +52,7 @@ We also recommend setting up the local HTTP listener or the TCP port before subs ## Buffering configuration Lambda can buffer logs and deliver them to the subscriber\. You can configure this behavior in the subscription request by specifying the following optional fields\. Lambda uses the default value for any field that you do not specify: -+ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1000\. Minimum: 100\. Maximum: 30000\. ++ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1000\. Minimum: 25\. Maximum: 30000\. + **maxBytes** – The maximum size \(in bytes\) of the logs to buffer in memory\. Default: 262144\. Minimum: 262144\. Maximum: 1048576\. + **maxItems** – The maximum number of events to buffer in memory\. Default: 10000\. Minimum: 1000\. Maximum: 10000\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 96a96ad4..a1febf9f 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -79,7 +79,56 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 ## Create the execution role -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. +Create the [execution role](lambda-intro-execution-role.md)\. This role uses a custom policy to give your function permission to access the required AWS resources\. You first create the policy and then create the execution role\. + +**To create a custom policy** + +1. Open the [policy page](https://console.aws.amazon.com/iam/home#/policies) in the IAM console\. + +1. Choose **Create Policy**\. + +1. Choose the **JSON** tab\. Paste the following custom policy into the input box\. + + ``` + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "Stmt1428341300017", + "Action": [ + "dynamodb:DeleteItem", + "dynamodb:GetItem", + "dynamodb:PutItem", + "dynamodb:Query", + "dynamodb:Scan", + "dynamodb:UpdateItem" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Sid": "", + "Resource": "*", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow" + } + ] + } + ``` + +1. Choose **Next: Tags**\. + +1. Choose **Next: Review**\. + +1. For the policy name, enter **lambda\-apigateway\-policy**\. + +1. Enter **Create policy**\. + +This policy includes permissions for the function to access DynamoDB and CloudWatch Logs\. **To create an execution role** @@ -87,55 +136,21 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func 1. Choose **Create role**\. -1. Create a role with the following properties\. - + **Trusted entity** – AWS Service\. - + **Use Case** – **Lambda**\. - -1. Choose Next: Permissions - + Choose **Create policy**\. This will open a new tab\. - + Choose the **JSON** tab and paste this custom policy with permission to DynamoDB and CloudWatch Logs\. - - ``` - { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "Stmt1428341300017", - "Action": [ - "dynamodb:DeleteItem", - "dynamodb:GetItem", - "dynamodb:PutItem", - "dynamodb:Query", - "dynamodb:Scan", - "dynamodb:UpdateItem" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Sid": "", - "Resource": "*", - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow" - } - ] - } - ``` +1. For the trusted entity, choose **AWS Service**, and for the use case choose **Lambda**\. -1. Choose **Next: Tags**\. - + Tags are key-value pairs that you can add to AWS resources to help identify, organize, or search for resources. Note that this is optional. +1. Choose **Next: Permissions**\. + +1. In the policy search box, enter **lambda\-apigateway\-policy**\. + +1. In the results, select `lambda-apigateway-policy` and choose **Next: Tags**\. 1. Choose **Next: Review**\. - + Enter a **Name** for your policy\. - + Verify that you see write access for CloudWatch Logs and both read and write access for DynamoDB\. -1. Choose **Create Policy**\. +1. For the role name, enter **lambda\-apigateway\-role**\. + +1. Enter **Create role**\. -The custom policy has the permissions that the function needs to write data to DynamoDB and upload logs\. Note the Amazon Resource Name \(ARN\) of the role for later use\. + Note the Amazon Resource Name \(ARN\) of the execution role for later use\. ## Create the function diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md index eb06bd91..ad0c3815 100644 --- a/doc_source/services-cloudwatchevents-expressions.md +++ b/doc_source/services-cloudwatchevents-expressions.md @@ -14,7 +14,7 @@ Where *Value* is a positive integer and *Unit* can be minute\(s\), hour\(s\), or | Frequency | Expression | | --- | --- | | Every 5 minutes | `rate(5 minutes)` | -| Every hour | `rate(1 hour)` | +| Every hour | `rate(1 hours)` | | Every seven days | `rate(7 days)` | Cron expressions have the following format\. @@ -39,4 +39,4 @@ Note the following: + If you are using the Lambda console, do not include the `cron` prefix in your expression\. + One of the day\-of\-month or day\-of\-week values must be a question mark \(`?`\)\. -For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schedule-expressions.html) in the *EventBridge User Guide*\. \ No newline at end of file +For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schedule-expressions.html) in the *EventBridge User Guide*\. \ No newline at end of file diff --git a/doc_source/services-cloudwatchlogs.md b/doc_source/services-cloudwatchlogs.md index 59ffb2fa..cf435ee5 100644 --- a/doc_source/services-cloudwatchlogs.md +++ b/doc_source/services-cloudwatchlogs.md @@ -2,7 +2,7 @@ You can use a Lambda function to monitor and analyze logs from an Amazon CloudWatch Logs log stream\. Create [subscriptions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions.html) for one or more log streams to invoke a function when logs are created or match an optional pattern\. Use the function to send a notification or persist the log to a database or storage\. -CloudWatch Logs invokes your function asynchronously with an event that contains log data\. The value of the data field is a Base64\-encoded \.zip file archive\. +CloudWatch Logs invokes your function asynchronously with an event that contains log data\. The value of the data field is a Base64\-encoded \.gzip file archive\. **Example CloudWatch Logs message event** diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 0d38b65a..0c547d52 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -6,7 +6,7 @@ We recommend that you complete this console\-based tutorial before you try the [ ## Prerequisites -To use Lambda, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) +To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. @@ -294,4 +294,4 @@ You can now delete the resources that you created for this tutorial, unless you ## Next steps -Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. +Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. \ No newline at end of file diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index c1ca9ecc..3e4468bc 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -35,7 +35,7 @@ This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We ## Prerequisites + AWS account - To use Lambda, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) + To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) + Command line To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: @@ -58,7 +58,7 @@ This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We In this tutorial, you use AWS CLI commands to create and invoke the Lambda function\. [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)\. + Language tools - Install the language support tools and a package manager for the language that you want to use: Node\.js, Python, or Java\. For suggested tools, see [Code authoring tools](gettingstarted-tools.md#lambda-app-author)\. + Install the language support tools and a package manager for the language that you want to use: Node\.js, Python, or Java\. For suggested tools, see [Code authoring tools](lambda-settingup.md#lambda-settingup-author)\. ## Step 1\. Create S3 buckets and upload a sample object From fdd1f74609c54f456f5ec6ce288893a1c5078675 Mon Sep 17 00:00:00 2001 From: yorickdowne <71337066+yorickdowne@users.noreply.github.com> Date: Fri, 23 Apr 2021 11:47:30 -0400 Subject: [PATCH 33/94] Update deprecated `Buffer()` ... to use `Buffer.from()` instead --- sample-apps/error-processor/processor/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/error-processor/processor/index.js b/sample-apps/error-processor/processor/index.js index 8894ab27..d6b5e412 100644 --- a/sample-apps/error-processor/processor/index.js +++ b/sample-apps/error-processor/processor/index.js @@ -83,7 +83,7 @@ var getTrace = function(context){ exports.handler = function(event, context) { console.log("Event: " + JSON.stringify(event, null, 2)) - var payload = new Buffer(event.awslogs.data, 'base64') + var payload = new Buffer.from(event.awslogs.data, 'base64') zlib.gunzip(payload, function(e, decodedEvent) { if (e) { context.fail(e) @@ -104,4 +104,4 @@ exports.handler = function(event, context) { //context.succeed() } }) -} \ No newline at end of file +} From 4def38a50837a8255b24453f9b9485adb4440e5b Mon Sep 17 00:00:00 2001 From: Andy Garfield Date: Tue, 27 Apr 2021 17:53:23 -0400 Subject: [PATCH 34/94] use ascii quotes and typo fix --- doc_source/images-test.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 9765af49..2e1ae3f0 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -78,7 +78,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric + exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-rie else exec /usr/bin/npx aws-lambda-ric fi @@ -90,7 +90,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie - ENTRYPOINT [ “/entry_script.sh” ] + ENTRYPOINT [ "/entry_script.sh" ] ``` 1. Build your image locally using the `docker build` command\. @@ -129,4 +129,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. \ No newline at end of file + This command invokes the function running in the container image and returns a response\. From 250be931160222eab0a7623809e64a8846e78169 Mon Sep 17 00:00:00 2001 From: Andy Garfield Date: Wed, 28 Apr 2021 07:53:42 -0400 Subject: [PATCH 35/94] Update images-test.md It is `ric`, oops. --- doc_source/images-test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 2e1ae3f0..d44b3c83 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -78,7 +78,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-rie + exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric else exec /usr/bin/npx aws-lambda-ric fi From 0585ea78268050e03c85863c6e10508913586cb0 Mon Sep 17 00:00:00 2001 From: Murat Goksel Date: Thu, 29 Apr 2021 15:23:45 -0400 Subject: [PATCH 36/94] Correct function-name argument in invocation call On lines 391 and 398, the function-name argument was passed as `requests-function`, but the name of the created function is `my-sourcecode-function`. This might be confusing to new comers so I changed those arguments to `my-sourcecode-function` to be in line with the rest of the document. --- doc_source/python-package-create.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 786bcf9f..b2faa753 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -388,14 +388,14 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i #### [ macOS/Linux ] ``` - aws lambda invoke --function-name requests-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + aws lambda invoke --function-name my-sourcecode-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------ #### [ Windows ] ``` - aws lambda invoke --function-name requests-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + aws lambda invoke --function-name my-sourcecode-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------ @@ -449,4 +449,4 @@ You can now delete the resources that you created for this tutorial, unless you ``` aws iam delete-role --role-name lambda-ex - ``` \ No newline at end of file + ``` From a930cb32b75fbda45d903b22864bdd605a96bb95 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 30 Apr 2021 12:46:08 -0700 Subject: [PATCH 37/94] Documentation updates --- .DS_Store | Bin 8196 -> 0 bytes doc_source/.DS_Store | Bin 129028 -> 0 bytes doc_source/access-control-resource-based.md | 6 +- doc_source/applications-tutorial.md | 4 +- doc_source/best-practices.md | 2 +- doc_source/configuration-concurrency.md | 2 +- doc_source/configuration-database.md | 2 +- doc_source/configuration-layers.md | 335 +++++------------- doc_source/csharp-image.md | 2 +- doc_source/csharp-package-toolkit.md | 2 +- doc_source/csharp-tracing.md | 4 +- doc_source/getting-started-create-function.md | 4 +- doc_source/gettingstarted-awscli.md | 4 +- doc_source/gettingstarted-concepts.md | 12 +- doc_source/gettingstarted-package.md | 6 +- doc_source/go-image.md | 4 +- doc_source/golang-package.md | 19 +- doc_source/golang-tracing.md | 4 +- doc_source/images-test.md | 19 +- doc_source/index.md | 3 +- doc_source/invocation-layers.md | 195 ++++++++++ doc_source/java-image.md | 4 +- doc_source/java-package-eclipse.md | 2 +- doc_source/java-package.md | 4 +- doc_source/java-tracing.md | 6 +- doc_source/lambda-functions.md | 4 +- doc_source/lambda-nodejs.md | 4 +- doc_source/lambda-python.md | 2 +- doc_source/lambda-rolling-deployments.md | 2 +- doc_source/lambda-ruby.md | 4 +- doc_source/lambda-runtimes.md | 4 +- .../monitoring-functions-access-metrics.md | 2 +- doc_source/nodejs-package.md | 13 +- doc_source/nodejs-tracing.md | 6 +- doc_source/python-package-create.md | 6 +- doc_source/python-package-update.md | 4 +- doc_source/python-package.md | 13 +- doc_source/python-tracing.md | 12 +- doc_source/ruby-package.md | 13 +- doc_source/ruby-tracing.md | 12 +- doc_source/runtime-support-policy.md | 4 +- doc_source/runtimes-walkthrough.md | 4 +- doc_source/samples-blank.md | 14 +- doc_source/samples-errorprocessor.md | 2 +- doc_source/samples-listmanager.md | 2 +- doc_source/security-dataprotection.md | 2 +- doc_source/services-apigateway-tutorial.md | 4 +- .../services-cloudwatchevents-expressions.md | 2 +- doc_source/services-ec2-tutorial.md | 4 +- doc_source/services-ec2.md | 4 +- doc_source/services-elasticache-tutorial.md | 4 +- doc_source/services-rds-tutorial.md | 4 +- doc_source/services-s3-batch.md | 2 +- doc_source/services-xray.md | 4 +- doc_source/troubleshooting-deployment.md | 2 +- doc_source/troubleshooting-execution.md | 8 +- doc_source/troubleshooting-invocation.md | 2 +- doc_source/using-extensions.md | 2 +- doc_source/welcome.md | 98 +++-- doc_source/with-android-example.md | 4 +- doc_source/with-ddb-example.md | 4 +- doc_source/with-ddb.md | 6 +- doc_source/with-kinesis-example.md | 4 +- doc_source/with-kinesis.md | 8 +- doc_source/with-mq.md | 1 + doc_source/with-s3-tutorial.md | 4 +- doc_source/with-s3.md | 2 +- doc_source/with-sns-example.md | 4 +- doc_source/with-sqs-example.md | 4 +- doc_source/with-sqs.md | 4 +- 70 files changed, 548 insertions(+), 411 deletions(-) delete mode 100644 .DS_Store delete mode 100644 doc_source/.DS_Store create mode 100644 doc_source/invocation-layers.md diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 46177358ce517fc9065e0a719a965ecfd3892489..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMS!@+m82-OfU}g&Rl&#AExzflI3bq(1Ws%zrsX#z)OUrt>_s#$lr!)1=+*_d3 z)S%G^193@=+Y9;z(I*TsKDk0PCdS4s(U|z=lkv?Mm;cO}vK0E@3z#q`Ip;s;{QrNJ zZ@xL_{&R^49VM%UsE&v<&QgjhE^d>gUgld;Mcgx;CD@-RAfHN9qypKuSSK9`0to^M z0to^M0to{D2L$-emPwo9-dEbBOb|#AxF->i=R=CKl<8QGDH$CdTtp!N%S!H!64yBn zhFmSajPcY<;!#4{s~P!P?|eyPZukXAA& z69f_jZbd-G?gm*Lw-+dTWBi^U4ufB7!cx$YD;|)oJ-P6BKCburzI&~n%kOpU;jEb7>3d<$@$6#c>{vFN9PD>I%OCFW zOP&=(<7AXV*L6+Lin@`Jme$s$)Y=VgqfM!iw$_%WRO{Nd(NSHiy}xBk&ym5Cr$$bX zKKZKJAL28DsweIDwW&611qCQ-ZUPP6s4{yVF?MFf+%j)+ z_fY8gUa;3L1}w9pI$&UW3ck0eXiI&6!FNl8UXT?vg`8U`xw+78cioJ0$_@rX`$Q;f z`vboic1DI-AxeS$n9X)h+3sTNV8G$wq?v$zVb+4hOP8%`Ubk^;*ZAx?)xt35&F?Qe zfs=RbeYv1udzRxJ>l=2g@c4el)eD`Yj$PFC8eH!6a)b7`SXf(E-(Z@`=DN?sC5-<iX0IFdSkjd=88u3w1zL8 z?R1boVhzz5dY;bGIeMMmri=6*eL$bl6}n1a&{y;W{Y<~o@AN1AMSs&j(69gtQHOdg z#Tq<-X0+iUY(+adumgMWC^G29ArxTYD2`zWCvXxYIE`m;7U%FHUcwu=fQxts@8U8( z#7FoTpWsV;jd8WUiV1G-iq{(p{K%E5s2jh?6^Cy}-G=UM#`e2I-S1~fzShj0H-EvB z#ucmAwr*~}_FN}D$r~vZ@kkLRBG3duqDOfXE5{>Z8;cfCF!?&S71#TifA$GYl1R){ z)(!V9)tEOzi<`@qbMum@h?+*jswSN&ET+XnH@9d^Rxw>^jdkmFrn9JwwHr6Fc88cT zUSC_caEr0k5G3C^JsxWrA8-GiiRbA8y-%Og=gh!w=qLJxexpACRG|j75&ITl36^68 zR$>)aV?A220UNOy-PneQ(ZgKqMIZKJ0Q(~@+RQ}@W==kZGk6-$;yJt!aq?xn ziSu}C5(9fCG4SG43@m4gp6h$ZSUT5o*9iLTL(&}B+C}#j6Io^q2kYr^*%oHcIERQ;n{=Y5I?tzEqtF%{JxD>__eOE6_@83ExQBP%D>m@T1H5v8cfF1G-R%7PYVip^+s6p^ zP4QK62kCrPd|!NCe2ULFK1Ko~fsw#Sz$O9KeR!NY?eF8yk-$h`BrqpH`>=wG_nWi( zOMiE!13%FGcYlAKcRuhM`T_2~GP~cL-Cz2|jg~4&ZIlI5~ zcOSi&_~^xC_Rf=84`t%s9r0FN@M3b)-^ZULfsw!>0rq`Y(5KwQzwP1(|Jc)Ik9Law z?$cry&v(%4+;*?*;MEs+Wdkve@Y>eA-+OP?@7+aDbGOu2{S}^Xps&1xS5LAxdjtL9 zJH>bSJnO}M{Qgm~hWl6O_1-~$`F8D7?BNq07Ekbro)*vX&8nZ-KVv_iK7bnt^$0(Q z;UxZn-pnID5B(KK_=d;$u2gr_P0!ykoMLtBObfa#AxEwicj1S*<;oouVtKoVQnH6@ zYN}Ml(+~|JW3-U|7UklB^Z1G1&Vv1F;z>O=lqy@TthAupbx}R@3;nSS*A8|u}3LN$|uf>kN3S$d0&pEv!}`)6n}p)e;*6&!dMo9m6!ll|m;DZ<<-pCgVO?fPt^SlmubwGEu}i9AUpk-J;`}QMb}WsED3K5g)R*Vf zZ@XH99vweFj@}%rRxF*0&`*pB1wsu^1$G_%ZKxuBCQJ4xmW9xc3J=DiHYqb6Ywq%> zS6@b=Nw0LERj5hIT8%Y#b&RqD7+IAz7gnwukkF+@a(1dgDd_TU`;4=Z)O z)HHRS;;o{5?m^SV=M0|1HhR8oV%e841Siq3cUsZ;D_HWo=pjEtKkNzGJXTwpab+i- zndmuay3jU^yOhgh)9A0IHftUk(J3P~)c8-;lCPo1_7o+GqauD>kz*ygowQosPKKPQ zc><|J?J#1)vd4BHM_t0`u~jW|xQJ58aiK%#ZQgM;*N!W1`38ORfhN-TV5>KcT7i5zqC{p2Q07{zGBP{Bu7&Qy zN7Ttq1NsD?SH0wfT6XkN4Z}(F>dhRw1)s@pQFBdE%DAdcR@bb%*JNI=t(i}GWJH^c z*ihr_+{%d>7DukTDG23`kRTdr98Z)jvn|(J<7_hPb8hqLhys}@K$%e6cx6I8(cBxe z)Xwe0N7Ttq1NsCnlh>zSuUpb0mW6PS3J=CVui5)LO9N}^WJlp-u*XeErj$?p0io|Y)sRU<{F z2qoXHS;%pILpl>tC5a{2*IVUH?7x7|`W8kt!d|Qv>|H(`(IYbjC{u5dHz^a=587JO z*N2a&lbr_iIajkJ*^DVJ)epT3;x@qsMp_z$ZgQg2@LvQyk#y;Lt4ZkpL6?;mEbB*e!@cynGq zmHR)IN?1Dq;oA}l6w9S9%$vW3`5Q0L7Tz>94=a|1kc|ot#%Ja^HMDUp<%&KM%1#6NgnIs-TLs0rK{6Yq zyrY!`k6|ne;T{zpjKk=bFzz1lwKWT?A0g4BM=DS$?7|=_g;9{^xhl4F>dQ!!>Xi;= zbX8YBFM37fefswQKPdHXxJGnZ)aP!5JW}qdm;GWPhsdWIFjeH+u*a_C+xlk=pTL3@ zPvIeoM8^T||LDvUM+HaRx^29rUfuB2M7x1ghQj9;6b@}yTV*MZgeVaa8g#=tVzF0& zZnY0?i**hcA)g!ERG?Crukbazw_hU9a|JKwf7)7sAHzY2cZOZyx(=e@gfvTe zyvj=FpmSBif@^3!eT}gO?j;*`A+Tku<46eGh|t(oP#=G+X1kO6 zq7QHM)P(g{L(&qp2I3DTLyNFk$#FfFKS48xkSNxJb3}RT_L*CN78 z%pvxI93vEOHg|k>6x*i8-JMlbZOM1m{5DhxRR;(Yn?qMg2XSg@D zx~-oo8f;ZxTB6ZFDMHCGdR+c&))h;qBFZGjM6bQg6C$aeRR5pz|HBNp@(d8adlF|y z#hg$ppR;#b_&j08k@w*Y`24L z=;k4OqvL>gu=C#{w{E#nl<{=9b{4`piX9k-`J3f*M?Y%WkJ^`!XwoYkXcgApl(h<8 zrE<%5JlFO6BA1fr)sr_A3%iPzKTCZ+iIg@=ZT>tmqD)3?sPX=M47f{;aewNeSczhT zq=z;@&iFt3|H0?lrhTxbO=|$8jLP>KG+lho;FtUkZJtf_WC9Cw|6@3a2AyHSHO#AB z(y!l=DV#?<-92Kj0?$6bE>dxnol4c>dr&AFP5@WiO(5%4J z&8pxDQ#;UU*VO3I<(8b;#6?s{j@zNbF+4Ndu6*!r%S+S7vWZKK4r*NJaK6}ZjHj?b z2Qxo0Pf+0KsV(wxB!qQDXwZGjS#|E4JTGuYR&ZFBf4a#5v333#&G?} zA#~#J*7j^|D=+?UO?=|@X<%IO%4wdk7T-&c{(pNp_urZ0?>re$%BpkxoUFNQ~L3z%H!Q3zQ9O7OI`2MkP*xg_xZR z@T7ar0X{U=T5MN9qY|gULQE)dsnrVk88@~pP#O^-pAZYw+uKx}^G>U?gS^jE?=98H zd1OR|jMz})z1A}D%#8}tm$r}I5a&^HPV3Z|E`1q^LcP*~Ru?0*vQ%DDc!&nkagg8h z#{b`jQs<%6QSsRI@ebx=jocObN0c7XNIp|U=$ZQEG?^Ah4Gxf^MQceVV|fVa=s1do zRFhVaeMVa&3ibS{lMu!cp+Wa-O})_PlhR?qJJn4=sCI-@^6M^Y>qq$KSD{#t34U@{Sj@~TwT2{fF-Zu7+Y|)RWAi=KpU~h*l*HyBG+?)@Eh2-$4 z@Xn%F)Acqab6695?efbt-Z5N+eR5praJA$8WQLFTRN1ocxokv_toRX{aMvc< zeZQ;ms0rudu=T-Ov58HrCTjc$dqw}jp6kcj(xc1fXk0{#QA=lZo?f<_F z1uoX|ciULKynA#UMPYqJ)}q2X31M6>KT2qYu0DQfk*-dniLMe_p{utlEz;FVG|^Q; zD|D67kb~)lMY=kPCb~*!&^=db>-jw-f(Kpvm=@T^a1gScVZrsS8dpCOWNSpfi-GWL z4F{H|z>@RS*yga5C$;Y_%ohFzPD_r{GxTA~JHv1km@C3KLTQO!JPlzQ83UwO8c1)u z9q#>n@~6%h&H1c*P=Mp`_U1hd!AaEVofdSv*q~eRci8gErSK3PqT_(~r3T(?W3WB4 zgS#!_X+(s1Labs7tzn5*?;Ym%|C>Gm$D_H^Rn@l1`zORgZn@BqTP)UIu`GmiRCq8x zTl^k+ajm}W7iZB&*-b&Xc7$}fHV|#|idpDIT`1+QHWorRDts;1DjqH){r_@a)F}wp zj*uYwW=W~g`mxkMXeS^fTSC?HrQ#bjm@jn-LbIGNm5?C1T*{YKe<0WF`nhkM(HwRe zvS3%!sR;4Jn6*4zRlt&UDCbn2f)MTqStH6B348Db_gl}XF#Tsz#p3J|q#JFCg%jD4ozGa!h-92HOoMcIoo2KPfA}ITUN(-#n+*%L94szTBzCjG7>#{r30-l zDq7XY)h*eW6ds~MbR6)m*Q(-Cx5T)MfpBdNr{rDkxw#LkB7Hf|Pq)Oio)6o22;=BD z;9ajL_Q9KTm41)@kR{GB9E5LYSa7{mv%z{#(-Pq{BEmW$7IN-vA2{$25AOe0FA>~1 z^Eq-kcQ$>D`!4>87V^%~agcsJM;u_r+7v0%c1gMxT0k)zgl}h9aJ^6~MfA(i_iXW; zn^+dYH!3_B*S%W4xF2w%R?5RzhbXY@@=1@%ftNRz|{%jB~}25WW$il^pEPi{$Ph>?zq= zF<#G+O)P|PRQLwQhnRb4@oY$qnZ}}x@j`eoUS6;goX>f%u=klQo19KXxF^Ph0#|AZ zc%LrY7JiNg`!G*k-Du78l1E0A$cPO!-U0RUF43!K<#AkEc4gpSkI^Fcvmkh0mYv=u zPt9u@v3C@}M(h7y0@rJ3*)94J{Vvg-=yRk##TdrpnF6*fP9Hv!-pnI`Kw{4}41)qBg4-keB zA&etJgYMZ{ZVq#A?6mA-C-|UgpiF0tkoOah|oy$vP-u-qlxD< zmA%xK+EiCS;~e~r)lqVKC7+=_`L!W`JWm>-cdtI)>ir#ll`z*{a_6?N8cXtCQarrR zJGfTddzHr#$(^?O5$j*=q$mOuzWm*HQ~wQ8@Mx|MWK5ZvHd+$f-bj_Z#VHypTMqvT-+$WDZauU@b`+( zitmfhi%;>&Z9M-De_b!`HQc{KxI4uyJih@wkCDzUl)V8<$a6NH;CIdn-^VNE zb140@dT(^Gt)=wn(ejn=TyJYBp~1KwN^ift`aO)H`u}Ia^fa#5ab1P-YsFpUkl#RO z)`RQF0gs@!pI@rzhKAiKpjqlGok$L`0*U}BAgX-+~>i+C321|DF zU%+j7&h1O&9CBMn8Qn=K9@3&Ss9TD|lzVWAt4x;u_;8HHNlYj&Fe4FXzF|c zhGlOV?oHxz7+1?5;vd)3Y{FiY^PSMXJF_8{EGld3l{vw6v2%nFtj{g6c?)dLgALck zvR8C~UX~}teDx!8mmL~o|DQW)-EbCp?EkYZI0X%1QtzuPJ^Hc#pXps0s{fCyi*ZV> zBM;s@&39$Trp2?6K35bwFn*)P*b>vG?=B40zk}I-RhV)033~{~uGK*g)iYdvy?x#L z-0f|B^}U2A%TKgBF^!=A)r$V~GO)G9UZHQtbG;MSyF9^9YkOMevJu^~;zN`2$j_1U z{M5^yCCe61L%2uA0O`{Ux!)4m=5H?~8$vADjX#Wbqtq_1miu@%LOm-!G+C+SX8*p` z5#zDW_I=56TRe}GXw{qfg1y&1k0q;Awcc$sM1#l}3-+FATOwPv=H+iMBpX7Y{pUxh z?a&&s|Ic~3%V;}`E!IX~v1`Fo)?_zyBEmi) zRtt5zt3{gl=|sAyE3sOr+w~kaQP+udQCDJt`gz#$u*b9Ic1#=zp&St!bXn(?=~}Np zQ+NpJ=r~Gl)@ua|^<+JN>Li45L}<`GTg%N>_xPxm=|u`cwSyP>>0G;3KC#bvM$o_1 z_W$$iVyo}1)TEWU8l9n)GNaTJMpi!8OMy;8)Qt$O(6zb}X0fHAlW3x=gmxB5_K&yR zaybio;djw*q99Z|LW1apQd-tqE3qtuZdCYMuGQ;h3oVp#UeqZF*N%`N`erHDF4o5u zXtom&k}aWX`BHCLSRh%>Z8`;^*%7ivRBugKBdSx-h$q- z9HAhTJ3^koehD4D`cnV9BP70KO8=kZ|1mo@37O8YNN-8uY;~1X3JqZ#$q%G`-=JEq zxptOoakz_-?vfwq_4# z`B-Bi%%j4C@kJ%y`<{!<)a4v55~(%p60HI zyI4cS-OT)sZ#;9wQq7r8MYt!%gaYT#HVM1L(UNdCO74UC#1!)w4nnyzEVy1-;K~`j z%+K7VfOpv)gs)i2-Fak$eMW4k!TnpSxtx2au~p99^!9Oay`n80QkjSXN%3avxr-}z zE#V#&-0_yZ&!#6&{^0t5=5dXf>{(ac|HYc^NGBsXH-jtGxT>h( zcP^sGj+UG~&#>p9B|UQ4h$30>p^4uYxoT6md$%nQOE(4K+!3-NmvbH0L*(!WuBN1~ zmbskP$JQ=WS}u)YBlNT4LlbS+d9vsJd~Cn?-S}*2k;+6gNQwvczgV#P--9?U4DVa6 zpTu&(9Z;%cXZ8ITYClAJHj04d|ntTtUCyhACf1Hw9tc5fVhtyBr_vk@x!h(?A}Wq8dj+ z$VP-s9%?YO|zJe@dcM&y*4sJ4SDtR)Vd~T~lQ$g|kj6M=>QODCT>P^?G;F`dKPb zsZ2zTq`tT9O zveW3S@j|JSnSYkFX|J)G*@!M#@zL%c`ZPwTnQOcF-yr+^!L!P>R+99r{mhB#X}I$J zlH%cgE~^&a_u$#SBX3V;Jsx@~kK8HY^jbbf?zVQSay}hVBQph818~H$ zdWKaV^EgZrtlET(Qz7bFl)rI_fw@HY_%L* z3JIcqJyJafv)(&EyW<#s*RZO{7UeuLLOvrl)ZnV#@_cXBkUwI?`hl^v{xKYcbZ1y_ zrFXU|Pp_h-w`t0I5>G=IN5+`hlV;M~X>aP3ID}=fXHU|}hyt`HiLs%^yNIK&L-6OL zt-6`A2PgqgVPW=Qd$@0ur4~y+LZVKORG`wePL;T~6#eF$*FulXzA26R@DYWw({SbP z2Fl4JoS51*8}QW`|G(0iC)@Uu%7`6ht!TBLA^+1SZ?PnF+nF{(QWkoo5~UL7YD}?G zkuzhxC-adhd)3XijZnNwjj2GTCDax49`D0$`PIN|J(Tw*v{cK-(-8WRF+lnaesYy;`eQ5-#Ox{?9FXt=k30XM1x-GK&#~z zt=KLNds>j|v@1m59WyZJ8han|O4UihtyV|Lq-BOgx zMik154^1v~Xky8d#j+6QQQ>R(ehW4H#%QNXUWDhc+}vH39=LcmqCq*|N5`*tGF%RK zJv9Ft1e-s&|KC!ngvdMSc1k`|WDKNzdLeB~<*oVK3(1BMAXje7Rp$teZ2{d*~w*R`saq*d2fXK#nQIUeACgrD^HS}GSq@)8XPOA~sQ+wJXoT2d{YifEG< z6AGMdEK!z-cT*6;9U(!K{uyb9>=l17WpA3kyU^4eDJll{#HLmO9(5&pXAv;xp{3`+4yxM)_}JFTU@PZ`X_a_ zA94K&*Pn6y1=nA3{SDVoxF)BH$xWnF;5vtE1=kO_4sgB1^+#NP!u4ldf5G)vTz^Bn z@i7t@3H*ZyOkTgee)|i&`J~|kyoT3TaQ%Rb4~BcmU+}>1{4?*b^NuH{@a%v2yY`s) z;0W)6&vPyN^zb<6rmDi^+<63Nz&IsPF1Kq<8pW k5HGR6YGjl;or=_9i7}x-M}O7`@oox2xFaNp*7~^r2QD#qrvLx| diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 4d4d82de..ffd963b8 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -152,20 +152,20 @@ To grant other accounts permission for multiple functions, or for actions that d ## Granting layer access to other accounts -To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. +To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy using the add\-layer\-version\-permission command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. ``` aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ --action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text ``` -You should see the following output: +You should see output similar to the following: ``` e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} ``` -Permissions apply only to a single version of a layer\. Repeat the process each time that you create a new layer version\. +Permissions apply only to a single layer version\. Repeat the process each time that you create a new layer version\. To grant permission to all accounts in an organization, use the `organization-id` option\. The following example grants all accounts in an organization permission to use version 3 of a layer\. diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index e017d02d..5e13d816 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -34,13 +34,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index e765485d..f531f311 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -38,7 +38,7 @@ For more information about best practices for Lambda applications, see [Applicat + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. ## Function configuration -+ **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [AWS CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: ++ **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: ``` REPORT RequestId: 3604209a-e9a3-11e6-939a-754dd98c7be3 Duration: 12.34 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 18 MB diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 75406a69..1e3b8cc9 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -6,7 +6,7 @@ There are two types of concurrency available: + Reserved concurrency – Reserved concurrency creates a pool of requests that can only be used by its function, and also prevents its function from using unreserved concurrency\. + Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond to your function's invocations\. -This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see AWS Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. +This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. To ensure that a function can always reach a certain level of concurrency, configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index f1a0a47b..c10ef15a 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -39,7 +39,7 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy\. 1. Choose **Add**\. **Pricing** -Amazon RDS charges a hourly price for proxies that that is determined by the instance size of your database\. For details, see [RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/)\. +Amazon RDS charges a hourly price for proxies that is determined by the instance size of your database\. For details, see [RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/)\. Proxy creation takes a few minutes\. When the proxy is available, configure your function to connect to the proxy endpoint instead of the database endpoint\. diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index ac89a471..f58c1396 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -1,159 +1,46 @@ -# Lambda layers +# Creating and sharing Lambda layers -You use layers with functions that use \.zip file archives for deployment\. For a function defined as a container image, you package your preferred runtime and all code dependencies when you [create the container image](runtimes-custom.md)\. For more information, see [ Working with Lambda layers and extensions in container images]( https://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. +A Lambda layer is a \.zip file archive that can contain additional code or data\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. -You can use Lambda layers to share code in your functions\. A *layer* contains code libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. Layers help to reduce your \.zip archive deployment package size, because layers are not included in the deployment package\. +You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For functions [defined as a container image](lambda-images.md), you package your preferred runtime and all code dependencies when you create the container image\. For more information, see [Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. -A function can use up to five layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. - -You can create your own layers, or use layers that AWS or an AWS customer has published\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html), or all accounts\. - -You can also use the AWS Serverless Application Model \(AWS SAM\) to manage layers and your function's layer configuration\. For instructions, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. +You can create layers using the Lambda console, the Lambda API, AWS CloudFormation, or the AWS Serverless Application Model \(AWS SAM\)\. For more information about creating layers with AWS SAM, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. **Topics** -+ [Create layers](#configuration-layers-create) -+ [Manage layers](#configuration-layers-manage) -+ [Include library dependencies in a layer](#configuration-layers-path) -+ [Layer permissions](#configuration-layers-permissions) -+ [Configure a function to use layers](#configuration-layers-using) -+ [Add an updated layer version to your function](#configuration-layers-script) -+ [AWS CloudFormation and AWS SAM](#configuration-layers-cloudformation) -+ [Sample applications](#configuration-layers-samples) ++ [Creating layer content](#configuration-layers-upload) ++ [Compiling the \.zip file archive for your layer](#configuration-layers-compile) ++ [Including library dependencies in a layer](#configuration-layers-path) ++ [Creating a layer](#configuration-layers-create) ++ [Deleting a layer version](#configuration-layers-delete) ++ [Configuring layer permissions](#configuration-layers-permissions) ++ [Using AWS CloudFormation with layers](#invocation-layers-cloudformation) -## Create layers +## Creating layer content -When you create a new layer, Lambda creates the layer as version 1\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. +When you create a layer, you must bundle all its content into a \.zip file archive\. You upload the \.zip file archive to your layer from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. Lambda extracts the layer contents into the `/opt` directory when setting up the execution environment for the function\. -**To create a layer \(console\)** - -1. Open the [Layers page](https://console.aws.amazon.com/lambda/home#/layers) of the Lambda console\. +### Using the AWS CLI -1. Choose **Create layer**\. +You can create and upload a \.zip file for your layer using the Lambda console or the AWS Command Line Interface \(AWS CLI\)\. For language\-specific instructions, see the following topics\. ++ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) ++ [Deploy Python Lambda functions with \.zip file archives](python-package.md) ++ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) ++ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) ++ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) ++ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) -1. For **Name**, enter a name for your layer\. +## Compiling the \.zip file archive for your layer -1. \(Optional\) For **Description**, enter a description for your layer\. +You build your layer code into a \.zip file archive using the same procedure as you would for a function\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. -1. To upload your layer code, do one of the following: - + To upload a \.zip file from your computer, choose **Upload a \.zip file**, choose your \.zip file, and then choose **Open**\. - + To upload a file from Amazon Simple Storage Service \(Amazon S3\), choose **Upload a file from Amazon S3**\. Then, for **Amazon S3 link URL**, enter a link to the file\. +One way to ensure that you package libraries correctly for Lambda is to use [AWS Cloud9](http://aws.amazon.com/cloud9/)\. For more information, see [Using Lambda layers to simplify your development process](http://aws.amazon.com/blogs/compute/using-lambda-layers-to-simplify-your-development-process/) on the AWS Compute Blog\. -1. \(Optional\) For **Compatible runtimes**, choose up to 15 runtimes\. +## Including library dependencies in a layer -1. \(Optional\) For **License**, enter any necessary license information\. +For each [Lambda runtime](lambda-runtimes.md), the PATH variable includes specific folders in the `/opt` directory\. If you define the same folder structure in your layer \.zip file archive, your function code can access the layer content without the need to specify the path\. -1. Choose **Create**\. - -**To create a layer \(API\)** - -To create a layer, use the `publish-layer-version` command with a name, description, \.zip file archive, and a list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional, but it makes the layer easier to discover\. - -``` -aws lambda publish-layer-version --layer-name my-layer --description "My layer" \ ---license-info "MIT" --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip \ - --compatible-runtimes python3.6 python3.7 python3.8 -``` - -You should see the following output: - -``` -{ - "Content": { - "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-4aaa2fbb-ff77-4b0a-ad92-5b78a716a96a?versionId=27iWyA73cCAYqyH...", - "CodeSha256": "tv9jJO+rPbXUUXuRKi7CwHzKtLDkDRJLB3cC3Z/ouXo=", - "CodeSize": 169 - }, - "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer", - "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:1", - "Description": "My layer", - "CreatedDate": "2018-11-14T23:03:52.894+0000", - "Version": 1, - "LicenseInfo": "MIT", - "CompatibleRuntimes": [ - "python3.6", - "python3.7", - "python3.8" - ] -} -``` - -Each time that you call `publish-layer-version`, you create a new version of the layer\. - -## Manage layers - - To find layers that are compatible with your Lambda function's runtime, use the `list-layers` command\. - -``` -aws lambda list-layers --compatible-runtime python3.8 -``` - -You should see the following output: - -``` -{ - "Layers": [ - { - "LayerName": "my-layer", - "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer", - "LatestMatchingVersion": { - "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2", - "Version": 2, - "Description": "My layer", - "CreatedDate": "2018-11-15T00:37:46.592+0000", - "CompatibleRuntimes": [ - "python3.6", - "python3.7", - "python3.8", - ] - } - } - ] -} -``` - -To list all layers, you can omit the runtime option\. The details in the response reflect the latest version of the layer\. See all the versions of a layer with `list-layer-versions`\. To see more information about a version, use `get-layer-version`\. - -``` -aws lambda get-layer-version --layer-name my-layer --version-number 2 -``` - -You should see the following output: - -``` -{ - "Content": { - "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-91e9ea6e-492d-4100-97d5-a4388d442f3f?versionId=GmvPV.309OEpkfN...", - "CodeSha256": "tv9jJO+rPbXUUXuRKi7CwHzKtLDkDRJLB3cC3Z/ouXo=", - "CodeSize": 169 - }, - "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer", - "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2", - "Description": "My layer", - "CreatedDate": "2018-11-15T00:37:46.592+0000", - "Version": 2, - "CompatibleRuntimes": [ - "python3.6", - "python3.7", - "python3.8" - ] -} -``` - -The link in the response lets you download the layer archive\. The link is valid for 10 minutes\. - -To delete a layer version, use the `delete-layer-version` command\. - -``` -aws lambda delete-layer-version --layer-name my-layer --version-number 1 -``` - -When you delete a layer version, you can no longer configure functions to use it\. However, any function that already uses the version continues to have access to it\. Version numbers are never reused for a layer name\. - -## Include library dependencies in a layer - -Each Lambda runtime adds specific `/opt` directory folders to the PATH variable\. If the layer uses the same folder structure, your function code can access the layer content without the need to specify the path\. - -The following table lists the folder paths that each runtime supports\. +The following table lists the folder paths that each runtime supports\. **Layer paths for each Lambda runtime** @@ -164,7 +51,7 @@ The following examples show how you can structure the folders in your layer \.zi ------ #### [ Node\.js ] -**Example file structure for AWS X\-Ray SDK** +**Example file structure for the AWS X\-Ray SDK for Node\.js** ``` xray-sdk.zip @@ -185,7 +72,7 @@ pillow.zip ------ #### [ Ruby ] -**Example file structure for JSON gem** +**Example file structure for the JSON gem** ``` json.zip @@ -203,7 +90,7 @@ json.zip ------ #### [ Java ] -**Example file structure for Jackson jar file** +**Example file structure for the Jackson JAR file** ``` jackson.zip @@ -213,7 +100,7 @@ jackson.zip ------ #### [ All ] -**Example file structure for JQ library** +**Example file structure for the jq library** ``` jq.zip @@ -224,129 +111,115 @@ jq.zip For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. -## Layer permissions +## Creating a layer -To configure a Lambda function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md)\. +You can create new layers using the Lambda console or the Lambda API\. -To use a layer in another account, the owner of the other account must grant your account permission in a [resource\-based policy](access-control-resource-based.md)\. +Layers can have one or more version\. When you create a layer, Lambda sets the layer version to version 1\. You can configure permissions on an existing layer version, but to update the code or make other configuration changes, you must create a new version of the layer\. -To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. +**To create a layer \(console\)** -``` -aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ ---action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text -``` +1. Open the [Layers page](https://console.aws.amazon.com/lambda/home#/layers) of the Lambda console\. -You should see the following output: +1. Choose **Create layer**\. -``` -e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} -``` +1. Under **Layer configuration**, for **Name**, enter a name for your layer\. -Permissions apply only to a single version of a layer\. Repeat the process each time that you create a new layer version\. +1. \(Optional\) For **Description**, enter a description for your layer\. -For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. +1. To upload your layer code, do one of the following: + + To upload a \.zip file from your computer, choose **Upload a \.zip file**\. Then, choose **Upload** to select your local \.zip file\. + + To upload a file from Amazon S3, choose **Upload a file from Amazon S3**\. Then, for **Amazon S3 link URL**, enter a link to the file\. -## Configure a function to use layers +1. \(Optional\) For **Compatible runtimes**, choose up to 15 runtimes\. -You can specify up to five layers in your Lambda function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, you can update your function's configuration\. +1. \(Optional\) For **License**, enter any necessary license information\. -To add layers to your function, use the `update-function-configuration` command\. The following example adds two layers: one from the same account as the function, and one from a different account\. +1. Choose **Create**\. -``` -aws lambda update-function-configuration --function-name my-function \ ---layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ -arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 -``` +**To create a layer \(API\)** -You should see the following output: +To create a layer, use the publish\-layer\-version command with a name, description, \.zip file archive, and list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional\. ``` -{ - "FunctionName": "test-layers", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", - "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", - "Layers": [ - { - "Arn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3", - "CodeSize": 169 - }, - { - "Arn": "arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2", - "CodeSize": 169 - } - ], - "RevisionId": "81cc64f5-5772-449a-b63e-12330476bcc4", - ... -} +aws lambda publish-layer-version --layer-name my-layer --description "My layer" \ +--license-info "MIT" --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip \ + --compatible-runtimes python3.6 python3.7 python3.8 ``` -You must specify the version of each layer to use by providing the full Amazon Resource Name \(ARN\) of the layer version\. When you add layers to a function that already has layers, the new list overwrites the previous list\. Include all layers every time that you update the layer configuration\. To remove all layers, specify an empty list\. +You should see output similar to the following: ``` -aws lambda update-function-configuration --function-name my-function --layers [] +{ + "Content": { + "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-4aaa2fbb-ff77-4b0a-ad92-5b78a716a96a?versionId=27iWyA73cCAYqyH...", + "CodeSha256": "tv9jJO+rPbXUUXuRKi7CwHzKtLDkDRJLB3cC3Z/ouXo=", + "CodeSize": 169 + }, + "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer", + "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:1", + "Description": "My layer", + "CreatedDate": "2018-11-14T23:03:52.894+0000", + "Version": 1, + "LicenseInfo": "MIT", + "CompatibleRuntimes": [ + "python3.6", + "python3.7", + "python3.8" + ] +} ``` -While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. - -The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. - -## Add an updated layer version to your function - - Use the `update-function-configuration` command to add an updated layer version to your function\. +**Note** +Each time that you call `publish-layer-version`, you create a new version of the layer\. -The `layers` parameter for this command is a list of all of the layer versions to add to the function\. If the function already has layers, the new list overwrites the previous list\. If you want to update only one of the layer versions, the `layers` parameter needs to include the ARNs of the existing layer versions\. +## Deleting a layer version -The following procedure assumes that you have packaged the updated layer code into a local file named `layer.zip`\. +To delete a layer version, use the delete\-layer\-version command\. -**Add an updated layer version to your function** +``` +aws lambda delete-layer-version --layer-name my-layer --version-number 1 +``` -1. \(Optional\) If the new layer version is not published yet, publish the new version\. +When you delete a layer version, you can no longer configure a Lambda function to use it\. However, any function that already uses the version continues to have access to it\. Version numbers are never reused for a layer name\. - ``` - aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ - --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 - ``` +## Configuring layer permissions -1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. +By default, a layer that you create is private to your AWS account\. However, you can optionally share the layer with other accounts or make it public\. - ``` - aws lambda get-function-config --function-name my-function --query 'Layers[*].Arn' --output yaml - ``` +To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy using the add\-layer\-version\-permission command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. - \(Optional\) You can also get the latest version of a layer based on the layer name\. +``` +aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ +--action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text +``` - ``` - aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn' - ``` +You should see output similar to the following: -1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`\. +``` +e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} +``` - ``` - aws lambda update-function-configuration --function-name my-function \ - --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ - arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 - ``` +Permissions apply only to a single layer version\. Repeat the process each time that you create a new layer version\. -## AWS CloudFormation and AWS SAM +For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. -To automate the creation and mapping of layers in your application, use AWS SAM in your AWS CloudFormation templates\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. +## Using AWS CloudFormation with layers -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** +You can use AWS CloudFormation to create a layer and associate the layer with your Lambda function\. The following example template creates a layer named **blank\-nodejs\-lib** and attaches the layer to the Lambda function using the **Layers** property\. ``` AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' -Description: An AWS Lambda application that calls the Lambda API. +Description: A Lambda application that calls the Lambda API. Resources: function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) + Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs12.x CodeUri: function/. - Description: Call the AWS Lambda API + Description: Call the Lambda API Timeout: 10 # Function's execution role Policies: @@ -357,23 +230,11 @@ Resources: Layers: - !Ref libs libs: - Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) + Type: AWS::Serverless::LayerVersion Properties: LayerName: blank-nodejs-lib Description: Dependencies for the blank sample app. ContentUri: lib/. CompatibleRuntimes: - nodejs12.x -``` - -When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. - -## Sample applications - -The GitHub repository for this guide provides [sample applications](lambda-samples.md) that demonstrate the use of layers for dependency management\. -+ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) -+ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) -+ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) -+ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) - -For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. \ No newline at end of file +``` \ No newline at end of file diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 66353c8d..6e28a97f 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -27,7 +27,7 @@ Amazon ECR repository: gallery\.ecr\.aws/lambda/dotnet For instructions on how to use a \.NET base image, choose the **usage** tab on [AWS Lambda base images for \.NET](https://gallery.ecr.aws/lambda/dotnet) in the *Amazon ECR repository*\. -The instructions are also available on [AWS Lambda base images for \.NET](https://hub.docker.com/r/amazon/aws-lambda-dotnet) in the *Docker Hub repository*\. +The instructions are also available on [Lambda base images for \.NET](https://hub.docker.com/r/amazon/aws-lambda-dotnet) in the *Docker Hub repository*\. ## \.NET runtime interface clients diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md index e43ddef3..8b9a182c 100644 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -6,7 +6,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A 1. From the **File** menu, choose **New**, and then choose **Project**\. - 1. In the **New Project** window, choose **AWS Lambda Project \(\.NET Core\)**, and then choose **OK**\. + 1. In the **New Project** window, choose **Lambda Project \(\.NET Core\)**, and then choose **OK**\. 1. In the **Select Blueprint** window, you can select from a list of sample applications that provide you with sample code to get started with creating a \.NET\-based Lambda application\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index c01fbf94..ea1e1aaa 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 6373c1ff..1cf23be7 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -124,13 +124,13 @@ In this getting started exercise, you use the Docker CLI to create a container i To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index 7d821b6d..e71c6056 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -11,13 +11,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index c5ac3406..79ba9114 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -79,9 +79,17 @@ For more information, see [Lambda runtimes](lambda-runtimes.md)\. ## Layer -A Lambda layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. You can use a layer to distribute a dependency to multiple functions\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. +A Lambda *layer* is a \.zip file archive that can contain additional code or other content\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. -For more information, see [Lambda layers](configuration-layers.md)\. +Layers provide a convenient way to package libraries and other dependencies that you can use with your Lambda functions\. Using layers reduces the size of uploaded deployment archives and makes it faster to deploy your code\. Layers also promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. + +You can include up to five layers per function\. Layers count towards the standard Lambda [deployment size quotas](https://docs.amazonaws.cn/en_us/lambda/latest/dg/gettingstarted-limits.html)\. When you include a layer in a function, the contents are extracted to the `/opt` directory in the execution environment\. + +By default, the layers that you create are private to your AWS account\. You can choose to share a layer with other accounts or to make the layer public\. If your functions consume a layer that a different account published, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function or update functions using a deleted layer version\. + +Functions deployed as a container image do not use layers\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. + +For more information, see [Creating and sharing Lambda layers](configuration-layers.md)\. ## Extension diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index 787224a9..f48a2107 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -1,6 +1,6 @@ # Lambda deployment packages -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. **Topics** + [Container images](#gettingstarted-package-images) @@ -63,7 +63,7 @@ If you deploy your function code using a \.zip file archive, you can use Lambda You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. -For more information about layers, see [Lambda layers](configuration-layers.md)\. +For more information about layers, see [Creating and sharing Lambda layers](configuration-layers.md)\. ## Using other AWS services to build a deployment package @@ -79,6 +79,6 @@ For more information, see [sam build](https://docs.aws.amazon.com/serverless-app If your deployment package is larger than 50 MB, we recommend uploading your function code and dependencies to an Amazon S3 bucket\. -You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS Command Line Interface \(AWS CLI\)\. +You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS CLI\. To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. \ No newline at end of file diff --git a/doc_source/go-image.md b/doc_source/go-image.md index b1b2d290..8160dbe6 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -34,9 +34,9 @@ AWS does not provide a separate runtime interface client for Go\. The `aws-lambd ## Using the Go:1\.x base image -For instructions on how to use the base image for Go:1\.x, choose the **usage** tab on [AWS Lambda base images for Go](https://gallery.ecr.aws/lambda/go) in the *Amazon ECR repository*\. +For instructions on how to use the base image for Go:1\.x, choose the **usage** tab on [Lambda base images for Go](https://gallery.ecr.aws/lambda/go) in the *Amazon ECR repository*\. -The instructions are also available on [AWS Lambda base images for Go](https://hub.docker.com/r/amazon/aws-lambda-go) in the *Docker Hub repository*\. +The instructions are also available on [Lambda base images for Go](https://hub.docker.com/r/amazon/aws-lambda-go) in the *Docker Hub repository*\. ## Deploying Go with the `provided.al2` base image diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index 3db7529a..ee9506f4 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -1,8 +1,8 @@ # Deploy Go Lambda functions with \.zip file archives -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. -This page describes how to create a \.zip file as your deployment package for the Go runtime, and then use the \.zip file to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](gettingstarted-package.md)\. +This page describes how to create a \.zip file as your deployment package for the Go runtime, and then use the \.zip file to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. **Topics** + [Prerequisites](#golang-package-prereqs) @@ -10,7 +10,6 @@ This page describes how to create a \.zip file as your deployment package for th + [Sample applications](#golang-package-sample) + [Creating a \.zip file on macOS and Linux](#golang-package-mac-linux) + [Creating a \.zip file on Windows](#golang-package-windows) -+ [Creating the Lambda function using the AWS CLI](#golang-package-create) ## Prerequisites @@ -70,6 +69,8 @@ The following steps demonstrate how to download the [lambda](https://github.com/ This command creates a stable binary package for standard C library \(`libc`\) versions, which may be different on Lambda and other devices\. +1. Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. + 1. Create a deployment package by packaging the executable in a \.zip file\. ``` @@ -115,14 +116,4 @@ If you have not already done so, you must install [git](https://git-scm.com/) an ~\Go\Bin\build-lambda-zip.exe -output main.zip main ``` ------- - -## Creating the Lambda function using the AWS CLI - -Lambda needs to know the [Lambda runtime](lambda-runtimes.md) environment to use for your function's code \(in `runtime`\), a name for your Lambda function \(in `function-name`\), the Lambda handler in your function code \(in `handler`\), and the [execution role](lambda-intro-execution-role.md) it can use to invoke your function \(in `role`\)\. - -Use the [create\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-function.html) command to create the Lambda function\. - -``` -aws lambda create-function --function-name my-function --runtime go1.x --zip-file fileb://function.zip --handler main --role arn:aws:iam::your-account-id:role/execution_role -``` \ No newline at end of file +------ \ No newline at end of file diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index c479b6f0..7822bf4c 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index d44b3c83..deba8173 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -73,7 +73,11 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local **To build the emulator into your image** -1. Create a script and save it in your project directory\. The following example shows a typical script for a Node\.js function\. The presence of the `AWS_LAMBDA_RUNTIME_API` environment variable indicates the presence of the runtime API\. If the runtime API is present, the script runs the [runtime interface client](runtimes-images.md#runtimes-api-client)\. Otherwise, the script runs the runtime interface emulator\. +1. Create a script and save it in your project directory\. Set execution permissions for the script file\. + + The script checks for the presence of the `AWS_LAMBDA_RUNTIME_API` environment variable, which indicates the presence of the runtime API\. If the runtime API is present, the script runs the [runtime interface client](runtimes-images.md#runtimes-api-client)\. Otherwise, the script runs the runtime interface emulator\. + + The following example shows a typical script for a Node\.js function\. ``` #!/bin/sh @@ -84,6 +88,17 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local fi ``` + The following example shows a typical script for a Python function\. + + ``` + #!/bin/sh + if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then + exec /usr/local/bin/aws-lambda-rie usr/local/bin/python -m awslambdaric $@ + else + exec usr/local/bin/python -m awslambdaric $@ + fi + ``` + 1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. 1. Install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: @@ -129,4 +144,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. + This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index 42811c25..c45b7949 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -37,7 +37,8 @@ Amazon's trademarks and trade dress may not be used in + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) + [Lambda function aliases](configuration-aliases.md) - + [Lambda layers](configuration-layers.md) + + [Creating and sharing Lambda layers](configuration-layers.md) + + [Using layers with your Lambda function](invocation-layers.md) + [Configuring Lambda function memory](configuration-memory.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md new file mode 100644 index 00000000..98619e6c --- /dev/null +++ b/doc_source/invocation-layers.md @@ -0,0 +1,195 @@ +# Using layers with your Lambda function + +A Lambda layer is a \.zip file archive that can contain additional code or other content\. A layer can contain libraries, a custom runtime, data, or configuration files\. Use layers to reduce deployment package size and to promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. + +You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For a function [defined as a container image](lambda-images.md), you can package your preferred runtime and all code dependencies when you create the container image\. For more information, see [ Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. + +**Topics** ++ [Configuring a function to use layers](#invocation-layers-using) ++ [Accessing the contents of a layer](#invocation-layers-accessing) ++ [Finding layer information](#configuration-layers-finding) ++ [Updating a layer version that your function uses](#invocation-layers-script) ++ [Adding layer permissions](#invocation-layers-permissions) ++ [Using AWS SAM to add a layer to a function](#invocation-layers-cloudformation) ++ [Sample applications](#invocation-layers-samples) + +## Configuring a function to use layers + +A Lambda function can use up to five layers at a time\. The total unzipped size of the function and all layers cannot exceed the unzipped deployment package size quota of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. + +If your functions consume a layer that a different AWS account publishes, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function that uses a deleted layer version\. + +To add layers to your function, use the update\-function\-configuration command\. The following example adds two layers: one from the same AWS account as the function, and one from a different account\. + +``` +aws lambda update-function-configuration --function-name my-function \ +--layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ +arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 +``` + +You should see output similar to the following: + +``` +{ + "FunctionName": "test-layers", + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", + "Layers": [ + { + "Arn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3", + "CodeSize": 169 + }, + { + "Arn": "arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2", + "CodeSize": 169 + } + ], + "RevisionId": "81cc64f5-5772-449a-b63e-12330476bcc4", + ... +} +``` + +To specify the layer versions to use, you must provide the full Amazon Resource Name \(ARN\) of each layer version\. When you add layers to a function that already has layers, you overwrite the previous list of layers\. Be sure to include all layers every time that you update the layer configuration\. Or, to remove all layers, specify an empty list\. + +``` +aws lambda update-function-configuration --function-name my-function --layers [] +``` + +The creator of a layer can delete a version of the layer\. If you're using that layer version in a function, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. + +## Accessing the contents of a layer + +When you include a layer in a Lambda function, Lambda extracts the layer's contents into the `/opt` directory in the function execution environment\. Lambda extracts layers in the order that you specified them, merging any folders with the same name\. If the same file appears in multiple layers, the function uses the version in the last extracted layer\. + +Each [Lambda runtime](lambda-runtimes.md) adds specific `/opt` directory folders to the PATH variable\. Your function code can access the layer content without the need to specify the path\. For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. + +## Finding layer information + +To find layers in your AWS account that are compatible with your Lambda function's runtime, use the list\-layers command\. + +``` +aws lambda list-layers --compatible-runtime python3.8 +``` + +You should see output similar to the following: + +``` +{ + "Layers": [ + { + "LayerName": "my-layer", + "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer", + "LatestMatchingVersion": { + "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2", + "Version": 2, + "Description": "My layer", + "CreatedDate": "2018-11-15T00:37:46.592+0000", + "CompatibleRuntimes": [ + "python3.6", + "python3.7", + "python3.8", + ] + } + } + ] +} +``` + +To list all layers in your account, you can omit the `--compatible-runtime` option\. The details in the response reflect the latest version of the layer\. + +You can also get the latest version of a layer using the list\-layer\-versions command\. + +``` +aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn +``` + +## Updating a layer version that your function uses + +Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. + +To add an updated layer version to your function, use the update\-function\-configuration command\. Use the `--layers` option with this command to list all of the layer versions that you want to add\. If the function already has layers, the new list overwrites the previous list\. + +To update only one of the layer versions, you must include the ARNs of the existing layer versions with the `--layers` option\. + +The following procedure assumes that you have packaged the updated layer code into a local file named `layer.zip`\. + +**Add an updated layer version to your function** + +1. \(Optional\) If the new layer version is not published yet, publish the new version\. + + ``` + aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ + --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 + ``` + +1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. + + ``` + aws lambda get-function-config --function-name my-function --query 'Layers[*].Arn' --output yaml + ``` + +1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`: + + ``` + aws lambda update-function-configuration --function-name my-function \ + --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ + arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 + ``` + +## Adding layer permissions + +To use a Lambda function with a layer, you need permission to call the [GetLayerVersion](API_GetLayerVersion.md) API operation on the layer version\. For functions in your AWS account, you can add this permission from your [user policy](access-control-identity-based.md)\. + +To use a layer in another account, the owner of that account must grant your account permission in a [resource\-based policy](access-control-resource-based.md)\. + +For examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. + +## Using AWS SAM to add a layer to a function + +To automate the creation and mapping of layers in your application, use the AWS Serverless Application Model \(AWS SAM\)\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. + +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** + +``` +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Lambda application that calls the Lambda API. +Resources: + function: + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) + Properties: + Handler: index.handler + Runtime: nodejs12.x + CodeUri: function/. + Description: Call the AWS Lambda API + Timeout: 10 + # Function's execution role + Policies: + - AWSLambdaBasicExecutionRole + - AWSLambda_ReadOnlyAccess + - AWSXrayWriteOnlyAccess + Tracing: Active + Layers: + - !Ref libs + libs: + Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) + Properties: + LayerName: blank-nodejs-lib + Description: Dependencies for the blank sample app. + ContentUri: lib/. + CompatibleRuntimes: + - nodejs12.x +``` + +When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. + +## Sample applications + +The GitHub repository for this guide provides blank sample applications that demonstrate the use of layers for dependency management\. ++ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) ++ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) ++ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) ++ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) + +For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 8e1c2457..7b94916b 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -30,9 +30,9 @@ Amazon ECR repository: gallery\.ecr\.aws/lambda/java ## Using a Java base image -For instructions on how to use a Java base image, choose the **usage** tab on [AWS Lambda base images for Java](https://gallery.ecr.aws/lambda/java) in the *Amazon ECR repository*\. +For instructions on how to use a Java base image, choose the **usage** tab on [Lambda base images for Java](https://gallery.ecr.aws/lambda/java) in the *Amazon ECR repository*\. -The instructions are also available on [AWS Lambda base images for Java](https://hub.docker.com/r/amazon/aws-lambda-java) in the *Docker Hub repository*\. +The instructions are also available on [Lambda base images for Java](https://hub.docker.com/r/amazon/aws-lambda-java) in the *Docker Hub repository*\. ## Java runtime interface clients diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md index 03935add..c0c3a2a5 100644 --- a/doc_source/java-package-eclipse.md +++ b/doc_source/java-package-eclipse.md @@ -3,7 +3,7 @@ This section shows how to package your Java code into a deployment package using Eclipse IDE and Maven plugin for Eclipse\. **Note** -The AWS SDK Eclipse Toolkit provides an Eclipse plugin for you to both create a deployment package and also upload it to create a Lambda function\. If you can use Eclipse IDE as your development environment, this plugin enables you to author Java code, create and upload a deployment package, and create your Lambda function\. For more information, see the [AWS Toolkit for Eclipse Getting Started Guide](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/)\. For an example of using the toolkit for authoring Lambda functions, see [Using AWS Lambda with the AWS toolkit for Eclipse](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/lambda.html)\. +The AWS SDK Eclipse Toolkit provides an Eclipse plugin for you to both create a deployment package and also upload it to create a Lambda function\. If you can use Eclipse IDE as your development environment, this plugin enables you to author Java code, create and upload a deployment package, and create your Lambda function\. For more information, see the [AWS Toolkit for Eclipse Getting Started Guide](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/)\. For an example of using the toolkit for authoring Lambda functions, see [Using Lambda with the AWS toolkit for Eclipse](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/lambda.html)\. **Topics** + [Prerequisites](#java-package-eclipse-prereqs) diff --git a/doc_source/java-package.md b/doc_source/java-package.md index bbc574e0..5b41ed3a 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -1,6 +1,6 @@ # Deploy Java Lambda functions with \.zip or JAR file archives -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. This page describes how to create your deployment package as a \.zip file or Jar file, and then use the deployment package to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. @@ -62,7 +62,7 @@ dependencies { To create a deployment package, compile your function code and dependencies into a single \.zip file or Java Archive \(JAR\) file\. For Gradle, [use the `Zip` build type](#java-package-gradle)\. For Apache Maven, [use the Maven Shade plugin](#java-package-maven)\. **Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [Lambda layers](configuration-layers.md)\. +To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [Creating and sharing Lambda layers](configuration-layers.md)\. You can upload your deployment package by using the Lambda console, the Lambda API, or AWS Serverless Application Model \(AWS SAM\)\. diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 6da3fdad..269149d7 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -114,7 +114,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 35371776..b474f5e5 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -10,6 +10,4 @@ As you add libraries and other dependencies to your function, creating and uploa To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. -To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. - -For more information about designing Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. \ No newline at end of file +To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index c3e5aa0b..2df01c9f 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -7,7 +7,7 @@ Lambda supports the following Node\.js runtimes\. **Node\.js runtimes** -| Name | Identifier | AWS SDK for JavaScript | Operating system | +| Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | | Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | | Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | @@ -58,7 +58,7 @@ You can add permissions to the role later, or swap it out for a different role t The console creates a Lambda function with a single source file named `index.js`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with AWS Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. +The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `index.js` file exports a function named `handler` that takes an event object and a context object\. This is the [handler function](nodejs-handler.md) that Lambda calls when the function is invoked\. The Node\.js function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `index.handler`\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index aa915f24..158cf7c8 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -42,7 +42,7 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in The console creates a Lambda function with a single source file named `lambda_function`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with AWS Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. +The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `lambda_function` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](python-handler.md) that Lambda calls when the function is invoked\. The Python function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md index ba58d856..1a30e336 100644 --- a/doc_source/lambda-rolling-deployments.md +++ b/doc_source/lambda-rolling-deployments.md @@ -4,7 +4,7 @@ Use rolling deployments to control the risks associated with introducing new ver You configure a rolling deployment by using AWS CodeDeploy and AWS SAM\. CodeDeploy is a service that automates application deployments to Amazon computing platforms such as Amazon EC2 and AWS Lambda\. For more information, see [What is CodeDeploy?](https://docs.aws.amazon.com/codedeploy/latest/userguide/welcome.html)\. By using CodeDeploy to deploy your Lambda function, you can easily monitor the status of the deployment and initiate a rollback if you detect any issues\. -AWS SAM is an open\-source framework for building serverless applications\. You create an AWS SAM template \(in YAML format\) to specify the configuration of the components required for the rolling deployment\. AWS SAM uses the template to create and configure the components\. For more information, see [What is the AWS Serverless Application Model?](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html)\. +AWS SAM is an open\-source framework for building serverless applications\. You create an AWS SAM template \(in YAML format\) to specify the configuration of the components required for the rolling deployment\. AWS SAM uses the template to create and configure the components\. For more information, see [What is the AWS SAM?](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html)\. In a rolling deployment, AWS SAM performs these tasks: + It configures your Lambda function and creates an alias\. diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index 62807c1a..6e6a6a6a 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -7,7 +7,7 @@ Lambda supports the following Ruby runtimes\. **Ruby runtimes** -| Name | Identifier | AWS SDK for Ruby | Operating system | +| Name | Identifier | SDK for Ruby | Operating system | | --- | --- | --- | --- | | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | | Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | @@ -57,7 +57,7 @@ You can add permissions to the role later, or swap it out for a different role t The console creates a Lambda function with a single source file named `lambda_function.rb`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with AWS Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. +The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `lambda_function.rb` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](ruby-handler.md) that Lambda calls when the function is invoked\. The Ruby function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index d58ef247..d6936b4a 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -19,7 +19,7 @@ A runtime can support a single version of a language, multiple versions of a lan **Node\.js runtimes** -| Name | Identifier | AWS SDK for JavaScript | Operating system | +| Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | | Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | | Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | @@ -44,7 +44,7 @@ Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) **Ruby runtimes** -| Name | Identifier | AWS SDK for Ruby | Operating system | +| Name | Identifier | SDK for Ruby | Operating system | | --- | --- | --- | --- | | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | | Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md index 5d586b61..ec584aa9 100644 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -73,7 +73,7 @@ The following section describes how to view and add reports from CloudWatch Logs 1. \(Optional\) Choose **Save**\. -![\[The AWS CloudWatch Logs Insights reports on the CloudWatch dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) +![\[The CloudWatch Logs Insights reports on the CloudWatch dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) ## What's next? + Learn about the metrics that Lambda records and sends to CloudWatch in [Working with AWS Lambda function metrics](monitoring-metrics.md)\. diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index 2bbfd1d6..64882488 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -1,11 +1,14 @@ # Deploy Node\.js Lambda functions with \.zip file archives -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. -To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: -+ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. -+ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. -+ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. +To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file contains your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ If the \.zip file is larger than 50 MB, we recommend uploading it to your function from an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + + For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 43c7fc2c..6f2c191a 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -148,7 +148,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index b2faa753..dc71a008 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -95,7 +95,7 @@ The sample code contains standard math and logging Python libraries, which are u ### Create the deployment package -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. Create the \.zip file that Lambda uses as your deployment package\. @@ -265,7 +265,7 @@ You'll learn how to: ### Create the deployment package -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. Create the \.zip file that Lambda uses as your deployment package\. @@ -449,4 +449,4 @@ You can now delete the resources that you created for this tutorial, unless you ``` aws iam delete-role --role-name lambda-ex - ``` + ``` \ No newline at end of file diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index f6ba930e..e6ea38a0 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -61,7 +61,7 @@ For more information, see [What is a runtime dependency?](python-package.md#pyth The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. **Note** -If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with dependencies** @@ -141,7 +141,7 @@ A dependency can be any package, module or other assembly dependency that is not The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. **Note** -If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with a virtual environment** diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 743f475e..f507f007 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -3,12 +3,15 @@ **Note** End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. -To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: -+ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. -+ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. -+ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. +To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file contains your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ If the \.zip file is larger than 50 MB, we recommend uploading it to your function from an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + + For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 83b40b55..373542ae 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -5,7 +5,7 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -21,7 +21,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -45,9 +45,9 @@ jsonpickle==1.3 aws-xray-sdk==2.4.3 ``` -To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. +To instrumentAWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing anAWS SDK client** ``` import boto3 @@ -84,7 +84,7 @@ You can also instrument HTTP clients, record SQL queries, and create custom subs ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -129,7 +129,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index cd066b9e..eebb0309 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -1,11 +1,14 @@ # Deploy Ruby Lambda functions with \.zip file archives -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. -To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: -+ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. -+ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. -+ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. +To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file contains your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ If the \.zip file is larger than 50 MB, we recommend uploading it to your function from an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + + For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index 2f08c9dd..bf39980b 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -46,9 +46,9 @@ gem 'aws-sdk-lambda', '1.39.0' gem 'test-unit', '3.3.5' ``` -To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. +To instrumentAWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing anAWS SDK client** ``` # lambda_function.rb @@ -83,7 +83,7 @@ You can also instrument HTTP clients, record SQL queries, and create custom subs ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -128,7 +128,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index d191b0b7..ccba88a3 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -37,6 +37,4 @@ In some cases, advance notice of support ending might not be possible\. For exam + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) + **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/doc/devel/release.html) -+ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) - -After ending support for a runtime, Lambda might retire it completely at any time by disabling invocation\. Before retiring a runtime, Lambda sends additional notifications to affected customers\. No runtimes are scheduled for retirement at this time\. \ No newline at end of file ++ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md index bb0ab2f1..c49f6e76 100644 --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -9,13 +9,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 38688e57..014a51c7 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -1,6 +1,6 @@ # Blank function sample application for AWS Lambda -The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. +The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and theAWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-blank.png) @@ -37,7 +37,7 @@ The sample application consists of function code, an AWS CloudFormation template Standard charges apply for each service\. For more information, see [AWS Pricing](https://aws.amazon.com/pricing)\. -The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. +The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with theAWS SDK and passes the response back to the Lambda runtime\. **Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Handler code** @@ -64,7 +64,7 @@ var serialize = function(object) { } ``` -The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. +The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code orAWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. @@ -174,7 +174,7 @@ The sample function is configured for tracing with [AWS X\-Ray](https://console. The first service node \(`AWS::Lambda`\) represents the Lambda service, which validates the invocation request and sends it to the function\. The second node, `AWS::Lambda::Function`, represents the function itself\. -To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. +To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with theAWS SDK to AWS services\. **Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** @@ -186,15 +186,15 @@ const AWS = AWSXRay.captureAWS(require('aws-sdk')) const lambda = new AWS.Lambda() ``` -Instrumenting the AWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. +Instrumenting theAWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-servicemap.png) -The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for the AWS SDK call to the `GetAccountSettings` API operation\. +The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for theAWS SDK call to the `GetAccountSettings` API operation\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-trace.png) -You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes the AWS SDK in the execution environment\. +You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes theAWS SDK in the execution environment\. ## Dependency management with layers diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 67e825cc..a9eeb6f5 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -72,7 +72,7 @@ The two Node\.js functions are configured for active tracing in the template, an ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-trace.png) -The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It uses AWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. +The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It usesAWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. ## AWS CloudFormation template and additional resources diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 7225177f..29c48463 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -98,7 +98,7 @@ The application uses [AWS X\-Ray](services-xray.md) to trace function invocation ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-servicemap.png) -The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with an AWS SDK or MySQL client\. +The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with anAWS SDK or MySQL client\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-trace.png) diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 4cc83fe3..49760245 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -18,7 +18,7 @@ We strongly recommend that you never put sensitive identifying information, such ## Encryption in transit -Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console, AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. +Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console,AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. When you [connect your function to a file system](configuration-filesystem.md), Lambda uses [Encryption in transit](https://docs.aws.amazon.com/efs/latest/ug/encryption.html) for all connections\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index a1febf9f..3e190953 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -64,13 +64,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md index ad0c3815..74c7e746 100644 --- a/doc_source/services-cloudwatchevents-expressions.md +++ b/doc_source/services-cloudwatchevents-expressions.md @@ -14,7 +14,7 @@ Where *Value* is a positive integer and *Unit* can be minute\(s\), hour\(s\), or | Frequency | Expression | | --- | --- | | Every 5 minutes | `rate(5 minutes)` | -| Every hour | `rate(1 hours)` | +| Every hour | `rate(1 hour)` | | Every seven days | `rate(7 days)` | Cron expressions have the following format\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 194c346a..8416d961 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -15,13 +15,13 @@ For more information about spot instances usage and best practices, see [Spot In To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md index bdce5f13..28a100e6 100644 --- a/doc_source/services-ec2.md +++ b/doc_source/services-ec2.md @@ -27,7 +27,7 @@ CloudWatch Events invokes your Lambda function asynchronously with the event doc For details on configuring events in CloudWatch Events, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon CloudWatch Events for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. -You can also use the AWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. +You can also use theAWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. ## Permissions @@ -59,4 +59,4 @@ aws lambda add-permission --action lambda:InvokeFunction --statement-id ec2-even --principal events.amazonaws.com --function-name my-function --source-arn 'arn:aws:events:us-east-2:12456789012:rule/*' ``` -If your function uses the AWS SDK to manage Amazon EC2 resources, add Amazon EC2 permissions to the function's [execution role](lambda-intro-execution-role.md)\. \ No newline at end of file +If your function uses theAWS SDK to manage Amazon EC2 resources, add Amazon EC2 permissions to the function's [execution role](lambda-intro-execution-role.md)\. \ No newline at end of file diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index 356f6507..048ecc12 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -14,13 +14,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index ec9474d1..2af5cd7b 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -14,13 +14,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md index 848b668a..08bb31ec 100644 --- a/doc_source/services-s3-batch.md +++ b/doc_source/services-s3-batch.md @@ -57,7 +57,7 @@ In the [resource\-based policy](access-control-resource-based.md) that you creat In the [execution role](lambda-intro-execution-role.md) for the function, set a trust policy for Amazon S3 to assume the role when it runs your function\. -If your function uses the AWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. +If your function uses theAWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. When the job runs, Amazon S3 starts multiple function instances to process the Amazon S3 objects in parallel, up to the [concurrency limit](invocation-scaling.md) of the function\. Amazon S3 limits the initial ramp\-up of instances to avoid excess cost for smaller jobs\. diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 35da3661..b80cdabb 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -74,7 +74,7 @@ For more information, see [The X\-Ray daemon](https://docs.aws.amazon.com/xray/l ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index a0c24ba6..8c6c8337 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -26,7 +26,7 @@ chmod 755 $(find . -type d) When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the [S3Bucket and S3Key](API_UpdateFunctionCode.md#SSS-UpdateFunctionCode-request-S3Bucket) parameters\. **Note** -When you upload a file directly with the AWS CLI, AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. +When you upload a file directly with the AWS CLI,AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. ## Amazon S3: Error Code PermanentRedirect\. diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index be5f6ba8..d2138fe1 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -28,7 +28,7 @@ When you add permissions to your function, make an update to its code or configu **Issue: \(Node\.js\)** *Function returns before code finishes executing* -Many libraries, including the AWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. +Many libraries, including theAWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. To wait for the promise to resolve into a response, use the `await` keyword\. This blocks your handler code from executing until the promise is resolved into an object that contains the response\. If you don't need to use the data from the response in your code, you can return the promise directly to the runtime\. @@ -36,11 +36,11 @@ Some libraries don't return promises but can be wrapped in code that does\. For ## AWS SDK: Versions and updates -**Issue:** *The AWS SDK included on the runtime is not the latest version* +**Issue:** *TheAWS SDK included on the runtime is not the latest version* -**Issue:** *The AWS SDK included on the runtime updates automatically* +**Issue:** *TheAWS SDK included on the runtime updates automatically* -Runtimes for scripting languages include the AWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of the AWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: +Runtimes for scripting languages include theAWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of theAWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 0ac5dda8..27afc2dc 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -36,7 +36,7 @@ If a function is stuck in the `Pending` state for more than six minutes, call on Lambda cancels the pending operation and puts the function into the `Failed` state\. You can then delete the function and recreate it, or attempt another update\. -## Lambda: One function is using all concurrency +## Lambda: One function is using all concurrency **Issue:** *One function is using all of the available concurrency, causing other functions to be throttled\.* diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 6e5c559a..23e90de8 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -65,7 +65,7 @@ For a \.zip file archive, you can create an AWS CloudFormation template to simpl You can add an extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. -You add the extension to your function using the same method as you would for any layer\. For more information, see [Configure a function to use layers](configuration-layers.md#configuration-layers-using)\. +You add the extension to your function using the same method as you would for any layer\. For more information, see [Using layers with your Lambda function](invocation-layers.md)\. **Add an extension to your function \(console\)** diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 54e8030d..86848848 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -1,39 +1,97 @@ # What is AWS Lambda? -AWS Lambda is a compute service that lets you run code without provisioning or managing servers\. Lambda runs your code only when needed and scales automatically, from a few requests per day to thousands per second\. You pay only for the compute time that you consume—there is no charge when your code is not running\. With Lambda, you can run code for virtually any type of application or backend service, all with zero administration\. Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging\. All you need to do is supply your code in one of the [languages that Lambda supports](lambda-runtimes.md)\. +Lambda is a compute service that lets you run code without provisioning or managing servers\. Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging\. With Lambda, you can run code for virtually any type of application or backend service\. All you need to do is supply your code in one of the [languages that Lambda supports](lambda-runtimes.md)\. -You can use Lambda to run your code in response to events, such as changes to data in an Amazon Simple Storage Service \(Amazon S3\) bucket or an Amazon DynamoDB table; to run your code in response to HTTP requests using Amazon API Gateway; or to invoke your code using API calls made using AWS SDKs\. With these capabilities, you can use Lambda to build data processing triggers for AWS services such as Amazon S3 and DynamoDB, process streaming data stored in Amazon Kinesis, or create your own backend that operates at AWS scale, performance, and security\. +**Note** +In the AWS Lambda Developer Guide, we assume that you have experience with coding, compiling, and deploying programs using one of the supported languages\. -You can also build serverless applications composed of functions that are triggered by events, and automatically deploy them using AWS CodePipeline and AWS CodeBuild\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. +You organize your code into [Lambda functions](gettingstarted-concepts.md#gettingstarted-concepts-function)\. Lambda runs your function only when needed and scales automatically, from a few requests per day to thousands per second\. You pay only for the compute time that you consume—there is no charge when your code is not running\. -For more information about designing, operating, and troubleshooting Lambda\-based applications, see [Introduction](https://docs.aws.amazon.com/lambda/latest/operatorguide/intro.html) in the *Lambda operator guide*\. +You can invoke your Lambda functions using the Lambda API, or Lambda can run your functions in response to events from other AWS services\. For example, you can use Lambda to: ++ Build data\-processing triggers for AWS services such as Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. ++ Process streaming data stored in Amazon Kinesis\. ++ Create your own backend that operates at AWS scale, performance, and security\. -**Topics** -+ [When should I use AWS Lambda?](#when-to-use-cloud-functions) -+ [Are you a first\-time user of AWS Lambda?](#welcome-first-time-user) +Lambda is a highly available service\. For more information, see the [AWS Lambda Service Level Agreement](http://aws.amazon.com/lambda/sla/)\. -## When should I use AWS Lambda? +## When should I use Lambda? -AWS Lambda is an ideal compute service for many application scenarios, provided that you can run your application code using the Lambda standard runtime environment and within the resources that Lambda provides\. +Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](runtimes-context.md) and within the resources that Lambda provides\. -When using Lambda, you are responsible only for your code\. Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources\. This is in exchange for flexibility, which means you cannot log in to compute instances, or customize the operating system on provided runtimes\. These constraints enable Lambda to perform operational and administrative activities on your behalf, including provisioning capacity, monitoring fleet health, applying security patches, deploying your code, and monitoring and logging your Lambda functions\. +When using Lambda, you are responsible only for your code\. Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources to run your code\. Because Lambda manages these resources, you cannot log in to compute instances or customize the operating system on [provided runtimes](lambda-runtimes.md)\. Lambda performs operational and administrative activities on your behalf, including managing capacity, monitoring, and logging your Lambda functions\. -If you need to manage your own compute resources, AWS also offers other compute services to meet your needs\. For example: -+ Amazon Elastic Compute Cloud \(Amazon EC2\) offers flexibility and a wide range of EC2 instance types to choose from\. It gives you the option to customize operating systems, network and security settings, and the entire software stack\. You are responsible for provisioning capacity, monitoring fleet health and performance, and using Availability Zones for fault tolerance\. +If you need to manage your own compute resources, AWS has other compute services to meet your needs\. For example: ++ Amazon Elastic Compute Cloud \(Amazon EC2\) offers a wide range of EC2 instance types to choose from\. It lets you customize operating systems, network and security settings, and the entire software stack\. You are responsible for provisioning capacity, monitoring fleet health and performance, and using Availability Zones for fault tolerance\. + AWS Elastic Beanstalk enables you to deploy and scale applications onto Amazon EC2\. You retain ownership and full control over the underlying EC2 instances\. -Lambda is a highly available service\. For more information, see the [AWS Lambda Service Level Agreement](http://aws.amazon.com/lambda/sla/)\. +## Lambda features + +The following key features help you develop Lambda applications that are scalable, secure, and easily extensible: + +**Concurrency controls** +[Concurrency limits and provisioned concurrency](invocation-scaling.md) give you fine\-grained control over the scaling and responsiveness of your production applications\. + +**Functions defined as container images** +Use your preferred [container image](lambda-images.md) tooling, workflows, and dependencies to build, test, and deploy your Lambda functions\. + +**Code signing ** +[Code signing](configuration-codesigning.md) for Lambda provides trust and integrity controls that let you verify that only unaltered code that approved developers have published is deployed in your Lambda functions\. + +**Lambda extensions** +You can use [Lambda extensions](runtimes-extensions-api.md) to augment your Lambda functions\. For example, use extensions to more easily integrate Lambda with your favorite tools for monitoring, observability, security, and governance\. + +**Function blueprints** +A function blueprint provides sample code that shows how to use Lambda with other AWS services or third\-party applications\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. + +**Database access** +A [database proxy](configuration-database.md) manages a pool of database connections and relays queries from a function\. This enables a function to reach high concurrency levels without exhausting database connections\. + +**File systems access** +You can configure a function to mount an [Amazon Elastic File System \(Amazon EFS\) file system](configuration-filesystem.md) to a local directory\. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency\. + +## Getting started with Lambda + +To work effectively with Lambda, you need coding experience and expertise in the following domains: ++ Linux OS and commands, as well as concepts such as processes, threads, and file permissions\. ++ Cloud concepts and IP networking concepts \(for public and private networks\)\. ++ Distributed computing concepts such as HTML as an IPC, queues, messaging, notifications, and concurrency\. ++ Familiarity with security services and concepts: AWS Identity and Access Management \(IAM\) and access control principles, and AWS Key Management Service \(AWS KMS\) and public key infrastructure\. ++ Familiarity with key services that interact with Lambda: Amazon API Gateway, Amazon S3, Amazon Simple Queue Service \(Amazon SQS\), and DynamoDB\. ++ Configuring EC2 instances with Linux\. + +If you are a first\-time user of Lambda, we recommend that you start with the following topics to help you learn the basics: + +1. **Read the [Lambda product overview](http://aws.amazon.com/lambda/) and explore the [Lambda getting started](http://aws.amazon.com/lambda/getting-started/) page\.** + +1. **To create and test a Lambda function using the Lambda console, try the [console\-based getting started exercise](getting-started.md)\.** This exercise teaches you about the Lambda programming model and other concepts\. + +1. **If you are familiar with container image workflows, try the getting started exercise to [create a Lambda function defined as a container image](getting-started-create-function.md#gettingstarted-images)\.** + + AWS also provides the following resources for learning about serverless applications and Lambda: ++ The [AWS Compute Blog](http://aws.amazon.com/blogs/compute/ ) includes useful articles about Lambda\. ++ [AWS Serverless](https://serverlessland.com/) provides blogs, videos, and training related to AWS serverless development\. ++ The [AWS Online Tech Talks](https://www.youtube.com/channel/UCT-nPlVzJI-ccQXlxjSvJmw) YouTube channel includes videos about Lambda\-related topics\. For an overview of serverless applications and Lambda, see the [Introduction to AWS Lambda & Serverless Applications](https://www.youtube.com/watch?v=EBSdyoO3goc) video\. + +## Related services -## Are you a first\-time user of AWS Lambda? +[Lambda integrates with other AWS services](lambda-services.md) to invoke functions based on events that you specify\. For example: ++ Use [API Gateway](services-apigateway.md) to provide a secure and scalable gateway for web APIs that route HTTP requests to Lambda functions\. ++ For services that generate a queue or data stream \(such as [DynamoDB](with-ddb.md) and [Kinesis](with-kinesis.md)\), have Lambda read data from the services, create an event, and invoke your function to process the event\. ++ Define [Amazon S3](with-s3.md) events that invoke a Lambda function to process Amazon S3 objects, for example, when an object is created or deleted\. ++ Use a Lambda function to process [Amazon SQS](with-sqs.md) messages or [Amazon Simple Notification Service \(Amazon SNS\)](with-sns.md) notifications\. ++ Use [AWS Step Functions](lambda-stepfunctions.md) to connect Lambda functions together into serverless workflows called state machines\. -If you are a first\-time user of AWS Lambda, we recommend that you review the following in order: +## Accessing Lambda -1. **Read the product overview and watch the introductory video on the [AWS Lambda webpage](http://aws.amazon.com/lambda/)\.** +You can create, invoke, and manage your Lambda functions using any of the following interfaces: ++ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Configuring functions in the console](configuration-console.md)\. ++ **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. ++ **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. ++ **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(AWS CDK\)](http://aws.amazon.com/cdk)\. ++ **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [AWS SAM](lambda-settingup.md#lambda-settingup-awssam)\. -1. **Try the console\-based getting started exercise\.** This exercise guides you through creating and testing a Lambda function using the AWS Management Console\. You also learn about the programming model and other Lambda concepts\. For instructions, see [Getting started with Lambda](getting-started.md)\. -1. **Try the getting started exercise for container images\.** This exercise guides you through creating and testing a Lambda function defined as a container image\. For instructions, see [Create a function defined as a container image](getting-started-create-function.md#gettingstarted-images)\. -1. **Read about deploying applications with Lambda\.** The [AWS Lambda applications](deploying-lambda-apps.md) section of this guide introduces various Lambda components that you work with to create an end\-to\-end experience\. +## Pricing for Lambda -Beyond the getting started exercises, you can also explore the various use cases, each of which includes a tutorial that walks you through an example scenario\. Depending on your application needs \(for example, whether you want event\-driven Lambda function invocation or on\-demand invocation\), you can follow tutorials that meet your specific needs\. For more information on the various use cases, see [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +There is no additional charge for creating Lambda functions\. There are charges for running a function and for data transfer between Lambda and other AWS services\. Some optional Lambda features \(such as [provisioned concurrency](configuration-concurrency.md)\) also incur charges\. For more information, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. \ No newline at end of file diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 2c2cb972..b0312a74 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -13,13 +13,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index 7c711bb4..d4413760 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -9,13 +9,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index ff9e2917..0287e764 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -79,7 +79,7 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [ New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. **Topics** + [Execution role permissions](#events-dynamodb-permissions) @@ -515,9 +515,9 @@ When configuring reporting on batch item failures, the `StreamsEventResponse` cl ``` { - "BatchItemFailures": [ + "batchItemFailures": [ { - "ItemIdentifier": "" + "itemIdentifier": "" } ] } diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 6e39e0bb..36f9a21e 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -17,13 +17,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index b1e09fd7..783c19fc 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -59,7 +59,7 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [ New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. **Topics** + [Configuring your data stream and function](#services-kinesis-configure) @@ -464,9 +464,9 @@ When configuring reporting on batch item failures, the `StreamsEventResponse` cl ``` { - "BatchItemFailures": [ + "batchItemFailures": [ { - "ItemIdentifier": "" + "itemIdentifier": "" } ] } @@ -541,7 +541,7 @@ public class ProcessKinesisRecords implements RequestHandler Date: Mon, 3 May 2021 20:09:14 +0300 Subject: [PATCH 38/94] #276 - Add error handling for function callLambda call in init. --- sample-apps/blank-go/function/main.go | 83 ++++++++++++++------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/sample-apps/blank-go/function/main.go b/sample-apps/blank-go/function/main.go index fb45d288..bc1a5c3d 100644 --- a/sample-apps/blank-go/function/main.go +++ b/sample-apps/blank-go/function/main.go @@ -1,57 +1,60 @@ package main import ( - "os" - "log" - "context" - "encoding/json" - runtime "github.com/aws/aws-lambda-go/lambda" - "github.com/aws/aws-lambda-go/events" - "github.com/aws/aws-lambda-go/lambdacontext" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/lambda" + "context" + "encoding/json" + "github.com/aws/aws-lambda-go/events" + runtime "github.com/aws/aws-lambda-go/lambda" + "github.com/aws/aws-lambda-go/lambdacontext" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/lambda" + "log" + "os" ) var client = lambda.New(session.New()) func init() { - callLambda() + _, err := callLambda() + if err != nil { + log.Printf("ERROR calling GetAccountSettings API: %s", err) + } } func callLambda() (string, error) { - input := &lambda.GetAccountSettingsInput{} - req, resp := client.GetAccountSettingsRequest(input) - err := req.Send() - output, _ := json.Marshal(resp.AccountUsage) - return string(output), err + input := &lambda.GetAccountSettingsInput{} + req, resp := client.GetAccountSettingsRequest(input) + err := req.Send() + output, _ := json.Marshal(resp.AccountUsage) + return string(output), err } func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { - // event - eventJson, _ := json.MarshalIndent(event, "", " ") - log.Printf("EVENT: %s", eventJson) - // environment variables - log.Printf("REGION: %s", os.Getenv("AWS_REGION")) - log.Println("ALL ENV VARS:") - for _, element := range os.Environ() { - log.Println(element) - } - // request context - lc, _ := lambdacontext.FromContext(ctx) - log.Printf("REQUEST ID: %s", lc.AwsRequestID) - // global variable - log.Printf("FUNCTION NAME: %s", lambdacontext.FunctionName) - // context method - deadline, _ := ctx.Deadline() - log.Printf("DEADLINE: %s", deadline) - // AWS SDK call - usage, err := callLambda() - if err != nil { - return "ERROR", err - } - return usage, nil + // event + eventJson, _ := json.MarshalIndent(event, "", " ") + log.Printf("EVENT: %s", eventJson) + // environment variables + log.Printf("REGION: %s", os.Getenv("AWS_REGION")) + log.Println("ALL ENV VARS:") + for _, element := range os.Environ() { + log.Println(element) + } + // request context + lc, _ := lambdacontext.FromContext(ctx) + log.Printf("REQUEST ID: %s", lc.AwsRequestID) + // global variable + log.Printf("FUNCTION NAME: %s", lambdacontext.FunctionName) + // context method + deadline, _ := ctx.Deadline() + log.Printf("DEADLINE: %s", deadline) + // AWS SDK call + usage, err := callLambda() + if err != nil { + return "ERROR", err + } + return usage, nil } func main() { - runtime.Start(handleRequest) -} \ No newline at end of file + runtime.Start(handleRequest) +} From 016de409939cb0d99327895b40a5090dd6c350cd Mon Sep 17 00:00:00 2001 From: gytisrepecka Date: Mon, 3 May 2021 20:23:27 +0300 Subject: [PATCH 39/94] #276 - Remove callLambda within init function as it does not return anything. Function callLambda is still called from handleRequest which is expected to return string and error - no need to query GetAccountSettings API twice. --- sample-apps/blank-go/function/main.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sample-apps/blank-go/function/main.go b/sample-apps/blank-go/function/main.go index bc1a5c3d..04d89f09 100644 --- a/sample-apps/blank-go/function/main.go +++ b/sample-apps/blank-go/function/main.go @@ -14,13 +14,6 @@ import ( var client = lambda.New(session.New()) -func init() { - _, err := callLambda() - if err != nil { - log.Printf("ERROR calling GetAccountSettings API: %s", err) - } -} - func callLambda() (string, error) { input := &lambda.GetAccountSettingsInput{} req, resp := client.GetAccountSettingsRequest(input) From 097f8fc10c803be2aabd6b0ba08e1f9882fc6e4c Mon Sep 17 00:00:00 2001 From: gytisrepecka Date: Mon, 3 May 2021 20:26:21 +0300 Subject: [PATCH 40/94] #276 - Fix element name to FunctionCount in error message to avoid misleading notice. --- sample-apps/blank-go/function/main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/blank-go/function/main_test.go b/sample-apps/blank-go/function/main_test.go index bf192bd6..277a3cf6 100644 --- a/sample-apps/blank-go/function/main_test.go +++ b/sample-apps/blank-go/function/main_test.go @@ -33,7 +33,7 @@ func TestMain(t *testing.T) { } t.Log(result) if !strings.Contains(result, "FunctionCount") { - t.Errorf("Output does not contain FunctionCode.") + t.Errorf("Output does not contain FunctionCount.") } } func ReadJSONFromFile(t *testing.T, inputFile string) []byte { From d9c31dccca17a0dbfa5d6f7e515a1d3099a9a92f Mon Sep 17 00:00:00 2001 From: nickcox Date: Tue, 4 May 2021 18:43:11 +1000 Subject: [PATCH 41/94] Update Nodejs example to forward CMD arguments The nodejs example doesn't seem to work as given. Shouldn't it forward the handler argument from CMD as with the Python example? --- doc_source/images-test.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index deba8173..74d6a73a 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -82,9 +82,9 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric + exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric $@ else - exec /usr/bin/npx aws-lambda-ric + exec /usr/bin/npx aws-lambda-ric $@ fi ``` @@ -144,4 +144,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. \ No newline at end of file + This command invokes the function running in the container image and returns a response\. From 377fd133dc67d97aeffc022f8eaed06acb7edbf1 Mon Sep 17 00:00:00 2001 From: Daniel Garces Date: Fri, 7 May 2021 15:46:00 -0400 Subject: [PATCH 42/94] Update README.md to reference correct filename of cleanup script README.md currently references ./8-cleanup.sh in order to run the cleanup script. This file currently exists in the repo as 7-cleanup.sh --- sample-apps/rds-mysql/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/rds-mysql/README.md b/sample-apps/rds-mysql/README.md index c1d82810..c29f1a7f 100644 --- a/sample-apps/rds-mysql/README.md +++ b/sample-apps/rds-mysql/README.md @@ -138,4 +138,4 @@ For more information, see [Configuring database access](https://docs.aws.amazon. To delete the application, run the cleanup script. - rds-mysql$ ./8-cleanup.sh + rds-mysql$ ./7-cleanup.sh From 3cf6c95fe44ee304ce96826b9cab656b32433598 Mon Sep 17 00:00:00 2001 From: Mirek Svoboda <7804468+GoodMirek@users.noreply.github.com> Date: Mon, 24 May 2021 21:42:16 +0200 Subject: [PATCH 43/94] Add VPC endpoints as alternative to NAT gateway Error messages in Lambda console indicate that it is possible to use AWS VPC Endpoints for LAmbda and STS services, instead of NAT gateway. It indeed works, but this alternative was not documented so far. --- doc_source/services-msk-topic-add.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md index 87d49a38..94d769a9 100644 --- a/doc_source/services-msk-topic-add.md +++ b/doc_source/services-msk-topic-add.md @@ -12,6 +12,7 @@ This section describes how to add your Kafka cluster and topic as a function tri To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, we recommend: + Configuring one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. ++ Alternatively, instead of NAT gateway, deploy VPC Endpoints (PrivateLink) for Lambda and STS services. Your Amazon VPC security groups must be configured with the following rules \(at minimum\): + Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. @@ -56,4 +57,4 @@ The following example uses the [https://awscli.amazonaws.com/v2/documentation/ap ``` aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -``` \ No newline at end of file +``` From 3cc2149acd68f8497998312af2307b9c834858b7 Mon Sep 17 00:00:00 2001 From: Mirek Svoboda Date: Tue, 25 May 2021 08:04:58 +0200 Subject: [PATCH 44/94] Add VPC endpoint for Secrets Manager if authentication is required --- doc_source/services-msk-topic-add.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md index 94d769a9..62f8eb85 100644 --- a/doc_source/services-msk-topic-add.md +++ b/doc_source/services-msk-topic-add.md @@ -12,7 +12,7 @@ This section describes how to add your Kafka cluster and topic as a function tri To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, we recommend: + Configuring one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -+ Alternatively, instead of NAT gateway, deploy VPC Endpoints (PrivateLink) for Lambda and STS services. ++ Alternatively, instead of NAT gateway, deploy VPC Endpoints (PrivateLink) for Lambda and STS services\. If authentication is required, then deploy also VPC Endpoint for Secrets Manager\. Your Amazon VPC security groups must be configured with the following rules \(at minimum\): + Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. From 746224008a1677657ae0b6e8e69308d20be1b3ab Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 3 Jun 2021 09:27:41 -0700 Subject: [PATCH 45/94] periodic update of documentation fixes --- doc_source/best-practices.md | 2 +- doc_source/configuration-aliases.md | 6 +- doc_source/configuration-concurrency.md | 6 +- doc_source/configuration-database.md | 1 + doc_source/configuration-vpc.md | 4 +- doc_source/csharp-tracing.md | 2 +- doc_source/deploying-lambda-apps.md | 2 +- doc_source/gettingstarted-concepts.md | 2 +- doc_source/gettingstarted-features.md | 2 +- doc_source/gettingstarted-limits.md | 6 +- doc_source/golang-tracing.md | 2 +- doc_source/images-create.md | 35 ++- doc_source/images-test.md | 10 +- doc_source/index.md | 15 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/invocation-images.md | 4 +- doc_source/invocation-scaling.md | 2 +- doc_source/java-tracing.md | 4 +- doc_source/kafka-hosting.md | 29 -- doc_source/kafka-smaa.md | 9 - doc_source/kafka-using-cluster.md | 56 ---- doc_source/lambda-csharp.md | 10 +- doc_source/lambda-intro-execution-role.md | 2 +- doc_source/lambda-kafka.md | 13 - doc_source/lambda-nodejs.md | 6 +- doc_source/lambda-python.md | 8 +- doc_source/lambda-releases.md | 14 +- doc_source/lambda-runtimes.md | 19 +- doc_source/lambda-services.md | 2 +- doc_source/monitoring-insights.md | 2 +- doc_source/msk-permissions.md | 42 --- doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-package.md | 2 +- doc_source/nodejs-tracing.md | 4 +- doc_source/powershell-handler.md | 2 +- doc_source/python-package-create.md | 24 +- doc_source/python-package.md | 2 +- doc_source/python-tracing.md | 10 +- doc_source/ruby-package.md | 2 +- doc_source/ruby-tracing.md | 10 +- doc_source/runtime-support-policy.md | 13 +- doc_source/runtimes-api.md | 130 +++++++-- doc_source/runtimes-context.md | 2 +- doc_source/runtimes-extensions-api.md | 117 +++++--- doc_source/runtimes-logs-api.md | 294 ++++++++++++-------- doc_source/samples-blank.md | 14 +- doc_source/samples-errorprocessor.md | 2 +- doc_source/samples-listmanager.md | 2 +- doc_source/services-cognito.md | 2 +- doc_source/services-ec2-tutorial.md | 2 +- doc_source/services-ec2.md | 4 +- doc_source/services-iotevents.md | 3 +- doc_source/services-msk-topic-add.md | 59 ---- doc_source/services-s3-batch.md | 2 +- doc_source/services-smaa-topic-add.md | 57 ---- doc_source/services-xray.md | 10 +- doc_source/smaa-permissions.md | 81 ------ doc_source/troubleshooting-deployment.md | 2 +- doc_source/troubleshooting-execution.md | 8 +- doc_source/using-extensions.md | 10 +- doc_source/welcome.md | 16 +- doc_source/with-kafka.md | 237 ++++++++++++++++ doc_source/with-mq.md | 6 +- doc_source/with-msk.md | 114 +++++++- doc_source/with-s3.md | 2 +- doc_source/with-sqs.md | 4 +- 66 files changed, 900 insertions(+), 670 deletions(-) delete mode 100644 doc_source/kafka-hosting.md delete mode 100644 doc_source/kafka-smaa.md delete mode 100644 doc_source/kafka-using-cluster.md delete mode 100644 doc_source/lambda-kafka.md delete mode 100644 doc_source/msk-permissions.md delete mode 100644 doc_source/services-msk-topic-add.md delete mode 100644 doc_source/services-smaa-topic-add.md delete mode 100644 doc_source/smaa-permissions.md create mode 100644 doc_source/with-kafka.md diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index f531f311..8ee37b62 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -48,7 +48,7 @@ For more information about best practices for Lambda applications, see [Applicat **To find the right memory configuration** for your functions, we recommend using the open source AWS Lambda Power Tuning project\. For more information, see [AWS Lambda Power Tuning](https://github.com/alexcasalboni/aws-lambda-power-tuning) on GitHub\. - To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [Creating faster AWS Lambda functions with AVX2](https://aws.amazon.com/blogs/compute/creating-faster-aws-lambda-functions-with-avx2/)\. + To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [ Creating faster AWS Lambda functions with AVX2](http://aws.amazon.com/blogs/ompute/creating-faster-aws-lambda-functions-with-avx2/)\. + **Load test your Lambda function** to determine an optimum timeout value\. It is important to analyze how long your function runs so that you can better determine any problems with a dependency service that may increase the concurrency of the function beyond what you expect\. This is especially important when your Lambda function makes network calls to resources that may not handle Lambda's scaling\. + **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. + **Be familiar with [Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 9af84539..769e0491 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -35,19 +35,19 @@ You can create a function alias using the Lambda console\. ## Managing aliases with the Lambda API -To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html) command\. +To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-alias.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-alias.html) command\. ``` aws lambda create-alias --function-name my-function --name alias-name --function-version version-number --description " " ``` -To change an alias to point a new version of the function, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html) command\. +To change an alias to point a new version of the function, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/update-alias.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-alias.html) command\. ``` aws lambda update-alias --function-name my-function --name alias-name --function-version version-number ``` -To delete an alias, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html) command\. +To delete an alias, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-alias.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-alias.html) command\. ``` aws lambda delete-alias --function-name my-function --name alias-name diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 1e3b8cc9..f1cfbbbb 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -2,9 +2,9 @@ Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. Concurrency is subject to a Regional [quota](gettingstarted-limits.md) that is shared by all functions in a Region\. -There are two types of concurrency available: -+ Reserved concurrency – Reserved concurrency creates a pool of requests that can only be used by its function, and also prevents its function from using unreserved concurrency\. -+ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond to your function's invocations\. +There are two types of concurrency controls available: ++ Reserved concurrency – Reserved concurrency guarantees the maximum number of concurrent instances for the function\. When a function has reserved concurrency, no other function can use that concurrency\. There is no charge for configuring reserved concurrency for a function\. ++ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond immediately to your function's invocations\. Note that configuring provisioned concurrency incurs charges to your AWS account\. This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index c10ef15a..b7a76747 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -75,6 +75,7 @@ exports.handler = async (event) => { var query = event.query var result connection.connect() +} ``` For more information, see [IAM database authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) in the Amazon RDS User Guide\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index c05e249b..13f14522 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -2,11 +2,11 @@ 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 while the function is running\. -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 subnet in your function's VPC configuration\. This process can take about a minute\. +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 subnet in your function's VPC configuration\. This process can take several minutes\. 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\. +Multiple functions can share a network interface, if the functions share the same subnet and security group\. 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\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index ea1e1aaa..bae18fb8 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index 19cd514e..9e76814a 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -8,7 +8,7 @@ The [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverle The [AWS CLI](lambda-settingup.md#lambda-settingup-awscli) and [SAM CLI](lambda-settingup.md#lambda-settingup-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates and testing locally\. -When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [What are connections?](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. +When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [ What are connections?](https://docs.aws.amazon.com/connect/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. For more information about designing Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 79ba9114..91685abf 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -83,7 +83,7 @@ A Lambda *layer* is a \.zip file archive that can contain additional code or oth Layers provide a convenient way to package libraries and other dependencies that you can use with your Lambda functions\. Using layers reduces the size of uploaded deployment archives and makes it faster to deploy your code\. Layers also promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. -You can include up to five layers per function\. Layers count towards the standard Lambda [deployment size quotas](https://docs.amazonaws.cn/en_us/lambda/latest/dg/gettingstarted-limits.html)\. When you include a layer in a function, the contents are extracted to the `/opt` directory in the execution environment\. +You can include up to five layers per function\. Layers count towards the standard Lambda [deployment size quotas](gettingstarted-limits.md)\. When you include a layer in a function, the contents are extracted to the `/opt` directory in the execution environment\. By default, the layers that you create are private to your AWS account\. You can choose to share a layer with other accounts or to make the layer public\. If your functions consume a layer that a different account published, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function or update functions using a deleted layer version\. diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index a40b35da..709727ba 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -95,7 +95,7 @@ For more information, see [Configuring destinations for asynchronous invocation] When you create a function in the Lambda console, you can choose to start from scratch, use a blueprint, use a [container image](gettingstarted-package.md#gettingstarted-package-images), or deploy an application from the [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html)\. A blueprint provides sample code that shows how to use Lambda with an AWS service or a popular third\-party application\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. -Blueprints are provided for use under the [Amazon Software License](https://aws.amazon.com/asl/)\. They are available only in the Lambda console\. +Blueprints are provided for use under the [Amazon Software License](http://aws.amazon.com/asl/)\. They are available only in the Lambda console\. ## Testing and deployment tools diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 2af77154..b2821df3 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -6,8 +6,8 @@ Lambda sets quotas for the amount of compute and storage resources that you can | Resource | Default quota | Can be increased up to | | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | -| Function and layer storage \(\.zip file archives\) | 75 GB | Terabytes | -| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | +| Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. @@ -24,7 +24,7 @@ The following quotas apply to function configuration, deployments, and execution | Function [layers](configuration-layers.md) | five layers | | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | | [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | -| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\), 512 KB maximum for an individual file | +| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | | [Container image](lambda-images.md) code package size | 10 GB | | Test events \(console editor\) | 10 | | `/tmp` directory storage | 512 MB | diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 7822bf4c..94755a2a 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 9b67b93f..10f34f47 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -8,6 +8,8 @@ You can also use an alternative base image from another container registry\. Lam For example applications, including a Node\.js example and a Python example, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. +After you create a container image in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. + **Topics** + [Image types](#images-types) + [Container tools](#images-tools) @@ -83,7 +85,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do 1. On your local machine, create a project directory for your new function\. -1. Create an app directory in the project directory, and then add your function handler code to the app directory\. +1. Create a directory named **app** in in the project directory, and then add your function handler code to the app directory\. 1. Use a text editor to create a new Dockerfile\. @@ -91,13 +93,14 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do + LAMBDA\_TASK\_ROOT=/var/task + LAMBDA\_RUNTIME\_DIR=/var/runtime - The following shows an example Dockerfile for Node\.js version 12\. : + The following shows an example Dockerfile for Node\.js version 14\. : ``` - FROM public.ecr.aws/lambda/nodejs:12 + FROM public.ecr.aws/lambda/nodejs:14 # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 - COPY app.js package.json /var/task/ + # Assumes your function is named "app.js", and there is a package.json file in the app directory. + COPY app.js package.json /var/task/ # Install NPM dependencies for function RUN npm install @@ -112,6 +115,12 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do docker build -t hello-world . ``` +1. Start the Docker image with the `docker run` command\. For this example, enter `hello-world` as the image name\. + + ``` + docker run -p 9000:8080 hello-world + ``` + 1. \(Optional\) Test your application locally using the [runtime interface emulator](images-test.md)\. From a new terminal window, post an event to the following endpoint using a `curl` command: ``` @@ -126,6 +135,12 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com ``` +1. Create a repository in Amazon ECR using the `create-repository` command\. + + ``` + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + ``` + 1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. ``` @@ -133,6 +148,8 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` +Now that your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. + ## Create an image from an alternative base image **Prerequisites** @@ -146,7 +163,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do 1. On your local machine, create a project directory for your new function\. -1. Create an app directory in the project directory, and then add your function handler code to the app directory\. +1. Create a directory named **app** in the project directory, and then add your function handler code to the app directory\. 1. Use a text editor to create a new Dockerfile with the following configuration: + Set the `FROM` property to the URI of the base image\. @@ -213,6 +230,12 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com ``` +1. Create a repository in Amazon ECR using the `create-repository` command\. + + ``` + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + ``` + 1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. ``` @@ -220,6 +243,8 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` +Now that your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. + ## Create an image using the AWS SAM toolkit You can use the AWS Serverless Application Model \(AWS SAM\) toolkit to create and deploy a function defined as a container image\. For a new project, you can use the AWS SAM CLI `init` command to set up the scaffolding for your project in your preferred runtime\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index deba8173..5f278440 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -82,9 +82,9 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric + exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric $@ else - exec /usr/bin/npx aws-lambda-ric + exec /usr/bin/npx aws-lambda-ric $@ fi ``` @@ -93,9 +93,9 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie usr/local/bin/python -m awslambdaric $@ + exec /usr/local/bin/aws-lambda-rie /usr/local/bin/python -m awslambdaric $@ else - exec usr/local/bin/python -m awslambdaric $@ + exec /usr/local/bin/python -m awslambdaric $@ fi ``` @@ -132,7 +132,7 @@ You install the runtime interface emulator to your local machine\. When you run ``` docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ - --entrypoint /aws-lambda/aws-lambda-rie myfunction:latest \ + --entrypoint /aws-lambda/aws-lambda-rie hello-world:latest \ <(optional) image command> ``` diff --git a/doc_source/index.md b/doc_source/index.md index c45b7949..7a2b41ed 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -1,7 +1,7 @@ # AWS Lambda Developer Guide ----- -*****Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** +*****Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** ----- Amazon's trademarks and trade dress may not be used in @@ -70,8 +70,8 @@ Amazon's trademarks and trade dress may not be used in + [Runtime support for Lambda container images](runtimes-images.md) + [AWS Lambda runtime API](runtimes-api.md) + [Lambda Extensions API](runtimes-extensions-api.md) + + [Lambda Logs API](runtimes-logs-api.md) + [Modifying the runtime environment](runtimes-modify.md) - + [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) @@ -112,6 +112,7 @@ Amazon's trademarks and trade dress may not be used in + [Using Amazon EFS with Lambda](services-efs.md) + [Using AWS Lambda with AWS IoT](services-iot.md) + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) + + [Using Lambda with an Apache Kafka cluster](with-kafka.md) + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) @@ -119,6 +120,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) + [Using AWS Lambda with Amazon Lex](services-lex.md) + [Using Lambda with Amazon MQ](with-mq.md) + + [Using Lambda with Amazon MSK](with-msk.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + [Using AWS Lambda with Amazon S3](with-s3.md) @@ -139,15 +141,6 @@ Amazon's trademarks and trade dress may not be used in + [State machine application patterns](stepfunctions-patterns.md) + [Managing state machines in the Lambda console](stepfunctions-lc.md) + [Orchestration examples with Step Functions](services-stepfunctions.md) -+ [Using Lambda with an Apache Kafka cluster](lambda-kafka.md) - + [Hosting an Apache Kafka cluster](kafka-hosting.md) - + [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) - + [Using Lambda with Amazon MSK](with-msk.md) - + [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) - + [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) - + [Using Lambda with self-managed Apache Kafka](kafka-smaa.md) - + [Managing access and permissions for a self-managed Apache Kafka cluster](smaa-permissions.md) - + [Adding a self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 285b7ef7..15a739c4 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -7,7 +7,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md index 5059ae08..b0027372 100644 --- a/doc_source/invocation-images.md +++ b/doc_source/invocation-images.md @@ -19,7 +19,9 @@ You can use the Lambda API to get information about a function's state\. For mor ## Invoking the function -When you invoke the function, Lambda deploys the container image to an execution environment\. Lambda calls the code entry point specified in the function configuration \(the ENTRYPOINT and CMD [container image settings](images-create.md#images-parms)\)\. +When you invoke the function, Lambda deploys the container image to an execution environment\. Lambda initializes any [extensions](using-extensions.md#invocation-extensions-images) and then runs the function’s initialization code \(the code outside the main handler\)\. Note that function initialization duration is included in billed execution time\. + +Lambda then runs the function by calling the code entry point specified in the function configuration \(the ENTRYPOINT and CMD [container image settings](images-create.md#images-parms)\)\. ## Image security diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md index ef5329f2..38f3c55d 100644 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -2,7 +2,7 @@ The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event\. When the function returns a response, it stays active and waits to process additional events\. If you invoke the function again while the first event is being processed, Lambda initializes another instance, and the function processes the two events concurrently\. As more events come in, Lambda routes them to available instances and creates new instances as needed\. When the number of requests decreases, Lambda stops unused instances to free up scaling capacity for other functions\. - Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. + Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. Note that the burst concurrency quota is not per\-function; it applies to all of your functions in the Region\. **Burst concurrency quotas** + **3000** – US West \(Oregon\), US East \(N\. Virginia\), Europe \(Ireland\) diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 269149d7..410d2902 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -114,7 +114,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. diff --git a/doc_source/kafka-hosting.md b/doc_source/kafka-hosting.md deleted file mode 100644 index 096de4b5..00000000 --- a/doc_source/kafka-hosting.md +++ /dev/null @@ -1,29 +0,0 @@ -# Hosting an Apache Kafka cluster - -You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. - -This page describes the AWS and non\-AWS hosting options available for using your Kafka cluster as an for your Lambda function\. - -## Using a non\-AWS provider - -To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud provider, such as [CloudKarafka](https://www.cloudkarafka.com/)\. - -When you create a Kafka cluster using a non\-AWS provider, you receive the connection information for your cluster\. This information includes the Kafka cluster hostname, topic name, Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) user name and password, and bootstrap server host\-port pairs\. - -For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. - -## Using Amazon MSK - -To host your Apache Kafka cluster and topics, you can use [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html)\. - -When you create an Amazon MSK cluster, you receive the required hosting and connection information of the cluster\. This information includes the Kafka cluster hostname, topic name, SASL/SCRAM user name and password, and bootstrap server host\-port pairs\. - -To support your Kafka cluster on Amazon MSK, you might need to create Amazon Virtual Private Cloud \(Amazon VPC\) networking components\. For more information, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. - -For more information about using an MSK cluster, see [Using Lambda with Amazon MSK](with-msk.md)\. - -## Using other AWS hosting options - -You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. - -For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file diff --git a/doc_source/kafka-smaa.md b/doc_source/kafka-smaa.md deleted file mode 100644 index df8fc0ed..00000000 --- a/doc_source/kafka-smaa.md +++ /dev/null @@ -1,9 +0,0 @@ -# Using Lambda with self\-managed Apache Kafka - -You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. - -This section describes how to use a function with a self\-managed Kafka cluster to process records in an Kafka topic\. - -**Topics** -+ [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md) -+ [Adding a self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file diff --git a/doc_source/kafka-using-cluster.md b/doc_source/kafka-using-cluster.md deleted file mode 100644 index 61272809..00000000 --- a/doc_source/kafka-using-cluster.md +++ /dev/null @@ -1,56 +0,0 @@ -# Using an Apache Kafka cluster as an event source for Lambda - - - -You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. - -This page describes how to use your Kafka cluster as an event source for your Lambda function\. - -## Prerequisites -+ A [Lambda function](getting-started-create-function.md) with function code in a [supported runtime](lambda-runtimes.md) to invoke your cluster -+ A [Lambda execution role](lambda-intro-execution-role.md) - -## How it works - - - -When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. -+ If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. -+ If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. -+ Lambda reads event data from the Kafka topics that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. -+ Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. -+ Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. - -For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. - -## Event source API operations - -When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS Command Line Interface \(AWS CLI\), Lambda uses APIs to process your request\. - -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - -## Event source mapping errors - -When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. - -To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: - -**`ESM_CONFIG_NOT_VALID`** -The event source mapping configuration is not valid\. - -**`EVENT_SOURCE_AUTHN_ERROR`** -Lambda couldn't authenticate the event source\. - -**`EVENT_SOURCE_AUTHZ_ERROR`** -Lambda doesn't have the required permissions to access the event source\. - -**`FUNCTION_CONFIG_NOT_VALID`** -The Lambda function configuration is not valid\. - -**Note** -If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. \ No newline at end of file diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index 407b533d..82c2db32 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -27,9 +27,13 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | **Note** -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. +For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. + +To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. + +**Sample Lambda applications in C\#** ++ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. **Topics** + [AWS Lambda function handler in C\#](csharp-handler.md) diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index c738417e..525bb027 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -146,7 +146,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) + [Amazon Simple Queue Service](with-sqs.md) In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-kafka.md b/doc_source/lambda-kafka.md deleted file mode 100644 index 0cb6ab64..00000000 --- a/doc_source/lambda-kafka.md +++ /dev/null @@ -1,13 +0,0 @@ -# Using Lambda with an Apache Kafka cluster - -[Apache Kafka](https://kafka.apache.org/) is a distributed data store optimized for ingesting and processing streaming data in real time\. - -Kafka is primarily used to build streaming data pipelines and applications that adapt to the data streams\. It combines messaging, storage, and stream processing to allow storage and analysis of both historical and real\-time data\. - -This section describes how to use an AWS or non\-AWS hosted Kafka cluster with Lambda\. - -**Topics** -+ [Hosting an Apache Kafka cluster](kafka-hosting.md) -+ [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) -+ [Using Lambda with Amazon MSK](with-msk.md) -+ [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 2df01c9f..6cb32e93 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,9 +9,9 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.880\.0 | Amazon Linux 2 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 158cf7c8..7c5c94ce 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -12,10 +12,10 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | **To create a Python function** diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index d5b2158b..fbe5224f 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -17,12 +17,12 @@ The following table describes the important changes to the *AWS Lambda Developer | [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | | [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window \(MaximumBatchingWindowInSeconds\) for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | | [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | -| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | -| [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | +| [CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(CDK\) for TypeScript\. The CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | +| [Support for \.NET Core 3\.1\.0 runtime in ](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | | [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | | [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | -| [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](https://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | +| [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](http://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | | [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/API_FunctionConfiguration.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConfiguration.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | | [Provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss) | You can now allocate provisioned concurrency for a function version or alias\. Provisioned concurrency enables a function to scale without fluctuations in latency\. For details, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Create a database proxy](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss) | You can now use the Lambda console to create a database proxy for a Lambda function\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. For details, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | @@ -49,12 +49,12 @@ The following table describes the important changes to the *AWS Lambda Developer | [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | -| [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. For details, see [AWS GovCloud \(US\-East\) now open](https://aws.amazon.com/blogs/aws/aws-govcloud-us-east-now-open/?icmpid=docs_lambda_rss) on the AWS blog\. | November 12, 2018 | -| [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | +| [ GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. | November 12, 2018 | +| [Moved SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | | [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | | [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | -| [Support for PowerShell Core language in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | -| [Support for \.NET Core 2\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | +| [Support for PowerShell Core language in ](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | +| [Support for \.NET Core 2\.1\.0 runtime in ](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | | [Updates now available over RSS](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | You can now subscribe to an RSS feed to follow releases for this guide\. | July 5, 2018 | | [Support for Amazon SQS as event source](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Amazon Simple Queue Service \(Amazon SQS\) as an event source\. For more information, see [Invoking Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss)\. | June 28, 2018 | | [China \(Ningxia\) Region](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the China \(Ningxia\) Region\. For more information about Lambda Regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html?icmpid=docs_lambda_rss) in the *AWS General Reference*\. | June 28, 2018 | diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index d6936b4a..d94696dc 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -21,9 +21,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.880\.0 | Amazon Linux 2 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. @@ -33,10 +33,10 @@ For end of support information about Node\.js 10, see [Runtime support policy](r | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. @@ -76,6 +76,9 @@ For end of support information about Ruby 2\.5, see [Runtime support policy](run | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | +**Note** +For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. + To use other languages in Lambda, you can implement a [custom runtime](runtimes-custom.md)\. The Lambda execution environment provides a [runtime interface](runtimes-api.md) for getting invocation events and sending responses\. You can deploy a custom runtime alongside your function code, or in a [layer](configuration-layers.md)\. @@ -92,8 +95,8 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- + [Runtime support for Lambda container images](runtimes-images.md) + [AWS Lambda runtime API](runtimes-api.md) + [Lambda Extensions API](runtimes-extensions-api.md) ++ [Lambda Logs API](runtimes-logs-api.md) + [Modifying the runtime environment](runtimes-modify.md) -+ [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 5bac8e85..601fb137 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -53,7 +53,7 @@ For services that generate a queue or data stream, you create an [event source m + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index d8dead06..95336612 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -49,7 +49,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu ## Enabling Lambda Insights programmatically -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. diff --git a/doc_source/msk-permissions.md b/doc_source/msk-permissions.md deleted file mode 100644 index 403f7af9..00000000 --- a/doc_source/msk-permissions.md +++ /dev/null @@ -1,42 +0,0 @@ -# Managing access and permissions for an Amazon MSK cluster - -Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. - -This page describes how to grant permission to Lambda and other users of your Amazon MSK cluster\. - -## Required Lambda function permissions - -To read records from your Amazon MSK cluster on your behalf, your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: -+ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) -+ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) - -## Adding a policy to your execution role - -Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. - -**To add an AWS managed policy** - -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. - -1. In the search box, enter the policy name \(`AWSLambdaMSKExecutionRole`\)\. - -1. Select the policy from the list, and then choose **Policy actions**, **Attach**\. - -1. Select your execution role from the list, and then choose **Attach policy**\. - -## Granting users access with an IAM policy - -By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon Managed Streaming for Apache Kafka Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -## Using SASL/SCRAM authentication - -Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Using Username and Password Authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. \ No newline at end of file diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index 406c5f25..2ff4c530 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -33,7 +33,7 @@ If your code performs an asynchronous task, return a promise to make sure that i ``` const https = require('https') -let url = "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html" +let url = "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html" exports.handler = async function(event) { const promise = new Promise(function(resolve, reject) { diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index 64882488..d04db7f6 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -8,7 +8,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. -+ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 6f2c191a..e3ab82dc 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -148,7 +148,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md index 2e5e7c32..a9827dd4 100644 --- a/doc_source/powershell-handler.md +++ b/doc_source/powershell-handler.md @@ -17,7 +17,7 @@ This script returns the FunctionName property that's obtained from the $LambdaCo **Note** You're required to use the `#Requires` statement within your PowerShell scripts to indicate the modules that your scripts depend on\. This statement performs two important tasks\. 1\) It communicates to other developers which modules the script uses, and 2\) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment\. For more information about the `#Requires` statement in PowerShell, see [ About requires](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-6)\. For more information about PowerShell deployment packages, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. -When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](https://aws.amazon.com/documentation/powershell/?id=docs_gateway)\. +When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](https://docs.aws.amazon.com/documentation/powershell/?id=docs_gateway)\. ## Returning data diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index dc71a008..417d545e 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -23,7 +23,7 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AW **To create the execution role** -1. Open a command prompt and use the [create\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/create-role.html) command to create an execution role named `lambda-ex`\. +1. Open a command prompt and use the [create\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/create-role.html) command to create an execution role named `lambda-ex`\. ------ #### [ macOS/Linux ] @@ -67,7 +67,7 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AW } ``` -1. Use the [attach\-role\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/attach-role-policy.html) command to add `AWSLambdaBasicExecutionRole` permissions to the role\. +1. Use the [attach\-role\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/attach-role-policy.html) command to add `AWSLambdaBasicExecutionRole` permissions to the role\. ``` $ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole @@ -184,7 +184,7 @@ Create the Lambda function using the execution role and deployment package that Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. **To invoke the function** -+ Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. ++ Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. ``` aws lambda invoke --function-name my-math-function --payload '{"action": "square","number": 3}' output.txt @@ -223,7 +223,7 @@ If you are using AWS CLI version 2, add the following command parameter: You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** -+ Use the [delete\-function](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-function.html) command\. ++ Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. ``` aws lambda delete-function --function-name my-function @@ -232,14 +232,14 @@ You can now delete the resources that you created for this tutorial, unless you This command produces no output\. **To delete the execution role policy** -+ Use the [delete\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-policy.html) command\. ++ Use the [delete\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-policy.html) command\. ``` aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole ``` **To delete the execution role** -+ Use the [delete\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-role.html) command\. ++ Use the [delete\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-role.html) command\. ``` aws iam delete-role --role-name lambda-ex @@ -255,7 +255,7 @@ This section describes how to create a Lambda function with runtime dependencies ### Overview -In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://docs\.aws\.amazon\.com/](https://docs.aws.amazon.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. +In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://www\.test\.com/](https://www.test.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. You'll learn how to: + Set up the directory structure of a deployment package \(\.zip file\)\. @@ -288,7 +288,7 @@ Create the \.zip file that Lambda uses as your deployment package\. ``` import requests def main(event, context): - response = requests.get("https://docs.aws.amazon.com") + response = requests.get("https://www.test.com/") print(response.text) return response.text if __name__ == "__main__": @@ -382,7 +382,7 @@ Create the Lambda function using the execution role and deployment package that Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. **To invoke the function** -+ Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. ++ Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. ------ #### [ macOS/Linux ] @@ -429,7 +429,7 @@ If you are using AWS CLI version 2, add the following command parameter: You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** -+ Use the [delete\-function](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-function.html) command\. ++ Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. ``` aws lambda delete-function --function-name my-function @@ -438,14 +438,14 @@ You can now delete the resources that you created for this tutorial, unless you This command produces no output\. **To delete the execution role policy** -+ Use the [delete\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-policy.html) command\. ++ Use the [delete\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-policy.html) command\. ``` aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole ``` **To delete the execution role** -+ Use the [delete\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-role.html) command\. ++ Use the [delete\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-role.html) command\. ``` aws iam delete-role --role-name lambda-ex diff --git a/doc_source/python-package.md b/doc_source/python-package.md index f507f007..daaff8a8 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -11,7 +11,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. -+ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 373542ae..b3129243 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -5,7 +5,7 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -45,9 +45,9 @@ jsonpickle==1.3 aws-xray-sdk==2.4.3 ``` -To instrumentAWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. +To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing anAWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** ``` import boto3 @@ -84,7 +84,7 @@ You can also instrument HTTP clients, record SQL queries, and create custom subs ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -129,7 +129,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index eebb0309..4ed7911d 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -8,7 +8,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. -+ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index bf39980b..ee881ffb 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -46,9 +46,9 @@ gem 'aws-sdk-lambda', '1.39.0' gem 'test-unit', '3.3.5' ``` -To instrumentAWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. +To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing anAWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** ``` # lambda_function.rb @@ -83,7 +83,7 @@ You can also instrument HTTP clients, record SQL queries, and create custom subs ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -128,7 +128,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index ccba88a3..200ce1ac 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -2,9 +2,11 @@ [Lambda runtimes](lambda-runtimes.md) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When security updates are no longer available for a component of a runtime, Lambda deprecates the runtime\. -Deprecation \(end of support\) for a runtime occurs in two phases\. In phase 1, Lambda no longer applies security patches or other updates to the runtime\. You can no longer create functions that use the runtime, but you can continue to update existing functions\. Note that existing functions that use the runtime are no longer eligible for technical support\. +Deprecation \(end of support\) for a runtime occurs in two phases\. In phase 1, Lambda no longer applies security patches or other updates to the runtime\. You can no longer create functions that use the runtime, but you can continue to update existing functions\. This includes updating the runtime version, and rolling back to the previous runtime version\. Note that functions that use a deprecated runtime are no longer eligible for technical support\. -In phase 2, which starts at least 30 days after the start of phase 1, you can no longer create or update functions that use the runtime\. However, existing functions that use the runtime remain available to process invocation events\. +In phase 2, which starts at least 30 days after the start of phase 1, you can no longer create or update functions that use the runtime\. To update a function, you need to migrate it to a supported runtime version\. After you migrate the function to a supported runtime version, you cannot rollback the function to the previous runtime\. + +Lambda does not block invocations of functions that use deprecated runtime versions\. Function invocations continue indefinitely after the runtime version reaches end of support\. However, AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. @@ -16,6 +18,7 @@ The following runtimes have reached or are scheduled for end of support: | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Aug 23, 2021 | Sept 23, 2021 | | Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | | Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | | Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Aug 30, 2021 | @@ -27,14 +30,12 @@ The following runtimes have reached or are scheduled for end of support: | \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | | May 30, 2019 | | \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | | July 30, 2019 | -In most cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. - -In some cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. +In almost all cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. In rare cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. **Language and framework support policies** + **Node\.js** – [github\.com](https://github.com/nodejs/Release#release-schedule) + **Python** – [devguide\.python\.org](https://devguide.python.org/#status-of-python-branches) + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) -+ **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) ++ **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/doc/devel/release.html) + **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file diff --git a/doc_source/runtimes-api.md b/doc_source/runtimes-api.md index da982192..8e13f1bf 100644 --- a/doc_source/runtimes-api.md +++ b/doc_source/runtimes-api.md @@ -2,9 +2,9 @@ AWS Lambda provides an HTTP API for [custom runtimes](runtimes-custom.md) to receive invocation events from Lambda and send response data back within the Lambda [execution environment](lambda-runtimes.md)\. -The OpenAPI specification for the runtime API version **2018\-06\-01** is available here: [runtime\-api\.zip](samples/runtime-api.zip) +The OpenAPI specification for the runtime API version **2018\-06\-01** is available in [runtime\-api\.zip](samples/runtime-api.zip) -Runtimes get an endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable, add the API version, and use the following resource paths to interact with the API\. +To create an API request URL, runtimes get the API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable, add the API version, and add the desired resource path\. **Example Request** @@ -15,8 +15,8 @@ curl "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/next" **Topics** + [Next invocation](#runtimes-api-next) + [Invocation response](#runtimes-api-response) -+ [Invocation error](#runtimes-api-invokeerror) + [Initialization error](#runtimes-api-initerror) ++ [Invocation error](#runtimes-api-invokeerror) ## Next invocation @@ -24,7 +24,7 @@ curl "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/next" **Method** – **GET** -Retrieves an invocation event\. The response body contains the payload from the invocation, which is a JSON document that contains event data from the function trigger\. The response headers contain additional data about the invocation\. +The runtime sends this message to Lambda to request an invocation event\. The response body contains the payload from the invocation, which is a JSON document that contains event data from the function trigger\. The response headers contain additional data about the invocation\. **Response headers** + `Lambda-Runtime-Aws-Request-Id` – The request ID, which identifies the request that triggered the function invocation\. @@ -42,7 +42,7 @@ Retrieves an invocation event\. The response body contains the payload from the + `Lambda-Runtime-Client-Context` – For invocations from the AWS Mobile SDK, data about the client application and device\. + `Lambda-Runtime-Cognito-Identity` – For invocations from the AWS Mobile SDK, data about the Amazon Cognito identity provider\. -Call `/runtime/invocation/next` to get the invocation event, and pass it to the function handler for processing\. Do not set a timeout on the `GET` call\. Between when Lambda bootstraps the runtime and when the runtime has an event to return, the runtime process may be frozen for several seconds\. +Do not set a timeout on the `GET` request as the response may be delayed\. Between when Lambda bootstraps the runtime and when the runtime has an event to return, the runtime process may be frozen for several seconds\. The request ID tracks the invocation within Lambda\. Use it to specify the invocation when you send the response\. @@ -54,7 +54,7 @@ The tracing header contains the trace ID, parent ID, and sampling decision\. If **Method** – **POST** -Sends an invocation response to Lambda\. After the runtime invokes the function handler, it posts the response from the function to the invocation response path\. For synchronous invocations, Lambda then sends the response back to the client\. +After the function has run to completion, the runtime sends an invocation response to Lambda\. For synchronous invocations, Lambda sends the response to the client\. **Example success request** @@ -63,42 +63,128 @@ REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/response" -d "SUCCESS" ``` -## Invocation error +## Initialization error -**Path** – `/runtime/invocation/AwsRequestId/error` +If the function returns an error or the runtime encounters an error during initialization, the runtime uses this method to report the error to Lambda\. + +**Path** – `/runtime/init/error` **Method** – **POST** -If the function returns an error, the runtime formats the error into a JSON document, and posts it to the invocation error path\. +**Headers** + +`Lambda-Runtime-Function-Error-Type` – Error type that the extension encountered\. Required: no\. -**Example request body** +This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: ++ Runtime\.NoSuchHandler ++ Extension\.APIKeyNotFound ++ Extension\.ConfigInvalid ++ Extension\.UnknownReason + +**Body parameters** + +`ErrorRequest` – Information about the error\. Required: no\. + +This field is a JSON object with the following structure: ``` { - "errorMessage" : "Error parsing event data.", - "errorType" : "InvalidEventDataException" + errorMessage: string (text description of the error), + errorType: string, + stackTrace: array of strings } ``` -**Example error request** +Note that Lambda accepts any value for `errorType`\. -``` -REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 -ERROR="{\"errorMessage\" : \"Error parsing event data.\", \"errorType\" : \"InvalidEventDataException\"}" -curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/error" -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" -``` +The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. -## Initialization error +**Example Function error** -**Path** – `/runtime/init/error` +``` +{ + "errorMessage" : "Error parsing event data.", + "errorType" : "InvalidEventDataException", + "stackTrace": [ ] +} +``` -**Method** – **POST** +**Response body parameters** ++ `StatusResponse` – String\. Status information, sent with 202 response codes\. ++ `ErrorResponse` – Additional error information, sent with the error response codes\. ErrorResponse contains an error type and an error message\. -If the runtime encounters an error during initialization, it posts an error message to the initialization error path\. +**Response codes** ++ 202 – Accepted ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. **Example initialization error request** ``` ERROR="{\"errorMessage\" : \"Failed to load function.\", \"errorType\" : \"InvalidFunctionException\"}" curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/init/error" -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" +``` + +## Invocation error + +If the function returns an error or the runtime encounters an error, the runtime uses this method to report the error to Lambda\. + +**Path** – `/runtime/invocation/AwsRequestId/error` + +**Method** – **POST** + +**Headers** + +`Lambda-Runtime-Function-Error-Type` – Error type that the extension encountered\. Required: no\. + +This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: ++ Runtime\.NoSuchHandler ++ Extension\.APIKeyNotFound ++ Extension\.ConfigInvalid ++ Extension\.UnknownReason + +**Body parameters** + +`ErrorRequest` – Information about the error\. Required: no\. + +This field is a JSON object with the following structure: + +``` +{ + errorMessage: string (text description of the error), + errorType: string, + stackTrace: array of strings +} +``` + +Note that Lambda accepts any value for `errorType`\. + +The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. + +**Example Function error** + +``` +{ + "errorMessage" : "Error parsing event data.", + "errorType" : "InvalidEventDataException", + "stackTrace": [ ] +} +``` + +**Response body parameters** ++ `StatusResponse` – String\. Status information, sent with 202 response codes\. ++ `ErrorResponse` – Additional error information, sent with the error response codes\. ErrorResponse contains an error type and an error message\. + +**Response codes** ++ 202 – Accepted ++ 400 – Bad Request ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. + +**Example error request** + +``` +REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 +ERROR="{\"errorMessage\" : \"Error parsing event data.\", \"errorType\" : \"InvalidEventDataException\"}" +curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/error" -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" ``` \ No newline at end of file diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index cc75571a..09fccb9a 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -19,7 +19,7 @@ The lifecycle of the execution environment includes the following phases: The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ![\[The Init phase is followed by one or more function invocations. When there are no invocation requests, Lambda initiates the SHutdown phase.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Successful-Invokes.png) diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 233db4c2..b2c45236 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -1,12 +1,10 @@ # Lambda Extensions API -You use the Extensions API to create Lambda extensions\. Extensions provide a method for monitoring, security, and other tools to integrate with the Lambda [execution environment](runtimes-context.md)\. For more information, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. +Lambda function authors use extensions to integrate Lambda with their preferred tools for monitoring, observability, security, and governance\. Function authors can use extensions from AWS, AWS Partners, and open\-source projects\. For more information on using extensions, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. -The Extensions API builds on the existing [Runtime API](runtimes-api.md), which provides an HTTP API for custom runtimes to receive invocation events from Lambda\. As an extension author, you can use the Extensions API to register for function and execution environment lifecycle events\. In response to these events, you can start new processes or run logic\. +As an extension author, you can use the Lambda Extensions API to integrate deeply into the Lambda [execution environment](runtimes-context.md)\. Your extension can register for function and execution environment lifecycle events\. In response to these events, you can start new processes, run logic, and control and participate in all phases of the Lambda lifecycle: initialization, invocation, and shutdown\. In addition, you can use the [Runtime Logs API](runtimes-logs-api.md) to receive a stream of logs\. -Lambda supports internal and external extensions\. *Internal extensions* allow you to configure the runtime environment and modify the startup of the runtime process\. Internal extensions use language\-specific [environment variables and wrapper scripts](runtimes-modify.md), and start and shut down within the runtime process\. Internal extensions run as separate threads within the runtime process, which starts and stops them\. - -An *external extension* runs as an independent process in the execution environment and continues to run after the function invoke is fully processed\. An external extension must register for the `Shutdown` event, which triggers the extension to shut down\. Because external extensions run as processes, you can write them in a different language than the function\. +An extension runs as an independent process in the execution environment and can continue to run after the function invocation is fully processed\. Because extensions run as processes, you can write them in a different language than the function\. We recommend that you implement extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with all of the supported runtimes\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) @@ -22,18 +20,15 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Ruby 2\.7 \(`ruby2.7`\) + Ruby 2\.5 \(`ruby2.5`\) -We recommend that you implement external extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with all of the supported runtimes\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. - -You share your extension as a [Lambda layer](configuration-layers.md) to make it available within your organization or to the entire community of Lambda developers\. Function developers can find, manage, and install extensions through layers\. +Lambda also supports *internal extensions*\. An internal extension runs as a separate thread in the runtime process\. The runtime starts and stops the internal extension\. An alternative way to integrate with the Lambda environment is to use language\-specific [environment variables and wrapper scripts](runtimes-modify.md)\. You can use these to configure the runtime environment and modify the startup behavior of the runtime process\. -You can install and manage extensions using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. +You can add extensions to a function in two ways\. For a function deployed as a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip), you deploy your extension as a [layer](configuration-layers.md)\. For a function defined as a container image, you add [the extensions](using-extensions.md#invocation-extensions-images) to your container image\. **Note** For example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. **Topics** + [Lambda execution environment lifecycle](#runtimes-extensions-api-lifecycle) -+ [Adding extensions to container images](#extensions-images) + [Extensions API reference](#runtimes-extensions-registration-api) ## Lambda execution environment lifecycle @@ -43,9 +38,9 @@ The lifecycle of the execution environment includes the following phases: The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. -Each phase starts with an event from the Lambda service to the runtime and to all registered extensions\. The runtime and each extension signal completion by sending a `Next` API request\. Lambda freezes the execution environment when each process has completed and there are no pending events\. +Each phase starts with an event from Lambda to the runtime and to all registered extensions\. The runtime and each extension signal completion by sending a `Next` API request\. Lambda freezes the execution environment when each process has completed and there are no pending events\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Full-Sequence.png) @@ -78,7 +73,9 @@ Extensions can complete their initialization at any point in the `Init` phase\. When a Lambda function is invoked in response to a `Next` API request, Lambda sends an `Invoke` event to the runtime and to each extension that is registered for the `Invoke` event\. -During the invocation, external extensions run in parallel with the function\. They also continue running after the function has completed\. This enables you to capture diagnostic information or send logs, metrics, and traces to a location of your choice\. +During the invocation, external extensions run in parallel with the function\. They also continue running after the function has completed\. This enables you to capture diagnostic information or to send logs, metrics, and traces to a location of your choice\. + +After receiving the function response from the runtime, Lambda returns the response to the client, even if extensions are still running\. The `Invoke` phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. @@ -103,17 +100,20 @@ Here is an example payload: } ``` -**Duration limit**: The function's [timeout setting](configuration-console.md) limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished executing\. +**Duration limit**: The function's [timeout setting](configuration-console.md) limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished running\. **Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. +**Note** +Lambda allocates CPU power in proportion to the function's memory setting\. You might see increased execution and initialization duration at lower memory settings because the function and extension processes are competing for the same CPU resources\. To reduce the execution and initialization duration, try increasing the memory setting\. + To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. ### Shutdown phase -When Lambda is about to terminate the runtime, it sends a `Shutdown` event to the runtime and then to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is sent in response to a `Next` API request\. +When Lambda is about to shut down the runtime, it sends a `Shutdown` event to the runtime and then to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is sent in response to a `Next` API request\. **Duration limit**: The maximum duration of the `Shutdown` phase depends on the configuration of registered extensions: + 300 ms – A function with no registered extensions @@ -122,7 +122,7 @@ When Lambda is about to terminate the runtime, it sends a `Shutdown` event to th For a function with external extensions, Lambda reserves up to 300 ms \(500 ms for a runtime with an internal extension\) for the runtime process to perform a graceful shutdown\. Lambda allocates the remainder of the 2,000 ms limit for external extensions to shut down\. -If the runtime or an extension does not respond to the `Shutdown` event within the limit, Lambda terminates the process using a `SIGKILL` signal\. +If the runtime or an extension does not respond to the `Shutdown` event within the limit, Lambda ends the process using a `SIGKILL` signal\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Shutdown-Phase.png) @@ -145,7 +145,7 @@ If the runtime or an extension does not respond to the `Shutdown` event within t Extensions run in the same execution environment as the Lambda function\. Extensions also share resources with the function, such as CPU, memory, and `/tmp` disk storage\. In addition, extensions use the same AWS Identity and Access Management \(IAM\) role and security context as the function\. -**File system and network access permissions**: Extensions run in the same file system and network name namespace as the function runtime\. This means that extensions need to be compatible with the associated operating system\. If an extension requires any additional network egress rules, you must apply these rules to the function configuration\. +**File system and network access permissions**: Extensions run in the same file system and network name namespace as the function runtime\. This means that extensions need to be compatible with the associated operating system\. If an extension requires any additional outbound network traffic rules, you must apply these rules to the function configuration\. **Note** Because the function code directory is read\-only, extensions cannot modify the function code\. @@ -172,21 +172,12 @@ If there is a failure \(such as a function timeout or runtime error\) during `In ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) -**Note** -Lambda does not automatically shut down extensions that repeatedly fail\. However, Lambda reports these errors through Amazon CloudWatch metrics and logs so that function developers and extension authors can understand and diagnose such failures\. - **Extension logs**: Lambda sends the log output of extensions to CloudWatch Logs\. Lambda also generates an additional log event for each extension during `Init`\. The log event records the name and registration preference \(event, config\) on success, or the failure reason on failure\. ### Troubleshooting extensions + If a `Register` request fails, make sure that the `Lambda-Extension-Name` header in the `Register` API call contains the full file name of the extension\. + If the `Register` request fails for an internal extension, make sure that the request does not register for the `Shutdown` event\. -## Adding extensions to container images - -You can add extensions to your [container image](lambda-images.md)\. The ENTRYPOINT [container image setting](images-create.md#images-parms) specifies the main process for the container\. Configure the ENTRYPOINT and CMD settings in the Dockerfile, or as an override in the function configuration\. - -You can run multiple processes within a container\. Lambda provides a built\-in server that manages the lifecycle of the main process and any additional processes\. The server uses the Extensions API to communicate with each external extension\. - ## Extensions API reference The OpenAPI specification for the extensions API version **2020\-01\-01** is available here: [extensions\-api\.zip](samples/extensions-api.zip) @@ -194,7 +185,7 @@ The OpenAPI specification for the extensions API version **2020\-01\-01** is ava You can retrieve the value of the API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send a `Register` request, use the prefix `2020-01-01/` before each API path\. For example: ``` -http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register +http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register ``` **Topics** @@ -274,7 +265,7 @@ Do not set a timeout on the GET call, as the extension can be suspended for a pe ### Init error -The extension uses this method to report an initialization error to Lambda\. Call it when the extension fails to initialize after it has registered\. After Lambda receives the error, no further API calls succeed\. The extension should exit\. +The extension uses this method to report an initialization error to Lambda\. Call it when the extension fails to initialize after it has registered\. After Lambda receives the error, no further API calls succeed\. The extension should exit after it receives the response from Lambda\. **Path** – `/extension/init/error` @@ -284,11 +275,41 @@ The extension uses this method to report an initialization error to Lambda\. Cal `Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. -`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(for example, Fatal\.ConnectFailed\)\. +`Lambda-Extension-Function-Error-Type` – Error type that the extension encountered\. Required: yes\. + +This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: ++ Runtime\.NoSuchHandler ++ Extension\.APIKeyNotFound ++ Extension\.ConfigInvalid ++ Extension\.UnknownReason **Body parameters** -`ErrorRequest` – JSON object with the error type, error message, and stack trace\. +`ErrorRequest` – Information about the error\. Required: no\. + +This field is a JSON object with the following structure: + +``` +{ + errorMessage: string (text description of the error), + errorType: string, + stackTrace: array of strings +} +``` + +Note that Lambda accepts any value for `errorType`\. + +The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. + +**Example Function error** + +``` +{ + "errorMessage" : "Error parsing event data.", + "errorType" : "InvalidEventDataException", + "stackTrace": [ ] +} +``` **Response body** + `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. @@ -301,7 +322,7 @@ The extension uses this method to report an initialization error to Lambda\. Cal ### Exit error -The extension uses this method to report an error to Lambda before exiting\. Call it when you encounter an unexpected failure\. After Lambda receives the error, no further API calls succeed\. The extension should exit\. +The extension uses this method to report an error to Lambda before exiting\. Call it when you encounter an unexpected failure\. After Lambda receives the error, no further API calls succeed\. The extension should exit after it receives the response from Lambda\. **Path** – `/extension/exit/error` @@ -311,11 +332,41 @@ The extension uses this method to report an error to Lambda before exiting\. Cal `Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. -`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(for example, Fatal\.ConnectFailed\)\. +`Lambda-Extension-Function-Error-Type` – Error type that the extension encountered\. Required: yes\. + +This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: ++ Runtime\.NoSuchHandler ++ Extension\.APIKeyNotFound ++ Extension\.ConfigInvalid ++ Extension\.UnknownReason **Body parameters** -`ErrorRequest` – JSON object with the error type, error message, and stack trace\. +`ErrorRequest` – Information about the error\. Required: no\. + +This field is a JSON object with the following structure: + +``` +{ + errorMessage: string (text description of the error), + errorType: string, + stackTrace: array of strings +} +``` + +Note that Lambda accepts any value for `errorType`\. + +The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. + +**Example Function error** + +``` +{ + "errorMessage" : "Error parsing event data.", + "errorType" : "InvalidEventDataException", + "stackTrace": [ ] +} +``` **Response body** + `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index c9712d97..82e9c6db 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -1,4 +1,4 @@ -# AWS Lambda Logs API +# Lambda Logs API Lambda automatically captures runtime logs and streams them to Amazon CloudWatch\. This log stream contains the logs that your function code and extensions generate, and also the logs that Lambda generates as part of the function invocation\. @@ -8,57 +8,60 @@ Lambda automatically captures runtime logs and streams them to Amazon CloudWatch The Logs API allows extensions to subscribe to three different logs streams: + Function logs that the Lambda function generates and writes to `stdout` or `stderr`\. -+ Lambda platform logs, such as the START, END, and REPORT logs\. + Extension logs that extension code generates\. ++ Lambda platform logs, which record events and errors related to invocations and extensions\. **Note** Lambda sends all logs to CloudWatch, even when an extension subscribes to one or more of the log streams\. **Topics** + [Subscribing to receive logs](#runtimes-logs-api-subscribing) ++ [Memory usage](#runtimes-logs-api-memory) + [Destination protocols](#runtimes-logs-api-dest) + [Buffering configuration](#runtimes-logs-api-buffering) + [Example subscription](#runtimes-logs-api-subs-example) -+ [Example log messages](#runtimes-logs-api-examples) + [Sample code for Logs API](#runtimes-logs-api-samples) + [Logs API reference](#runtimes-logs-api-ref) ++ [Log messages](#runtimes-logs-api-msg) ## Subscribing to receive logs A Lambda extension can subscribe to receive logs by sending a subscription request to the Logs API\. -To subscribe to receive logs, you need the extension identifier \(`Lambda-Extension-Identifier`\)\. First [register the extension](runtimes-extensions-api.md#extensions-registration-api-a) to receive the extension identifier\. Then subscribe to the Logs API during [initialization](runtimes-context.md#runtimes-lifecycle-ib)\. After the initialization phase is complete, Lambda does not process subscription requests\. +To subscribe to receive logs, you need the extension identifier \(`Lambda-Extension-Identifier`\)\. First [register the extension](runtimes-extensions-api.md#extensions-registration-api-a) to receive the extension identifier\. Then subscribe to the Logs API during [initialization](runtimes-context.md#runtimes-lifecycle-ib)\. After the initialization phase completes, Lambda does not process subscription requests\. **Note** Logs API subscription is idempotent\. Duplicate subscribe requests do not result in duplicate subscriptions\. +## Memory usage + Memory usage increases linearly as the number of subscribers increases\. Subscriptions consume memory resources because each subscription opens a new memory buffer to store the logs\. To help optimize memory usage, you can adjust the [buffering configuration](#runtimes-logs-api-buffering)\. Buffer memory usage counts towards overall memory consumption in the execution environment\. ## Destination protocols You can choose one of the following protocols to receive the logs: -1. **HTTP** \(recommended\) – Logs are delivered to a local HTTP endpoint \(`http://sandbox:${PORT}/${PATH}`\) as an array of records in JSON format\. The $PATH parameter is optional\. Note that only HTTP is supported, not HTTPS\. You can choose to receive logs through PUT or POST\. +1. **HTTP** \(recommended\) – Lambda delivers logs to a local HTTP endpoint \(`http://sandbox.localdomain:${PORT}/${PATH}`\) as an array of records in JSON format\. The `$PATH` parameter is optional\. Note that only HTTP is supported, not HTTPS\. You can choose to receive logs through PUT or POST\. -1. **TCP** – Logs are delivered to a TCP port in [Newline delimited JSON \(NDJSON\) format](https://github.com/ndjson/ndjson-spec)\. +1. **TCP** – Lambda delivers logs to a TCP port in [Newline delimited JSON \(NDJSON\) format](https://github.com/ndjson/ndjson-spec)\. -We recommend using HTTP rather than TCP\. With TCP, the Lambda platform cannot acknowledge that logs are delivered to the application layer\. Therefore, you may lose logs if your extension crashes\. HTTP does not share this limitation\. Also, in a TCP connection, you can unintentionally partition the NDJSON record incorrectly and corrupt the format\. If you choose to use TCP, wait until a newline arrives before flushing a record\. +We recommend using HTTP rather than TCP\. With TCP, the Lambda platform cannot acknowledge when it delivers logs to the application layer\. Therefore, you might lose logs if your extension crashes\. HTTP does not share this limitation\. We also recommend setting up the local HTTP listener or the TCP port before subscribing to receive logs\. During setup, note the following: + Lambda sends logs only to destinations that are inside the execution environment\. -+ Lambda retries the attempt to send the logs \(with backoff\) if there is no listener, or if the POST or PUT request results in error\. If the log subscriber crashes, it will continue to receive logs after Lambda restarts the execution environment\. ++ Lambda retries the attempt to send the logs \(with backoff\) if there is no listener, or if the POST or PUT request results in an error\. If the log subscriber crashes, it continues to receive logs after Lambda restarts the execution environment\. + Lambda reserves port 9001\. There are no other port number restrictions or recommendations\. ## Buffering configuration -Lambda can buffer logs and deliver them to the subscriber\. You can configure this behavior in the subscription request by specifying the following optional fields\. Lambda uses the default value for any field that you do not specify: -+ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1000\. Minimum: 25\. Maximum: 30000\. -+ **maxBytes** – The maximum size \(in bytes\) of the logs to buffer in memory\. Default: 262144\. Minimum: 262144\. Maximum: 1048576\. -+ **maxItems** – The maximum number of events to buffer in memory\. Default: 10000\. Minimum: 1000\. Maximum: 10000\. +Lambda can buffer logs and deliver them to the subscriber\. You can configure this behavior in the subscription request by specifying the following optional fields\. Note that Lambda uses the default value for any field that you do not specify\. ++ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1,000\. Minimum: 25\. Maximum: 30,000\. ++ **maxBytes** – The maximum size \(in bytes\) of the logs to buffer in memory\. Default: 262,144\. Minimum: 262,144\. Maximum: 1,048,576\. ++ **maxItems** – The maximum number of events to buffer in memory\. Default: 10,000\. Minimum: 1,000\. Maximum: 10,000\. During buffering configuration, note the following points: + Lambda flushes the logs if any of the input streams are closed, for example, if the runtime crashes\. -+ Each subscriber can specify a different buffering configuration during the subscription request\. ++ Each subscriber can specify a different buffering configuration in their subscription request\. + Consider the buffer size that you need for reading the data\. Expect to receive payloads as large as `2*maxBytes+metadata`, where `maxBytes` is configured in the subscribe request\. For example, Lambda adds the following metadata bytes to each record: ``` @@ -68,7 +71,7 @@ During buffering configuration, note the following points: "record": "Hello World" } ``` -+ If the subscriber cannot process incoming logs quickly enough, Lambda might drop logs to keep memory utilization bounded\. To indicate the number of dropped records, Lambda injects a `platform.logsDropped` record\. ++ If the subscriber cannot process incoming logs quickly enough, Lambda might drop logs to keep memory utilization bounded\. To indicate the number of dropped records, Lambda sends a `platform.logsDropped` log\. ## Example subscription @@ -76,18 +79,19 @@ The following example shows a request to subscribe to the platform and function ``` PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 -{"types": [ - "platform", - "function" - ], +{ "schemaVersion": "2020-08-15", + "types": [ + "platform", + "function" + ], "buffering": { - "maxItems": 1000, - "maxBytes": 10240, - "timeoutMs": 100 - } + "maxItems": 1000, + "maxBytes": 10240, + "timeoutMs": 100 + } "destination": { "protocol": "HTTP", - "URI": "http://sandbox:8080/lambda_logs" + "URI": "http://sandbox.localdomain:8080/lambda_logs" } } ``` @@ -99,32 +103,122 @@ HTTP/1.1 200 OK "OK" ``` -## Example log messages +## Sample code for Logs API + +For sample code showing how to send logs to a custom destination, see [Using AWS Lambda extensions to send logs to custom destinations](http://aws.amazon.com/blogs/compute/using-aws-lambda-extensions-to-send-logs-to-custom-destinations/) on the AWS Compute Blog\. + +For Python and Go code examples showing how to develop a basic Lambda extension and subscribe to the Logs API, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. For more information about building a Lambda extension, see [Lambda Extensions API](runtimes-extensions-api.md)\. + +## Logs API reference -The following example shows platform start, end, and report logs\. +You can retrieve the Logs API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, use the prefix `2020-08-15/` before the API path\. For example: ``` - { +http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ +``` + +The OpenAPI specification for the Logs API version **2020\-08\-15** is available here: [logs\-api\-request\.zip](samples/logs-api-request.zip) + +### Subscribe + +To subscribe to one or more of the log streams available in the Lambda execution environment, extensions send a Subscribe API request\. + +**Path** – `/logs` + +**Method** – **PUT** + +**Body parameters** + +`destination` – See [Destination protocols](#runtimes-logs-api-dest)\. Required: yes\. Type: strings\. + +`buffering` – See [Buffering configuration](#runtimes-logs-api-buffering)\. Required: no\. Type: strings\. + +`types` – An array of the types of logs to receive\. Required: yes\. Type: array of strings\. Valid values: "platform", "function", "extension"\. + +`schemaVersion` – Required: no\. Default value: "2020\-08\-15"\. Set to "2021\-03\-18" for the extension to receive [`platform.runtimeDone`](#runtimes-logs-api-ref-done) messages\. + +****Response parameters**** + +The OpenAPI specifications for the subscription responses version **2020\-08\-15** are available for the HTTP and TCP protocols: ++ HTTP: [logs\-api\-http\-response\.zip](samples/logs-api-http-response.zip) ++ TCP: [logs\-api\-tcp\-response\.zip](samples/logs-api-tcp-response.zip) + +****Response codes**** ++ 200 – Request completed successfully ++ 202 – Request accepted\. Response to a subscription request during local testing\. ++ 4XX – Bad Request ++ 500 – Service error + +If the request succeeds, the subscriber receives an HTTP 200 success response\. + +``` +HTTP/1.1 200 OK +"OK" +``` + +If the request fails, the subscriber receives an error response\. For example: + +``` +HTTP/1.1 400 OK +{ + "errorType": "Logs.ValidationError", + "errorMessage": URI port is not provided; types should not be empty" +} +``` + +## Log messages + +The Logs API allows extensions to subscribe to three different logs streams: ++ Function – Logs that the Lambda function generates and writes to `stdout` or `stderr`\. ++ Extension – Logs that extension code generates\. ++ Platform – Logs that the runtime platform generates, which record events and errors related to invocations and extensions\. + +**Topics** ++ [Function logs](#runtimes-logs-api-msg-function) ++ [Extension logs](#runtimes-logs-api-msg-extension) ++ [Platform logs](#runtimes-logs-api-msg-platform) + +### Function logs + +The Lambda function and internal extensions generate function logs and write them to `stdout` or `stderr`\. + +The following example shows the format of a function log message\. \{ "time": "2020\-08\-20T12:31:32\.123Z", "type": "function", "record": "ERROR encountered\. Stack trace:\\n\\my\-function \(line 10\)\\n" \} + +### Extension logs + +Extensions can generate extension logs\. The log format is the same as for a function log\. + +### Platform logs + +Lambda generates log messages for platform events such as `platform.start`, `platform.end`, and `platform.fault`\. + +Optionally, you can subscribe to the **2021\-03\-18** version of the Logs API schema, which includes the `platform.runtimeDone` log message\. + +#### Example platform log messages + +The following example shows the platform start and platform end logs\. These logs indicate the invocation start time and invocation end time for the invocation that the requestId specifies\. + +``` +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.start", - "record": { - "requestId": "6f7f0961f83442118a7af6fe80b88d56" - } + "record": {"requestId": "6f7f0961f83442118a7af6fe80b88d56"} } { "time": "2020-08-20T12:31:32.123Z", "type": "platform.end", - "record": { - "requestId": "6f7f0961f83442118a7af6fe80b88d56" - } + "record": {"requestId": "6f7f0961f83442118a7af6fe80b88d56"} } -{ +``` + +The platform report log includes metrics about the invocation that the requestId specifies\. The `initDurationMs` field is included in the log only if the invocation included a cold start\. If AWS X\-Ray tracing is active, the log includes X\-Ray metadata\. The following example shows a platform report log for an invocation that included a cold start\. + +``` +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.report", - "record": { - "requestId": "6f7f0961f83442118a7af6fe80b88d56", - "metrics": { - "durationMs": 101.51, + "record": {"requestId": "6f7f0961f83442118a7af6fe80b88d56", + "metrics": {"durationMs": 101.51, "billedDurationMs": 300, "memorySizeMB": 512, "maxMemoryUsedMB": 33, @@ -134,146 +228,102 @@ The following example shows platform start, end, and report logs\. } ``` -The platform log captures runtime or execution environment errors\. The following example shows a platform fault log message\. +The platform fault log captures runtime or execution environment errors\. The following example shows a platform fault log message\. ``` -{ +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.fault", "record": "RequestId: d783b35e-a91d-4251-af17-035953428a2c Process exited before completing request" } ``` -The following example shows an Extensions API registration log message\. +Lambda generates a platform extension log when an extension registers with the extensions API\. The following example shows a platform extension message\. ``` -{ +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.extension", - "record": { - "name": "Foo.bar", + "record": {"name": "Foo.bar", "state": "Ready", "events": ["INVOKE", "SHUTDOWN"] } } ``` -The following example shows a Logs API subscription log message\. +Lambda generates a platform logs subscription log when an extension subscribes to the logs API\. The following example shows a logs subscription message\. ``` -{ +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.logsSubscription", - "record": { - "name": "Foo.bar", + "record": {"name": "Foo.bar", "state": "Subscribed", "types": ["function", "platform"], } } ``` -The following example shows a `platform.logsDropped` log message\. +Lambda generates a platform logs dropped log when an extension is not able to process the number of logs that it is receiving\. The following example shows a `platform.logsDropped` log message\. ``` -{ +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.logsDropped", - "record": { - "reason": "Consumer seems to have fallen behind as it has not acknowledged receipt of logs.", + "record": {"reason": "Consumer seems to have fallen behind as it has not acknowledged receipt of logs.", "droppedRecords": 123, "droppedBytes" 12345 } } ``` -The following example shows a function log message\. +#### Platform `runtimeDone` messages -``` -{ - "time": "2020-08-20T12:31:32.123Z", - "type": "function", - "record": "ERROR something happened. Stack trace:\n\tfoo (line 10)\n" -} -``` +If you set the schema version to "2021\-03\-18" in the subscribe request, Lambda sends a `platform.runtimeDone` message after the function invocation completes either successfully or with an error\. The extension can use this message to stop all the telemetry collection for this function invocation\. -## Sample code for Logs API +The OpenAPI specification for the Log event type in schema version **2021\-03\-18** is available here: [schema\-2021\-03\-18\.zip](samples/schema-2021-03-18.zip) -The [ compute blog post entry](https://aws.amazon.com/blogs/compute/using-aws-lambda-extensions-to-send-logs-to-custom-destinations) for Logs API includes sample code showing how to send logs to a custom destination\. +Lambda generates the `platform.runtimeDone` log message when the runtime sends a `Next` or `Error` runtime API request\. The `platform.runtimeDone` log informs consumers of the Logs API that the function invocation completes\. Extensions can use this information to decide when to send all the telemetry collected during that invocation\. -Lambda provides [Python and Go code examples](https://github.com/aws-samples/aws-lambda-extensions) showing how to develop a basic extension and subscribe to the Logs API\. For more information about building a Lambda extension, see [Lambda Extensions API](runtimes-extensions-api.md)\. +##### Examples -## Logs API reference +Lambda sends the `platform.runtimeDone` message after the runtime sends the NEXT request when the function invocation completes\. The following examples show messages for each of the status values: success, failure, and timeout\. -You can retrieve the Logs API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, use the prefix `2020-08-15/` before the API path\. For example: +**Example success message** ``` -http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ -``` - -### Subscribe - -To subscribe to one or more of the log streams that are available in the Lambda execution environment, extensions send a Subscribe API request\. - -The OpenAPI specification for the Logs API subscription request, version **2020\-08\-15**, is available here: [logs\-api\-request\.zip](samples/logs-api-request.zip) - -**Path** – `/logs` - -**Method** – **PUT** - -**Body parameters** - -`destination` – See [Destination protocols](#runtimes-logs-api-dest)\. Required: yes\. Type: strings\. - -`buffering` – See [Buffering configuration](#runtimes-logs-api-buffering)\. Required: no\. Type: strings\. - -`types` – An array of the types of logs to receive\. Required: yes\. Type: array of strings\. Valid values: "platform", "function", "extension"\. - -**Response parameters** - -The OpenAPI specifications for the subscription responses, version **2020\-08\-15**, are available for HTTP and TCP: -+ HTTP: [logs\-api\-http\-response\.zip](samples/logs-api-http-response.zip) -+ TCP: [logs\-api\-tcp\-response\.zip](samples/logs-api-tcp-response.zip) - -**Response codes** -+ 200 – Request completed successfully -+ 202 – Request accepted\. Response to a subscription request during local testing\. -+ 4XX – Bad Request -+ 500 – Service error - -**Example subscription request** - -``` - PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 - { - "types": [ - "platform", - "function" - ], - "buffering": { - "maxItems": 1000, - "maxBytes": 10240, - "timeoutMs": 100 - } - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox:8080/lambda_logs" - } +{ + "time": "2021-02-04T20:00:05.123Z", + "type": "platform.runtimeDone", + "record": { + "requestId":"6f7f0961f83442118a7af6fe80b88", + "status": "success" + } } ``` -If the request succeeds, the subscriber receives an HTTP 200 success response\. +**Example failure message** ``` -HTTP/1.1 200 OK -"OK" +{ + "time": "2021-02-04T20:00:05.123Z", + "type": "platform.runtimeDone", + "record": { + "requestId":"6f7f0961f83442118a7af6fe80b88", + "status": "failure" + } +} ``` -If the request fails, the subscriber receives an error response\. +**Example timeout message** ``` -HTTP/1.1 400 OK { - "errorType": "Logs.ValidationError", - "errorMessage": URI port is not provided; types should not be empty" + "time": "2021-02-04T20:00:05.123Z", + "type": "platform.runtimeDone", + "record": { + "requestId":"6f7f0961f83442118a7af6fe80b88", + "status": "timeout" + } } ``` \ No newline at end of file diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 014a51c7..38688e57 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -1,6 +1,6 @@ # Blank function sample application for AWS Lambda -The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and theAWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. +The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-blank.png) @@ -37,7 +37,7 @@ The sample application consists of function code, an AWS CloudFormation template Standard charges apply for each service\. For more information, see [AWS Pricing](https://aws.amazon.com/pricing)\. -The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with theAWS SDK and passes the response back to the Lambda runtime\. +The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. **Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Handler code** @@ -64,7 +64,7 @@ var serialize = function(object) { } ``` -The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code orAWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. +The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. @@ -174,7 +174,7 @@ The sample function is configured for tracing with [AWS X\-Ray](https://console. The first service node \(`AWS::Lambda`\) represents the Lambda service, which validates the invocation request and sends it to the function\. The second node, `AWS::Lambda::Function`, represents the function itself\. -To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with theAWS SDK to AWS services\. +To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. **Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** @@ -186,15 +186,15 @@ const AWS = AWSXRay.captureAWS(require('aws-sdk')) const lambda = new AWS.Lambda() ``` -Instrumenting theAWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. +Instrumenting the AWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-servicemap.png) -The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for theAWS SDK call to the `GetAccountSettings` API operation\. +The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for the AWS SDK call to the `GetAccountSettings` API operation\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-trace.png) -You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes theAWS SDK in the execution environment\. +You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes the AWS SDK in the execution environment\. ## Dependency management with layers diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index a9eeb6f5..67e825cc 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -72,7 +72,7 @@ The two Node\.js functions are configured for active tracing in the template, an ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-trace.png) -The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It usesAWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. +The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It uses AWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. ## AWS CloudFormation template and additional resources diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 29c48463..7225177f 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -98,7 +98,7 @@ The application uses [AWS X\-Ray](services-xray.md) to trace function invocation ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-servicemap.png) -The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with anAWS SDK or MySQL client\. +The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with an AWS SDK or MySQL client\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-trace.png) diff --git a/doc_source/services-cognito.md b/doc_source/services-cognito.md index 36138928..3625525c 100644 --- a/doc_source/services-cognito.md +++ b/doc_source/services-cognito.md @@ -1,6 +1,6 @@ # Using AWS Lambda with Amazon Cognito -The Amazon Cognito Events feature enables you to run Lambda functions in response to events in Amazon Cognito\. For example, you can invoke a Lambda function for the Sync Trigger events, that is published each time a dataset is synchronized\. To learn more and walk through an example, see [Introducing Amazon Cognito Events: Sync Triggers](https://aws.amazon.com/blogs/mobile/introducing-amazon-cognito-events-sync-triggers/) in the Mobile Development blog\. +The Amazon Cognito Events feature enables you to run Lambda functions in response to events in Amazon Cognito\. For example, you can invoke a Lambda function for the Sync Trigger events, that is published each time a dataset is synchronized\. To learn more and walk through an example, see [Introducing Amazon Cognito Events: Sync Triggers](http://aws.amazon.com/blogs/mobile/introducing-amazon-cognito-events-sync-triggers/) in the Mobile Development blog\. **Example Amazon Cognito message event** diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 8416d961..5b41419f 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -73,7 +73,7 @@ using Amazon.EC2; public async Task FunctionHandler(Dictionary input, ILambdaContext context) { - // More AMI IDs: [aws\.amazon\.com/amazon\-linux\-2/release\-notes/](https://aws.amazon.com/amazon-linux-2/release-notes/) + // More AMI IDs: [amazon\-linux\-2/release\-notes/](http://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"; diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md index 28a100e6..bdce5f13 100644 --- a/doc_source/services-ec2.md +++ b/doc_source/services-ec2.md @@ -27,7 +27,7 @@ CloudWatch Events invokes your Lambda function asynchronously with the event doc For details on configuring events in CloudWatch Events, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon CloudWatch Events for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. -You can also use theAWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. +You can also use the AWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. ## Permissions @@ -59,4 +59,4 @@ aws lambda add-permission --action lambda:InvokeFunction --statement-id ec2-even --principal events.amazonaws.com --function-name my-function --source-arn 'arn:aws:events:us-east-2:12456789012:rule/*' ``` -If your function uses theAWS SDK to manage Amazon EC2 resources, add Amazon EC2 permissions to the function's [execution role](lambda-intro-execution-role.md)\. \ No newline at end of file +If your function uses the AWS SDK to manage Amazon EC2 resources, add Amazon EC2 permissions to the function's [execution role](lambda-intro-execution-role.md)\. \ No newline at end of file diff --git a/doc_source/services-iotevents.md b/doc_source/services-iotevents.md index 997a2044..95c70582 100644 --- a/doc_source/services-iotevents.md +++ b/doc_source/services-iotevents.md @@ -9,7 +9,6 @@ When the event occurs, AWS IoT Events invokes your Lambda function asynchronousl **Example AWS IoT Events message event** ``` - { "event: ":{ "eventName": "myChargedEvent", @@ -17,7 +16,7 @@ When the event occurs, AWS IoT Events invokes your Lambda function asynchronousl "payload":{ "detector":{ "detectorModelName": "AWS_IoTEvents_Hello_World1567793458261", - "detectorModelVersion": "4", + "detectorModelVersion": "4", "keyValue": "100009" }, "eventTriggerDetails":{ diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md deleted file mode 100644 index 87d49a38..00000000 --- a/doc_source/services-msk-topic-add.md +++ /dev/null @@ -1,59 +0,0 @@ -# Adding an Amazon MSK cluster as an event source - -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. - -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. - -## Prerequisites -+ An Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. For more information, see [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md)\. - -## VPC configuration - -To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, we recommend: -+ Configuring one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. - -Your Amazon VPC security groups must be configured with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. - -**Note** -Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and doesn't need to be configured in your `create-event-source-mapping` setup\. - -## Adding an Amazon MSK cluster using the Lambda console - -Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. - -**To add an MSK trigger to your Lambda function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of your Lambda function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Under **Trigger configuration**, choose the **MSK** trigger type\. - -1. Configure the remaining options, and then choose **Add**\. - -## Adding an Amazon MSK cluster using the AWS CLI - -Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. - -### Creating a trigger using the AWS CLI - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. - -``` -aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function -``` - -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. - -### Viewing the status using the AWS CLI - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. - -``` -aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -``` \ No newline at end of file diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md index 08bb31ec..848b668a 100644 --- a/doc_source/services-s3-batch.md +++ b/doc_source/services-s3-batch.md @@ -57,7 +57,7 @@ In the [resource\-based policy](access-control-resource-based.md) that you creat In the [execution role](lambda-intro-execution-role.md) for the function, set a trust policy for Amazon S3 to assume the role when it runs your function\. -If your function uses theAWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. +If your function uses the AWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. When the job runs, Amazon S3 starts multiple function instances to process the Amazon S3 objects in parallel, up to the [concurrency limit](invocation-scaling.md) of the function\. Amazon S3 limits the initial ramp\-up of instances to avoid excess cost for smaller jobs\. diff --git a/doc_source/services-smaa-topic-add.md b/doc_source/services-smaa-topic-add.md deleted file mode 100644 index 0e525069..00000000 --- a/doc_source/services-smaa-topic-add.md +++ /dev/null @@ -1,57 +0,0 @@ -# Adding a self\-managed Apache Kafka cluster as an event source - -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. - -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. - -## Prerequisites -+ A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](kafka-hosting.md)\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md)\. - -## Adding a self\-managed Apache Kafka cluster using the Lambda console - -Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. - -**To add an Apache Kafka trigger to your Lambda function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of your Lambda function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Under **Trigger configuration**, choose the **Apache Kafka** trigger type\. - -1. Configure the remaining options, and then choose **Add**\. - -## Adding a self\-managed Apache Kafka cluster using the AWS CLI - -Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. - -### Using SASL/SCRAM - -If Kafka users access your Kafka brokers over the internet, you must specify your AWS Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. - -``` -aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' -``` - -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. - -### Using a VPC - -If only Kafka users within your virtual private cloud \(VPC\) access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. - -``` -aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' -``` - -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. - -### Viewing the status - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. - -``` -aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 -``` \ No newline at end of file diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index b80cdabb..402690ca 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -29,7 +29,13 @@ Your function needs permission to upload trace data to X\-Ray\. When you enable X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. -In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. +In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. For more information see [ Lambda execution environment lifecycle](runtimes-context.md)\. + +The `Initialization` subsegment represents the init phase of the Lambda execution environment lifecycle\. During this phase, Lambda creates or unfreezes an execution environment with the resources you have configured, downloads the function code and all layers, initializes extensions, initializes the runtime, and runs the function's initialization code\. + +The `Invocation` subsegment represents the invoke phase where Lambda invokes the function handler\. This begins with runtime and extension registration and it ends when the runtime is ready to send the response\. + +The `Overhead` subsegment represents the phase that occurs between the time when the runtime sends the response and the signal for the next invoke\. During this time, the runtime finishes all tasks related to an invoke and prepares to freeze the sandbox\. The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. @@ -74,7 +80,7 @@ For more information, see [The X\-Ray daemon](https://docs.aws.amazon.com/xray/l ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) diff --git a/doc_source/smaa-permissions.md b/doc_source/smaa-permissions.md deleted file mode 100644 index 7da4dcd6..00000000 --- a/doc_source/smaa-permissions.md +++ /dev/null @@ -1,81 +0,0 @@ -# Managing access and permissions for a self\-managed Apache Kafka cluster - -Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. - -This page describes how to grant permission to Lambda and other users of your self\-managed Kafka cluster\. - -## Required Lambda function permissions - -To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) - -## Optional Lambda function permissions - -Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed CMK](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. - -### Secrets Manager and AWS KMS permissions - -If your Kafka users access your Apache Kafka brokers over the internet, you must specify a Secrets Manager secret\. For more information, see [Using SASL/SCRAM authentication](#smaa-permissions-add-secret)\. - -Your Lambda function might need permission to describe your Secrets Manager secret or decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: -+ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) -+ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) - -### VPC permissions - -If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) - -## Adding permissions to your execution role - -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. - -By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. - -``` -{ - "Version":"2012-10-17", - "Statement":[ - { - "Effect":"Allow", - "Action":[ - "ec2:CreateNetworkInterface", - "ec2:DescribeNetworkInterfaces", - "ec2:DescribeVpcs", - "ec2:DeleteNetworkInterface", - "ec2:DescribeSubnets", - "ec2:DescribeSecurityGroups" - ], - "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" - } - ] - } -``` - -For information about creating a JSON policy document on the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. - -## Adding users to an IAM policy - -By default, IAM users and roles don't have permission to perform [event source API operations](kafka-using-cluster.md#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. - -## Using SASL/SCRAM authentication - -User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. - -To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: - -``` -{ - "username": "ab1c23de", - "password": "qxbbaLRG7JXYN4NpNMVccP4gY9WZyDbp" -} -``` - -For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. \ No newline at end of file diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index 8c6c8337..a0c24ba6 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -26,7 +26,7 @@ chmod 755 $(find . -type d) When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the [S3Bucket and S3Key](API_UpdateFunctionCode.md#SSS-UpdateFunctionCode-request-S3Bucket) parameters\. **Note** -When you upload a file directly with the AWS CLI,AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. +When you upload a file directly with the AWS CLI, AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. ## Amazon S3: Error Code PermanentRedirect\. diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index d2138fe1..be5f6ba8 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -28,7 +28,7 @@ When you add permissions to your function, make an update to its code or configu **Issue: \(Node\.js\)** *Function returns before code finishes executing* -Many libraries, including theAWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. +Many libraries, including the AWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. To wait for the promise to resolve into a response, use the `await` keyword\. This blocks your handler code from executing until the promise is resolved into an object that contains the response\. If you don't need to use the data from the response in your code, you can return the promise directly to the runtime\. @@ -36,11 +36,11 @@ Some libraries don't return promises but can be wrapped in code that does\. For ## AWS SDK: Versions and updates -**Issue:** *TheAWS SDK included on the runtime is not the latest version* +**Issue:** *The AWS SDK included on the runtime is not the latest version* -**Issue:** *TheAWS SDK included on the runtime updates automatically* +**Issue:** *The AWS SDK included on the runtime updates automatically* -Runtimes for scripting languages include theAWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of theAWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: +Runtimes for scripting languages include the AWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of the AWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 23e90de8..c1889ca0 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -29,7 +29,7 @@ You are charged for the execution time that the extension consumes \(in 1 ms inc + [Impact on performance and resources](#using-extensions-reg) + [Permissions](#using-extensions-permissions) + [Configuring extensions \(\.zip file archive\)](#using-extensions-config) -+ [Using extensions in container images](#invocation-images-extensions) ++ [Using extensions in container images](#invocation-extensions-images) + [Next steps](#using-extensions-next) ## Execution environment @@ -41,7 +41,7 @@ The lifecycle of the execution environment includes the following phases: The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. During the `Init` phase, Lambda extracts layers containing extensions into the `/opt` directory in the execution environment\. Lambda looks for extensions in the `/opt/extensions/` directory, interprets each file as an executable bootstrap for launching the extension, and starts all extensions in parallel\. @@ -83,7 +83,7 @@ You add the extension to your function using the same method as you would for an 1. Choose **Add**\. -## Using extensions in container images +## Using extensions in container images You can add extensions to your [container image](lambda-images.md)\. The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. @@ -111,6 +111,6 @@ CMD python ./index.py ## Next steps To learn more about extensions, we recommend the following resources: -+ For a basic working example, see [Building Extensions for AWS Lambda](https://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) on the AWS Compute Blog\. -+ For information about extensions that AWS Lambda Partners provides, see [Introducing AWS Lambda Extensions](https://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. ++ For a basic working example, see [Building Extensions for AWS Lambda](http://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) on the AWS Compute Blog\. ++ For information about extensions that AWS Lambda Partners provides, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. + To view available example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. \ No newline at end of file diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 86848848..663bec4f 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -14,6 +14,14 @@ You can invoke your Lambda functions using the Lambda API, or Lambda can run you Lambda is a highly available service\. For more information, see the [AWS Lambda Service Level Agreement](http://aws.amazon.com/lambda/sla/)\. +**Topics** ++ [When should I use Lambda?](#when-to-use-cloud-functions) ++ [Lambda features](#features) ++ [Getting started with Lambda](#welcome-first-time-user) ++ [Related services](#related-services) ++ [Accessing Lambda](#accessing) ++ [Pricing for Lambda](#pricing) + ## When should I use Lambda? Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](runtimes-context.md) and within the resources that Lambda provides\. @@ -28,8 +36,8 @@ If you need to manage your own compute resources, AWS has other compute services The following key features help you develop Lambda applications that are scalable, secure, and easily extensible: -**Concurrency controls** -[Concurrency limits and provisioned concurrency](invocation-scaling.md) give you fine\-grained control over the scaling and responsiveness of your production applications\. +**Concurrency and scaling controls** +[Concurrency and scaling controls](invocation-scaling.md) such as concurrency limits and provisioned concurrency give you fine\-grained control over the scaling and responsiveness of your production applications\. **Functions defined as container images** Use your preferred [container image](lambda-images.md) tooling, workflows, and dependencies to build, test, and deploy your Lambda functions\. @@ -76,7 +84,7 @@ If you are a first\-time user of Lambda, we recommend that you start with the fo [Lambda integrates with other AWS services](lambda-services.md) to invoke functions based on events that you specify\. For example: + Use [API Gateway](services-apigateway.md) to provide a secure and scalable gateway for web APIs that route HTTP requests to Lambda functions\. -+ For services that generate a queue or data stream \(such as [DynamoDB](with-ddb.md) and [Kinesis](with-kinesis.md)\), have Lambda read data from the services, create an event, and invoke your function to process the event\. ++ For services that generate a queue or data stream \(such as [DynamoDB](with-ddb.md) and [Kinesis](with-kinesis.md)\), Lambda polls the queue or data stream from the service and invokes your function to process the received data\. + Define [Amazon S3](with-s3.md) events that invoke a Lambda function to process Amazon S3 objects, for example, when an object is created or deleted\. + Use a Lambda function to process [Amazon SQS](with-sqs.md) messages or [Amazon Simple Notification Service \(Amazon SNS\)](with-sns.md) notifications\. + Use [AWS Step Functions](lambda-stepfunctions.md) to connect Lambda functions together into serverless workflows called state machines\. @@ -87,7 +95,7 @@ You can create, invoke, and manage your Lambda functions using any of the follow + **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Configuring functions in the console](configuration-console.md)\. + **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. + **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. -+ **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(AWS CDK\)](http://aws.amazon.com/cdk)\. ++ **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(CDK\)](http://aws.amazon.com/cdk)\. + **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [AWS SAM](lambda-settingup.md#lambda-settingup-awssam)\. diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md new file mode 100644 index 00000000..7921d071 --- /dev/null +++ b/doc_source/with-kafka.md @@ -0,0 +1,237 @@ +# Using Lambda with an Apache Kafka cluster + +[Apache Kafka](https://kafka.apache.org/) is a distributed data store optimized for ingesting and processing streaming data in real time\. + +Kafka is primarily used to build streaming data pipelines and applications that adapt to the data streams\. It combines messaging, storage, and stream processing to allow storage and analysis of both historical and real\-time data\. + +AWS provides a managed Kafka service, or you can use a non\-AWS Kafka cluster with Lambda\. + +**Topics** ++ [Hosting an Apache Kafka cluster](#kafka-hosting) ++ [Using an Apache Kafka cluster as an event source for Lambda](#kafka-using-cluster) ++ [Using Lambda with self\-managed Apache Kafka](#kafka-smaa) + +## Hosting an Apache Kafka cluster + +You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. + +### Using Amazon MSK + +To host your Apache Kafka cluster and topics, you can use [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html)\. + +For more information about using an MSK cluster, see [Using Lambda with Amazon MSK](with-msk.md)\. + +### Using a self\-managed Kafka provider + +To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud provider, such as [CloudKarafka](https://www.cloudkarafka.com/)\. + +You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. + +For more information about using a self\-managed Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](#kafka-smaa)\. + +## Using an Apache Kafka cluster as an event source for Lambda + + + +You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. + +### Prerequisites ++ A [Lambda function](getting-started-create-function.md) with function code in a [supported runtime](lambda-runtimes.md) to invoke your cluster ++ A [Lambda execution role](lambda-intro-execution-role.md) + +### How it works + + + +When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. ++ If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. ++ If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. ++ Lambda reads event data from the Kafka topics that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. ++ Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. ++ Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. ++ + +For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. + +### Event source API operations + +When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS Command Line Interface \(AWS CLI\), Lambda uses APIs to process your request\. + +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + +### Event source mapping errors + +When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. + +To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: + +**`ESM_CONFIG_NOT_VALID`** +The event source mapping configuration is not valid\. + +**`EVENT_SOURCE_AUTHN_ERROR`** +Lambda couldn't authenticate the event source\. + +**`EVENT_SOURCE_AUTHZ_ERROR`** +Lambda doesn't have the required permissions to access the event source\. + +**`FUNCTION_CONFIG_NOT_VALID`** +The Lambda function configuration is not valid\. + +**Note** +If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. + +## Using Lambda with self\-managed Apache Kafka + +You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. + +**Topics** ++ [Managing access and permissions for a self\-managed Apache Kafka cluster](#smaa-permissions) ++ [Adding a self\-managed Apache Kafka cluster as an event source](#services-smaa-topic-add) + +### Managing access and permissions for a self\-managed Apache Kafka cluster + +Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. + +This page describes how to grant permission to Lambda and other users of your self\-managed Kafka cluster\. + +#### Required Lambda function permissions + +To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) + +#### Optional Lambda function permissions + +Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed CMK](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. + +##### Secrets Manager and AWS KMS permissions + +If your Kafka users access your Apache Kafka brokers over the internet, you must specify a Secrets Manager secret\. For more information, see [Using SASL/SCRAM authentication](#smaa-permissions-add-secret)\. + +Your Lambda function might need permission to describe your Secrets Manager secret or decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) ++ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) + +##### VPC permissions + +If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) + +#### Adding permissions to your execution role + +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. + +By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. + +``` +{ + "Version":"2012-10-17", + "Statement":[ + { + "Effect":"Allow", + "Action":[ + "ec2:CreateNetworkInterface", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeVpcs", + "ec2:DeleteNetworkInterface", + "ec2:DescribeSubnets", + "ec2:DescribeSecurityGroups" + ], + "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" + } + ] + } +``` + +For information about creating a JSON policy document on the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. + +#### Adding users to an IAM policy + +By default, IAM users and roles don't have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. + +#### Using SASL/SCRAM authentication + +**Important** +Plaintext brokers are not supported if you are is using SASL/SCRAM based authentication\. You must use TLS encryption for your brokers\. + +User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. + +To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: + +``` +{ + "username": "ab1c23de", + "password": "qxbbaLRG7JXYN4NpNMVccP4gY9WZyDbp" +} +``` + +For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. + +### Adding a self\-managed Apache Kafka cluster as an event source + +You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. + +This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. + +#### Prerequisites ++ A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](#kafka-hosting)\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](#smaa-permissions)\. + +#### Adding a self\-managed Apache Kafka cluster using the Lambda console + +Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. + +**To add an Apache Kafka trigger to your Lambda function \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of your Lambda function\. + +1. Under **Function overview**, choose **Add trigger**\. + +1. Under **Trigger configuration**, choose the **Apache Kafka** trigger type\. + +1. Configure the remaining options, and then choose **Add**\. + +#### Adding a self\-managed Apache Kafka cluster using the AWS CLI + +Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. + +##### Using SASL/SCRAM + +If Kafka users access your Kafka brokers over the internet, you must specify your AWS Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. + +``` +aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +``` + +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. + +##### Using a VPC + +If only Kafka users within your virtual private cloud \(VPC\) access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. + +``` +aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +``` + +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. + +##### Viewing the status + +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. + +``` +aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 +``` \ No newline at end of file diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index fc3f5e22..5b8a125a 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -127,7 +127,7 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. +To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) command\. By default, Amazon MQ brokers are created with the `PubliclyAccessible` flag set to false\. It is only when `PubliclyAccessible` is set to true that the broker is given a public IP address\. @@ -175,7 +175,7 @@ You should see the following output: } ``` -Using the `[update\-event\-source\-mapping](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. +Using the `[update\-event\-source\-mapping](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. ``` aws lambda update-event-source-mapping \ @@ -198,7 +198,7 @@ You should see the following output: } ``` -Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) command\. +Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) command\. ``` aws lambda get-event-source-mapping \ diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index b22063bb..72717471 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -2,6 +2,116 @@ [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that enables you to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK provides the control\-plane operations, such as those for creating, updating, and deleting clusters\. It supports multiple open\-source versions of Kafka\. +When you create an Amazon MSK cluster, you receive the required hosting and connection information of the cluster\. This information includes the Kafka cluster hostname, topic name, SASL/SCRAM user name and password, and bootstrap server host\-port pairs\. + +To support your Kafka cluster on Amazon MSK, you might need to create Amazon Virtual Private Cloud \(Amazon VPC\) networking components\. For more information, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. + **Topics** -+ [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) -+ [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) \ No newline at end of file ++ [Managing access and permissions for an Amazon MSK cluster](#msk-permissions) ++ [Adding an Amazon MSK cluster as an event source](#services-msk-topic-add) + +## Managing access and permissions for an Amazon MSK cluster + +Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. + +This page describes how to grant permission to Lambda and other users of your Amazon MSK cluster\. + +### Required Lambda function permissions + +To read records from your Amazon MSK cluster on your behalf, your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: ++ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) ++ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) + +### Adding a policy to your execution role + +Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. + +**To add an AWS managed policy** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. + +1. In the search box, enter the policy name \(`AWSLambdaMSKExecutionRole`\)\. + +1. Select the policy from the list, and then choose **Policy actions**, **Attach**\. + +1. Select your execution role from the list, and then choose **Attach policy**\. + +### Granting users access with an IAM policy + +By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon Managed Streaming for Apache Kafka Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +### Using SASL/SCRAM authentication + +Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Using Username and Password Authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +## Adding an Amazon MSK cluster as an event source + +You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. + +This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. + +### Prerequisites ++ An Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. For more information, see [Managing access and permissions for an Amazon MSK cluster](#msk-permissions)\. + +### VPC configuration + +To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, do one of the following: ++ We recommend that you deploy Amazon VPC Endpoints \(PrivateLink\) for Lambda and AWS STS services\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. + + If authentication is required, also deploy an Amazon VPC Endpoint for the Secrets Manager\. ++ Alternatively, you can configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. + +Your Amazon VPC security groups must be configured with the following rules \(at minimum\): ++ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. ++ Outbound rules – Allow all traffic on all ports for all destinations\. + +**Note** +Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and doesn't need to be configured in your `create-event-source-mapping` setup\. + +### Adding an Amazon MSK cluster using the Lambda console + +Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. + +**To add an MSK trigger to your Lambda function \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of your Lambda function\. + +1. Under **Function overview**, choose **Add trigger**\. + +1. Under **Trigger configuration**, choose the **MSK** trigger type\. + +1. Configure the remaining options, and then choose **Add**\. + +### Adding an Amazon MSK cluster using the AWS CLI + +Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. + +#### Creating a trigger using the AWS CLI + +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. + +``` +aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function +``` + +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. + +#### Viewing the status using the AWS CLI + +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. + +``` +aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 +``` \ No newline at end of file diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md index 35103d89..29b23cba 100644 --- a/doc_source/with-s3.md +++ b/doc_source/with-s3.md @@ -52,7 +52,7 @@ Amazon S3 invokes your function [asynchronously](invocation-async.md) with an ev To invoke your function, Amazon S3 needs permission from the function's [resource\-based policy](access-control-resource-based.md)\. When you configure an Amazon S3 trigger in the Lambda console, the console modifies the resource\-based policy to allow Amazon S3 to invoke the function if the bucket name and account ID match\. If you configure the notification in Amazon S3, you use the Lambda API to update the policy\. You can also use the Lambda API to grant permission to another account, or restrict permission to a designated alias\. -If your function uses theAWS SDK to manage Amazon S3 resources, it also needs Amazon S3 permissions in its [execution role](lambda-intro-execution-role.md)\. +If your function uses the AWS SDK to manage Amazon S3 resources, it also needs Amazon S3 permissions in its [execution role](lambda-intro-execution-role.md)\. **Topics** + [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 08eb3d96..8bf175d7 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -45,7 +45,7 @@ Lambda polls the queue and invokes your Lambda function [synchronously](invocati } ``` -By default, Lambda invokes your function as soon as records are available in the SQS queue\. Lambda will poll up to 10 messages in your queue at once and will send that batch to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) is reached or full batch size is reached\. +By default, Lambda invokes your function as soon as records are available in the SQS queue\. Lambda will poll up to 10 messages in your queue at once and will send that batch to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. For FIFO queues, records contain additional attributes that are related to deduplication and sequencing\. @@ -141,7 +141,7 @@ Lambda supports the following options for Amazon SQS event sources\. **Event source options** + **SQS queue** – The Amazon SQS queue to read records from\. -+ **Batch size** – The number of records to send to the function in each batch\. For a standard queue this can be up to 10,000 records\. For a FIFO queue the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) for synchronous invocation \(6 MB\)\. ++ **Batch size** – The number of records to send to the function in each batch\. For a standard queue this can be up to 10,000 records\. For a FIFO queue the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. Metadata is generated by both Lambda and Amazon SQS for each record\. This additional metadata is counted towards the total payload size and may cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields sent by Amazon SQS can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) documentation in the *Amazon Simple Queue Service API Reference*\. + **Batch window ** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. Only applicable to standard queues\. From ff84f50662dcf11c14578969d00d7ace82dc9a29 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 3 Jun 2021 10:45:52 -0700 Subject: [PATCH 46/94] Updates --- doc_source/images-test.md | 2 +- doc_source/services-msk-topic-add.md | 60 ---------------------------- 2 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 doc_source/services-msk-topic-add.md diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 68b379c7..5f278440 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -144,4 +144,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. + This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md deleted file mode 100644 index 62f8eb85..00000000 --- a/doc_source/services-msk-topic-add.md +++ /dev/null @@ -1,60 +0,0 @@ -# Adding an Amazon MSK cluster as an event source - -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. - -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. - -## Prerequisites -+ An Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. For more information, see [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md)\. - -## VPC configuration - -To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, we recommend: -+ Configuring one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -+ Alternatively, instead of NAT gateway, deploy VPC Endpoints (PrivateLink) for Lambda and STS services\. If authentication is required, then deploy also VPC Endpoint for Secrets Manager\. - -Your Amazon VPC security groups must be configured with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. - -**Note** -Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and doesn't need to be configured in your `create-event-source-mapping` setup\. - -## Adding an Amazon MSK cluster using the Lambda console - -Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. - -**To add an MSK trigger to your Lambda function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of your Lambda function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Under **Trigger configuration**, choose the **MSK** trigger type\. - -1. Configure the remaining options, and then choose **Add**\. - -## Adding an Amazon MSK cluster using the AWS CLI - -Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. - -### Creating a trigger using the AWS CLI - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. - -``` -aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function -``` - -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. - -### Viewing the status using the AWS CLI - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. - -``` -aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -``` From 595790bcd0c6925b67d1ae99bd4d292e8d8a0c5c Mon Sep 17 00:00:00 2001 From: Elias Lousseief Date: Fri, 4 Jun 2021 09:09:40 +0200 Subject: [PATCH 47/94] Update images-test.md Clarified that script needs to be copied into the image as well. Also changed the path to `npx` which seems to be wrong in the script. --- doc_source/images-test.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 5f278440..6da8454f 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -82,9 +82,9 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric $@ + exec /usr/local/bin/aws-lambda-rie /usr/local/bin/npx aws-lambda-ric $@ else - exec /usr/bin/npx aws-lambda-ric $@ + exec /usr/local/bin/npx aws-lambda-ric $@ fi ``` @@ -101,9 +101,10 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local 1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. -1. Install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: +1. Copy the script and install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: ``` + COPY ./entry_script.sh /entry_script.sh ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie ENTRYPOINT [ "/entry_script.sh" ] ``` @@ -144,4 +145,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. \ No newline at end of file + This command invokes the function running in the container image and returns a response\. From 0b302c5bf8d99ec01f7c04a54b0e3396dff4723c Mon Sep 17 00:00:00 2001 From: Elias Lousseief Date: Fri, 4 Jun 2021 09:13:02 +0200 Subject: [PATCH 48/94] Update images-test.md --- doc_source/images-test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 6da8454f..8504098f 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -101,7 +101,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local 1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. -1. Copy the script and install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: +1. Copy the script, install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: ``` COPY ./entry_script.sh /entry_script.sh From 730c4f65d5bdad4c0bbb48e28b9ae36b6256a915 Mon Sep 17 00:00:00 2001 From: bl-ue <54780737+bl-ue@users.noreply.github.com> Date: Thu, 10 Jun 2021 10:04:06 -0400 Subject: [PATCH 49/94] Fix typos in getting-started-create-function.md --- doc_source/getting-started-create-function.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 1cf23be7..faa6c2c9 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell,C\#\) Go, Java, Node\.js, Python, and Ruby\. + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell, C\#\) Go, Java, Node\.js, Python, and Ruby\. 1. Choose **Create function**\. @@ -242,7 +242,7 @@ For example, use the IAM console to create a role with the following policy: { "Sid": "VisualEditor0", "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload], + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload"], "Resource": "arn:aws:ecr:::repository//" } ] @@ -341,4 +341,4 @@ If you are done working with your function, delete it\. You can also delete the 1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. From f4c82b57c5f5c942912ac1635b488f51fded2c29 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 14 Jun 2021 09:11:09 -0700 Subject: [PATCH 50/94] Updates. Add file for Secrets manager in Services chapter --- doc_source/API_AccountLimit.md | 2 +- doc_source/API_AddLayerVersionPermission.md | 2 +- doc_source/API_CreateEventSourceMapping.md | 22 +++++++++---------- doc_source/API_CreateFunction.md | 4 ++-- doc_source/API_DeleteEventSourceMapping.md | 8 +++---- doc_source/API_DeleteLayerVersion.md | 2 +- .../API_EventSourceMappingConfiguration.md | 8 +++---- doc_source/API_GetEventSourceMapping.md | 8 +++---- doc_source/API_GetLayerVersion.md | 2 +- doc_source/API_GetLayerVersionByArn.md | 2 +- doc_source/API_GetLayerVersionPolicy.md | 2 +- doc_source/API_Invoke.md | 10 ++++----- doc_source/API_Layer.md | 2 +- doc_source/API_LayerVersionContentInput.md | 2 +- doc_source/API_LayerVersionContentOutput.md | 2 +- doc_source/API_LayerVersionsListItem.md | 2 +- doc_source/API_LayersListItem.md | 2 +- doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- doc_source/API_PublishLayerVersion.md | 2 +- doc_source/API_PublishVersion.md | 2 +- .../API_RemoveLayerVersionPermission.md | 2 +- doc_source/API_TracingConfig.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 22 +++++++++---------- doc_source/API_UpdateFunctionConfiguration.md | 2 +- doc_source/best-practices.md | 2 +- doc_source/csharp-image.md | 8 +++++++ doc_source/getting-started-create-function.md | 6 ++--- doc_source/gettingstarted-limits.md | 2 +- doc_source/go-image.md | 14 ++++++++++-- doc_source/images-create.md | 10 ++++----- doc_source/images-test.md | 4 ++-- doc_source/index.md | 1 + doc_source/java-image.md | 20 ++++++++++++----- doc_source/lambda-releases.md | 12 +++++----- doc_source/lambda-services.md | 1 + doc_source/nodejs-image.md | 8 +++++++ doc_source/powershell-handler.md | 2 +- doc_source/python-image.md | 12 ++++++++-- doc_source/ruby-image.md | 8 +++++++ doc_source/with-secrets-manager.md | 15 +++++++++++++ 41 files changed, 156 insertions(+), 87 deletions(-) create mode 100644 doc_source/with-secrets-manager.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md index e59478cf..d365af86 100644 --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -10,7 +10,7 @@ Type: Long Required: No **CodeSizeZipped** -The maximum size of a deployment package when it's uploaded directly to AWS Lambda\. Use Amazon S3 for larger files\. +The maximum size of a deployment package when it's uploaded directly to Lambda\. Use Amazon S3 for larger files\. Type: Long Required: No diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index e5c0a23a..ed1614f6 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -1,6 +1,6 @@ # AddLayerVersionPermission -Adds permissions to the resource\-based policy of a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. +Adds permissions to the resource\-based policy of a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. To revoke permission, call [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 61a802c8..c1f14b5d 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -81,12 +81,12 @@ Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No ** [DestinationConfig](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object Required: No @@ -120,7 +120,7 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} Required: Yes ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -133,19 +133,19 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. +\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No ** [ParallelizationFactor](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. +\(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No @@ -189,7 +189,7 @@ Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No @@ -272,7 +272,7 @@ 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-_]+))?` ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -291,12 +291,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. @@ -346,7 +346,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 90ff763a..675dda2a 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -1,6 +1,6 @@ # CreateFunction -Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. +Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and X\-Ray for request tracing\. You set the package type to `Image` if the deployment package is a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)\. For a container image, the code property must include the URI of a container image in the Amazon ECR registry\. You do not need to specify the handler and runtime properties\. @@ -197,7 +197,7 @@ Valid Range: Minimum value of 1\. Required: No ** [TracingConfig](#API_CreateFunction_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. +Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. Type: [TracingConfig](API_TracingConfig.md) object Required: No diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 85797869..96159677 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -100,7 +100,7 @@ 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-_]+))?` ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -119,12 +119,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. @@ -174,7 +174,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md index 7efc4d20..44a8a967 100644 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -1,6 +1,6 @@ # DeleteLayerVersion -Deletes a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Deleted versions can no longer be viewed or added to functions\. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it\. +Deletes a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Deleted versions can no longer be viewed or added to functions\. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it\. ## Request Syntax diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 8c6aca49..0719b9c9 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -33,7 +33,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi Required: No **FunctionResponseTypes** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -56,13 +56,13 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No **MaximumRecordAgeInSeconds** -\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No **MaximumRetryAttempts** -\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No @@ -122,7 +122,7 @@ Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No **TumblingWindowInSeconds** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index eb182d3f..f1e2f959 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -98,7 +98,7 @@ 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-_]+))?` ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -117,12 +117,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. @@ -172,7 +172,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index 61c5fcd7..260e345b 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -1,6 +1,6 @@ # GetLayerVersion -Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. +Returns information about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. ## Request Syntax diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index e4c3cf0d..90ea2d4d 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -1,6 +1,6 @@ # GetLayerVersionByArn -Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. +Returns information about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. ## Request Syntax diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index 8a6f1f17..c81c02ab 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -1,6 +1,6 @@ # GetLayerVersionPolicy -Returns the permission policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. +Returns the permission policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. ## Request Syntax diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 294589d9..8ee0f24c 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -110,11 +110,11 @@ 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\. + 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\. + AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function\. HTTP Status Code: 502 **EFSIOException** @@ -134,7 +134,7 @@ The function was able to make a network connection to the configured file system 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\. + 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 **InvalidParameterValueException** @@ -158,7 +158,7 @@ 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\. + AWS Lambda could not unzip the deployment package\. HTTP Status Code: 502 **KMSAccessDeniedException** @@ -198,7 +198,7 @@ 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\. + 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** diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index 80c3a729..7f3231c3 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -1,6 +1,6 @@ # Layer -An [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +An [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md index 8f946fc3..0e082bcc 100644 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -1,6 +1,6 @@ # LayerVersionContentInput -A ZIP archive that contains the contents of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. You can specify either an Amazon S3 location, or upload a layer archive directly\. +A ZIP archive that contains the contents of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. You can specify either an Amazon S3 location, or upload a layer archive directly\. ## Contents diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index b0ead36e..9ad0560e 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -1,6 +1,6 @@ # LayerVersionContentOutput -Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index f2df4764..9171a195 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -1,6 +1,6 @@ # LayerVersionsListItem -Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md index 8748e7b8..d87156c7 100644 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -1,6 +1,6 @@ # LayersListItem -Details about an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index eacec069..db472ea6 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -1,6 +1,6 @@ # ListLayerVersions -Lists the versions of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. +Lists the versions of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. ## Request Syntax diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 4adf853d..3f0ec3fe 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -1,6 +1,6 @@ # ListLayers -Lists [AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. +Lists [ AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. ## Request Syntax diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 21b6f62a..35fb23e5 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -1,6 +1,6 @@ # PublishLayerVersion -Creates an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. +Creates an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. Add layers to your function with [CreateFunction](API_CreateFunction.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index a70135ce..ef95166a 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -2,7 +2,7 @@ Creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) from the current code and configuration of a function\. Use versions to create a snapshot of your function code and configuration that doesn't change\. -AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [UpdateFunctionCode](API_UpdateFunctionCode.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. + AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [UpdateFunctionCode](API_UpdateFunctionCode.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. Clients can invoke versions directly or with an alias\. To create an alias, use [CreateAlias](API_CreateAlias.md)\. diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md index 529e3980..769a97a1 100644 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -1,6 +1,6 @@ # RemoveLayerVersionPermission -Removes a statement from the permissions policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. +Removes a statement from the permissions policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. ## Request Syntax diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 517a7d18..48a8dba7 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -1,6 +1,6 @@ # TracingConfig -The function's [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. +The function's [ AWS X\-Ray ](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. ## Contents diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index c238265e..00dad8a2 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -67,12 +67,12 @@ Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No ** [DestinationConfig](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object Required: No @@ -96,7 +96,7 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} Required: No ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -109,19 +109,19 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. +\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No ** [ParallelizationFactor](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. +\(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No @@ -133,7 +133,7 @@ Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No @@ -216,7 +216,7 @@ 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-_]+))?` ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -235,12 +235,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. @@ -290,7 +290,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index d01c5d7b..24c67918 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -150,7 +150,7 @@ Valid Range: Minimum value of 1\. Required: No ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. +Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. Type: [TracingConfig](API_TracingConfig.md) object Required: No diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index 8ee37b62..0a9fe11f 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -48,7 +48,7 @@ For more information about best practices for Lambda applications, see [Applicat **To find the right memory configuration** for your functions, we recommend using the open source AWS Lambda Power Tuning project\. For more information, see [AWS Lambda Power Tuning](https://github.com/alexcasalboni/aws-lambda-power-tuning) on GitHub\. - To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [ Creating faster AWS Lambda functions with AVX2](http://aws.amazon.com/blogs/ompute/creating-faster-aws-lambda-functions-with-avx2/)\. + To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [ Creating faster AWS Lambda functions with AVX2](http://aws.amazon.com/blogs/compute/creating-faster-aws-lambda-functions-with-avx2/)\. + **Load test your Lambda function** to determine an optimum timeout value\. It is important to analyze how long your function runs so that you can better determine any problems with a dependency service that may increase the concurrency of the function beyond what you expect\. This is especially important when your Lambda function makes network calls to resources that may not handle Lambda's scaling\. + **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. + **Be familiar with [Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 6e28a97f..6132f93a 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -8,6 +8,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + ## AWS base images for \.NET AWS provides the following base images for \.NET: diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index faa6c2c9..83c80e0b 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell, C\#\) Go, Java, Node\.js, Python, and Ruby\. + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell, C\#\), Go, Java, Node\.js, Python, and Ruby\. 1. Choose **Create function**\. @@ -242,7 +242,7 @@ For example, use the IAM console to create a role with the following policy: { "Sid": "VisualEditor0", "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload"], + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload], "Resource": "arn:aws:ecr:::repository//" } ] @@ -341,4 +341,4 @@ If you are done working with your function, delete it\. You can also delete the 1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index b2821df3..4fd1e465 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -5,7 +5,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can | Resource | Default quota | Can be increased up to | | --- | --- | --- | -| Concurrent executions | 1,000 | Hundreds of thousands | +| Concurrent executions | 1,000 | Tens of thousands | | Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | | Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 8160dbe6..c55879cf 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -8,6 +8,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + **Topics** + [AWS base images for Go](#go-image-base) + [Go runtime interface clients](#go-image-clients) @@ -98,6 +106,8 @@ Note that the first three steps are identical whether you deploy your function a docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` +Now that your container image resides in the Amazon ECR container registry, you can [create](configuration-images.md) the Lambda function and deploy the image\. + ## Deploying Go with an alternative base image You can build a container image for Go from an alternative base image\. The following example Dockerfile uses [alpine](https://gallery.ecr.aws/h1a5s9h8/alpine) as the base image\. @@ -119,7 +129,7 @@ COPY --from=build /main /main ENTRYPOINT [ "/main" ] ``` -The steps are the same as described for a `provided.al2` base image, with one additional consideration: if you want to add the RIE to your image, you need to follow these additional steps before you run the `docker build` command\. +The steps are the same as described for a `provided.al2` base image, with one additional consideration: if you want to add the RIE to your image, you need to follow these additional steps before you run the `docker build` command\. For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. **To add RIE to the image** @@ -173,4 +183,4 @@ If you do not want to add the RIE to your image, you can test your image locally This command invokes the function running in the container image and returns a response\. -For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. \ No newline at end of file +Now that your container image resides in the Amazon ECR container registry, you can you can [create](configuration-images.md) the Lambda function and deploy the image\. \ No newline at end of file diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 10f34f47..3d64771e 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -15,8 +15,8 @@ After you create a container image in the Amazon ECR container registry, you can + [Container tools](#images-tools) + [Lambda requirements for container images](#images-reqs) + [Container image settings](#images-parms) -+ [Create an image from an AWS base image for Lambda](#images-create-1) -+ [Create an image from an alternative base image](#images-create-2) ++ [Create an image from an AWS base image for Lambda](#images-create-from-base) ++ [Create an image from an alternative base image](#images-create-from-alt) + [Create an image using the AWS SAM toolkit](#images-create-sam) ## Image types @@ -41,7 +41,7 @@ To deploy a container image to Lambda, note the following requirements: 1. The container image must implement the Lambda [Runtime API](runtimes-api.md)\. The AWS open\-source [runtime interface clients](runtimes-images.md#runtimes-api-client) implement the API\. You can add a runtime interface client to your preferred base image to make it compatible with Lambda\. -1. The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with 512 MB of storage\. If you are using an image that requires a writable directory outside of `/tmp`, configure it to write to a directory under the `/tmp` directory\. +1. The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with 512 MB of storage\. 1. The default Lambda user must be able to read all the files required to run your function code\. Lambda follows security best practices by defining a default Linux user with least\-privileged permissions\. Verify that your application code does not rely on files that other Linux users are restricted from running\. @@ -65,7 +65,7 @@ You can specify the container image settings in the Dockerfile when you build yo **Warning** When you specify ENTRYPOINT or CMD in the Dockerfile or as an override, make sure that you enter the absolute path\. Also, do not use symlinks as the entry point to the container\. -## Create an image from an AWS base image for Lambda +## Create an image from an AWS base image for Lambda To build a container image for a new Lambda function, you can start with an AWS base image for Lambda\. @@ -150,7 +150,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do Now that your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. -## Create an image from an alternative base image +## Create an image from an alternative base image **Prerequisites** + The AWS CLI diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 8504098f..4ce6881d 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -101,7 +101,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local 1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. -1. Copy the script, install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: +1. Copy the script, install the emulator package, and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: ``` COPY ./entry_script.sh /entry_script.sh @@ -145,4 +145,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. + This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index 7a2b41ed..ef9fea9a 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -128,6 +128,7 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + + [Using AWS Lambda with Secrets Manager](with-secrets-manager.md) + [Using AWS Lambda with Amazon SES](services-ses.md) + [Using Lambda with Amazon SNS](with-sns.md) + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 7b94916b..e6dc8fe7 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -8,10 +8,13 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. -**Topics** -+ [AWS base images for Java](#java-image-base) -+ [Using a Java base image](#java-image-instructions) -+ [Java runtime interface clients](#java-image-clients) +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. ## AWS base images for Java @@ -48,4 +51,11 @@ Install the runtime interface client for Java using the Apache Maven package man For package details, see [Lambda RIC](https://search.maven.org/artifact/com.amazonaws/aws-lambda-java-runtime-interface-client) in Maven Central Repository\. -You can also view the Java client source code in the [AWS Lambda Java Support Libraries](https://github.com/aws/aws-lambda-java-libs) repository on GitHub\. \ No newline at end of file +You can also view the Java client source code in the [AWS Lambda Java Support Libraries](https://github.com/aws/aws-lambda-java-libs) repository on GitHub\. + +After your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. + +**Topics** ++ [AWS base images for Java](#java-image-base) ++ [Using a Java base image](#java-image-instructions) ++ [Java runtime interface clients](#java-image-clients) \ No newline at end of file diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index fbe5224f..9a25d4b8 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -17,8 +17,8 @@ The following table describes the important changes to the *AWS Lambda Developer | [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | | [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window \(MaximumBatchingWindowInSeconds\) for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | | [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | -| [CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(CDK\) for TypeScript\. The CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | -| [Support for \.NET Core 3\.1\.0 runtime in ](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | +| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | +| [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | | [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | | [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | @@ -49,12 +49,12 @@ The following table describes the important changes to the *AWS Lambda Developer | [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | -| [ GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. | November 12, 2018 | -| [Moved SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | +| [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. | November 12, 2018 | +| [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | | [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | | [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | -| [Support for PowerShell Core language in ](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | -| [Support for \.NET Core 2\.1\.0 runtime in ](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | +| [Support for PowerShell Core language in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | +| [Support for \.NET Core 2\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | | [Updates now available over RSS](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | You can now subscribe to an RSS feed to follow releases for this guide\. | July 5, 2018 | | [Support for Amazon SQS as event source](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Amazon Simple Queue Service \(Amazon SQS\) as an event source\. For more information, see [Invoking Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss)\. | June 28, 2018 | | [China \(Ningxia\) Region](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the China \(Ningxia\) Region\. For more information about Lambda Regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html?icmpid=docs_lambda_rss) in the *AWS General Reference*\. | June 28, 2018 | diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 601fb137..f7d76415 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -70,6 +70,7 @@ For more information about Lambda service architectures, see [Event driven archi + [Amazon CloudFront \(Lambda@Edge\)](lambda-edge.md) + [Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + [Amazon Simple Storage Service Batch](services-s3-batch.md) ++ [Secrets Manager](with-secrets-manager.md) For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 49d69fcc..60c1a5ee 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -8,6 +8,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + ## AWS base images for Node\.js AWS provides the following base images for Node\.js: diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md index a9827dd4..8b640b5a 100644 --- a/doc_source/powershell-handler.md +++ b/doc_source/powershell-handler.md @@ -17,7 +17,7 @@ This script returns the FunctionName property that's obtained from the $LambdaCo **Note** You're required to use the `#Requires` statement within your PowerShell scripts to indicate the modules that your scripts depend on\. This statement performs two important tasks\. 1\) It communicates to other developers which modules the script uses, and 2\) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment\. For more information about the `#Requires` statement in PowerShell, see [ About requires](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-6)\. For more information about PowerShell deployment packages, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. -When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](https://docs.aws.amazon.com/documentation/powershell/?id=docs_gateway)\. +When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](http://aws.amazon.com/powershell/?track=sdk)\. ## Returning data diff --git a/doc_source/python-image.md b/doc_source/python-image.md index 5b7c5dc1..6c21dc9b 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -11,6 +11,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + ## AWS base images for Python AWS provides the following base images for Python: @@ -64,8 +72,8 @@ When you build a container image for Python using an AWS base image, you only ne CMD ["app.handler"] ``` -1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-1.title)\. +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base.title)\. -## Create a Python image from an alternative base image +## Create a Python image from an alternative base image For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 29d147cb..3cb98410 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -8,6 +8,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + ## AWS base images for Ruby AWS provides the following base images for Ruby: diff --git a/doc_source/with-secrets-manager.md b/doc_source/with-secrets-manager.md new file mode 100644 index 00000000..0dd06a0a --- /dev/null +++ b/doc_source/with-secrets-manager.md @@ -0,0 +1,15 @@ +# Using AWS Lambda with Secrets Manager + +Secrets Manager uses a Lambda function to [ rotate the secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html) for a secured service or database\. You can customize the Lambda function to implement the service\-specific details of rotating a secret\. + +Secrets Manager invokes the Lambda rotation function as a synchronous invocation\. The event parameter contains the following fields: + +``` +{ + "Step" : "request.type", + "SecretId" : "string", + "ClientRequestToken" : "string" +} +``` + +For more information about using Lambda with Secrets Manager, see [Understanding Your Lambda rotation function](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets-lambda-function-customizing.html)\. \ No newline at end of file From 3b408fe4da597a1f12b8bd4915d3ac68c71032a5 Mon Sep 17 00:00:00 2001 From: Jiahao Date: Tue, 15 Jun 2021 16:54:41 -0700 Subject: [PATCH 51/94] Remove Unused Variable `logger` is unused since `Util.logEnvironment()` is doing the logging. Remove the unused Logger here. --- .../java-events/src/main/java/example/HandlerApiGateway.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java index d417e28f..a13d63e0 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java +++ b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java @@ -18,7 +18,6 @@ public class HandlerApiGateway implements RequestHandler Date: Tue, 15 Jun 2021 19:22:00 -0700 Subject: [PATCH 52/94] Remove unused import --- .../java-events/src/main/java/example/HandlerApiGateway.java | 1 - 1 file changed, 1 deletion(-) diff --git a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java index a13d63e0..76df1e1e 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java +++ b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; From 2e781c600131f0fe5e2498d58a95c7ac2a540f69 Mon Sep 17 00:00:00 2001 From: Rafael CP Date: Sat, 26 Jun 2021 19:04:02 -0300 Subject: [PATCH 53/94] fix: use payload file protocol accordingly Aws Cli version --- sample-apps/blank-csharp/3-invoke.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/blank-csharp/3-invoke.sh b/sample-apps/blank-csharp/3-invoke.sh index 85db0bb9..85ab68d9 100755 --- a/sample-apps/blank-csharp/3-invoke.sh +++ b/sample-apps/blank-csharp/3-invoke.sh @@ -1,9 +1,9 @@ #!/bin/bash set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-csharp --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) - +if [[ $(aws --version) =~ "aws-cli/2." ]]; then PAYLOAD_PROTOCOL="fileb"; else PAYLOAD_PROTOCOL="file"; fi; while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD_PROTOCOL://event.json out.json cat out.json echo "" sleep 2 From a33a6f2c1a1158e4bc24f5d5a5b1cb906e45fc2e Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 28 Jun 2021 15:45:16 -0700 Subject: [PATCH 54/94] doc updates --- doc_source/API_ListEventSourceMappings.md | 2 +- doc_source/configuration-images.md | 36 ++++++------- doc_source/csharp-exceptions.md | 17 ++----- doc_source/csharp-handler.md | 2 +- doc_source/csharp-logging.md | 3 +- doc_source/csharp-package-cli.md | 6 ++- doc_source/gettingstarted-awscli.md | 2 +- doc_source/golang-exceptions.md | 17 ++----- doc_source/golang-handler.md | 2 +- doc_source/golang-logging.md | 3 +- doc_source/invocation-async.md | 8 ++- doc_source/java-exceptions.md | 17 ++----- doc_source/java-logging.md | 3 +- doc_source/lambda-releases.md | 1 + .../monitoring-functions-access-metrics.md | 2 +- doc_source/nodejs-exceptions.md | 17 ++----- doc_source/nodejs-logging.md | 3 +- doc_source/powershell-exceptions.md | 17 ++----- doc_source/powershell-logging.md | 3 +- doc_source/python-exceptions.md | 17 ++----- doc_source/python-image.md | 34 +++++++++++++ doc_source/python-logging.md | 3 +- doc_source/python-package-create.md | 50 ++++++++++--------- doc_source/ruby-exceptions.md | 17 ++----- doc_source/ruby-logging.md | 3 +- doc_source/runtimes-extensions-api.md | 3 +- doc_source/services-apigateway-tutorial.md | 6 +-- doc_source/services-xray.md | 6 +++ doc_source/using-extensions.md | 2 +- doc_source/with-android-example.md | 6 +-- doc_source/with-ddb-example.md | 7 +-- doc_source/with-kinesis-example.md | 6 +-- doc_source/with-s3-example.md | 5 +- doc_source/with-s3-tutorial.md | 33 +++--------- doc_source/with-sns-create-package.md | 2 +- doc_source/with-sns-example.md | 28 +++++------ doc_source/with-sqs-example.md | 6 +-- 37 files changed, 185 insertions(+), 210 deletions(-) diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 7ff4f8fe..fc36e832 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -36,7 +36,7 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} A pagination token returned by a previous call\. ** [MaxItems](#API_ListEventSourceMappings_RequestSyntax) ** -The maximum number of event source mappings to return\. +The maximum number of event source mappings to return\. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. ## Request Body diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index afcfaddc..d68f2173 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -13,7 +13,7 @@ In Amazon ECR, if you reassign the image tag to another image, Lambda does not u **Topics** + [Function version $LATEST](#configuration-images-latest) + [Container image deployment](#configuration-images-optimization) -+ [Update the user permissions](#configuration-images-permissions) ++ [Amazon ECR permissions](#configuration-images-permissions) + [Override the container settings](#configuration-images-settings) + [Creating a function \(console\)](#configuration-images-create) + [Updating the function code \(console\)](#configuration-images-update) @@ -33,30 +33,30 @@ For more information about managing versions, see [Lambda function versions](con When you deploy code as a container image to a Lambda function, the image undergoes an optimization process for running on Lambda\. This process can take a few seconds, during which the function is in pending state\. When the optimization process completes, the function enters the active state\. -## Update the user permissions +## Amazon ECR permissions -Make sure that the permissions for the AWS Identity and Access Management \(IAM\) user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy`, `SetRepositoryPolicy`, and `InitiateLayerUpload`\. - -For example, use the IAM console to create a role with the following policy: +For your function to access the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minumum policy: ``` { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": [ - "ecr:SetRepositoryPolicy", - "ecr:GetRepositoryPolicy", - "ecr:InitiateLayerUpload" - ], - "Resource": "arn:aws:ecr:::repository//" - } - ] + "Sid": "LambdaECRImageRetrievalPolicy", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": [ + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ] } ``` +For more information about Amazon ECR repository permissions, see [Repository policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html) in the *Amazon Elastic Container Registry User Guide*\. + +If the Amazon ECR repository does not include these permissions, Lambda adds `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` to the container image repository permissions\. Lambda can add these permissions only if the Principal calling Lambda has `ecr:getRepositoryPolicy` and `ecr:setRepositoryPolicy` permissions\. + +To view or edit your Amazon ECR repository permissions, follow the directions in [Setting a repository policy statement](https://docs.aws.amazon.com/AmazonECR/latest/userguide/set-repository-policy.html) in the *Amazon Elastic Container Registry User Guide*\. + ## Override the container settings You can use the Lambda console or the Lambda API to override the following container image settings: diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index 3e1a65f4..ff338602 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -179,21 +179,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 88ff9be2..10818ea5 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -97,7 +97,7 @@ If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda When creating Lambda functions, you have to provide a handler string that tells AWS Lambda where to look for the code to invoke\. In C\#, the format is: *ASSEMBLY::TYPE::METHOD* where: -+ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in \.csproj, the *ASSEMBLY* name will be the name of the folder that contains your \.csproj file once the build is complete\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the folder name is `HelloWorldApp`\. ++ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in \.csproj, the *ASSEMBLY* name will be the \.csproj file name\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the \.csproj file is `HelloWorldApp.csproj`\. + *TYPE* is the full name of the handler type, which consists of the *Namespace* and the *ClassName*\. In this case `Example.Hello`\. + *METHOD* is name of the function handler, in this case `MyHandler`\. diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index 2e53e534..eb775c10 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -151,10 +151,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md index 85cf3997..381751e5 100644 --- a/doc_source/csharp-package-cli.md +++ b/doc_source/csharp-package-cli.md @@ -167,14 +167,16 @@ dotnet lambda deploy-function MyFunction --function-role role After deployment, you can re\-test it in a production environment using the following command, and pass in a different value to your Lambda function handler: +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + ``` -dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" +dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" ``` If everything is successful, you see the following: ``` -dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" +dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" Payload: "JUST CHECKING IF EVERYTHING IS OK" diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index e71c6056..b145cf67 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -185,7 +185,7 @@ This example requires that `my-function` returns a log stream ID\. ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index 0be634ea..a2c01bb6 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -97,21 +97,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index c3c80996..bf6475de 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -113,7 +113,7 @@ The following lists valid handler signatures\. `TIn` and `TOut` represent types + ``` - func (TIn), error + func (TIn) error ``` + diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 5f8da42a..88cdb341 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -136,10 +136,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index b1611c5d..e3a39d64 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -9,9 +9,15 @@ The following diagram shows clients invoking a Lambda function asynchronously\. For asynchronous invocation, Lambda places the event in a queue and returns a success response without additional information\. A separate process reads events from the queue and sends them to your function\. To invoke a function asynchronously, set the invocation type parameter to `Event`\. ``` -aws lambda invoke --function-name my-function --invocation-type Event --payload '{ "key": "value" }' response.json +aws lambda invoke \ + --function-name my-function \ + --invocation-type Event \ + --cli-binary-format raw-in-base64-out \ + --payload '{ "key": "value" }' response.json ``` +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + You should see the following output: ``` diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index cf8cadf2..b597748e 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -159,21 +159,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index c8da6366..6e6600ef 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -150,10 +150,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 9a25d4b8..dc4829a1 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | General availability for Lambda extensions\. Use extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | May 24, 2021 | | [New Lambda console experience](#lambda-releases) | The Lambda console has been redesigned to improve performance and consistency\. | March 2, 2021 | | [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | | [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md index ec584aa9..015532fb 100644 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -25,7 +25,7 @@ You can use the Lambda console's monitoring dashboard to monitor your Lambda fun The following section describes the monitoring graphs on the Lambda console\. **Lambda monitoring graphs** -+ **Invocations** – The number of times that the function was invoked in each 5\-minute period\. ++ **Invocations** – The number of times that the function was invoked\. + **Duration** – The average, minimum, and maximum execution times\. + **Error count and success rate \(%\)** – The number of errors and the percentage of executions that completed without error\. + **Throttles** – The number of times that execution failed due to concurrency limits\. diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 0955df5f..bcb6fab3 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -92,21 +92,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 6f0b9f5f..18f012c4 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -129,10 +129,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index bddd1d85..04a07bb0 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -116,21 +116,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 1c5ab1ea..4df8aab8 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -139,10 +139,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index ef389967..23085fbb 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -71,21 +71,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/python-image.md b/doc_source/python-image.md index 6c21dc9b..b7f6ee42 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -19,6 +19,12 @@ The workflow for a function defined as a container image includes these steps: 1. [Create](configuration-images.md) the Lambda function and deploy the image\. +**Topics** ++ [AWS base images for Python](#python-image-base) ++ [Python runtime interface clients](#python-image-clients) ++ [Deploying Python with an AWS base image](#python-image-create) ++ [Create a Python image from an alternative base image](#python-image-create-alt) + ## AWS base images for Python AWS provides the following base images for Python: @@ -74,6 +80,34 @@ When you build a container image for Python using an AWS base image, you only ne 1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base.title)\. +### Adding dependencies when you create a Python image + +If your Lambda function depends on external Python libraries, modify the previous procedure as follows: + +1. In your project directory, add a file named `requirements.txt`\. List each required library as a separate line in this file\. + +1. Modify your Dockerfile to add the required libraries to the container image\. The following example copies the requirements file and installs the required libraries into the `app` directory\. Do not install the dependencies globally or in user space\. + + ``` + FROM public.ecr.aws/lambda/python:3.8 + + # Create function directory + WORKDIR /app + + # Install the function's dependencies + # Copy file requirements.txt from your project folder and install + # the requirements in the app directory. + + COPY requirements.txt . + RUN pip3 install -r requirements.txt + + # Copy handler function (from the local app directory) + COPY app.py . + + # Overwrite the command by providing a different command directly in the template. + CMD ["/app/app.handler"] + ``` + ## Create a Python image from an alternative base image For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index c8d3710a..46c2c9e6 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -121,10 +121,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 417d545e..61ca477b 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -83,6 +83,14 @@ A dependency can be any package, module or other assembly dependency that is not This section describes how to create a Lambda function without runtime dependencies\. +**Topics** ++ [Overview](#python-package-create-about-no-dependency) ++ [Create the deployment package](#python-package-create-package-no-dependency) ++ [Create the Lambda function](#python-package-create-createfunction-no-dependency) ++ [Invoke the Lambda function](#python-package-create-invokefunction-no-dependency) ++ [What's next?](#python-package-create-next-no-dependency) ++ [Clean up your resources](#python-package-create-cleanup-no-dependency) + ### Overview In this tutorial, you use the [sample code from the AWS SDK for Python \(Boto3\) project on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) to create a Lambda function using the AWS CLI\. You'll learn how to: @@ -187,14 +195,13 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i + Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. ``` - aws lambda invoke --function-name my-math-function --payload '{"action": "square","number": 3}' output.txt + aws lambda invoke \ + --function-name my-math-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"action": "square","number": 3}' output.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) This command produces the following output: @@ -253,6 +260,14 @@ For more information, see [What is a runtime dependency?](python-package.md#pyth This section describes how to create a Lambda function with runtime dependencies\. +**Topics** ++ [Overview](#python-package-create-about) ++ [Create the deployment package](#python-package-create-package-with-dependency) ++ [Create the Lambda function](#python-package-create-createfunction-with-dependency) ++ [Invoke the Lambda function](#python-package-create-invokefunction-with-dependency) ++ [What's next?](#python-package-create-next-with-dependency) ++ [Clean up your resources](#python-package-create-cleanup-with-dependency) + ### Overview In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://www\.test\.com/](https://www.test.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. @@ -384,27 +399,14 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i **To invoke the function** + Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. ------- -#### [ macOS/Linux ] - ``` - aws lambda invoke --function-name my-sourcecode-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + aws lambda invoke \ + --function-name my-sourcecode-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- -#### [ Windows ] - - ``` - aws lambda invoke --function-name my-sourcecode-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt - ``` - ------- -**Note** -If you are using AWS CLI version 2, add the following command parameter: - - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) This command produces the following output: diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index e28640b7..6a9b9ff9 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -93,21 +93,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 12d7b277..02f53e70 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -151,10 +151,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index b2c45236..96f68152 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -10,6 +10,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) + Custom runtime \(`provided`\) + Custom runtime on Amazon Linux 2 \(`provided.al2`\) ++ Go 1\.x \(`go1.x`\) + Java 11 \(Corretto\) \(`java11`\) + Java 8 \(Corretto\) \(`java8.al2`\) + Node\.js 14\.x \(`nodejs14.x`\) @@ -107,7 +108,7 @@ Here is an example payload: **Note** Lambda allocates CPU power in proportion to the function's memory setting\. You might see increased execution and initialization duration at lower memory settings because the function and extension processes are competing for the same CPU resources\. To reduce the execution and initialization duration, try increasing the memory setting\. -To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExtensionsDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 3e190953..32b02804 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -253,12 +253,8 @@ Invoke the function manually using the sample event data\. We recommend that you aws lambda invoke --function-name LambdaFunctionOverHttps \ --payload file://input.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ## Create an API using Amazon API Gateway diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 402690ca..c509f9e0 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -37,6 +37,12 @@ The `Invocation` subsegment represents the invoke phase where Lambda invokes the The `Overhead` subsegment represents the phase that occurs between the time when the runtime sends the response and the signal for the next invoke\. During this time, the runtime finishes all tasks related to an invoke and prepares to freeze the sandbox\. + + +**Note** +If your Lambda function uses [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), your X\-Ray trace might display a function initialization with a very long duration\. +Provisioned concurrency initializes function instances in advance, to reduce lag at the time of invocation\. Over time, provisioned concurrency refreshes these instances by creating new instances to replace the old ones\. For workloads with steady traffic, the new instances are initialized well in advance of their first invocation\. The time gap gets recorded in the X\-Ray trace as the initialization duration\. + The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index c1889ca0..5d6b1af5 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -53,7 +53,7 @@ Extensions can impact the performance of your function because they share functi Each extension must complete its initialization before Lambda invokes the function\. Therefore, an extension that consumes significant initialization time can increase the latency of the function invocation\. -To measure the extra time that the extension takes after the function execution, you can use the `PostRuntimeExecutionDuration` [function metric](monitoring-metrics.md)\. To measure the increase in memory used, you can use the `MaxMemoryUsed` metric\. To understand the impact of a specific extension, you can run different versions of your functions side by side\. +To measure the extra time that the extension takes after the function execution, you can use the `PostRuntimeExtensionsDuration` [function metric](monitoring-metrics.md)\. To measure the increase in memory used, you can use the `MaxMemoryUsed` metric\. To understand the impact of a specific extension, you can run different versions of your functions side by side\. ## Permissions diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index b0312a74..8389bf61 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -98,12 +98,8 @@ Invoke the function manually using the sample event data\. aws lambda invoke --function-name AndroidBackendLambdaFunction \ --payload file://file-path/input.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ## Create an Amazon Cognito identity pool diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index d4413760..f26f7fb4 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -185,12 +185,7 @@ Run the following `invoke` command\. aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - -``` ---cli-binary-format raw-in-base64-out -``` +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The function returns the string `message` in the response body\. diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 36f9a21e..1efb74d3 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -123,12 +123,8 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a ``` aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The response is saved to `out.txt`\. diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 0c547d52..9f6c28d6 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -242,7 +242,10 @@ Invoke your function when you upload a file to the Amazon S3 source bucket\. 1. Choose the name of your function \(**my\-s3\-function**\)\. -1. Choose the **Monitor** tab, then verify that the function ran once for each file that you uploaded\. +1. To verify that the function ran once for each file that you uploaded, choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. The count in the **Invocations** graph should match the number of files that you uploaded to the Amazon S3 bucket\. +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) + + For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. 1. \(Optional\) To view the logs in the CloudWatch console, choose **View logs in CloudWatch**\. Choose a log stream to view the logs output for one of the function invocations\. diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index 189fedf9..11e3265d 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -488,12 +488,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -507,12 +502,7 @@ If you are using AWS CLI version 2, add the following command parameter: --role arn:aws:iam::123456789012:role/lambda-s3-role ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The create\-function command specifies the function handler as `lambda_function.lambda_handler`\. This handler name reflects the function name as `lambda_handler`, and the name of the file where the handler code is stored as `lambda_function.py`\. For more information, see [Lambda function handler in Python](python-handler.md)\. The command specifies a runtime of `python3.8`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -526,12 +516,7 @@ If you are using AWS CLI version 2, add the following command parameter: --role arn:aws:iam::123456789012:role/lambda-s3-role ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The create\-function command specifies the function handler as `example.handler`\. The function can use the abbreviated handler format of `package.Class` because the function implements a handler interface\. For more information, see [AWS Lambda function handler in Java](java-handler.md)\. The command specifies a runtime of `java11`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -595,15 +580,13 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. 1. Invoke the function with the following invoke command\. Note that the command requests asynchronous execution \(`--invocation-type Event`\)\. Optionally, you can invoke the function synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. ``` - aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ - --payload file://inputFile.txt outputfile.txt + aws lambda invoke + --function-name CreateThumbnail \ + --invocation-type Event \ + --payload file://inputFile.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) 1. Verify that the thumbnail is created in the target S3 bucket\. diff --git a/doc_source/with-sns-create-package.md b/doc_source/with-sns-create-package.md index 8f44c052..25919e17 100644 --- a/doc_source/with-sns-create-package.md +++ b/doc_source/with-sns-create-package.md @@ -32,7 +32,7 @@ Zip up the sample code to create a deployment package\. For instructions, see [D The following example processes messages from Amazon SNS, and logs their contents\. -**Example LambdaWithSNS\.java** +**Example LogEvent\.java** ``` package example; diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index c048cb30..03e2fffe 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -29,7 +29,7 @@ In the tutorial, you use two accounts\. The AWS CLI commands illustrate this by From account A \(01234567891A\), create the source Amazon SNS topic\. ``` -aws sns create-topic --name lambda-x-account --profile accountA +aws sns create-topic --name sns-topic-for-lambda --profile accountA ``` Note the topic ARN that is returned by the command\. You will need it when you add permissions to the Lambda function to subscribe to the topic\. @@ -85,7 +85,7 @@ exports.handler = function(event, context, callback) { 1. Create a Lambda function with the `create-function` command\. ``` - aws lambda create-function --function-name SNS-X-Account \ + aws lambda create-function --function-name Function-With-SNS \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::01234567891B:role/service-role/lambda-sns-execution-role \ --timeout 60 --profile accountB @@ -99,16 +99,16 @@ From account A \(01234567891A\), grant permission to account B \(01234567891B\) ``` aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ +--topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ --action-name Subscribe ListSubscriptionsByTopic --profile accountA ``` From account B \(01234567891B\), add the Lambda permission to allow invocation from Amazon SNS\. ``` -aws lambda add-permission --function-name SNS-X-Account \ ---source-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ ---statement-id sns-x-account --action "lambda:InvokeFunction" \ +aws lambda add-permission --function-name Function-With-SNS \ +--source-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +--statement-id function-with-sns --action "lambda:InvokeFunction" \ --principal sns.amazonaws.com --profile accountB ``` @@ -117,11 +117,11 @@ You should see the following output: ``` { "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": - \"arn:aws:sns:us-east-2:12345678901A:lambda-x-account\"}}, + \"arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda\"}}, \"Action\":[\"lambda:InvokeFunction\"], - \"Resource\":\"arn:aws:lambda:us-east-2:01234567891B:function:SNS-X-Account\", + \"Resource\":\"arn:aws:lambda:us-east-2:01234567891B:function:Function-With-SNS\", \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, - \"Sid\":\"sns-x-account1\"}" + \"Sid\":\"function-with-sns1\"}" } ``` @@ -132,12 +132,12 @@ If the account with the SNS topic is hosted in an opt\-in region, you need to sp ## Create a subscription -From account B, subscribe the Lambda function to the topic\. When a message is sent to the `lambda-x-account` topic in account A \(01234567891A\), Amazon SNS invokes the `SNS-X-Account` function in account B \(01234567891B\)\. +From account B, subscribe the Lambda function to the topic\. When a message is sent to the `sns-topic-for-lambda` topic in account A \(01234567891A\), Amazon SNS invokes the `Function-With-SNS` function in account B \(01234567891B\)\. ``` aws sns subscribe --protocol lambda \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ ---notification-endpoint arn:aws:lambda:us-east-2:12345678901B:function:SNS-X-Account \ +--topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +--notification-endpoint arn:aws:lambda:us-east-2:12345678901B:function:Function-With-SNS \ --profile accountB ``` @@ -145,7 +145,7 @@ You should see the following output: ``` { - "SubscriptionArn": "arn:aws:sns:us-east-2:12345678901A:lambda-x-account:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" + "SubscriptionArn": "arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" } ``` @@ -157,7 +157,7 @@ From account A \(01234567891A\), test the subscription\. Type `Hello World` into ``` aws sns publish --message file://message.txt --subject Test \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ +--topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ --profile accountA ``` diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index b226fdea..87cd8e43 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -113,12 +113,8 @@ If the handler returns normally without exceptions, Lambda considers the message aws lambda invoke --function-name ProcessSQSRecord \ --payload file://input.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) 1. Verify the output in the `outputfile.txt` file\. From e0af1ee737a7c1ed14682d374d2ddd8e0a6cfd4a Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 8 Jul 2021 13:51:14 -0700 Subject: [PATCH 55/94] MQ event source now supports RabbitMQ. Other updates --- doc_source/API_CreateEventSourceMapping.md | 22 +- doc_source/API_DeleteEventSourceMapping.md | 20 +- .../API_EventSourceMappingConfiguration.md | 22 +- doc_source/API_GetEventSourceMapping.md | 20 +- doc_source/API_SelfManagedEventSource.md | 2 +- doc_source/API_SourceAccessConfiguration.md | 18 +- doc_source/API_UpdateEventSourceMapping.md | 22 +- doc_source/configuration-aliases.md | 4 +- doc_source/index.md | 2 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/lambda-intro-execution-role.md | 2 +- doc_source/lambda-releases.md | 2 + doc_source/lambda-services.md | 2 +- doc_source/monitoring-cloudwatchlogs.md | 8 +- doc_source/python-package-create.md | 4 +- doc_source/python-package-update.md | 6 +- doc_source/python-package.md | 2 +- doc_source/runtimes-extensions-api.md | 5 +- doc_source/runtimes-images.md | 7 +- doc_source/troubleshooting-execution.md | 3 + doc_source/troubleshooting-invocation.md | 6 + doc_source/using-extensions.md | 4 +- doc_source/with-kafka.md | 354 +++++++++++------- doc_source/with-mq.md | 187 +++++---- doc_source/with-msk.md | 152 ++++++-- 25 files changed, 549 insertions(+), 329 deletions(-) diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index c1f14b5d..c10c1f12 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -164,7 +164,7 @@ Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of authentication protocols or VPC components required to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No @@ -278,15 +278,15 @@ Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp ** [LastProcessingResult](#API_CreateEventSourceMapping_ResponseSyntax) ** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -301,28 +301,28 @@ Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. ** [Queues](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` @@ -335,7 +335,7 @@ The state of the event source mapping\. It can be one of the following: `Creatin Type: String ** [StateTransitionReason](#API_CreateEventSourceMapping_ResponseSyntax) ** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** @@ -346,7 +346,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 96159677..9a7ed927 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -106,15 +106,15 @@ Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp ** [LastProcessingResult](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -129,28 +129,28 @@ Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. ** [Queues](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` @@ -163,7 +163,7 @@ The state of the event source mapping\. It can be one of the following: `Creatin Type: String ** [StateTransitionReason](#API_DeleteEventSourceMapping_ResponseSyntax) ** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** @@ -174,7 +174,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 0719b9c9..b035d9d8 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -1,6 +1,6 @@ # EventSourceMappingConfiguration -A mapping between an AWS resource and an AWS Lambda function\. See [CreateEventSourceMapping](API_CreateEventSourceMapping.md) for details\. +A mapping between an AWS resource and a Lambda function\. For details, see [CreateEventSourceMapping](API_CreateEventSourceMapping.md)\. ## Contents @@ -40,17 +40,17 @@ Valid Values:` ReportBatchItemFailures` Required: No **LastModified** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp Required: No **LastProcessingResult** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String Required: No **MaximumBatchingWindowInSeconds** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -68,13 +68,13 @@ Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No **ParallelizationFactor** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No **Queues** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. @@ -82,18 +82,18 @@ Pattern: `[\s\S]*` Required: No **SelfManagedEventSource** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No **SourceAccessConfigurations** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No **StartingPosition** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No @@ -109,7 +109,7 @@ Type: String Required: No **StateTransitionReason** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String Required: No @@ -122,7 +122,7 @@ Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No **TumblingWindowInSeconds** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index f1e2f959..b23d8210 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -104,15 +104,15 @@ Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp ** [LastProcessingResult](#API_GetEventSourceMapping_ResponseSyntax) ** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -127,28 +127,28 @@ Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. ** [Queues](#API_GetEventSourceMapping_ResponseSyntax) ** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` @@ -161,7 +161,7 @@ The state of the event source mapping\. It can be one of the following: `Creatin Type: String ** [StateTransitionReason](#API_GetEventSourceMapping_ResponseSyntax) ** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** @@ -172,7 +172,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md index cdf08843..0c6fbb53 100644 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -1,6 +1,6 @@ # SelfManagedEventSource -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. ## Contents diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 06601520..4cb6fbc6 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -1,18 +1,20 @@ # SourceAccessConfiguration -You can specify the authentication protocol, or the VPC components to secure access to your event source\. +To secure and define access to your event source, you can specify the authentication protocol, VPC components, or virtual host\. ## Contents **Type** -The type of authentication protocol or the VPC components for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. -+ `BASIC_AUTH` \- \(MQ\) The Secrets Manager secret that stores your broker credentials\. -+ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your Self\-Managed Apache Kafka cluster\. -+ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your Self\-Managed Apache Kafka brokers\. -+ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your Self\-Managed Apache Kafka brokers\. -+ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your Self\-Managed Apache Kafka brokers\. +The type of authentication protocol, VPC components, or virtual host for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. ++ `BASIC_AUTH` \- \(Amazon MQ\) The AWS Secrets Manager secret that stores your broker credentials\. ++ `BASIC_AUTH` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers\. ++ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your self\-managed Apache Kafka cluster\. ++ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your self\-managed Apache Kafka brokers\. ++ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your self\-managed Apache Kafka brokers\. ++ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your self\-managed Apache Kafka brokers\. ++ `VIRTUAL_HOST` \- \(Amazon MQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. Type: String -Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH` +Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST` Required: No **URI** diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 00dad8a2..b834fc9f 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -127,7 +127,7 @@ Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of authentication protocols or VPC components required to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No @@ -222,15 +222,15 @@ Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp ** [LastProcessingResult](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -245,28 +245,28 @@ Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. ** [Queues](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` @@ -279,7 +279,7 @@ The state of the event source mapping\. It can be one of the following: `Creatin Type: String ** [StateTransitionReason](#API_UpdateEventSourceMapping_ResponseSyntax) ** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** @@ -290,7 +290,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 769e0491..1ceeea73 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -86,6 +86,8 @@ For more information about using resource names in policies, see [Resources and Use routing configuration on an alias to send a portion of traffic to a second function version\. For example, you can reduce the risk of deploying a new version by configuring the alias to send most of the traffic to the existing version, and only a small percentage of traffic to the new version\. +Note that Lambda uses a simple probabilistic model to distribute the traffic between the two function versions\. At low traffic levels, you might see a high variance between the configured and actual percentage of traffic on each version\. If your function uses provisioned concurrency, you can avoid [spillover invocations](monitoring-metrics.md#monitoring-metrics-invocation) by configuring a higher number of provisioned concurrency instances during the time that alias routing is active\. + You can point an alias to a maximum of two Lambda function versions\. The versions must meet the following criteria: + Both versions must have the same [execution role](lambda-intro-execution-role.md)\. + Both versions must have the same [dead\-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) configuration, or no dead\-letter queue configuration\. @@ -117,7 +119,7 @@ Verify that the function has at least two published versions\. To create additio 1. Choose **Save**\. -### Configuring alias routing +### Configuring alias routing using CLI Use the `create-alias` and `update-alias` AWS CLI commands to configure the traffic weights between two function versions\. When you create or update the alias, you specify the traffic weight in the `routing-config` parameter\. diff --git a/doc_source/index.md b/doc_source/index.md index ef9fea9a..b4ce81fa 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -112,7 +112,7 @@ Amazon's trademarks and trade dress may not be used in + [Using Amazon EFS with Lambda](services-efs.md) + [Using AWS Lambda with AWS IoT](services-iot.md) + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) - + [Using Lambda with an Apache Kafka cluster](with-kafka.md) + + [Using Lambda with self-managed Apache Kafka](with-kafka.md) + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 15a739c4..8ebd736e 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -7,7 +7,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) ++ [self\-managed Apache Kafka](with-kafka.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 525bb027..bce78b63 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -146,7 +146,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) ++ [self\-managed Apache Kafka](with-kafka.md) + [Amazon Simple Queue Service](with-sqs.md) In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index dc4829a1..d8ea2dd7 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,8 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Support for RabbitMQ as an event source on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ for RabbitMQ as an event source\. Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | July 7, 2021 | +| [SASL/PLAIN authentication for self\-managed Kafka on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss) | SASL/PLAIN is now a supported authentication mechanism for self\-managed Kafka event sources on Lambda Customers already using SASL/PLAIN on their self\-managed Kafka cluster can now easily use Lambda to build consumer applications without having to modify the way they authenticate\. For details, see [Using Lambda with self\-managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss)\. | June 29, 2021 | | [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | General availability for Lambda extensions\. Use extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | May 24, 2021 | | [New Lambda console experience](#lambda-releases) | The Lambda console has been redesigned to improve performance and consistency\. | March 2, 2021 | | [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index f7d76415..c51eea66 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -53,7 +53,7 @@ For services that generate a queue or data stream, you create an [event source m + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) ++ [self\-managed Apache Kafka](with-kafka.md) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md index b17ff9c9..8c6012d6 100644 --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -6,6 +6,9 @@ You can insert logging statements into your code to help you validate that your You can view logs for Lambda functions using the Lambda console, the CloudWatch console, the AWS Command Line Interface \(AWS CLI\), or the CloudWatch API\. This page describes how to view logs using the Lambda console\. +**Note** +It may take 5 to 10 minutes for logs to show up after a function invocation\. + **Topics** + [Prerequisites](#monitoring-cloudwatchlogs-prereqs) + [Pricing](#monitoring-cloudwatchlogs-pricing) @@ -31,16 +34,13 @@ The following section describes how to view logs for your function on the Lambda 1. Choose a function\. -1. Choose **Monitoring**\. +1. Choose **Monitor**\. ![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png)![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/)![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/) A graphical representation of the metrics for the Lambda function are shown\. 1. Choose **View logs in CloudWatch**\. -**Note** -Logs may not be immediately available after invocation\. We recommend waiting 5 to 10 minutes before checking your execution role\. - ## Using the AWS CLI To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language\. The Lambda runtime uploads your function's log output to CloudWatch Logs\. For language\-specific instructions, see the following topics: diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 61ca477b..80ee105a 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -77,7 +77,7 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AW ## Creating a function without runtime dependencies -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) @@ -254,7 +254,7 @@ You can now delete the resources that you created for this tutorial, unless you ## Creating a function with runtime dependencies -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index e6ea38a0..b94099d2 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -18,7 +18,7 @@ The AWS CLI is an open\-source tool that enables you to interact with AWS servic ## Updating a function without runtime dependencies -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. @@ -54,7 +54,7 @@ The Lambda function in this step uses a function handler of `lambda_function.lam ## Updating a function with runtime dependencies -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. @@ -134,7 +134,7 @@ The Lambda function in this step uses a function handler of `lambda_function.lam ## Using a virtual environment -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. diff --git a/doc_source/python-package.md b/doc_source/python-package.md index daaff8a8..cf4e4866 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -31,7 +31,7 @@ The AWS CLI is an open\-source tool that enables you to interact with AWS servic A [deployment package](gettingstarted-package.md) is required to create or update a Lambda function with or without runtime dependencies\. The deployment package acts as the source bundle to run your function's code and dependencies \(if applicable\) on Lambda\. -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](#python-package)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. The following example describes a Lambda function without runtime dependencies: + If your function's code is in Python 3\.8, and it depends only on standard Python math and logging libraries, you don't need to include the libraries in your \.zip file\. These libraries are included with the `python3.8` runtime\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 96f68152..8792ad16 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -6,11 +6,10 @@ As an extension author, you can use the Lambda Extensions API to integrate deepl An extension runs as an independent process in the execution environment and can continue to run after the function invocation is fully processed\. Because extensions run as processes, you can write them in a different language than the function\. We recommend that you implement extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with all of the supported runtimes\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. -The following [Lambda runtimes](lambda-runtimes.md) support external extensions: +The following [Lambda runtimes](lambda-runtimes.md) support extensions: + \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) + Custom runtime \(`provided`\) + Custom runtime on Amazon Linux 2 \(`provided.al2`\) -+ Go 1\.x \(`go1.x`\) + Java 11 \(Corretto\) \(`java11`\) + Java 8 \(Corretto\) \(`java8.al2`\) + Node\.js 14\.x \(`nodejs14.x`\) @@ -21,6 +20,8 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Ruby 2\.7 \(`ruby2.7`\) + Ruby 2\.5 \(`ruby2.5`\) +Note that the Go 1\.x runtime does not support extensions\. To support extensions, you can create Go functions on the `provided.al2` runtime\. For more information, see [ Migrating Lambda functions to Amazon Linux 2](http://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/)\. + Lambda also supports *internal extensions*\. An internal extension runs as a separate thread in the runtime process\. The runtime starts and stops the internal extension\. An alternative way to integrate with the Lambda environment is to use language\-specific [environment variables and wrapper scripts](runtimes-modify.md)\. You can use these to configure the runtime environment and modify the startup behavior of the runtime process\. You can add extensions to a function in two ways\. For a function deployed as a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip), you deploy your extension as a [layer](configuration-layers.md)\. For a function defined as a container image, you add [the extensions](using-extensions.md#invocation-extensions-images) to your container image\. diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md index 2a097aed..9f42c839 100644 --- a/doc_source/runtimes-images.md +++ b/doc_source/runtimes-images.md @@ -4,6 +4,7 @@ AWS provides a set of open\-source base images that you can use\. You can also u **Topics** + [AWS base images for Lambda](#runtimes-images-lp) ++ [Base images for custom runtimes](#runtimes-images-custom) + [Runtime interface clients](#runtimes-api-client) + [Runtime interface emulator](#runtimes-test-emulator) @@ -21,7 +22,7 @@ Lambda provides base images for the following runtimes: + [Go](go-image.md) + [Ruby](ruby-image.md) -### Base images for custom runtimes +## Base images for custom runtimes AWS provides base images that contain the required Lambda components and the Amazon Linux or Amazon Linux2 operating system\. You can add your preferred runtime, dependencies and code to these images\. @@ -39,7 +40,7 @@ ECR Public: public\.ecr\.aws/lambda/provided The runtime interface client in your container image manages the interaction between Lambda and your function code\. The [Runtime API](runtimes-api.md), along with the [ Extensions API](runtimes-extensions-api.md), defines a simple HTTP interface for runtimes to receive invocation events from Lambda and respond with success or failure indications\. -Each of the AWS base images for Lambda include a runtime interface client\. If you choose an alternative base image, you need to add the appropriate runtime interface client\. +Each of the AWS base images for Lambda include a runtime interface client\. If you choose one of the base images for custom runtimes or an alternative base image, you need to add the appropriate runtime interface client\. For your convenience, Lambda provides an open source runtime interface client for each of the supported Lambda runtimes: + [Node\.js](nodejs-image.md#nodejs-image-clients) @@ -51,4 +52,4 @@ For your convenience, Lambda provides an open source runtime interface client fo ## Runtime interface emulator -Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The AWS base images for Lambda include the RIE\. For other base images, you can download the [Runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from the AWS GitHub repository\. \ No newline at end of file +Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The AWS base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the [Runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from the AWS GitHub repository\. \ No newline at end of file diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index be5f6ba8..07078be7 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -24,6 +24,9 @@ Your function needs permission to call CloudWatch Logs and X\-Ray\. Update its [ When you add permissions to your function, make an update to its code or configuration as well\. This forces running instances of your function, which have out\-of\-date credentials, to stop and be replaced\. +**Note** +It may take 5 to 10 minutes for logs to show up after a function invocation\. + ## Lambda: The function returns before execution finishes **Issue: \(Node\.js\)** *Function returns before code finishes executing* diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 27afc2dc..04a7bfc4 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -54,6 +54,12 @@ You grant [other services](lambda-services.md) and accounts permission to invoke This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-console.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. +## Lambda: Alias routing with provisioned concurrency + +**Issue:** *Provisioned concurrency spillover invocations during alias routing\.* + +Lambda uses a simple probabilistic model to distribute the traffic between the two function versions\. At low traffic levels, you might see a high variance between the configured and actual percentage of traffic on each version\. If your function uses provisioned concurrency, you can avoid [spillover invocations](monitoring-metrics.md#monitoring-metrics-invocation) by configuring a higher number of provisioned concurrency instances during the time that alias routing is active\. + ## Lambda: Cold starts with provisioned concurrency **Issue:** *You see cold starts after enabling provisioned concurrency\.* diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 5d6b1af5..6b72a4eb 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -8,7 +8,7 @@ An internal extension runs as part of the runtime process\. Your function access You can add extensions to a function using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. -The following [Lambda runtimes](lambda-runtimes.md) support external extensions: +The following [Lambda runtimes](lambda-runtimes.md) support extensions: + \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) + Custom runtime \(`provided`\) + Custom runtime on Amazon Linux 2 \(`provided.al2`\) @@ -22,6 +22,8 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Ruby 2\.7 \(`ruby2.7`\) + Ruby 2\.5 \(`ruby2.5`\) +Note that the Go 1\.x runtime does not support extensions\. To support extensions, you can create Go functions on the `provided.al2` runtime\. For more information, see [ Migrating Lambda functions to Amazon Linux 2](http://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/)\. + You are charged for the execution time that the extension consumes \(in 1 ms increments\)\. For more pricing information for extensions, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. For pricing information for partner extensions, see those partners' websites\. There is no cost to install your own extensions\. **Topics** diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index 7921d071..c56a6ffc 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -1,237 +1,301 @@ -# Using Lambda with an Apache Kafka cluster +# Using Lambda with self\-managed Apache Kafka -[Apache Kafka](https://kafka.apache.org/) is a distributed data store optimized for ingesting and processing streaming data in real time\. +Lambda supports [Apache Kafka](https://kafka.apache.org/) as an [event source](invocation-eventsourcemapping.md)\. Apache Kafka is a an open\-source event streaming platform that supports workloads such as data pipelines and streaming analytics\. -Kafka is primarily used to build streaming data pipelines and applications that adapt to the data streams\. It combines messaging, storage, and stream processing to allow storage and analysis of both historical and real\-time data\. +You can use the AWS managed Kafka service Amazon Managed Streaming for Apache Kafka \(Amazon MSK\), or a self\-managed Kafka cluster\. For details about using Lambda with Amazon MSK, see [Using Lambda with Amazon MSK](with-msk.md)\. -AWS provides a managed Kafka service, or you can use a non\-AWS Kafka cluster with Lambda\. +This topic describes how to use Lambda with a self\-managed Kafka cluster\. In AWS terminology, a self\-managed cluster includes non\-AWS hosted Kafka clusters\. For example, you can host your Kafka cluster with a cloud provider such as [CloudKarafka](https://www.cloudkarafka.com/)\. You can also use other AWS hosting options for your cluster\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. + +Apache Kafka as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) + +For an example of how to use self\-managed Kafka as an event source, see [Using self\-hosted Apache Kafka as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-self-hosted-apache-kafka-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. + + + +Lambda sends the batch of messages in the event parameter when it invokes your Lambda function\. The event payload contains an array of messages\. Each array item contains details of the Kafka topic and Kafka partition identifier, together with a timestamp and a base64\-encoded message\. + +``` +{ "eventSource": "aws:kafka", + "eventSourceArn": "arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", + "records": { + "mytopic-0": [ + { + "topic": "mytopic" + "partition": "0", + "offset": 15, + "timestamp": 1545084650987, + "timestampType": "CREATE_TIME", + "value": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + } + ] + } +} +``` **Topics** -+ [Hosting an Apache Kafka cluster](#kafka-hosting) -+ [Using an Apache Kafka cluster as an event source for Lambda](#kafka-using-cluster) -+ [Using Lambda with self\-managed Apache Kafka](#kafka-smaa) ++ [Managing access and permissions](#smaa-permissions) ++ [Kafka authentication](#smaa-authentication) ++ [Network configuration](#services-msk-vpc-config) ++ [Adding a Kafka cluster as an event source](#services-smaa-topic-add) ++ [Using a Kafka cluster as an event source](#kafka-using-cluster) ++ [Auto scaling of the Kafka event source](#services-kafka-scaling) ++ [Event source API operations](#kafka-hosting-api-operations) ++ [Event source mapping errors](#services-event-errors) ++ [Event source configuration parameters](#services-msk-parms) -## Hosting an Apache Kafka cluster +## Managing access and permissions -You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. +For Lambda to poll your Apache Kafka topic and update other cluster resources, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have the following permissions\. -### Using Amazon MSK +### Required Lambda function permissions -To host your Apache Kafka cluster and topics, you can use [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html)\. +To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) -For more information about using an MSK cluster, see [Using Lambda with Amazon MSK](with-msk.md)\. +### Optional Lambda function permissions -### Using a self\-managed Kafka provider +Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed customer master key \(CMK\)](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. -To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud provider, such as [CloudKarafka](https://www.cloudkarafka.com/)\. +#### Secrets Manager and AWS KMS permissions -You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. +If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) ++ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) -For more information about using a self\-managed Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](#kafka-smaa)\. +#### VPC permissions -## Using an Apache Kafka cluster as an event source for Lambda +If only users within a VPC can access your self\-managed Apache Kafka cluster, your Lambda function must have permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources\. These resources include your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) +### Adding permissions to your execution role +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's [execution role](lambda-intro-execution-role.md)\. -You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. +By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an [IAM trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#term_trust-policy), and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. -### Prerequisites -+ A [Lambda function](getting-started-create-function.md) with function code in a [supported runtime](lambda-runtimes.md) to invoke your cluster -+ A [Lambda execution role](lambda-intro-execution-role.md) +``` +{ + "Version":"2012-10-17", + "Statement":[ + { + "Effect":"Allow", + "Action":[ + "ec2:CreateNetworkInterface", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeVpcs", + "ec2:DeleteNetworkInterface", + "ec2:DescribeSubnets", + "ec2:DescribeSecurityGroups" + ], + "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" + } + ] + } +``` -### How it works +For information about creating a JSON policy document in the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. +### Adding users to an IAM policy +By default, IAM users and roles do not have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. -When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. -+ If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. -+ If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. -+ Lambda reads event data from the Kafka topics that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. -+ Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. -+ Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. -+ +## Kafka authentication -For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. +Lambda supports several methods to authenticate with your self\-managed Apache Kafka cluster\. Make sure that you configure the Kafka cluster to use one of the following authentication methods that Lambda supports: ++ VPC -### Event source API operations + If only Kafka users within your VPC access your Kafka brokers, you must configure the event source with VPC access\. ++ SASL/SCRAM -When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS Command Line Interface \(AWS CLI\), Lambda uses APIs to process your request\. + With Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication, the cluster encrypts the credentials using SSL encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. Because the credentials are encrypted, the connection to the cluster does not need to be encrypted\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. ++ SASL/PLAIN -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + With SASL/PLAIN authentication, credentials are sent as clear text \(unencrypted\) to the server\. Because the credentials are clear text, the connection to the server must use TLS encryption\. -### Event source mapping errors +For SASL authentication, you must store the user name and password as a secret in Secrets Manager\. For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. -When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. +## Network configuration -To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: +If you configure Amazon VPC access to your Kafka brokers, Lambda must have access to the Amazon VPC resources\. -**`ESM_CONFIG_NOT_VALID`** -The event source mapping configuration is not valid\. +Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Kafka cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. -**`EVENT_SOURCE_AUTHN_ERROR`** -Lambda couldn't authenticate the event source\. +Alternatively, ensure that the VPC associated with your Kafka cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -**`EVENT_SOURCE_AUTHZ_ERROR`** -Lambda doesn't have the required permissions to access the event source\. +You must configure your Amazon VPC security groups with the following rules \(at minimum\): ++ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. ++ Outbound rules – Allow all traffic on all ports for all destinations\. -**`FUNCTION_CONFIG_NOT_VALID`** -The Lambda function configuration is not valid\. +For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. -**Note** -If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. +## Adding a Kafka cluster as an event source -## Using Lambda with self\-managed Apache Kafka +To create an [event source mapping](invocation-eventsourcemapping.md), add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. -You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. +This section describes how to create an event source mapping using the Lambda console and the AWS CLI\. -**Topics** -+ [Managing access and permissions for a self\-managed Apache Kafka cluster](#smaa-permissions) -+ [Adding a self\-managed Apache Kafka cluster as an event source](#services-smaa-topic-add) +### Prerequisites ++ A self\-managed Apache Kafka cluster\. Lambda supports Apache Kafka version 0\.10\.0\.0 and later\. ++ A Lambda execution role with permission to access the AWS resources that your self\-managed Kafka cluster uses\. -### Managing access and permissions for a self\-managed Apache Kafka cluster +### Adding a self\-managed Kafka cluster \(console\) -Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. +Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. -This page describes how to grant permission to Lambda and other users of your self\-managed Kafka cluster\. +**To add an Apache Kafka trigger to your Lambda function \(console\)** -#### Required Lambda function permissions +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) +1. Choose the name of your Lambda function\. -#### Optional Lambda function permissions +1. Under **Function overview**, choose **Add trigger**\. -Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed CMK](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. +1. Under **Trigger configuration**, do the following: -##### Secrets Manager and AWS KMS permissions + 1. Choose the **Apache Kafka** trigger type\. -If your Kafka users access your Apache Kafka brokers over the internet, you must specify a Secrets Manager secret\. For more information, see [Using SASL/SCRAM authentication](#smaa-permissions-add-secret)\. + 1. For **Bootstrap servers**, enter the host and port pair address of a Kafka broker in your cluster, and then choose **Add**\. Repeat for each Kafka broker in the cluster\. -Your Lambda function might need permission to describe your Secrets Manager secret or decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: -+ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) -+ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) + 1. For **Topic name**, enter the name of the Kafka topic used to store records in the cluster\. -##### VPC permissions + 1. \(Optional\) For **Batch size**, enter the maximum number of records to receive in a single batch\. -If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) + 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. + +1. Under **Authentication method**, choose the access or authentication protocol of the Kafka brokers in your cluster\. If only users within your VPC access your Kafka brokers, you must configure VPC access\. If users access your Kafka brokers over the internet, you must configure SASL authentication\. + + To configure VPC access, choose the **VPC** for your Kafka cluster, then choose **VPC subnets** and **VPC security groups**\. + + To configure SASL authentication, under **Secret key**, choose **Add**, then do the following: -#### Adding permissions to your execution role + 1. Choose the key type\. If your Kafka broker uses SASL plaintext, choose **BASIC\_AUTH**\. Otherwise, choose one of the **SASL\_SCRAM** options\. -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. + 1. Choose the name of the Secrets Manager secret key that contains the credentials for your Kafka cluster\. -By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. +1. To create the trigger, choose **Add**\. + +### Adding a self\-managed Kafka cluster \(AWS CLI\) + +Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. + +#### Using SASL/SCRAM + +If Kafka users access your Kafka brokers over the internet, you must specify the Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. ``` -{ - "Version":"2012-10-17", - "Statement":[ - { - "Effect":"Allow", - "Action":[ - "ec2:CreateNetworkInterface", - "ec2:DescribeNetworkInterfaces", - "ec2:DescribeVpcs", - "ec2:DeleteNetworkInterface", - "ec2:DescribeSubnets", - "ec2:DescribeSecurityGroups" - ], - "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" - } - ] - } +aws lambda create-event-source-mapping --topics AWSKafkaTopic + --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName + --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function + --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` -For information about creating a JSON policy document on the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. -#### Adding users to an IAM policy +#### Using a VPC -By default, IAM users and roles don't have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. +If only Kafka users within your VPC access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. -#### Using SASL/SCRAM authentication +``` +aws lambda create-event-source-mapping + --topics AWSKafkaTopic + --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"}, + {"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"}, + {"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' + --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function + --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", + "abc2.xyz.com:9092"]}}' +``` -**Important** -Plaintext brokers are not supported if you are is using SASL/SCRAM based authentication\. You must use TLS encryption for your brokers\. +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. -User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. +#### Viewing the status using the AWS CLI -To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. ``` -{ - "username": "ab1c23de", - "password": "qxbbaLRG7JXYN4NpNMVccP4gY9WZyDbp" -} +aws lambda get-event-source-mapping + --uuid dh38738e-992b-343a-1077-3478934hjkfd7 ``` -For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. +## Using a Kafka cluster as an event source -### Adding a self\-managed Apache Kafka cluster as an event source +When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. +Lambda reads event data from the Kafka topics that you specify in [ `Topics`](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [ `StartingPosition`](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. +If you specify `LATEST` as the starting position, Lambda starts reading from the latest message in each partition belonging to the topic\. Because there can be some delay after trigger configuration before Lambda starts reading the messages, Lambda does not read any messages produced during this window\. -#### Prerequisites -+ A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](#kafka-hosting)\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](#smaa-permissions)\. +Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. -#### Adding a self\-managed Apache Kafka cluster using the Lambda console +If your Lambda function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. -Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. +The maximum amount of time that Lambda lets a function run before stopping it is 14 minutes\. -**To add an Apache Kafka trigger to your Lambda function \(console\)** +## Auto scaling of the Kafka event source -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +When you initially create an Apache Kafka [event source](invocation-eventsourcemapping.md), Lambda allocates one consumer to process all of the partitions in the Kafka topic\. Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. -1. Choose the name of your Lambda function\. +Every 15 minutes, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. -1. Under **Function overview**, choose **Add trigger**\. +If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. -1. Under **Trigger configuration**, choose the **Apache Kafka** trigger type\. +To monitor the throughput of your Kafka topic, you can view the Apache Kafka consumer metrics, such as `consumer_lag` and `consumer_offset`\. To check how many function invocations occur in parallel, you can also monitor the [concurrency metrics](monitoring-metrics.md#monitoring-metrics-concurrency) for your function\. -1. Configure the remaining options, and then choose **Add**\. +## Event source API operations -#### Adding a self\-managed Apache Kafka cluster using the AWS CLI +When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS CLI, Lambda uses APIs to process your request\. -Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -##### Using SASL/SCRAM +## Event source mapping errors -If Kafka users access your Kafka brokers over the internet, you must specify your AWS Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. +When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. -``` -aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' -``` +To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +**`ESM_CONFIG_NOT_VALID`** +The event source mapping configuration is not valid\. -##### Using a VPC +**`EVENT_SOURCE_AUTHN_ERROR`** +Lambda could not authenticate the event source\. -If only Kafka users within your virtual private cloud \(VPC\) access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. +**`EVENT_SOURCE_AUTHZ_ERROR`** +Lambda does not have the required permissions to access the event source\. -``` -aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' -``` +**`FUNCTION_CONFIG_NOT_VALID`** +The function configuration is not valid\. -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +**Note** +If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. -##### Viewing the status +## Event source configuration parameters -The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Apache Kafka\. -``` -aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 -``` \ No newline at end of file + +**Event source parameters that apply to self\-managed Apache Kafka** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10,000 | +| DestinationConfig | N | none | | +| Enabled | N | Enabled | | +| KafkaBrokerList | Y | | Can set only on Create | +| FunctionName | Y | | | +| MaximumBatchingWindowInSeconds | N | 0 | Maximum: 300 | +| MaximumRecordAgeInSeconds | N | 604,800 \(7 days\) | Maximum: no limit | +| MaximumRetryAttempts | N | 10,000 | Maximum: no limit | +| ParallelizationFactor | N | 1 | | +| SourceAccessConfigurations | N | No credentials | VPC information or authentication credentials for the cluster For SASL\_PLAIN, set to BASIC\_AUTH | +| StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | +| Topics | Y | | Topic name Can set only on Create | \ No newline at end of file diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 5b8a125a..2748d5ca 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -1,21 +1,23 @@ # Using Lambda with Amazon MQ -Amazon MQ is a managed message broker service for [Apache ActiveMQ](https://activemq.apache.org/) and [RabbitMQ](https://www.rabbitmq.com)\. Lambda only supports Apache ActiveMQ\. A *message broker* allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols through either topic or queue event destinations\. +Amazon MQ is a managed message broker service for [Apache ActiveMQ](https://activemq.apache.org/) and [RabbitMQ](https://www.rabbitmq.com)\. A *message broker* enables software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols through either topic or queue event destinations\. -Amazon MQ can also manage Amazon Elastic Compute Cloud \(Amazon EC2\) instances on your behalf by installing ActiveMQ brokers and by providing different network topologies and other infrastructure needs\. +Amazon MQ can also manage Amazon Elastic Compute Cloud \(Amazon EC2\) instances on your behalf by installing ActiveMQ or RabbitMQ brokers and by providing different network topologies and other infrastructure needs\. -You can use a Lambda function to process records from your Amazon MQ message broker\. Your function is triggered through an [event source mapping](invocation-eventsourcemapping.md), a Lambda resource that reads messages from your broker and invokes the function [synchronously](invocation-sync.md)\. +You can use a Lambda function to process records from your Amazon MQ message broker\. Lambda invokes your function through an [event source mapping](invocation-eventsourcemapping.md), a Lambda resource that reads messages from your broker and invokes the function [synchronously](invocation-sync.md)\. The Amazon MQ event source mapping has the following configuration restrictions: -+ Cross account – Cross account processing is not supported\. You cannot use Lambda to process records from an Amazon MQ message broker that is in a different account\. -+ Authentication – Only the ActiveMQ [SimpleAuthenticationPlugin](https://activemq.apache.org/security#simple-authentication-plugin) is supported\. User credentials associated with the broker are the only method of connection\. For more information about authentication, see [Messaging Authentication and Authorization for ActiveMQ](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/security-authentication-authorization.html) in the *Amazon MQ Developer Guide*\. ++ Cross account – Lambda does not support cross\-account processing\. You cannot use Lambda to process records from an Amazon MQ message broker that is in a different AWSaccount\. ++ Authentication – For ActiveMQ, only the ActiveMQ [SimpleAuthenticationPlugin](https://activemq.apache.org/security#simple-authentication-plugin) is supported\. For RabbitMQ, only the [PLAIN](https://www.rabbitmq.com/access-control.html#mechanisms) authentication mechanism is supported\. Users must use AWS Secrets Manager to manage their credentials\. For more information about ActiveMQ authentication, see [Integrating ActiveMQ brokers with LDAP](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/security-authentication-authorization.html) in the *Amazon MQ Developer Guide*\. + Connection quota – Brokers have a maximum number of allowed connections per wire\-level protocol\. This quota is based on the broker instance type\. For more information, see the [Brokers](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-limits.html#broker-limits) section of **Quotas in Amazon MQ** in the *Amazon MQ Developer Guide*\. -+ Connectivity – You can create brokers in a public or private virtual private cloud \(VPC\)\. For private VPCs, your Lambda function needs access to the VPC to interact with the records\. For more information, see [Event source mapping API](#services-mq-api) later in this topic\. -+ Event destinations – Only queue destinations are supported\. However, you can use a virtual topic, which behaves as a topic internally while interacting with Lambda as a queue\. For more information, see [Virtual Destinations](https://activemq.apache.org/virtual-destinations) on the Apache ActiveMQ website\. -+ Network topology – Only one single\-instance or standby broker is supported per event source mapping\. Single\-instance brokers require a failover endpoint\. For more information about these broker deployment modes, see [Amazon MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-broker-architecture.html) in the *Amazon MQ Developer Guide*\. -+ Protocols – Lambda consumes messages using the OpenWire/Java Message Service \(JMS\) protocol\. No other protocols are supported\. Within the JMS protocol, only [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html) and [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html) are supported\. For more information about the OpenWire protocol, see [OpenWire](https://activemq.apache.org/openwire.html) on the Apache ActiveMQ website\. ++ Connectivity – You can create brokers in a public or private virtual private cloud \(VPC\)\. For private VPCs, your Lambda function needs access to the VPC to receive messages\. For more information, see [Event source mapping API](#services-mq-api) later in this topic\. ++ Event destinations – Only queue destinations are supported\. However, you can use a virtual topic, which behaves as a topic internally while interacting with Lambda as a queue\. For more information, see [Virtual Destinations](https://activemq.apache.org/virtual-destinations) on the Apache ActiveMQ website, and [Virtual Hosts](https://www.rabbitmq.com/vhosts.html) on the RabbitMQ website\. ++ Network topology – For ActiveMQ, only one single\-instance or standby broker is supported per event source mapping\. For RabbitMQ, only one single\-instance broker or cluster deployment is supported per event source mapping\. Single\-instance brokers require a failover endpoint\. For more information about these broker deployment modes, see [Active MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-broker-architecture.html) and [Rabbit MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/rabbitmq-broker-architecture.html)in the *Amazon MQ Developer Guide*\. ++ Protocols – Supported protocols depend on the type of Amazon MQ integration\. + + For ActiveMQ integrations, Lambda consumes messages using the OpenWire/Java Message Service \(JMS\) protocol\. No other protocols are supported for consuming messages\. Within the JMS protocol, only [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html) and [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html) are supported\. For more information about the OpenWire protocol, see [OpenWire](https://activemq.apache.org/openwire.html) on the Apache ActiveMQ website\. + + For RabbitMQ integrations, Lambda consumes messages using the AMQP 0\-9\-1 protocol\. No other protocols are supported for consuming messages\. For more information about RabbitMQ's implementation of the AMQP 0\-9\-1 protocol, see [AMQP 0\-9\-1 Complete Reference Guide](https://www.rabbitmq.com/amqp-0-9-1-reference.html) on the RabbitMQ website\. -Lambda automatically supports the latest versions of ActiveMQ that Amazon MQ supports\. For the latest supported versions, see [Amazon MQ Release Notes](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-release-notes.html) in the *Amazon MQ Developer Guide*\. +Lambda automatically supports the latest versions of ActiveMQ and RabbitMQ that Amazon MQ supports\. For the latest supported versions, see [Amazon MQ release notes](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-release-notes.html) in the *Amazon MQ Developer Guide*\. **Note** By default, Amazon MQ has a weekly maintenance window for brokers\. During that window of time, brokers are unavailable\. For brokers without standby, Lambda cannot process any messages during that window\. @@ -36,45 +38,101 @@ Lambda will pull messages until it has processed a maximum of 6 MB, until timeou **Note** The maximum function invocation time is 14 minutes\. -Lambda processes all incoming batches concurrently and automatically scales the concurrency to meet demands\. You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. -**Example Amazon MQ record event** +**Example Amazon MQ record events** ``` { - "eventSource": "aws:amq", - "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", - "messages": { [ - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType": "jms/text-message", - "data": "QUJDOkFBQUE=", - "connectionId": "myJMSCoID", - "redelivered": false, - "destination": { - "physicalname": "testQueue" - }, - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 + "eventSource": "aws:amq", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "messages": { + [ + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType": "jms/text-message", + "data": "QUJDOkFBQUE=", + "connectionId": "myJMSCoID", + "redelivered": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + }, + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType":"jms/bytes-message", + "data": "3DTOOW7crj51prgVLQaGQ82S48k=", + "connectionId": "myJMSCoID1", + "persistent": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + } + ] + } +} +``` + +``` +{ + "eventSource": "aws:rmq", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "rmqMessagesByQueue": { + "test::/": [ + { + "basicProperties": { + "contentType": "text/plain", + "contentEncoding": null, + "headers": { + "header1": { + "bytes": [ + 118, + 97, + 108, + 117, + 101, + 49 + ] }, - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType":"jms/bytes-message", - "data": "3DTOOW7crj51prgVLQaGQ82S48k=", - "connectionId": "myJMSCoID1", - "persistent": false, - "destination": { - "physicalname": "testQueue" - }, - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 - } - ] - } + "header2": { + "bytes": [ + 118, + 97, + 108, + 117, + 101, + 50 + ] + }, + "numberInHeader": 10 + } + "deliveryMode": 1, + "priority": 34, + "correlationId": null, + "replyTo": null, + "expiration": "60000", + "messageId": null, + "timestamp": "Jan 1, 1970, 12:33:41 AM", + "type": null, + "userId": "AIDACKCEVSQ6C2EXAMPLE", + "appId": null, + "clusterId": null, + "bodySize": 80 + }, + "redelivered": false, + "data": "eyJ0aW1lb3V0IjowLCJkYXRhIjoiQ1pybWYwR3c4T3Y0YnFMUXhENEUifQ==" + } + ] + } } ``` +In the RabbitMQ example, `test` is the name of the RabbitMQ queue, and `/` is the name of the virtual host\. When receiving messages, the event source lists messages under `test::/`\. ## Execution role permissions @@ -87,6 +145,9 @@ To read records from an Amazon MQ broker, your Lambda function needs the followi + [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) + [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) **Note** When using an encrypted customer managed key, add the `[kms:Decrypt](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget)` permission as well\. @@ -113,7 +174,7 @@ Lambda supports the following options for Amazon MQ event sources: + **MQ broker** – Select an Amazon MQ broker\. + **Batch size** – Set the maximum number of messages to retrieve in a single batch\. + **Queue name** – Enter the Amazon MQ queue to consume\. -+ **Source access configuration** – Select the AWS Secrets Manager secret that stores your broker credentials\. ++ **Source access configuration** – Enter virtual host information and the Secrets Manager secret that stores your broker credentials\. + **Enable trigger** – Disable the trigger to stop processing records\. To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in the designer\. To reconfigure the trigger, use the event source mapping API operations\. @@ -129,26 +190,26 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) command\. -By default, Amazon MQ brokers are created with the `PubliclyAccessible` flag set to false\. It is only when `PubliclyAccessible` is set to true that the broker is given a public IP address\. +By default, Amazon MQ brokers are created with the `PubliclyAccessible` flag set to false\. It is only when `PubliclyAccessible` is set to true that the broker receives a public IP address\. -For full access with your event source mapping, your broker must either use a public endpoint or provide access to the VPC\. To meet the Amazon VPC access requirements, you can do one of the following: +For full access with your event source mapping, your broker must either use a public endpoint or provide access to the VPC\. To meet the Amazon Virtual Private Cloud \(Amazon VPC\) access requirements, you can do one of the following: + Configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -+ Create a connection between your Amazon VPC and Lambda\. Your Amazon VPC must also connect to AWS STS and Secrets Manager endpoints\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. ++ Create a connection between your Amazon VPC and Lambda\. Your Amazon VPC must also connect to AWS Security Token Service \(AWS STS\) and Secrets Manager endpoints\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. -The Amazon Virtual Private Cloud \(Amazon VPC\) security group rules that you configure should have the following settings at minimum: +The Amazon VPC security group rules that you configure should have the following settings at minimum: + Inbound rules – For a broker without public accessibility, allow all traffic on all ports for the security group that's specified as your source\. For a broker with public accessibility, allow all traffic on all ports for all destinations\. + Outbound rules – Allow all traffic on all ports for all destinations\. The Amazon VPC configuration is discoverable through the [Amazon MQ API](https://docs.aws.amazon.com/amazon-mq/latest/api-reference/resources.html) and does not need to be configured in the `create-event-source-mapping` setup\. -The following example AWS CLI command creates an event source which maps a Lambda function named `MQ-Example-Function` to an Amazon MQ broker named `ExampleMQBroker`\. The command also provides a Secrets Manager secret named `ExampleMQBrokerUserPassword` that stores the broker credentials\. +The following example AWS CLI command creates an event source which maps a Lambda function named `MQ-Example-Function` to an Amazon MQ RabbitMQ\-based broker named `ExampleMQBroker`\. The command also provides the virtual host name and a Secrets Manager secret ARN that stores the broker credentials\. ``` aws lambda create-event-source-mapping \ ---event-source-arn arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca \ ---function-name MQ-Example-Function \ ---source-access-configuration Type=BASIC_AUTH,URI=arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt \ ---queues ExampleQueue +--event-source-arn arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-24cacbb4-b295-49b7-8543-7ce7ce9dfb98 \ +--function-name arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function \ +--queues ExampleQueue \ +--source-access-configuration Type=VIRTUAL_HOST,URI="/" Type=BASIC_AUTH,URI=arn:aws:secretsmanager:us-east-1:123456789012:secret:ExampleMQBrokerUserPassword-xPBMTt \ ``` You should see the following output: @@ -157,8 +218,8 @@ You should see the following output: { "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", "BatchSize": 100, - "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", - "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "EventSourceArn": "arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function", "LastModified": 1601927898.741, "LastProcessingResult": "No records processed", "State": "Creating", @@ -169,13 +230,13 @@ You should see the following output: "SourceAccessConfigurations": [ { "Type": "BASIC_AUTH", - "URI": "arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt" + "URI": "arn:aws:secretsmanager:us-east-1:123456789012:secret:ExampleMQBrokerUserPassword-xPBMTt" } ] } ``` -Using the `[update\-event\-source\-mapping](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. +Using the `[update\-event\-source\-mapping](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how Lambda processes batches and to specify when to discard records that cannot be processed\. The following example command updates an event source mapping to have a batch size of 2\. ``` aws lambda update-event-source-mapping \ @@ -189,8 +250,8 @@ You should see the following output: { "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", "BatchSize": 2, - "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", - "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "EventSourceArn": "arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function", "LastModified": 1601928393.531, "LastProcessingResult": "No records processed", "State": "Updating", @@ -198,7 +259,7 @@ You should see the following output: } ``` -Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) command\. +Lambda updates these settings asynchronously\. The output will not reflect changes until this process completes\. To view the current status of your resource, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) command\. ``` aws lambda get-event-source-mapping \ @@ -211,8 +272,8 @@ You should see the following output: { "UUID": "91eaeb7e-c976-4939-9451-8709db01f137", "BatchSize": 2, - "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", - "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "EventSourceArn": "arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function", "LastModified": 1601928393.531, "LastProcessingResult": "No records processed", "State": "Enabled", @@ -222,7 +283,7 @@ You should see the following output: ## Event source mapping errors -When a Lambda function encounters an unrecoverable error, your Amazon MQ consumer stops processing records\. Any other consumers can continue processing, provided they don't encounter the same error\. To determine the potential cause of a stopped consumer, check the `StateTransitionReason` field in the return details of your `EventSourceMapping` for one of the following codes: +When a Lambda function encounters an unrecoverable error, your Amazon MQ consumer stops processing records\. Any other consumers can continue processing, provided that they do not encounter the same error\. To determine the potential cause of a stopped consumer, check the `StateTransitionReason` field in the return details of your `EventSourceMapping` for one of the following codes: **`ESM_CONFIG_NOT_VALID`** The event source mapping configuration is not valid\. @@ -236,4 +297,4 @@ Lambda does not have the required permissions to access the event source\. **`FUNCTION_CONFIG_NOT_VALID`** The function's configuration is not valid\. -Records also go unprocessed if they are dropped due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a redelivery policy and dead\-letter queue \(DLQ\) handling with Amazon MQ\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website\. \ No newline at end of file +Records also go unprocessed if Lambda drops them due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a redelivery policy and dead\-letter queue \(DLQ\) handling with Amazon MQ\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website and [Reliability Guide](https://www.rabbitmq.com/reliability.html) on the RabbitMQ website\. \ No newline at end of file diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 72717471..512f60f8 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -1,24 +1,49 @@ # Using Lambda with Amazon MSK -[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that enables you to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK provides the control\-plane operations, such as those for creating, updating, and deleting clusters\. It supports multiple open\-source versions of Kafka\. +[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that you can use to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK simplifies the setup, scaling, and management of clusters running Kafka\. Amazon MSK also makes it easier to configure your application for multiple Availability Zones and for security with AWS Identity and Access Management \(IAM\)\. Additionally, Amazon MSK supports multiple open\-source versions of Kafka\. -When you create an Amazon MSK cluster, you receive the required hosting and connection information of the cluster\. This information includes the Kafka cluster hostname, topic name, SASL/SCRAM user name and password, and bootstrap server host\-port pairs\. +Amazon MSK as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) -To support your Kafka cluster on Amazon MSK, you might need to create Amazon Virtual Private Cloud \(Amazon VPC\) networking components\. For more information, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. +For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. -**Topics** -+ [Managing access and permissions for an Amazon MSK cluster](#msk-permissions) -+ [Adding an Amazon MSK cluster as an event source](#services-msk-topic-add) +Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. -## Managing access and permissions for an Amazon MSK cluster +Lambda allows a function to run for up to 14 minutes before stopping it\. -Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. +Lambda sends the batch of messages in the event parameter when it invokes your function\. The event payload contains an array of messages\. Each array item contains details of the Amazon MSK topic and partition identifier, together with a timestamp and a base64\-encoded message\. -This page describes how to grant permission to Lambda and other users of your Amazon MSK cluster\. +``` +{ "eventSource": "aws:kafka", + "eventSourceArn": "arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", + "records": { + "mytopic-0": [ + { + "topic": "mytopic" + "partition": "0", + "offset": 15, + "timestamp": 1545084650987, + "timestampType": "CREATE_TIME", + "value": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + } + ] + } +} +``` + +**Topics** ++ [Managing access and permissions](#msk-permissions) ++ [Network configuration](#services-msk-vpc-config) ++ [Adding Amazon MSK as an event source](#services-msk-topic-add) ++ [Auto scaling of the Amazon MSK event source](#services-msk-ops-scaling) ++ [Amazon MSK configuration parameters](#services-msk-parms) + +## Managing access and permissions + +For Lambda to poll your Kafka topic and update other cluster resources, your Lambda function—as well as your IAM users and roles—must have the following permissions\. ### Required Lambda function permissions -To read records from your Amazon MSK cluster on your behalf, your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: +Your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission to read records from your Amazon MSK cluster on your behalf\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: + [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) + [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) @@ -43,46 +68,48 @@ Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to 1. Select the policy from the list, and then choose **Policy actions**, **Attach**\. -1. Select your execution role from the list, and then choose **Attach policy**\. +1. On the **Attach policy** page, select your execution role from the list, and then choose **Attach policy**\. ### Granting users access with an IAM policy -By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon Managed Streaming for Apache Kafka Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. +By default, IAM users and roles do not have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon MSK Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ### Using SASL/SCRAM authentication -Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Using Username and Password Authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -## Adding an Amazon MSK cluster as an event source - -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. +Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Username and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. +Note that Amazon MSK does not support SASL/PLAIN authentication\. -### Prerequisites -+ An Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. For more information, see [Managing access and permissions for an Amazon MSK cluster](#msk-permissions)\. - -### VPC configuration +## Network configuration -To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, do one of the following: -+ We recommend that you deploy Amazon VPC Endpoints \(PrivateLink\) for Lambda and AWS STS services\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. +Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Amazon MSK cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. - If authentication is required, also deploy an Amazon VPC Endpoint for the Secrets Manager\. -+ Alternatively, you can configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +Alternatively, ensure that the VPC associated with your Amazon MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -Your Amazon VPC security groups must be configured with the following rules \(at minimum\): +You must configure your Amazon VPC security groups with the following rules \(at minimum\): + Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. + Outbound rules – Allow all traffic on all ports for all destinations\. **Note** -Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and doesn't need to be configured in your `create-event-source-mapping` setup\. +Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and does not need to be configured during setup using the create\-event\-source\-mapping command\. + +For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. + +## Adding Amazon MSK as an event source + +To create an [event source mapping](invocation-eventsourcemapping.md), add Amazon MSK as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. -### Adding an Amazon MSK cluster using the Lambda console +This section describes how to create an event source mapping using the Lambda console and the AWS CLI\. + +### Prerequisites ++ An Amazon MSK cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your Amazon MSK cluster uses\. + +### Adding an Amazon MSK trigger \(console\) Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. -**To add an MSK trigger to your Lambda function \(console\)** +**To add an Amazon MSK trigger to your Lambda function \(console\)** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. @@ -90,20 +117,38 @@ Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger 1. Under **Function overview**, choose **Add trigger**\. -1. Under **Trigger configuration**, choose the **MSK** trigger type\. +1. Under **Trigger configuration**, do the following: + + 1. Choose the **MSK** trigger type\. -1. Configure the remaining options, and then choose **Add**\. + 1. For **MSK cluster**, select your cluster\. -### Adding an Amazon MSK cluster using the AWS CLI + 1. For **Batch size**, enter the maximum number of messages to receive in a single batch\. + + 1. For **Topic name**, enter the name of a Kafka topic\. + + 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. + + 1. \(Optional\) For **Secret key**, choose the secret key for SASL/SCRAM authentication of the brokers in your Amazon MSK cluster\. + + 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. + +1. To create the trigger, choose **Add**\. + +### Adding an Amazon MSK trigger \(AWS CLI\) Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. #### Creating a trigger using the AWS CLI -The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `LATEST`\. ``` -aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function +aws lambda create-event-source-mapping \ + --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 \ + --topics AWSKafkaTopic \ + --starting-position LATEST \ + --function-name my-kafka-function ``` For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. @@ -113,5 +158,36 @@ For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. ``` -aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -``` \ No newline at end of file +aws lambda get-event-source-mapping \ + --uuid 6d9bce8e-836b-442c-8070-74e77903c815 +``` + +## Auto scaling of the Amazon MSK event source + +When you initially create an Amazon MSK event source, Lambda allocates one consumer to process all of the partitions in the Kafka topic\. Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. + +Every 15 minutes, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. + +If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. + +To monitor the throughput of your Kafka topic, you can view the [Amazon MSK consumer\-lag metrics](https://docs.aws.amazon.com/msk/latest/developerguide/consumer-lag.html)\. To help you find the metrics for this Lambda function, the value of the consumer group field in the logs is set to the event source UUID\. + +To check how many function invocations occur in parallel, you can also monitor the [concurrency metrics](monitoring-metrics.md#monitoring-metrics-concurrency) for your function\. + +## Amazon MSK configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon MSK\. + + +**Event source parameters that apply to Amazon MSK** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10,000 | +| DestinationConfig | N | none | | +| Enabled | N | Enabled | | +| EventSourceArn | Y | | Can set only on Create | +| FunctionName | Y | | | +| SourceAccessConfigurations | N | No credentials | VPC information or SASL/SCRAM authentication credentials for your event source | +| StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | +| Topics | Y | | Kafka topic name Can set only on Create | \ No newline at end of file From abc4ca715d2e76cda599bb2177f6d3b011d9f1fa Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Fri, 23 Jul 2021 11:09:34 -0700 Subject: [PATCH 56/94] fixes. Also, updates to Python SDK versions. Updates for .NET 2.1 phase 1 and 2 deprecation start dates. --- doc_source/.DS_Store | Bin 0 -> 6148 bytes .../API_DeleteFunctionEventInvokeConfig.md | 4 +++ .../API_PutFunctionEventInvokeConfig.md | 4 +++ .../API_UpdateFunctionEventInvokeConfig.md | 4 +++ doc_source/access-control-identity-based.md | 16 +++++++--- doc_source/access-control-resource-based.md | 2 +- doc_source/configuration-filesystem.md | 4 +-- doc_source/configuration-images.md | 2 +- doc_source/configuration-layers.md | 29 ++++++++++-------- doc_source/csharp-exceptions.md | 2 +- doc_source/csharp-logging.md | 2 +- doc_source/csharp-package-cli.md | 2 +- doc_source/getting-started-create-function.md | 4 +-- doc_source/gettingstarted-concepts.md | 9 +++++- doc_source/golang-exceptions.md | 2 +- doc_source/golang-logging.md | 2 +- doc_source/invocation-async.md | 8 ++--- doc_source/java-exceptions.md | 2 +- doc_source/java-logging.md | 2 +- doc_source/lambda-powershell.md | 2 -- doc_source/lambda-python.md | 8 ++--- doc_source/lambda-runtimes.md | 8 ++--- doc_source/lambda-samples.md | 2 -- doc_source/nodejs-exceptions.md | 2 +- doc_source/nodejs-logging.md | 2 +- doc_source/powershell-devenv.md | 18 ++++------- doc_source/powershell-exceptions.md | 2 +- doc_source/powershell-logging.md | 2 +- doc_source/powershell-package.md | 23 -------------- doc_source/python-exceptions.md | 2 +- doc_source/python-logging.md | 2 +- doc_source/python-package-create.md | 4 +-- doc_source/ruby-exceptions.md | 2 +- doc_source/ruby-logging.md | 2 +- doc_source/runtime-support-policy.md | 2 +- doc_source/security-dataprotection.md | 2 +- doc_source/services-apigateway-tutorial.md | 2 +- doc_source/welcome.md | 2 +- doc_source/with-android-example.md | 2 +- doc_source/with-ddb-example.md | 2 +- doc_source/with-kafka.md | 11 ++----- doc_source/with-kinesis-example.md | 2 +- doc_source/with-mq.md | 5 ++- doc_source/with-s3-tutorial.md | 8 ++--- doc_source/with-sqs-example.md | 2 +- 45 files changed, 106 insertions(+), 115 deletions(-) create mode 100644 doc_source/.DS_Store diff --git a/doc_source/.DS_Store b/doc_source/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b69849dd92ef70b78b64791809fd6819225e77c8 GIT binary patch literal 6148 zcmeHK!AiqG5Pe%KM7{JPcwDdEiU+T;L_rWQMLbs06e}d8SjB7p!_VjP*;z_U z^biD5nSt52natZ|-$Et>z>S`YAus@t&;@%t96m95FW$0VjBFEKSmPWuN)(vkp_Ofc z->87x-9D~(W6$tdzdw%~+~W~*#xIC7R9F_vX_?n`DM#r*EANKmXm6yIE7F<(2u(HplnGX+cmQ{e9^z?v?zu43YY?>z)Au6 zK6tud8nICfpAHV81t9hr4#v6k62kEj(};~C-_V>=iAr^`#c)bz+{e5$Vxy>ZxY&HS zxU-8LiVM4QeIL@{Qbik00aIX8fh~O;Nc}(iy8quK*^?Pu=rTBmzjBzg$Vj8hgWQ1lv0zn2FOo1O&-~+==ODX^W literal 0 HcmV?d00001 diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md index 5b686b74..58e0a053 100644 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -51,6 +51,10 @@ If the action is successful, the service sends back an HTTP 204 response with an One of the parameters in the request is invalid\. HTTP Status Code: 400 + **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 diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index ec123c06..2818b8f5 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -137,6 +137,10 @@ Valid Range: Minimum value of 0\. Maximum value of 2\. One of the parameters in the request is invalid\. HTTP Status Code: 400 + **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 diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index 3a5cb783..0d90c5ef 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -135,6 +135,10 @@ Valid Range: Minimum value of 0\. Maximum value of 2\. One of the parameters in the request is invalid\. HTTP Status Code: 400 + **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 diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 829053aa..378cfbb9 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -33,10 +33,14 @@ The following shows an example of a permissions policy with limited scope\. It a "Effect": "Allow", "Action": [ "lambda:GetAccountSettings", - "lambda:ListFunctions", - "lambda:ListTags", "lambda:GetEventSourceMapping", + "lambda:GetFunction", + "lambda:GetFunctionConfiguration", + "lambda:GetFunctionCodeSigningConfig", + "lambda:GetFunctionConcurrency", "lambda:ListEventSourceMappings", + "lambda:ListFunctions", + "lambda:ListTags" "iam:ListRoles" ], "Resource": "*" @@ -96,10 +100,14 @@ The permissions in the policy are organized into statements based on the [resour ``` "Action": [ "lambda:GetAccountSettings", - "lambda:ListFunctions", - "lambda:ListTags", "lambda:GetEventSourceMapping", + "lambda:GetFunction", + "lambda:GetFunctionConfiguration", + "lambda:GetFunctionCodeSigningConfig", + "lambda:GetFunctionConcurrency", "lambda:ListEventSourceMappings", + "lambda:ListFunctions", + "lambda:ListTags" "iam:ListRoles" ], "Resource": "*" diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index ffd963b8..400ace4b 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function”, + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index d11a0713..bd90009b 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -170,9 +170,7 @@ Resources: CodeUri: function/. Description: Use a file system. FileSystemConfigs: - - - Arn: !Sub - - "arn:aws:elasticfilesystem:eu-central-1:123456789101:access-point/fsap-015cxmplb72b405fd" + - Arn: "arn:aws:elasticfilesystem:eu-central-1:123456789101:access-point/fsap-015cxmplb72b405fd" LocalMountPath: "/mnt/efs0" DependsOn: "MountTarget1" ``` diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index d68f2173..27751f4a 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -35,7 +35,7 @@ When you deploy code as a container image to a Lambda function, the image underg ## Amazon ECR permissions -For your function to access the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minumum policy: +For your function to access the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minimum policy: ``` { diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index f58c1396..76a659bf 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -10,6 +10,7 @@ You can create layers using the Lambda console, the Lambda API, AWS CloudFormati + [Creating layer content](#configuration-layers-upload) + [Compiling the \.zip file archive for your layer](#configuration-layers-compile) + [Including library dependencies in a layer](#configuration-layers-path) ++ [Language\-specific instructions](#configuration-layers-zip-cli) + [Creating a layer](#configuration-layers-create) + [Deleting a layer version](#configuration-layers-delete) + [Configuring layer permissions](#configuration-layers-permissions) @@ -19,20 +20,9 @@ You can create layers using the Lambda console, the Lambda API, AWS CloudFormati When you create a layer, you must bundle all its content into a \.zip file archive\. You upload the \.zip file archive to your layer from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. Lambda extracts the layer contents into the `/opt` directory when setting up the execution environment for the function\. -### Using the AWS CLI - -You can create and upload a \.zip file for your layer using the Lambda console or the AWS Command Line Interface \(AWS CLI\)\. For language\-specific instructions, see the following topics\. -+ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) -+ [Deploy Python Lambda functions with \.zip file archives](python-package.md) -+ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -+ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) -+ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) - ## Compiling the \.zip file archive for your layer -You build your layer code into a \.zip file archive using the same procedure as you would for a function\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. +You build your layer code into a \.zip file archive using the same procedure as you would for a function deployment package\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. One way to ensure that you package libraries correctly for Lambda is to use [AWS Cloud9](http://aws.amazon.com/cloud9/)\. For more information, see [Using Lambda layers to simplify your development process](http://aws.amazon.com/blogs/compute/using-lambda-layers-to-simplify-your-development-process/) on the AWS Compute Blog\. @@ -111,6 +101,17 @@ jq.zip For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. +## Language\-specific instructions + + For language\-specific instructions on how to create a \.zip file archive, see the following topics\. ++ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) ++ [Deploy Python Lambda functions with \.zip file archives](python-package.md) ++ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) ++ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) ++ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) ++ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + ## Creating a layer You can create new layers using the Lambda console or the Lambda API\. @@ -234,7 +235,9 @@ Resources: Properties: LayerName: blank-nodejs-lib Description: Dependencies for the blank sample app. - ContentUri: lib/. + Content: + S3Bucket: my-bucket-region-123456789012 + S3Key: layer.zip CompatibleRuntimes: - nodejs12.x ``` \ No newline at end of file diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index ff338602..043d1252 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -186,7 +186,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index eb775c10..2d009821 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -151,7 +151,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md index 381751e5..4e984227 100644 --- a/doc_source/csharp-package-cli.md +++ b/doc_source/csharp-package-cli.md @@ -167,7 +167,7 @@ dotnet lambda deploy-function MyFunction --function-role role After deployment, you can re\-test it in a production environment using the following command, and pass in a different value to your Lambda function handler: -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 83c80e0b..3747cb2e 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -231,7 +231,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. ### Update the user permissions -Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy`, `SetRepositoryPolicy`, and `InitiateLayerUpload`\. For information about access policies, see [ Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the *IAM User Guide* +Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about user permissions to access images in the Amazon ECR repository, see [ Amazon ECR permissions](configuration-images.md#configuration-images-permissions) For example, use the IAM console to create a role with the following policy: @@ -242,7 +242,7 @@ For example, use the IAM console to create a role with the following policy: { "Sid": "VisualEditor0", "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload], + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], "Resource": "arn:aws:ecr:::repository//" } ] diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 91685abf..6b394aa1 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -13,6 +13,7 @@ With Lambda, you run functions to process events\. To send events to your functi + [Extension](#gettingstarted-concepts-extensions) + [Concurrency](#gettingstarted-concepts-concurrency) + [Qualifier](#gettingstarted-concepts-qualifier) ++ [Destination](#gettingstarted-concepts-destinations) ## Function @@ -109,4 +110,10 @@ Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region l When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that you can update to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. -For more information, see [Lambda function versions](configuration-versions.md)\. \ No newline at end of file +For more information, see [Lambda function versions](configuration-versions.md)\. + +## Destination + +A *destination* is an AWS resource where Lambda can send events from an asynchronous invocation\. You can configure a destination for events that fail processing\. Some services also support a destination for events that are successfully processed\. + +For more information, see [Configuring destinations for asynchronous invocation](invocation-async.md#invocation-async-destinations)\. \ No newline at end of file diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index a2c01bb6..79406118 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -104,7 +104,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 88cdb341..89a50954 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -136,7 +136,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index e3a39d64..8d4abdf1 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -16,9 +16,7 @@ aws lambda invoke \ --payload '{ "key": "value" }' response.json ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) - -You should see the following output: +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` { @@ -32,7 +30,7 @@ Lambda manages the function's asynchronous event queue and attempts to retry on ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/invocation-types-retries.png) -If the function doesn't have enough concurrency available to process all events, additional requests are throttled\. For throttling errors \(429\) and system errors \(500\-series\), Lambda returns the event to the queue and attempts to run the function again for up to 6 hours\. The retry interval increases exponentially from 1 second after the first attempt to a maximum of 5 minutes\. However, it might be longer if the queue is backed up\. Lambda also reduces the rate at which it reads events from the queue\. +If the function doesn't have enough concurrency available to process all events, additional requests are throttled\. For throttling errors \(429\) and system errors \(500\-series\), Lambda returns the event to the queue and attempts to run the function again for up to 6 hours\. The retry interval increases exponentially from 1 second after the first attempt to a maximum of 5 minutes\. If the queue contains many entries, Lambda increases the retry interval and reduces the rate at which it reads events from the queue\. The following example shows an event that was successfully added to the queue, but is still pending one hour later due to throttling\. @@ -40,7 +38,7 @@ The following example shows an event that was successfully added to the queue, b Even if your function doesn't return an error, it's possible for it to receive the same event from Lambda multiple times because the queue itself is eventually consistent\. If the function can't keep up with incoming events, events might also be deleted from the queue without being sent to the function\. Ensure that your function code gracefully handles duplicate events, and that you have enough concurrency available to handle all invocations\. -When the queue is backed up, new events might age out before Lambda has a chance to send them to your function\. When an event expires or fails all processing attempts, Lambda discards it\. You can [configure error handling](#invocation-async-errors) for a function to reduce the number of retries that Lambda performs, or to discard unprocessed events more quickly\. +When the queue is very long, new events might age out before Lambda has a chance to send them to your function\. When an event expires or fails all processing attempts, Lambda discards it\. You can [configure error handling](#invocation-async-errors) for a function to reduce the number of retries that Lambda performs, or to discard unprocessed events more quickly\. You can also configure Lambda to send an invocation record to another service\. Lambda supports the following [destinations](#invocation-async-destinations) for asynchronous invocation\. + **Amazon SQS** – A standard SQS queue\. diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index b597748e..2ee6c9c0 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -166,7 +166,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 6e6600ef..b88eb616 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -150,7 +150,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md index 21bc2a35..0645f6d8 100644 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -11,8 +11,6 @@ The following sections explain how common programming patterns and core concepts | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Lambda provides the following sample applications for the PowerShell runtime: - -**Sample Lambda applications in PowerShell** + [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. Before you get started, you must first set up a PowerShell development environment\. For instructions on how to do this, see [Setting Up a PowerShell Development Environment](powershell-devenv.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 7c5c94ce..6b083454 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -12,10 +12,10 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | **To create a Python function** diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index d94696dc..73b9c8fb 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -33,10 +33,10 @@ For end of support information about Node\.js 10, see [Runtime support policy](r | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index e7a4582c..ccd61487 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -55,8 +55,6 @@ Lambda provides the following sample applications for the Go runtime: #### [ PowerShell ] Lambda provides the following sample applications for the PowerShell runtime: - -**Sample Lambda applications in PowerShell** + [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ------ diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index bcb6fab3..0d486fd1 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -99,7 +99,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 18f012c4..7ba49d9b 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -129,7 +129,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/powershell-devenv.md b/doc_source/powershell-devenv.md index 54b84ff7..0e4feffc 100644 --- a/doc_source/powershell-devenv.md +++ b/doc_source/powershell-devenv.md @@ -1,15 +1,9 @@ # Setting Up a PowerShell Development Environment -To set up your development environment for writing PowerShell scripts, do the following: +Lambda provides a set of tools and libraries for the PowerShell runtime\. For installation instructions, see [Lambda tools for Powershell](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) on GitHub\. -1. **Install the correct version of PowerShell** – Lambda's support for PowerShell is based on the cross\-platform PowerShell Core 6\.0 release\. This means that you can develop your PowerShell Lambda functions on Windows, Linux, or Mac\. If you don’t have this version of PowerShell installed, you can find instructions in [Installing PowerShell Core](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell#powershell-core)\. - -1. **Install the \.NET Core 3\.1 SDK** – Because PowerShell Core is built on top of \.NET Core, the Lambda support for PowerShell uses the same \.NET Core 3\.1 Lambda runtime for both \.NET Core and PowerShell Lambda functions\. The \.NET Core 3\.1 SDK is used by the new Lambda PowerShell publishing cmdlets to create the Lambda deployment package\. The \.NET Core 3\.1 SDK is available at [\.NET downloads](https://www.microsoft.com/net/download) on the Microsoft website\. Be sure to install the SDK and not the runtime installation\. - -1. **Install the AWSLambdaPSCore module** – You can install this either from the [ PowerShell Gallery](https://www.powershellgallery.com/packages/AWSLambdaPSCore), or you can install it by using the following PowerShell Core shell command: - - ``` - Install-Module AWSLambdaPSCore -Scope CurrentUser - ``` - -1. **\(Optional\) Install AWS Tools for PowerShell** – You can install either the modularized [AWS\.Tools](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-welcome.html#pwsh_structure_pstools) or single\-module [AWSPowerShell\.NetCore](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-welcome.html#pwsh_structure_pscore) version in PowerShell Core 6\.0 to use the Lambda API within your PowerShell environment\\\. For instructions, see [Installing the AWS Tools for PowerShell](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-set-up.html) \ No newline at end of file +The AWSLambdaPSCore module includes the following cmdlets to help author and publish PowerShell Lambda functions: ++ **Get\-AWSPowerShellLambdaTemplate** – Returns a list of getting started templates\. ++ **New\-AWSPowerShellLambda** – Creates an initial PowerShell script based on a template\. ++ **Publish\-AWSPowerShellLambda** – Publishes a given PowerShell script to Lambda\. ++ **New\-AWSPowerShellLambdaPackage** – Creates a Lambda deployment package that you can use in a CI/CD system for deployment\. \ No newline at end of file diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index 04a07bb0..a5709fb0 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -123,7 +123,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 4df8aab8..451ade07 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -139,7 +139,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/powershell-package.md b/doc_source/powershell-package.md index 09fdac4c..ba401214 100644 --- a/doc_source/powershell-package.md +++ b/doc_source/powershell-package.md @@ -2,29 +2,6 @@ A deployment package for the PowerShell runtime contains your PowerShell script, PowerShell modules that are required for your PowerShell script, and the assemblies needed to host PowerShell Core\. -## Tools and libraries - -Lambda provides the following sample applications for the PowerShell runtime: - -**Tools and libraries for PowerShell** -+ [AWS Lambda and AWS Tools for PowerShell](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-lambda.html): the steps to install PowerShell, the \.NET Core 2\.1 SDK, and the `AWSLambdaPSCore` module\. -+ [aws\-lambda\-dotnet](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell): Lambda tools for Powershell on GitHub\. - -The AWSLambdaPSCore module has the following new cmdlets to help author and publish PowerShell Lambda functions: - -**AWSLambdaPSCore cmdlets** -+ **Get\-AWSPowerShellLambdaTemplate** – Returns a list of getting started templates\. -+ **New\-AWSPowerShellLambda** – Creates an initial PowerShell script based on a template\. -+ **Publish\-AWSPowerShellLambda** – Publishes a given PowerShell script to Lambda\. -+ **New\-AWSPowerShellLambdaPackage** – Creates a Lambda deployment package that you can use in a CI/CD system for deployment\. - -## Sample applications - -Lambda provides the following sample applications for the PowerShell runtime: - -**Sample Lambda applications in PowerShell** -+ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. - ## Creating the Lambda function To get started writing and invoking a PowerShell script with Lambda, you can use the `New-AWSPowerShellLambda` cmdlet to create a starter script based on a template\. You can use the `Publish-AWSPowerShellLambda` cmdlet to deploy your script to Lambda\. Then you can test your script either through the command line or the Lambda console\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index 23085fbb..1c7113cd 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -78,7 +78,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 46c2c9e6..79fb10c2 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -121,7 +121,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 80ee105a..c23c3a21 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -201,7 +201,7 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i --payload '{"action": "square","number": 3}' output.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. This command produces the following output: @@ -406,7 +406,7 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. This command produces the following output: diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index 6a9b9ff9..0e87f7b6 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -100,7 +100,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 02f53e70..3ee0dbba 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -151,7 +151,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index 200ce1ac..87a4c1ad 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -18,7 +18,7 @@ The following runtimes have reached or are scheduled for end of support: | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Aug 23, 2021 | Sept 23, 2021 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Sept 20, 2021 | Oct 20, 2021 | | Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | | Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | | Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Aug 30, 2021 | diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 49760245..2c25ed53 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -10,7 +10,7 @@ For data protection purposes, we recommend that you protect AWS account credenti + Use advanced managed security services such as Amazon Macie, which assists in discovering and securing personal data that is stored in Amazon S3\. + If you require FIPS 140\-2 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint\. For more information about the available FIPS endpoints, see [Federal Information Processing Standard \(FIPS\) 140\-2](http://aws.amazon.com/compliance/fips/)\. -We strongly recommend that you never put sensitive identifying information, such as your customers' account numbers, into free\-form fields such as a **Name** field\. This includes when you work with Lambda or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into Lambda or other services might get picked up for inclusion in diagnostic logs\. When you provide a URL to an external server, don't include credentials information in the URL to validate your request to that server\. +We strongly recommend that you never put confidential or sensitive information, such as your customers' email addresses, into tags or free\-form fields such as a **Name** field\. This includes when you work with Lambda or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into tags or free\-form fields used for names may be used for billing or diagnostic logs\. If you provide a URL to an external server, we strongly recommend that you do not include credentials information in the URL to validate your request to that server\. **Topics** + [Encryption in transit](#security-privacy-intransit) diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 32b02804..41828285 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -254,7 +254,7 @@ Invoke the function manually using the sample event data\. We recommend that you --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ## Create an API using Amazon API Gateway diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 663bec4f..20e1a540 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -62,7 +62,7 @@ You can configure a function to mount an [Amazon Elastic File System \(Amazon EF To work effectively with Lambda, you need coding experience and expertise in the following domains: + Linux OS and commands, as well as concepts such as processes, threads, and file permissions\. + Cloud concepts and IP networking concepts \(for public and private networks\)\. -+ Distributed computing concepts such as HTML as an IPC, queues, messaging, notifications, and concurrency\. ++ Distributed computing concepts such as HTTP as an IPC, queues, messaging, notifications, and concurrency\. + Familiarity with security services and concepts: AWS Identity and Access Management \(IAM\) and access control principles, and AWS Key Management Service \(AWS KMS\) and public key infrastructure\. + Familiarity with key services that interact with Lambda: Amazon API Gateway, Amazon S3, Amazon Simple Queue Service \(Amazon SQS\), and DynamoDB\. + Configuring EC2 instances with Linux\. diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 8389bf61..31bb5ad9 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -99,7 +99,7 @@ Invoke the function manually using the sample event data\. --payload file://file-path/input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ## Create an Amazon Cognito identity pool diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index f26f7fb4..24b2ad24 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -185,7 +185,7 @@ Run the following `invoke` command\. aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The function returns the string `message` in the response body\. diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index c56a6ffc..ef7a8d36 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -41,7 +41,7 @@ Lambda sends the batch of messages in the event parameter when it invokes your L + [Auto scaling of the Kafka event source](#services-kafka-scaling) + [Event source API operations](#kafka-hosting-api-operations) + [Event source mapping errors](#services-event-errors) -+ [Event source configuration parameters](#services-msk-parms) ++ [Event source configuration parameters](#services-kafka-parms) ## Managing access and permissions @@ -278,7 +278,7 @@ The function configuration is not valid\. **Note** If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. -## Event source configuration parameters +## Event source configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Apache Kafka\. @@ -288,14 +288,9 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | | BatchSize | N | 100 | Maximum: 10,000 | -| DestinationConfig | N | none | | | Enabled | N | Enabled | | -| KafkaBrokerList | Y | | Can set only on Create | | FunctionName | Y | | | -| MaximumBatchingWindowInSeconds | N | 0 | Maximum: 300 | -| MaximumRecordAgeInSeconds | N | 604,800 \(7 days\) | Maximum: no limit | -| MaximumRetryAttempts | N | 10,000 | Maximum: no limit | -| ParallelizationFactor | N | 1 | | +| SelfManagedEventSource | Y | | List of Kafka Brokers\. Can set only on Create | | SourceAccessConfigurations | N | No credentials | VPC information or authentication credentials for the cluster For SASL\_PLAIN, set to BASIC\_AUTH | | StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | | Topics | Y | | Topic name Can set only on Create | \ No newline at end of file diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 1efb74d3..23fbf996 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -124,7 +124,7 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The response is saved to `out.txt`\. diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 2748d5ca..d047239c 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -297,4 +297,7 @@ Lambda does not have the required permissions to access the event source\. **`FUNCTION_CONFIG_NOT_VALID`** The function's configuration is not valid\. -Records also go unprocessed if Lambda drops them due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a redelivery policy and dead\-letter queue \(DLQ\) handling with Amazon MQ\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website and [Reliability Guide](https://www.rabbitmq.com/reliability.html) on the RabbitMQ website\. \ No newline at end of file +Records also go unprocessed if Lambda drops them due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a dead\-letter queue \(DLQ\)\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website and [Reliability Guide](https://www.rabbitmq.com/reliability.html) on the RabbitMQ website\. + +**Note** +Lambda does not support custom redelivery policies\. Instead, Lambda uses a policy with the default values from the [Redelivery Policy](https://activemq.apache.org/redelivery-policy) page on the Apache ActiveMQ website, with `maximumRedeliveries` set to 5\. \ No newline at end of file diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index 11e3265d..5921f6c6 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -488,7 +488,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -502,7 +502,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `lambda_function.lambda_handler`\. This handler name reflects the function name as `lambda_handler`, and the name of the file where the handler code is stored as `lambda_function.py`\. For more information, see [Lambda function handler in Python](python-handler.md)\. The command specifies a runtime of `python3.8`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -516,7 +516,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `example.handler`\. The function can use the abbreviated handler format of `package.Class` because the function implements a handler interface\. For more information, see [AWS Lambda function handler in Java](java-handler.md)\. The command specifies a runtime of `java11`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -586,7 +586,7 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. --payload file://inputFile.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify that the thumbnail is created in the target S3 bucket\. diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index 87cd8e43..037e18ea 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -114,7 +114,7 @@ If the handler returns normally without exceptions, Lambda considers the message --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify the output in the `outputfile.txt` file\. From a170fde11fc53c7ee0ba4b2e608b48158216515f Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 26 Jul 2021 12:14:38 -0700 Subject: [PATCH 57/94] Move java-events-v1sdk samples to java-events. Add note that v1sdk examples are deprecated. --- sample-apps/java-events-v1sdk/README.md | 2 + sample-apps/java-events/3-invoke.sh | 9 +++ sample-apps/java-events/README.md | 6 ++ sample-apps/java-events/build.gradle | 8 +-- .../java-events/events/dynamodb-record.json | 64 +++++++++++++++++++ .../java-events/events/kinesis-record.json | 36 +++++++++++ .../java-events/events/s3-notification.json | 39 +++++++++++ sample-apps/java-events/pom.xml | 13 ++-- 8 files changed, 165 insertions(+), 12 deletions(-) create mode 100644 sample-apps/java-events/events/dynamodb-record.json create mode 100644 sample-apps/java-events/events/kinesis-record.json create mode 100644 sample-apps/java-events/events/s3-notification.json diff --git a/sample-apps/java-events-v1sdk/README.md b/sample-apps/java-events-v1sdk/README.md index 31e42f6d..d2299710 100644 --- a/sample-apps/java-events-v1sdk/README.md +++ b/sample-apps/java-events-v1sdk/README.md @@ -2,6 +2,8 @@ This sample application shows the use of the `aws-lambda-java-events` library with event types that require AWS SDK as a dependency. A separate handler class is defined for each input type. For other event types (which don't require the AWS SDK), see the `java-events` sample. +**Note: The `java-events-v1sdk` examples are deprecated.** As of version 3.0.0 of the `aws-lambda-java-events` package, [users are no longer required to pull in SDK dependencies in order to use that library](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events). Please see the [`java-events` package](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) for updated examples. + ![Architecture](/sample-apps/java-events-v1sdk/images/sample-java-events-v1sdk.png) The project includes function code and supporting resources: diff --git a/sample-apps/java-events/3-invoke.sh b/sample-apps/java-events/3-invoke.sh index ebac190b..0504ea1e 100755 --- a/sample-apps/java-events/3-invoke.sh +++ b/sample-apps/java-events/3-invoke.sh @@ -25,12 +25,21 @@ then cog) PAYLOAD='file://events/cognito-sync.json' ;; + kin) + PAYLOAD='file://events/kinesis-record.json' + ;; fh) PAYLOAD='file://events/firehose-record.json' ;; lex) PAYLOAD='file://events/lex-flowers.json' ;; + ddb) + PAYLOAD='file://events/dynamodb-record.json' + ;; + s3) + PAYLOAD='file://events/s3-notification.json' + ;; *) echo -n "Unknown event type" ;; diff --git a/sample-apps/java-events/README.md b/sample-apps/java-events/README.md index 48533a0e..a8a0b7d8 100644 --- a/sample-apps/java-events/README.md +++ b/sample-apps/java-events/README.md @@ -90,8 +90,11 @@ By default, the function uses a handler class named `Handler` that takes an API - `HandlerCognito.java` - Takes `CognitoEvent` as input. - `HandlerCWEvents.java` - Takes `ScheduledEventEvent` as input. - `HandlerCWLogs.java` - Takes `CloudWatchLogsEvent` as input. +- `HandlerDynamoDB.java` - Takes `DynamodbEvent` as input. - `HandlerFirehose.java` - Takes `KinesisFirehoseEvent` as input. +- `HandlerKinesis.java` - Takes `KinesisEvent` as input. - `HandlerLex.java` - Takes `LexEvent` as input. +- `HandlerS3.java` - Takes `S3Event` as input. - `HandlerSNS.java` - Takes `SNSEvent` as input. To use a different handler, change the value of the Handler setting in the application template (`template.yml` or `template-mvn.yaml`). For example, to use the Amazon Lex handler: @@ -118,8 +121,11 @@ The following event type keys are supported: - `cfg` - Config rule (`events/config-rule.json`) - `cc` - CodeCommit push (`events/codecommit-push.json`) - `cog` - Cognito Sync (`events/cognito-sync.json`) +- `kin` - Kinesis record (`events/kinesis-record.json`) - `fh` - Kinesis Firehose record (`events/firehose-record.json`) - `lex` - Lex dialog (`events/lex-flowers.json`) +- `ddb` - DynamoDB record (`events/dynamodb-record.json`) +- `s3` - S3Event record (`events/s3-notification.json`) # Cleanup To delete the application, run `4-cleanup.sh`. diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index a22a9885..0f68f99a 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -8,11 +8,11 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' + implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.13.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.13.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' + implementation 'org.apache.logging.log4j:log4j-api:2.13.0' + implementation 'org.apache.logging.log4j:log4j-core:2.13.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/events/dynamodb-record.json b/sample-apps/java-events/events/dynamodb-record.json new file mode 100644 index 00000000..74a055e8 --- /dev/null +++ b/sample-apps/java-events/events/dynamodb-record.json @@ -0,0 +1,64 @@ +{ + "Records": [ + { + "eventID": "1", + "eventVersion": "1.0", + "dynamodb": { + "Keys": { + "Id": { + "N": "101" + } + }, + "NewImage": { + "Message": { + "S": "New item!" + }, + "Id": { + "N": "101" + } + }, + "StreamViewType": "NEW_AND_OLD_IMAGES", + "SequenceNumber": "111", + "SizeBytes": 26 + }, + "awsRegion": "us-west-2", + "eventName": "INSERT", + "eventSourceARN": "eventsourcearn", + "eventSource": "aws:dynamodb" + }, + { + "eventID": "2", + "eventVersion": "1.0", + "dynamodb": { + "OldImage": { + "Message": { + "S": "New item!" + }, + "Id": { + "N": "101" + } + }, + "SequenceNumber": "222", + "Keys": { + "Id": { + "N": "101" + } + }, + "SizeBytes": 59, + "NewImage": { + "Message": { + "S": "This item has changed" + }, + "Id": { + "N": "101" + } + }, + "StreamViewType": "NEW_AND_OLD_IMAGES" + }, + "awsRegion": "us-west-2", + "eventName": "MODIFY", + "eventSourceARN": "sourcearn", + "eventSource": "aws:dynamodb" + } + ] +} \ No newline at end of file diff --git a/sample-apps/java-events/events/kinesis-record.json b/sample-apps/java-events/events/kinesis-record.json new file mode 100644 index 00000000..8bc3e069 --- /dev/null +++ b/sample-apps/java-events/events/kinesis-record.json @@ -0,0 +1,36 @@ +{ + "Records": [ + { + "kinesis": { + "kinesisSchemaVersion": "1.0", + "partitionKey": "1", + "sequenceNumber": "49590338271490256608559692538361571095921575989136588898", + "data": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + "approximateArrivalTimestamp": 1545084650.987 + }, + "eventSource": "aws:kinesis", + "eventVersion": "1.0", + "eventID": "shardId-000000000006:49590338271490256608559692538361571095921575989136588898", + "eventName": "aws:kinesis:record", + "invokeIdentityArn": "arn:aws:iam::123456789012:role/lambda-role", + "awsRegion": "us-east-2", + "eventSourceARN": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream" + }, + { + "kinesis": { + "kinesisSchemaVersion": "1.0", + "partitionKey": "1", + "sequenceNumber": "49590338271490256608559692540925702759324208523137515618", + "data": "VGhpcyBpcyBvbmx5IGEgdGVzdC4=", + "approximateArrivalTimestamp": 1545084711.166 + }, + "eventSource": "aws:kinesis", + "eventVersion": "1.0", + "eventID": "shardId-000000000006:49590338271490256608559692540925702759324208523137515618", + "eventName": "aws:kinesis:record", + "invokeIdentityArn": "arn:aws:iam::123456789012:role/lambda-role", + "awsRegion": "us-east-2", + "eventSourceARN": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream" + } + ] +} \ No newline at end of file diff --git a/sample-apps/java-events/events/s3-notification.json b/sample-apps/java-events/events/s3-notification.json new file mode 100644 index 00000000..94c28f5c --- /dev/null +++ b/sample-apps/java-events/events/s3-notification.json @@ -0,0 +1,39 @@ +{ + "Records": [ + { + "awsRegion": "us-east-2", + "eventName": "ObjectCreated:Put", + "eventSource": "aws:s3", + "eventTime": "2020-03-08T00:30:12.456Z", + "eventVersion": "2.1", + "requestParameters": { + "sourceIPAddress": "174.255.255.156" + }, + "responseElements": { + "xAmzId2": "nBbLJPAHhdvxmplPvtCgTrWCqf/KtonyV93l9rcoMLeIWJxpS9x9P8u01+Tj0OdbAoGs+VGvEvWl/Sg1NW5uEsVO25Laq7L", + "xAmzRequestId": "AF2D7AB6002E898D" + }, + "s3": { + "configurationId": "682bbb7a-xmpl-48ca-94b1-7f77c4d6dbf0", + "bucket": { + "name": "BUCKET_NAME", + "ownerIdentity": { + "principalId": "A3XMPLFAF2AI3E" + }, + "arn": "arn:aws:s3:::BUCKET_NAME" + }, + "object": { + "key": "inbound/sample-java-s3.png", + "size": 21476, + "eTag": "d132690b6c65b6d1629721dcfb49b883", + "versionId": "", + "sequencer": "005E64A65DF093B26D" + }, + "s3SchemaVersion": "1.0" + }, + "userIdentity": { + "principalId": "AWS:AIDAINPONIXMPLT3IKHL2" + } + } + ] +} \ No newline at end of file diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index ec6141b0..0d13721a 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -20,7 +20,7 @@ com.amazonaws aws-lambda-java-events - 2.2.9 + 3.9.0 com.google.code.gson @@ -31,32 +31,29 @@ org.apache.logging.log4j log4j-api 2.13.0 - test org.apache.logging.log4j log4j-core 2.13.2 - test org.apache.logging.log4j log4j-slf4j18-impl 2.13.0 - test - + org.junit.jupiter junit-jupiter-api 5.6.0 test - - + + org.junit.jupiter junit-jupiter-engine 5.6.0 test - + From ea892da10971b4ed7846d2524a7b8bd31987b29c Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 26 Jul 2021 12:44:41 -0700 Subject: [PATCH 58/94] Add handlers & logging config to java-events samples --- .../main/java/example/HandlerDynamoDB.java | 33 +++++++++++++++++ .../src/main/java/example/HandlerKinesis.java | 30 ++++++++++++++++ .../src/main/java/example/HandlerS3.java | 35 +++++++++++++++++++ .../java-events/src/main/resources/log4j2.xml | 16 +++++++++ 4 files changed, 114 insertions(+) create mode 100644 sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java create mode 100644 sample-apps/java-events/src/main/java/example/HandlerKinesis.java create mode 100644 sample-apps/java-events/src/main/java/example/HandlerS3.java create mode 100644 sample-apps/java-events/src/main/resources/log4j2.xml diff --git a/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java new file mode 100644 index 00000000..7bdb3bba --- /dev/null +++ b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java @@ -0,0 +1,33 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.LambdaLogger; +import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; +import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Handler value: example.HandlerDynamoDB +public class HandlerDynamoDB implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerDynamoDB.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public String handleRequest(DynamodbEvent event, Context context) + { + String response = new String("200 OK"); + for (DynamodbStreamRecord record : event.getRecords()){ + logger.info(record.getEventID()); + logger.info(record.getEventName()); + logger.info(record.getDynamodb().toString()); + } + logger.info("Successfully processed " + event.getRecords().size() + " records."); + // log execution details + Util.logEnvironment(event, context, gson); + return response; + } +} \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerKinesis.java b/sample-apps/java-events/src/main/java/example/HandlerKinesis.java new file mode 100644 index 00000000..d337920b --- /dev/null +++ b/sample-apps/java-events/src/main/java/example/HandlerKinesis.java @@ -0,0 +1,30 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.LambdaLogger; +import com.amazonaws.services.lambda.runtime.events.KinesisEvent; +import com.amazonaws.services.lambda.runtime.events.KinesisEvent.KinesisEventRecord; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Handler value: example.HandleKinesis +public class HandlerKinesis implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerKinesis.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public String handleRequest(KinesisEvent event, Context context) + { + String response = new String("200 OK"); + for(KinesisEventRecord record : event.getRecords()) { + logger.info(gson.toJson(record.getKinesis().getData())); + } + // log execution details + Util.logEnvironment(event, context, gson); + return response; + } +} \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerS3.java b/sample-apps/java-events/src/main/java/example/HandlerS3.java new file mode 100644 index 00000000..a6f470be --- /dev/null +++ b/sample-apps/java-events/src/main/java/example/HandlerS3.java @@ -0,0 +1,35 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.LambdaLogger; +import com.amazonaws.services.lambda.runtime.events.S3Event; + +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Handler value: example.Handler +public class HandlerS3 implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerS3.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public String handleRequest(S3Event event, Context context) + { + String response = new String("200 OK"); + S3EventNotificationRecord record = event.getRecords().get(0); + String srcBucket = record.getS3().getBucket().getName(); + // Object key may have spaces or unicode non-ASCII characters. + String srcKey = record.getS3().getObject().getUrlDecodedKey(); + logger.info("RECORD: " + record); + logger.info("SOURCE BUCKET: " + srcBucket); + logger.info("SOURCE KEY: " + srcKey); + // log execution details + Util.logEnvironment(event, context, gson); + return response; + } +} \ No newline at end of file diff --git a/sample-apps/java-events/src/main/resources/log4j2.xml b/sample-apps/java-events/src/main/resources/log4j2.xml new file mode 100644 index 00000000..b9a6c317 --- /dev/null +++ b/sample-apps/java-events/src/main/resources/log4j2.xml @@ -0,0 +1,16 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss} %X{AWSRequestId} %-5p %c{1} - %m%n + + + + + + + + + + + \ No newline at end of file From dc96abc288940ddd62f19891ed545fbb36eb8a08 Mon Sep 17 00:00:00 2001 From: Stefan Schablowski Date: Wed, 28 Jul 2021 21:12:54 +0200 Subject: [PATCH 59/94] fix function name in code sample --- doc_source/python-package-create.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index c23c3a21..a2f536ae 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -434,7 +434,7 @@ You can now delete the resources that you created for this tutorial, unless you + Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. ``` - aws lambda delete-function --function-name my-function + aws lambda delete-function --function-name my-sourcecode-function ``` This command produces no output\. @@ -451,4 +451,4 @@ You can now delete the resources that you created for this tutorial, unless you ``` aws iam delete-role --role-name lambda-ex - ``` \ No newline at end of file + ``` From cbc91b4e710c5026473a4fca6415cfe361b019c8 Mon Sep 17 00:00:00 2001 From: csereno <35574850+csereno@users.noreply.github.com> Date: Thu, 29 Jul 2021 23:38:55 -0500 Subject: [PATCH 60/94] Removed a redundant half sentence in the cold start section Removed the statements in brackets in the following paragraph from the provision concurrency section. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency. [[For example, a function configured with 100 provisioned concurrency.]] For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur. --- doc_source/troubleshooting-invocation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 04a7bfc4..f526d9bd 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -70,7 +70,7 @@ When the number of concurrent executions on a function is less than or equal to Provisioned concurrency is not configurable on the [$LATEST version](configuration-images.md#configuration-images-latest)\. + Ensure that your triggers invoke the correct function version or alias\. For example, if you're using Amazon API Gateway, check that API Gateway invokes the function version or alias with provisioned concurrency, not $LATEST\. To confirm that provisioned concurrency is being used, you can check the [ProvisionedConcurrencyInvocations Amazon CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that the function is processing invocations on initialized execution environments\. + Determine whether your function concurrency exceeds the configured level of provisioned concurrency by checking the [ProvisionedConcurrencySpilloverInvocations CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that all provisioned concurrency is in use and some invocation occurred with a cold start\. -+ Check your [invocation frequency](gettingstarted-limits.md) \(requests per second\)\. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency\. For example, a function configured with 100 provisioned concurrency\. For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second\. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur\. ++ Check your [invocation frequency](gettingstarted-limits.md) \(requests per second\)\. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency\. For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second\. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur\. **Note** There is a known issue in which the first invocation on an initialized execution environment reports a non\-zero **Init Duration** metric in CloudWatch Logs, even though no cold start has occurred\. We're developing a fix to correct the reporting to CloudWatch Logs\. @@ -113,4 +113,4 @@ The function could connect to the function's [file system](configuration-filesys *EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* -A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file +A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. From 779926c5791c94cdf8b2767b0ea1483b9486f099 Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Sat, 31 Jul 2021 07:52:56 -0700 Subject: [PATCH 61/94] updates. Two new function configuration files --- doc_source/access-control-identity-based.md | 5 + doc_source/configuration-console.md | 58 ------ doc_source/configuration-envvars.md | 2 +- doc_source/configuration-function-common.md | 161 +++++++++++++++ doc_source/configuration-function-zip.md | 106 ++++++++++ doc_source/configuration-images.md | 4 +- doc_source/configuration-memory.md | 47 ----- doc_source/configuration-versions.md | 2 +- doc_source/csharp-handler.md | 2 +- doc_source/foundation-console.md | 187 ++++++++++++++++++ ...ode-editor.md => functions-code-editor.md} | 22 +-- doc_source/getting-started-create-function.md | 2 +- doc_source/getting-started.md | 4 +- doc_source/gettingstarted-limits.md | 4 +- doc_source/index.md | 17 +- doc_source/java-context.md | 4 +- doc_source/java-exceptions.md | 4 +- doc_source/java-handler.md | 4 +- doc_source/java-logging.md | 4 +- doc_source/java-package.md | 4 +- doc_source/java-samples.md | 4 +- doc_source/java-tracing.md | 4 +- doc_source/lambda-functions.md | 8 +- doc_source/lambda-java.md | 2 +- doc_source/lambda-managing.md | 13 ++ doc_source/lambda-monitoring.md | 1 + doc_source/lambda-nodejs.md | 6 +- doc_source/lambda-python.md | 6 +- doc_source/lambda-releases.md | 2 +- doc_source/lambda-ruby.md | 6 +- doc_source/lambda-runtimes.md | 2 +- doc_source/lambda-samples.md | 4 +- doc_source/monitoring-code-profiler.md | 50 +++++ doc_source/monitoring-metrics.md | 2 +- doc_source/nodejs-handler.md | 2 +- doc_source/ruby-package.md | 5 +- doc_source/runtimes-extensions-api.md | 2 +- doc_source/runtimes-modify.md | 2 +- doc_source/troubleshooting-execution.md | 2 +- doc_source/troubleshooting-invocation.md | 4 +- doc_source/welcome.md | 2 +- doc_source/with-sqs.md | 2 +- 42 files changed, 597 insertions(+), 177 deletions(-) delete mode 100644 doc_source/configuration-console.md create mode 100644 doc_source/configuration-function-common.md create mode 100644 doc_source/configuration-function-zip.md delete mode 100644 doc_source/configuration-memory.md create mode 100644 doc_source/foundation-console.md rename doc_source/{code-editor.md => functions-code-editor.md} (91%) create mode 100644 doc_source/lambda-managing.md create mode 100644 doc_source/monitoring-code-profiler.md diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 378cfbb9..daf049a0 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -20,6 +20,11 @@ AWS managed policies grant permission to API actions without restricting the Lam ## Function development +Use identity\-based policies to allow users to perform operations on Lambda functions\. + +**Note** +For a function defined as a container image, the user permission to access the image MUST be configured in the Amazon Elastic Container Registry For an example, see [Amazon ECR permissions\.](configuration-images.md#configuration-images-permissions) + The following shows an example of a permissions policy with limited scope\. It allows a user to create and manage Lambda functions named with a designated prefix \(`intern-`\), and configured with a designated execution role\. **Example Function development policy** diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md deleted file mode 100644 index 39af7e6f..00000000 --- a/doc_source/configuration-console.md +++ /dev/null @@ -1,58 +0,0 @@ -# Configuring functions in the console - -You can use the Lambda console to configure function settings, add triggers and destinations, and update and test your code\. - -To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. - -![\[The function overview in the AWS Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) - -The function overview shows a visualization of your function and its upstream and downstream resources\. - -You can use it to configure triggers, layers, and destinations\. -+ **Triggers** – Triggers are services and resources that you have configured to invoke your function\. Choose **Add trigger** to create a Lambda [event source mapping](invocation-eventsourcemapping.md) or to configure a trigger in another service that the Lambda console integrates with\. For details about these services and others, see [Using AWS Lambda with other services](lambda-services.md)\. -+ **Layers** – Choose the **Layers** node to add [layers](configuration-layers.md) to your application\. A layer is a \.zip file archive that contains libraries, a custom runtime, or other dependencies\. -+ **Destinations** – Add a destination to your function to send details about invocation results to another service\. You can send invocation records when your function is invoked [asynchronously](invocation-async.md), or by an [event source mapping](invocation-eventsourcemapping.md) that reads from a stream\. - -By default you are working with the `Latest` function version\. You can modify the following settings in this version: - -**Function settings** -+ **Code** – The code and dependencies of your function\. For scripting languages, you can edit your function code in the embedded [editor](code-editor.md)\. To add libraries, or for languages that the editor doesn't support, or to create a function deployed as a container image, upload a [deployment package](gettingstarted-package.md)\. If your deployment package is larger than 50 MB, choose **Upload a file from Amazon S3**\. -+ **Runtime** – The [Lambda runtime](lambda-runtimes.md) that runs your function\. -+ **Handler** – The method that the runtime runs when your function is invoked, such as `index.handler`\. The first value is the name of the file or module\. The second value is the name of the method\. -+ **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. -+ **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. - - Tags apply to the entire function, including all versions and aliases\. -+ **Execution role** – The [AWS Identity and Access Management \(IAM\) role](lambda-intro-execution-role.md) that Lambda assumes when it runs your function\. -+ **Description** – A description of the function\. -+ **Memory**– The amount of memory available to the function at runtime\. To [set the memory for your function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html), enter a value between 128 MB and 10,240 MB in 1\-MB increments\. -+ **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is three seconds\. The maximum allowed value is 900 seconds\. -+ **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. -+ **Database proxies** – [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\. -+ **Active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](services-xray.md)\. -+ **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. - - Reserved concurrency applies to the entire function, including all versions and aliases\. -+ **Asynchronous invocation** – [Configure error handling behavior](invocation-async.md) to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them\. [Configure a dead\-letter queue](invocation-async.md#dlq) to retain discarded events\. - - You can configure error handling settings on a function, version, or alias\. - -Except as noted in the preceding list, you can only change function settings on the unpublished version of a function\. When you publish a version, code and most settings are locked to ensure a consistent experience for users of that version\. Use [aliases](configuration-aliases.md) to propagate configuration changes in a controlled manner\. - -To configure functions with the Lambda API, use the following actions: -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) – Update the function's code\. -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) – Update version\-specific settings\. -+ [TagResource](API_TagResource.md) – Tag a function\. -+ [AddPermission](API_AddPermission.md) – Modify the [resource\-based policy](access-control-resource-based.md) of a function, version, or alias\. -+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) – Configure a function's reserved concurrency\. -+ [PublishVersion](API_PublishVersion.md) – Create an immutable version with the current code and configuration\. -+ [CreateAlias](API_CreateAlias.md) – Create aliases for function versions\. -+ [PutFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionEventInvokeConfig.html) – Configure error handling for asynchronous invocation\. - -For example, to update a function's memory setting with the AWS CLI, use the `update-function-configuration` command\. - -``` -aws lambda update-function-configuration --function-name my-function --memory-size 256 -``` - -For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index cf46ef31..b263c785 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -18,7 +18,7 @@ Environment variables are not evaluated prior to the function invocation\. Any v ## Configuring environment variables -You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-console.md)\. +You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-function-common.md)\. You create an environment variable on your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\. diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md new file mode 100644 index 00000000..72202d40 --- /dev/null +++ b/doc_source/configuration-function-common.md @@ -0,0 +1,161 @@ +# Configuring Lambda function options + +After you create a function, you can configure additional capabilities for the function, such as triggers, network acccess, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\. + +You can also create and edit test events to test your function using the console\. + +For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\. + +**Topics** ++ [Function versions](#configuration-function-latest) ++ [Using the function overview](#configuration-functions-designer) ++ [Configuring functions \(console\)](#configuration-common-summary) ++ [Configuring functions \(API\)](#configuration-function-api) ++ [Configuring function memory \(console\)](#configuration-memory-console) ++ [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept) ++ [Configuring triggers \(console\)](#configuration-common-triggers) ++ [Testing functions \(console\)](#configuration-common-test) + +## Function versions + +A function has an unpublished version, and can have published versions and aliases\. By default, the console displays configuration information for the unpublished version of the function\. You change the unpublished version when you update your function's code and configuration\. + +A published version is a snapshot of your function code and configuration that can't be changed \(except for a few configuration items relevant to a function version, such as provisioned concurrency\)\. + +## Using the function overview + +The **Function overview** shows a visualization of your function and its upstream and downstream resources\. You can use it to jump to trigger and destination configuration\. You can use it to jump to layer configuration for functions defined as \.zip file archives\. + +![\[The Lambda function overview, with no configured triggers or destinations.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) + +## Configuring functions \(console\) + +For most function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **configuration** tab provides the following sections: ++ **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function timeout and the execution role\. ++ **Triggers** – Configure [triggers](#configuration-common-triggers)\. ++ **Permissions** – Configure the execution role and other [permissions](lambda-permissions.md)\. ++ **Destinations** – Configure [destinations](invocation-async.md#invocation-async-destinations) for asynchronous invocations \. ++ **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. ++ **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. + + Tags apply to the entire function, including all versions and aliases\. ++ **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. ++ **Monitoring and operations tools** – configure CloudWatch and other monitoring tools\. ++ **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. + + Reserved concurrency applies to the entire function, including all versions and aliases\. ++ **Asynchronous invocation** – [Configure error handling behavior](invocation-async.md) to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them\. [Configure a dead\-letter queue](invocation-async.md#dlq) to retain discarded events\. + + You can configure on a function, version, or alias\. ++ **Code signing** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. ++ **Database proxies** – [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\. ++ **File systems** – Connect your function to a [file system](configuration-filesystem.md)\. + +The console provides separate tabs to configure aliases and versions: ++ **Aliases** – An alias is a named resource that maps to a function version\. You can change an alias to map to a different function version\. ++ **Versions** – Lambda assigns a new version number each time you publish your function\. For more information about managing versions, see [Lambda function versions](configuration-versions.md)\. + +You can configure the following items for a published function version: ++ Triggers ++ Destinations ++ Provisioned concurrency ++ Asynchronous invocation ++ Database proxies + +## Configuring functions \(API\) + +To configure functions with the Lambda API, use the following actions: ++ [UpdateFunctionCode](API_UpdateFunctionCode.md) – Update the function's code\. ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) – Update version\-specific settings\. ++ [TagResource](API_TagResource.md) – Tag a function\. ++ [AddPermission](API_AddPermission.md) – Modify the [resource\-based policy](access-control-resource-based.md) of a function, version, or alias\. ++ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) – Configure a function's reserved concurrency\. ++ [PublishVersion](API_PublishVersion.md) – Create an immutable version with the current code and configuration\. ++ [CreateAlias](API_CreateAlias.md) – Create aliases for function versions\. ++ [PutFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionEventInvokeConfig.html) – Configure error handling for asynchronous invocation\. + +## Configuring function memory \(console\) + +Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your Lambda function at runtime\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. + +You can configure the memory of your function in the Lambda console\. + +**To update the memory of a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. + +1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\. + +1. Choose **Save**\. + +## Accepting function memory recommendations \(console\) + +If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. + +When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\. + +**To accept a function memory recommendation** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. + +1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\. + +1. Choose **Save**\. + +## Configuring triggers \(console\) + +You can configure other AWS services to trigger your function each time a specified event occurs\. + +For details about how services trigger Lambda functions, see [Using AWS Lambda with other services](lambda-services.md)\. + +**To add a trigger to your function\.** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update\. + +1. Under **Function overview**, choose **Add trigger**\. + +1. From the drop\-down list of triggers, choose a trigger\. The console displays additional configuration fields required for this trigger\. + +1. Choose **Add**\. + +## Testing functions \(console\) + +You can create test events for your function from the **Test** tab\. + +**To create a test event** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to test, and choose **Test**\. + +1. Under **Test event**, select **New event**\. + +1. Select a **Template**\. + +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. + +1. Choose **Save changes**\. + +Saved test events are also available from the **Code** tab, under the **Test** menu\. After you create one or more test events, you can invoke your function using one of your tests as an event\. + +**To test the function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to test, and choose **Test**\. + +1. Under **Test event**, select **Saved events** and select the event you want to use\. + +1. Choose **Test**\. + +1. Expand the **Execution result** panel to display details about the test\. \ No newline at end of file diff --git a/doc_source/configuration-function-zip.md b/doc_source/configuration-function-zip.md new file mode 100644 index 00000000..32fa7a5e --- /dev/null +++ b/doc_source/configuration-function-zip.md @@ -0,0 +1,106 @@ +# Creating Lambda functions defined as \.zip file archives + +When you create a Lambda function, you package your function code into a [deployment package](gettingstarted-package.md)\. Lambda supports two types of deployment packages: [container images](configuration-images.md) and \.zip file archives\. + +You can use the Lambda console and the Lambda API to create a function defined with a \.zip file archive\. You can also upload an updated \.zip file to change the function code\. + +**Note** +You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. + +**Topics** ++ [Creating a function \(console\)](#configuration-function-create) ++ [Using the console code editor](#configuration-functions-console-update) ++ [Updating function code \(console\)](#configuration-function-update) ++ [Configuring runtime settings \(console\)](#configuration-function-runtime) ++ [Using the Lambda API](#configuration-function-api) ++ [AWS CloudFormation](#configuration-function-cloudformation) + +## Creating a function \(console\) + +When you create a function defined with a \.zip file archive, you choose a code template, the language version, and the execution role for the function\. You add your function code after Lambda creates the function\. + +**To create the function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose **Create function**\. + +1. Choose **Author from scratch** or **Use a blueprint** to create your function\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter the function name\. + + 1. For **Runtime**, choose the language version to use for your function\. + +1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. You can create a new **Execution role** or use an existing role\. + +1. \(Optional\) Expand **Advanced settings**\. You can choose a **Code signing configuration** for the function\. You can also configure an \(Amazon VPC\) for the function to access\. + +1. Choose **Create function**\. + +Lambda creates the new function\. You can now use the console to add the function code and configure other function parameters and features\. + +## Using the console code editor + +The console creates a Lambda function with a single source file\. For scripting languages, you can edit this file and add more files using the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. + +**Note** +The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. + +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. + +## Updating function code \(console\) + +For scripting languages \(Node\.js, Python, and Ruby\), you can edit your function code in the embedded code [editor](foundation-console.md#code-editor)\. To add libraries, or for languages that the editor doesn't support \(Java, Go, C\#\), you must upload your function code as a \.zip archive\. You can upload the zip archive from your local machine\. If the \.zip archive is larger than 50 MB, upload the file to the function from an Amazon S3 bucket\. + +**To upload function code as a \.zip archive** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update and choose the **Code** tab\. + +1. Under **Code source**, choose **Upload from**\. + +1. Choose **\.zip file** and then choose **Upload**\. + + 1. In the file chooser, select the new image version and choose **Open**, then choose **Save**\. + +1. \(Alternative to step 4\) Choose **Amazon S3 location**\. + + 1. In the text box, enter the S3 link URL of the \.zip file archive, then choose **Save**\. + +## Configuring runtime settings \(console\) + +When you create a function that uses a \.zip file deployment package, you must specify the runtime to use and the name of the function handler\. + +**To update the runtime settings** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update and choose the **Code** tab\. + +1. Under **Runtime settings**, choose **Edit**\. + + 1. For **Runtime**, select the runtime version\. + + 1. For **Handler**, specify file name and handler for your function\. + +1. Choose **Save**\. + +## Using the Lambda API + +To create and configure a function that uses a \.zip file archive, use the following API operations: ++ [CreateFunction](API_CreateFunction.md) ++ [UpdateFunctionCode](API_UpdateFunctionCode.md) ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + +## AWS CloudFormation + +You can use AWS CloudFormation to create a Lambda function that uses a \.zip file archive\. In your AWS CloudFormation template, the `AWS::Lambda::Function` resource specifies the Lambda function\. For descriptions of the properties in the `AWS::Lambda::Function` resource, see [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) in the *AWS CloudFormation User Guide*\. + +In the `AWS::Lambda::Function` resource, set the following properties to create a function defined as a \.zip file archive: ++ AWS::Lambda::Function + + PackageType – Set to `Zip`\. + + Code – Enter the Amazon S3 bucket name and \.zip file name in the `S3Bucket` and `S3Key`fields\. For Node\.js or Python, you can provide inline source code of your Lambda function\. + + Runtime – Set the runtime value\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 27751f4a..f6839867 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -1,4 +1,6 @@ -# Configuring functions defined as container images +# Creating Lambda functions defined as container images + +When you create a Lambda function, you use a [deployment package](gettingstarted-package.md) to deploy your function code\. Lambda supports two types of deployment packages: [\.zip file archives](configuration-function-zip.md) and container images\. You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. diff --git a/doc_source/configuration-memory.md b/doc_source/configuration-memory.md deleted file mode 100644 index b88d5251..00000000 --- a/doc_source/configuration-memory.md +++ /dev/null @@ -1,47 +0,0 @@ -# Configuring Lambda function memory - -Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your Lambda function at runtime\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. - -This page describes how to update the memory allotted to your function in the Lambda console\. - -**Topics** -+ [Configuring function memory \(console\)](#configuration-memory-console) -+ [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept) - -## Configuring function memory \(console\) - -You can configure the memory of your function in the Lambda console\. - -**To update the memory of a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **General configuration** - -1. Under **General configuration**, choose **Edit**\. - -1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\. - -1. Choose **Save**\. - -## Accepting function memory recommendations \(console\) - -If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. - -When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\. - -**To accept a function memory recommendation** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **General configuration** - -1. Under **General configuration**, choose **Edit**\. - -1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\. - -1. Choose **Save**\. \ No newline at end of file diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index 6ba8a250..d0890f5a 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -16,7 +16,7 @@ A function version includes the following information: ## Creating function versions -You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring functions in the console](configuration-console.md)\. +You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring Lambda function options](configuration-function-common.md)\. You can create a function version using the Lambda console\. diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 10818ea5..7ec210e0 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -168,7 +168,7 @@ Note that there are some restrictions on the handler signature\. ## Using async in C\# functions with AWS Lambda -If you know your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to [time out](configuration-console.md)\. +If you know your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to time out\. ``` public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) diff --git a/doc_source/foundation-console.md b/doc_source/foundation-console.md new file mode 100644 index 00000000..b930fbfc --- /dev/null +++ b/doc_source/foundation-console.md @@ -0,0 +1,187 @@ +# Using the Lambda console + +You can use the Lambda console to configure applications, functions, code signing configurations, and layers\. + +**Topics** ++ [Applications](#foundation-applications) ++ [Functions](#foundation-functions) ++ [Code signing](#foundation-code-signing) ++ [Layers](#foundation-layers) ++ [Edit code using the console editor](#code-editor) + +## Applications + +The [Applications](deploying-lambda-apps.md) page shows you a list of applications that have been deployed using AWS CloudFormation, or other tools including the AWS Serverless Application Model\. Filter to find applications based on keywords\. + +## Functions + +The functions page shows you a list of functions defined for your account in this region\. The initial console flow to create a function depends on whether the function uses a [container image](configuration-images.md) or [\.zip file archive](configuration-function-zip.md) for the deployment package\. Many of the optional [configuration tasks](configuration-function-common.md) are common to both types of function\. + +The console provides a [code editor](#code-editor) for your convenience\. + +## Code signing + +You can attach a [code signing](configuration-codesigning.md) configuration to a function\. With code signing, you can ensure that the code has been signed by an approved source and has not been altered since signing, and that the code signature has not expired or been revoked\. + +## Layers + +Create [layers](configuration-layers.md) to separate your \.zip archive function code from its dependencies\. A layer is a ZIP archive that contains libraries, a custom runtime, or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. + +## Edit code using the console editor + +You can use the code editor in the AWS Lambda console to write, test, and view the execution results of your Lambda function code\. The code editor supports languages that do not require compiling, such as Node\.js and Python\. The code editor suppports only \.zip archive deployment packages, and the size of the deployment package must be less than 3 MB\. + +The code editor includes the *menu bar*, *windows*, and the *editor pane*\. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) + +For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. + +**Topics** ++ [Working with files and folders](#code-editor-files) ++ [Working with code](#code-editor-code) ++ [Working in fullscreen mode](#code-editor-fullscreen) ++ [Working with preferences](#code-editor-prefs) + +### Working with files and folders + +You can use the **Environment** window in the code editor to create, open, and manage files for your function\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env.png) + +**To show or hide the Environment window**, choose the **Environment** button\. If the **Environment** button is not visible, choose **Window, Environment** on the menu bar\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-button.png) + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) + + + +**To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. + +**To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. + +**To create a new file**, do one of the following: ++ In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. ++ Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. ++ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) + + + +**To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. + +**To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. + +**To rename a file or folder**, right\-click the file or folder in the **Environment** window\. Type the replacement name, and then press Enter \. + +**To delete files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Delete**\. Then confirm the deletion by choosing **Yes** \(for a single selection\) or **Yes to All**\. + +**To cut, copy, paste, or duplicate files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Cut**, **Copy**, **Paste**, or **Duplicate**, respectively\. + +**To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) + +**To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. + +### Working with code + +Use the editor pane in the code editor to view and write code\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) + + + +#### Working with tab buttons + +Use the *tab buttons bar* to select, view, and create files\. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) + + + +**To display an open file's contents**, do one of the following: ++ Choose the file's tab\. ++ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) + + + +**To close an open file**, do one of the following: ++ Choose the **X** icon in the file's tab\. ++ Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. + +**To close multiple open files**, choose the drop\-down menu in the tab buttons bar, and then choose **Close All Tabs in All Panes** or **Close All But Current Tab** as needed\. + +**To create a new file**, choose the **\+** button in the tab buttons bar, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. + +#### Working with the status bar + +Use the status bar to move quickly to a line in the active file and to change how code is displayed\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) + + + +**To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) + + + +**To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) + +**To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-spaces-tabs.png) + +**To change for all files whether to show or hide invisible characters or the gutter, auto\-pair brackets or quotes, wrap lines, or the font size**, choose the gear icon, and then choose the new settings\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) + + + +### Working in fullscreen mode + +You can expand the code editor to get more room to work with your code\. + +To expand the code editor to the edges of the web browser window, choose the **Toggle fullscreen** button in the menu bar\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) + + + +To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. + +In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. + +### Working with preferences + +You can change various code editor settings such as which coding hints and warnings are displayed, code folding behaviors, code autocompletion behaviors, and much more\. + +To change code editor settings, choose the **Preferences** gear icon in the menu bar\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-preferences.png) + +For a list of what the settings do, see the following references in the *AWS Cloud9 User Guide*\. ++ [Project setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-project.html#settings-project-change) ++ [User setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-user.html#settings-user-change) + +Note that some of the settings listed in those references are not available in the code editor\. \ No newline at end of file diff --git a/doc_source/code-editor.md b/doc_source/functions-code-editor.md similarity index 91% rename from doc_source/code-editor.md rename to doc_source/functions-code-editor.md index 2472dcff..8c68efd3 100644 --- a/doc_source/code-editor.md +++ b/doc_source/functions-code-editor.md @@ -1,4 +1,4 @@ -# Creating functions using the AWS Lambda console editor +# Creating functions using the AWS Lambda console editor The Lambda console provides a code editor for languages that do not require compiling, such as Node\.js or Python\. The code editor in the AWS Lambda console enables you to write, test, and view the execution results of your Lambda function code\. @@ -11,12 +11,12 @@ The code editor includes the *menu bar*, *windows*, and the *editor pane*\. For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. **Topics** -+ [Working with files and folders](#code-editor-files) -+ [Working with code](#code-editor-code) -+ [Working in fullscreen mode](#code-editor-fullscreen) -+ [Working with preferences](#code-editor-prefs) ++ [Working with files and folders](#functions-code-editor-files) ++ [Working with code](#functions-code-editor-code) ++ [Working in fullscreen mode](#functions-code-editor-fullscreen) ++ [Working with preferences](#functions-code-editor-prefs) -## Working with files and folders +## Working with files and folders You can use the **Environment** window in the code editor to create, open, and manage files for your function\. @@ -62,7 +62,7 @@ You can use the **Environment** window in the code editor to create, open, and m **To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. -## Working with code +## Working with code Use the editor pane in the code editor to view and write code\. @@ -70,7 +70,7 @@ Use the editor pane in the code editor to view and write code\. -### Working with tab buttons +### Working with tab buttons Use the *tab buttons bar* to select, view, and create files\. @@ -97,7 +97,7 @@ Use the *tab buttons bar* to select, view, and create files\. **To create a new file**, choose the **\+** button in the tab buttons bar, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -### Working with the status bar +### Working with the status bar Use the status bar to move quickly to a line in the active file and to change how code is displayed\. @@ -129,7 +129,7 @@ Use the status bar to move quickly to a line in the active file and to change ho -## Working in fullscreen mode +## Working in fullscreen mode You can expand the code editor to get more room to work with your code\. @@ -143,7 +143,7 @@ To shrink the code editor to its original size, choose the **Toggle fullscreen** In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. -## Working with preferences +## Working with preferences You can change various code editor settings such as which coding hints and warnings are displayed, code folding behaviors, code autocompletion behaviors, and much more\. diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 3747cb2e..59006aec 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -2,7 +2,7 @@ In the following getting started exercises, you create Lambda functions using the console\. -In the first exercise, you create a function and use the default code that Lambda creates\. The Lambda console provides a [code editor](code-editor.md) for non\-compiled languages that lets you modify and test code quickly\. +In the first exercise, you create a function and use the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. In the next exercise, you create a function defined as a container image\. First, create a container image for your function code, and then use the Lambda console to create a function from the container image\. diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md index 7e77bf67..ab68ad07 100644 --- a/doc_source/getting-started.md +++ b/doc_source/getting-started.md @@ -6,7 +6,7 @@ To get started with Lambda, use the Lambda console to create a function\. In a f To use Lambda and other AWS services, you need an AWS account\. If you don't have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) As a best practice, create an AWS Identity and Access Management \(IAM\) user with administrator permissions, and then use that IAM user for all work that does not require root credentials\. Create a password for console access, and create access keys to use command line tools\. For instructions, see [Creating your first IAM admin user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html) in the *IAM User Guide*\. -You can author functions in the Lambda console, or with an IDE toolkit, command line tools, or the AWS SDKs\. The Lambda console provides a [code editor](code-editor.md) for non\-compiled languages that lets you modify and test code quickly\. The [AWS Command Line Interface \(AWS CLI\)](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. +You can author functions in the Lambda console, or with an IDE toolkit, command line tools, or the AWS SDKs\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. The [AWS Command Line Interface \(AWS CLI\)](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. You deploy your function code to Lambda using a deployment package\. Lambda supports two types of deployment packages: + A \.zip file archive that contains your function code and its dependencies\. For an example tutorial, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. @@ -14,7 +14,7 @@ You deploy your function code to Lambda using a deployment package\. Lambda supp **Topics** + [Create a Lambda function with the console](getting-started-create-function.md) -+ [Creating functions using the AWS Lambda console editor](code-editor.md) ++ [Creating functions using the AWS Lambda console editor](functions-code-editor.md) + [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 4fd1e465..a30ebad6 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -17,8 +17,8 @@ The following quotas apply to function configuration, deployments, and execution | Resource | Quota | | --- | --- | -| Function [memory allocation](configuration-console.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | -| Function [timeout](configuration-console.md) | 900 seconds \(15 minutes\) | +| Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | +| Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | five layers | diff --git a/doc_source/index.md b/doc_source/index.md index b4ce81fa..c193c4d8 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -18,7 +18,7 @@ Amazon's trademarks and trade dress may not be used in + [Setting up with Lambda](lambda-settingup.md) + [Getting started with Lambda](getting-started.md) + [Create a Lambda function with the console](getting-started-create-function.md) - + [Creating functions using the AWS Lambda console editor](code-editor.md) + + [Creating functions using the AWS Lambda console editor](functions-code-editor.md) + [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) @@ -31,21 +31,23 @@ Amazon's trademarks and trade dress may not be used in + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Managing AWS Lambda functions](lambda-functions.md) - + [Configuring functions in the console](configuration-console.md) - + [Configuring functions defined as container images](configuration-images.md) + + [Using the Lambda console](foundation-console.md) + + [Creating Lambda functions defined as .zip file archives](configuration-function-zip.md) + + [Creating and sharing Lambda layers](configuration-layers.md) + + [Creating Lambda functions defined as container images](configuration-images.md) + + [Configuring Lambda function options](configuration-function-common.md) + [Using AWS Lambda environment variables](configuration-envvars.md) - + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) + [Lambda function aliases](configuration-aliases.md) - + [Creating and sharing Lambda layers](configuration-layers.md) - + [Using layers with your Lambda function](invocation-layers.md) - + [Configuring Lambda function memory](configuration-memory.md) ++ [Managing AWS Lambda functions](lambda-managing.md) + + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) + [Configuring database access for a Lambda function](configuration-database.md) + [Configuring file system access for Lambda functions](configuration-filesystem.md) + [Configuring code signing for AWS Lambda](configuration-codesigning.md) + [Tagging Lambda Functions](configuration-tags.md) + + [Using layers with your Lambda function](invocation-layers.md) + [Invoking AWS Lambda functions](lambda-invocation.md) + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) @@ -213,6 +215,7 @@ Amazon's trademarks and trade dress may not be used in + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + + [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) + [Example workflows using other AWS services](monitoring-servicemap.md) + [Security in AWS Lambda](lambda-security.md) + [Data protection in AWS Lambda](security-dataprotection.md) diff --git a/doc_source/java-context.md b/doc_source/java-context.md index c249fff6..54e09cc3 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -101,8 +101,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 2ee6c9c0..16cb08af 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -211,8 +211,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 81125f55..0b66d6a4 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -172,8 +172,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index b88eb616..28e895dc 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -328,8 +328,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 5b41ed3a..5a441306 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -331,6 +331,6 @@ For a complete working example, see the following sample applications: **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](#java-package) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](#java-package) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 31985ad9..cf1a95f8 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -5,8 +5,8 @@ The GitHub repository for this guide provides sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. Use the `blank-java` sample app to learn the basics, or as a starting point for your own application\. It shows the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. It uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times when you are iterating on your function code\. The project requires minimal setup and can be deployed from the command line in less than a minute\. diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 410d2902..ccc18e0e 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -151,8 +151,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have active tracing enabled for Lambda functions\. The `blank-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index b474f5e5..60e6c31b 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -1,13 +1,9 @@ # Managing AWS Lambda functions -You can use the AWS Lambda API or console to create functions and configure function settings\. [Basic function settings](configuration-console.md) include the description and the execution role that you specify when you create a function in the Lambda console\. You can configure more settings after you create a function, or use the API to modify configuration settings such as the handler name, memory allocation, and security groups during creation\. +You can use the AWS Lambda API or console to create functions and configure function settings\. [Basic function settings](configuration-function-common.md) include the description and the execution role that you specify when you create a function in the Lambda console\. You can configure more settings after you create a function, or use the API to modify configuration settings such as the handler name, memory allocation, and security groups during creation\. To keep secrets out of your function code, store them in the function's configuration and read them from the execution environment during initialization\. [Environment variables](configuration-envvars.md) are always encrypted at rest, and can be encrypted client\-side as well\. Use environment variables to make your function code portable by removing connection strings, passwords, and endpoints for external resources\. [Versions and aliases](configuration-versions.md) are secondary resources that you can create to manage function deployment and invocation\. Publish [versions](configuration-versions.md) of your function to store its code and configuration as a separate resource that cannot be changed, and create an [alias](configuration-aliases.md) that points to a specific version\. Then you can configure your clients to invoke a function alias, and update the alias when you want to point the client to a new version, instead of updating the client\. -As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development\. Use [layers](configuration-layers.md) to manage your function's dependencies independently and keep your deployment package small\. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions\. - -To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. - -To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file +As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development\. Use [layers](configuration-layers.md) to manage your function's dependencies independently and keep your deployment package small\. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions\. \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index b843a7f6..db10e560 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -48,7 +48,7 @@ You can add permissions to the role later, or swap it out for a different role t 1. For **Event name**, enter **test**\. -1. Choose **Create**\. +1. Choose **Save changes**\. 1. To invoke the function, choose **Test**\. diff --git a/doc_source/lambda-managing.md b/doc_source/lambda-managing.md new file mode 100644 index 00000000..2f751d0e --- /dev/null +++ b/doc_source/lambda-managing.md @@ -0,0 +1,13 @@ +# Managing AWS Lambda functions + +Concurrency is the number of instances of your function that are active\. Scaling is how quickly Lambda increases the the number of instances\. + +Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [AWS Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. + + + +As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development\. Use [layers](configuration-layers.md) to manage your function's dependencies independently and keep your deployment package small\. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions\. + +To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. + +To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index caa57e8d..e2f9ba06 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -11,4 +11,5 @@ For more information about monitoring Lambda applications, see [Monitoring and o + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) ++ [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) + [Example workflows using other AWS services](monitoring-servicemap.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 6cb32e93..0dfaa908 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -51,18 +51,18 @@ You can add permissions to the role later, or swap it out for a different role t 1. For **Event name**, enter **test**\. -1. Choose **Create**\. +1. Choose **Save changes**\. 1. To invoke the function, choose **Test**\. -The console creates a Lambda function with a single source file named `index.js`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. +The console creates a Lambda function with a single source file named `index.js`\. You can edit this file and add more files in the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `index.js` file exports a function named `handler` that takes an event object and a context object\. This is the [handler function](nodejs-handler.md) that Lambda calls when the function is invoked\. The Node\.js function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `index.handler`\. -Each time you save your function code, the Lambda console creates a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](nodejs-package.md) and updating your code at the command line\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 6b083454..469cdeda 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -35,18 +35,18 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in 1. For **Event name**, enter **test**\. -1. Choose **Create**\. +1. Choose **Save changes**\. 1. To invoke the function, choose **Test**\. -The console creates a Lambda function with a single source file named `lambda_function`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. +The console creates a Lambda function with a single source file named `lambda_function`\. You can edit this file and add more files in the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `lambda_function` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](python-handler.md) that Lambda calls when the function is invoked\. The Python function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. -Each time you save your function code, the Lambda console creates a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](python-package.md) and updating your code at the command line\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](python-package.md) to upload your code to the Lambda function\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index d8ea2dd7..c2068ea7 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -72,7 +72,7 @@ The following table describes the important changes in each release of the *AWS | Runtime support for Node\.js runtime 8\.10 | AWS Lambda now supports Node\.js runtime version 8\.10\. For more information, see [Building Lambda functions with Node\.js](lambda-nodejs.md)\. | April 2, 2018 | | Function and alias revision IDs | AWS Lambda now supports revision IDs on your function versions and aliases\. You can use these IDs to track and apply conditional updates when you are updating your function version or alias resources\. | January 25, 2018 | | Runtime support for Go and \.NET 2\.0 | AWS Lambda has added runtime support for Go and \.NET 2\.0\. For more information, see [Building Lambda functions with Go](lambda-golang.md) and [Building Lambda functions with C\#](lambda-csharp.md)\. | January 15, 2018 | -| Console Redesign | AWS Lambda has introduced a new Lambda console to simplify your experience and added a Cloud9 Code Editor to enhance your ability debug and revise your function code\. For more information, see [Creating functions using the AWS Lambda console editor](code-editor.md)\. | November 30,2017 | +| Console Redesign | AWS Lambda has introduced a new Lambda console to simplify your experience and added a Cloud9 Code Editor to enhance your ability debug and revise your function code\. For more information, see [Edit code using the console editor](foundation-console.md#code-editor)\. | November 30,2017 | | Setting Concurrency Limits on Individual Functions | AWS Lambda now supports setting concurrency limits on individual functions\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. | November 30,2017 | | Shifting Traffic with Aliases | AWS Lambda now supports shifting traffic with aliases\. For more information, see [Rolling deployments for Lambda functions ](lambda-rolling-deployments.md)\. | November 28, 2017 | | Gradual Code Deployment | AWS Lambda now supports safely deploying new versions of your Lambda function by leveraging Code Deploy\. For more information, see [ Gradual code deployment](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/automating-updates-to-serverless-apps.html)\. | November 28, 2017 | diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index 6e6a6a6a..b9d679da 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -50,18 +50,18 @@ You can add permissions to the role later, or swap it out for a different role t 1. For **Event name**, enter **test**\. -1. Choose **Create**\. +1. Choose **Save changes**\. 1. To invoke the function, choose **Test**\. -The console creates a Lambda function with a single source file named `lambda_function.rb`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. +The console creates a Lambda function with a single source file named `lambda_function.rb`\. You can edit this file and add more files in the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `lambda_function.rb` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](ruby-handler.md) that Lambda calls when the function is invoked\. The Ruby function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. -Each time you save your function code, the Lambda console creates a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](ruby-package.md) and updating your code at the command line\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](ruby-package.md) to upload your code to the Lambda function\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 73b9c8fb..c526ef94 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -2,7 +2,7 @@ Lambda supports multiple languages through the use of [runtimes](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. For a [function defined as a container image](configuration-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. -When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-console.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. +When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-function-zip.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. **Amazon Linux** + Image – [amzn\-ami\-hvm\-2018\.03\.0\.20181129\-x86\_64\-gp2](https://console.aws.amazon.com/ec2/v2/home#Images:visibility=public-images;search=amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2) diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index ccd61487..8ced5952 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -32,8 +32,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ------ diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md new file mode 100644 index 00000000..fe2f6951 --- /dev/null +++ b/doc_source/monitoring-code-profiler.md @@ -0,0 +1,50 @@ +# Using CodeGuru Profiler with your Lambda function + +You can use Amazon CodeGuru Profiler to gain insights into runtime performance of your Lambda functions\. This page describes how to activate CodeGuru Profiler from the Lambda console\. + +**Topics** ++ [Supported runtimes](#monitoring-code-profiler-runtimes) ++ [Activating CodeGuru Profiler from the Lambda console](#monitoring-code-profiler-activate-console) ++ [What happens when you activate CodeGuru Profiler from the Lambda console?](#monitoring-code-profiler-what-happens-activate) ++ [What's next?](#monitoring-code-profiler-next-up) + +## Supported runtimes + +You can activate CodeGuru Profiler from the Lambda console if your function's runtime is Python 3\.8, Java 8 with Amazon Linux 2, or Java 11\. For additional runtime versions, you can activate CodeGuru Profiler manually\. ++ For Java runtimes, see [ Profiling your Java applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)\. ++ For Python runtimes, see [ Profiling your Python applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda.html)\. + +## Activating CodeGuru Profiler from the Lambda console + +This section describes how to activate CodeGuru Profiler from the Lambda console\. + +**To activate CodeGuru Profiler from the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose your function\. + +1. Choose the **Configuration** tab\. + +1. On the **Monitoring and operations tools** pane, choose **Edit**\. + +1. Under **Amazon CodeGuru Profiler**, turn on **Code profiling**\. + +1. Choose **Save**\. + +After activation, CodeGuru automatically creates a profiler group with the name `aws-lambda-`\. You can change the name from the CodeGuru console\. + +## What happens when you activate CodeGuru Profiler from the Lambda console? + +When you activate CodeGuru Profiler from the console, Lambda automatically does the following on your behalf: ++ Lambda adds a CodeGuru Profiler layer to your function\. For more details, see [ Use AWS Lambda layers](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda-layers.html) in the *Amazon CodeGuru Profiler User Guide*\. ++ Lambda also adds environment variables to your function\. The exact value varies based on the runtime\. +**Environment variables** +[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/monitoring-code-profiler.html) ++ Lambda adds the `AmazonCodeGuruProfilerAgentAccess` policy to your function's execution role\. + +**Note** +When you deactivate CodeGuru Profiler from the console, Lambda automatically removes the CodeGuru Profiler layer and environment variables from your function\. However, Lambda does not remove the `AmazonCodeGuruProfilerAgentAccess` policy from your execution role\. + +## What's next? ++ Learn more about the data collected by your profiler group in [Working with visualizations](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/working-with-visualizations.html) in the *Amazon CodeGuru Profiler User Guide*\. \ No newline at end of file diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index a685336f..5ed52df0 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -1,6 +1,6 @@ # Working with AWS Lambda function metrics -When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. +When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. Lambda sends metric data to CloudWatch in 1\-minute intervals\. This page describes the Lambda function invocation, performance, and concurrency metrics available on the CloudWatch console\. diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index 2ff4c530..76841bdf 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -13,7 +13,7 @@ exports.handler = async function(event, context) { } ``` -When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the exported handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. +When you configure a function, the value of the handler setting is the file name and the name of the exported handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. The runtime passes three arguments to the handler method\. The first argument is the `event` object, which contains information from the invoker\. The invoker passes this information as a JSON\-formatted string when it calls [Invoke](API_Invoke.md), and the runtime converts it to an object\. When an AWS service invokes your function, the event structure [varies by service](lambda-services.md)\. diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index 4ed7911d..baa12817 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -77,7 +77,8 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t 1. Install libraries in the vendor directory using the `bundle` command\. ``` - bundle install --path vendor/bundle + bundle config set --local path 'vendor/bundle' \ + bundle install ``` You should see the following output: @@ -90,7 +91,7 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t ... ``` - The `--path` installs the gems in the project directory instead of the system location, and sets this as the default path for future installations\. To later install gems globally, use the `--system` option\. + This installs the gems in the project directory instead of the system location, and sets `vendor/bundle` as the default path for future installations\. To later install gems globally, use `bundle config set --local system 'true'`\. 1. Create a \.zip file archive\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 8792ad16..e98d8c92 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -102,7 +102,7 @@ Here is an example payload: } ``` -**Duration limit**: The function's [timeout setting](configuration-console.md) limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished running\. +**Duration limit**: The function's timeout setting limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished running\. **Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index 83024158..024979c1 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -208,7 +208,7 @@ In the following example, you create a wrapper script to start the Python interp 1. Add the code and the environment variable to your function\. - 1. In the function [code editor](code-editor.md), paste the following function code: + 1. In the function [code editor](foundation-console.md#code-editor), paste the following function code: ``` import json diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 07078be7..02d46203 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -10,7 +10,7 @@ When your function code or the Lambda runtime return an error, the status code i **Issue:** *Function execution takes too long\.* -If your code takes much longer to run in Lambda than on your local machine, it may be constrained by the memory or processing power available to the function\. [Configure the function with additional memory](configuration-console.md) to increase both memory and CPU\. +If your code takes much longer to run in Lambda than on your local machine, it may be constrained by the memory or processing power available to the function\. [Configure the function with additional memory](configuration-function-common.md) to increase both memory and CPU\. ## Lambda: Logs or traces don't appear diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index f526d9bd..e0776c69 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -52,7 +52,7 @@ You grant [other services](lambda-services.md) and accounts permission to invoke **Issue:** *Function is invoked continuously in a loop\.* -This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-console.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. +This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-function-common.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. ## Lambda: Alias routing with provisioned concurrency @@ -113,4 +113,4 @@ The function could connect to the function's [file system](configuration-filesys *EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* -A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. +A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 20e1a540..a436a30a 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -92,7 +92,7 @@ If you are a first\-time user of Lambda, we recommend that you start with the fo ## Accessing Lambda You can create, invoke, and manage your Lambda functions using any of the following interfaces: -+ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Configuring functions in the console](configuration-console.md)\. ++ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Using the Lambda console](foundation-console.md)\. + **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. + **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. + **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(CDK\)](http://aws.amazon.com/cdk)\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 8bf175d7..d1eba474 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -101,7 +101,7 @@ Your function can scale in concurrency to the number of active message groups\. [Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. -To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [timeout](configuration-console.md) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. +To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [timeout](configuration-function-common.md) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. If a message fails to be processed multiple times, Amazon SQS can send it to a [dead\-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\. When your function returns an error, Lambda leaves it in the queue\. After the visibility timeout occurs, Lambda receives the message again\. To send messages to a second queue after a number of receives, configure a dead\-letter queue on your source queue\. From 498f007bbb8d6552d4c9f7a9ca52d42e3f34ca10 Mon Sep 17 00:00:00 2001 From: blange Date: Mon, 2 Aug 2021 00:07:37 -0700 Subject: [PATCH 62/94] Update lambda-runtimes.md This sentence is problematic "This saves time preparing the execution environment, and it allows you to save resources such as database connections and temporary files in the execution environment to avoid creating them every time your function runs." The "This" is referring to an "attempt" to re-use an environment, which is different than an environment actually being reused. The "attempt" doesn't in itself save time. The phrase "and it allows you to save resources such as database connections " is implying that the user can take certain actions because of the attempt that is made by Lambda to re-use an environment when in reality the users actions are the same regardless of whether the execution environment is reused or not. The sentence should be more clear than Lambda is doing the work. The phrase "creating them every time your function runs." is awkward because when an execution environment is reused the resources do not have to be recreated for that particular invocation of the function, but it should not be said that the savings applies to "every time your functions runs" Thank you for taking the time to review my proposed changes. --- doc_source/lambda-runtimes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index c526ef94..68f22226 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -12,7 +12,7 @@ When you use a \.zip file archive for the deployment package, you choose a runti + Image – Custom + Linux kernel – 4\.14\.165\-102\.205\.amzn2\.x86\_64 -When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. This saves time preparing the execution environment, and it allows you to save resources such as database connections and temporary files in the [execution environment](runtimes-context.md) to avoid creating them every time your function runs\. +When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. When an [execution environment](runtimes-context.md) is reused, time is saved because your resources, such as database connections and temporary files, do not have to be recreated before your function runs\. A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](runtime-support-policy.md) when the version reaches end of life\. @@ -99,4 +99,4 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- + [Modifying the runtime environment](runtimes-modify.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) -+ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file ++ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) From 7ddec7c919541a525427ada2a288330cd684bd02 Mon Sep 17 00:00:00 2001 From: Praveen Sripati Date: Sat, 7 Aug 2021 11:11:43 +0530 Subject: [PATCH 63/94] Broken link for the `Interface endpoint properties and limitations` Updated with the proper link for the `Interface endpoint properties and limitations` --- doc_source/configuration-vpc-endpoints.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 1ca577fe..143492e9 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -13,7 +13,7 @@ Each interface endpoint is represented by one or more [elastic network interface ## Considerations for Lambda interface endpoints -Before you set up an interface endpoint for Lambda, be sure to review [Interface endpoint properties and limitations](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#vpce-interface-limitations) in the *Amazon VPC User Guide*\. +Before you set up an interface endpoint for Lambda, be sure to review [Interface endpoint properties and limitations](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#vpce-interface-limitations) in the *Amazon VPC User Guide*\. You can call any of the Lambda API operations from your VPC\. For example, you can invoke the Lambda function by calling the `Invoke` API from within your VPC\. For the full list of Lambda APIs, see [Actions](https://docs.aws.amazon.com/lambda/latest/dg/API_Operations.html) in the Lambda API reference\. @@ -99,4 +99,4 @@ The following is an example of an endpoint policy for Lambda\. When attached to } ] } -``` \ No newline at end of file +``` From 9d6f318ab006f7e2cdc37d559a8a1981e9d48321 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 9 Aug 2021 13:15:55 -0700 Subject: [PATCH 64/94] created new Lambda foundations chapter. Some additional updates --- doc_source/API_AccountLimit.md | 8 +- doc_source/API_AccountUsage.md | 8 +- doc_source/API_AddLayerVersionPermission.md | 18 +- doc_source/API_AddPermission.md | 18 +- doc_source/API_AliasConfiguration.md | 8 +- doc_source/API_AliasRoutingConfiguration.md | 8 +- doc_source/API_AllowedPublishers.md | 8 +- doc_source/API_CodeSigningConfig.md | 8 +- doc_source/API_CodeSigningPolicies.md | 8 +- doc_source/API_Concurrency.md | 8 +- doc_source/API_CreateAlias.md | 18 +- doc_source/API_CreateCodeSigningConfig.md | 18 +- doc_source/API_CreateEventSourceMapping.md | 18 +- doc_source/API_CreateFunction.md | 18 +- doc_source/API_DeadLetterConfig.md | 8 +- doc_source/API_DeleteAlias.md | 18 +- doc_source/API_DeleteCodeSigningConfig.md | 18 +- doc_source/API_DeleteEventSourceMapping.md | 18 +- doc_source/API_DeleteFunction.md | 18 +- .../API_DeleteFunctionCodeSigningConfig.md | 18 +- doc_source/API_DeleteFunctionConcurrency.md | 18 +- .../API_DeleteFunctionEventInvokeConfig.md | 18 +- doc_source/API_DeleteLayerVersion.md | 18 +- .../API_DeleteProvisionedConcurrencyConfig.md | 18 +- doc_source/API_DestinationConfig.md | 8 +- doc_source/API_Environment.md | 8 +- doc_source/API_EnvironmentError.md | 8 +- doc_source/API_EnvironmentResponse.md | 8 +- .../API_EventSourceMappingConfiguration.md | 8 +- doc_source/API_FileSystemConfig.md | 8 +- doc_source/API_FunctionCode.md | 8 +- doc_source/API_FunctionCodeLocation.md | 8 +- doc_source/API_FunctionConfiguration.md | 8 +- doc_source/API_FunctionEventInvokeConfig.md | 8 +- doc_source/API_GetAccountSettings.md | 18 +- doc_source/API_GetAlias.md | 18 +- doc_source/API_GetCodeSigningConfig.md | 18 +- doc_source/API_GetEventSourceMapping.md | 18 +- doc_source/API_GetFunction.md | 18 +- .../API_GetFunctionCodeSigningConfig.md | 18 +- doc_source/API_GetFunctionConcurrency.md | 18 +- doc_source/API_GetFunctionConfiguration.md | 18 +- .../API_GetFunctionEventInvokeConfig.md | 18 +- doc_source/API_GetLayerVersion.md | 18 +- doc_source/API_GetLayerVersionByArn.md | 18 +- doc_source/API_GetLayerVersionPolicy.md | 18 +- doc_source/API_GetPolicy.md | 18 +- .../API_GetProvisionedConcurrencyConfig.md | 18 +- doc_source/API_ImageConfig.md | 8 +- doc_source/API_ImageConfigError.md | 8 +- doc_source/API_ImageConfigResponse.md | 8 +- doc_source/API_Invoke.md | 18 +- doc_source/API_InvokeAsync.md | 18 +- doc_source/API_Layer.md | 8 +- doc_source/API_LayerVersionContentInput.md | 8 +- doc_source/API_LayerVersionContentOutput.md | 8 +- doc_source/API_LayerVersionsListItem.md | 8 +- doc_source/API_LayersListItem.md | 8 +- doc_source/API_ListAliases.md | 18 +- doc_source/API_ListCodeSigningConfigs.md | 18 +- doc_source/API_ListEventSourceMappings.md | 18 +- .../API_ListFunctionEventInvokeConfigs.md | 18 +- doc_source/API_ListFunctions.md | 18 +- .../API_ListFunctionsByCodeSigningConfig.md | 18 +- doc_source/API_ListLayerVersions.md | 18 +- doc_source/API_ListLayers.md | 18 +- .../API_ListProvisionedConcurrencyConfigs.md | 18 +- doc_source/API_ListTags.md | 18 +- doc_source/API_ListVersionsByFunction.md | 18 +- doc_source/API_OnFailure.md | 8 +- doc_source/API_OnSuccess.md | 8 +- ...PI_ProvisionedConcurrencyConfigListItem.md | 8 +- doc_source/API_PublishLayerVersion.md | 18 +- doc_source/API_PublishVersion.md | 18 +- .../API_PutFunctionCodeSigningConfig.md | 18 +- doc_source/API_PutFunctionConcurrency.md | 18 +- .../API_PutFunctionEventInvokeConfig.md | 18 +- .../API_PutProvisionedConcurrencyConfig.md | 18 +- .../API_RemoveLayerVersionPermission.md | 18 +- doc_source/API_RemovePermission.md | 18 +- doc_source/API_SelfManagedEventSource.md | 8 +- doc_source/API_SourceAccessConfiguration.md | 8 +- doc_source/API_TagResource.md | 18 +- doc_source/API_TracingConfig.md | 8 +- doc_source/API_TracingConfigResponse.md | 8 +- doc_source/API_UntagResource.md | 18 +- doc_source/API_UpdateAlias.md | 18 +- doc_source/API_UpdateCodeSigningConfig.md | 18 +- doc_source/API_UpdateEventSourceMapping.md | 18 +- doc_source/API_UpdateFunctionCode.md | 18 +- doc_source/API_UpdateFunctionConfiguration.md | 18 +- .../API_UpdateFunctionEventInvokeConfig.md | 18 +- doc_source/API_VpcConfig.md | 8 +- doc_source/API_VpcConfigResponse.md | 8 +- doc_source/applications-tutorial.md | 8 +- doc_source/applications-usecases.md | 6 +- doc_source/configuration-concurrency.md | 2 +- doc_source/configuration-envvars.md | 4 +- doc_source/configuration-vpc-endpoints.md | 10 +- doc_source/csharp-tracing.md | 2 +- doc_source/foundation-console.md | 2 +- doc_source/foundation-progmodel.md | 27 ++ doc_source/functions-code-editor.md | 158 ----------- doc_source/getting-started-create-function.md | 264 +----------------- doc_source/getting-started.md | 11 +- doc_source/gettingstarted-awscli.md | 52 ++-- doc_source/gettingstarted-concepts.md | 6 +- doc_source/gettingstarted-features.md | 31 +- doc_source/gettingstarted-images.md | 227 +++++++++++++++ doc_source/gettingstarted-limits.md | 4 +- doc_source/golang-package.md | 2 +- doc_source/golang-tracing.md | 2 +- doc_source/images-create.md | 50 +++- doc_source/index.md | 12 +- doc_source/invocation-async.md | 23 +- doc_source/invocation-scaling.md | 4 +- doc_source/java-handler.md | 4 +- doc_source/java-tracing.md | 2 +- doc_source/lambda-foundation.md | 13 + doc_source/lambda-functions.md | 6 +- doc_source/lambda-golang.md | 2 +- doc_source/lambda-intro-execution-role.md | 50 ++-- doc_source/lambda-invocation.md | 3 +- doc_source/lambda-managing.md | 8 +- doc_source/lambda-runtimes.md | 4 +- doc_source/nodejs-tracing.md | 2 +- doc_source/python-image.md | 41 +-- doc_source/python-logging.md | 4 +- doc_source/python-package-create.md | 8 +- doc_source/python-tracing.md | 2 +- doc_source/ruby-image.md | 43 ++- doc_source/ruby-tracing.md | 2 +- doc_source/security-configuration.md | 2 +- doc_source/security-dataprotection.md | 2 +- doc_source/security-resilience.md | 2 +- doc_source/welcome.md | 6 +- doc_source/with-kinesis.md | 4 +- doc_source/with-msk.md | 1 - doc_source/with-s3-tutorial.md | 24 +- 139 files changed, 1188 insertions(+), 1286 deletions(-) create mode 100644 doc_source/foundation-progmodel.md delete mode 100644 doc_source/functions-code-editor.md create mode 100644 doc_source/gettingstarted-images.md create mode 100644 doc_source/lambda-foundation.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md index d365af86..be2309f9 100644 --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -33,7 +33,7 @@ Required: No ## See Also 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/AccountLimit) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountLimit) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md index 6f70e7c4..aab1e7ab 100644 --- a/doc_source/API_AccountUsage.md +++ b/doc_source/API_AccountUsage.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/AccountUsage) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountUsage) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index ed1614f6..2a0fa673 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -125,12 +125,12 @@ HTTP Status Code: 429 ## See Also 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/AddLayerVersionPermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddLayerVersionPermission) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index cd2857b7..a0852996 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -146,12 +146,12 @@ HTTP Status Code: 429 ## See Also 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/AddPermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddPermission) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddPermission) \ No newline at end of file diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md index c2be5893..53569649 100644 --- a/doc_source/API_AliasConfiguration.md +++ b/doc_source/API_AliasConfiguration.md @@ -43,7 +43,7 @@ Required: No ## See Also 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/AliasConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md index 641fc0c9..3bbc94a7 100644 --- a/doc_source/API_AliasRoutingConfiguration.md +++ b/doc_source/API_AliasRoutingConfiguration.md @@ -15,7 +15,7 @@ Required: No ## See Also 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/AliasRoutingConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasRoutingConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md index 808b7807..d4de5f7f 100644 --- a/doc_source/API_AllowedPublishers.md +++ b/doc_source/API_AllowedPublishers.md @@ -14,7 +14,7 @@ Required: Yes ## See Also 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/AllowedPublishers) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AllowedPublishers) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md index adcc72ca..9f2849ef 100644 --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -41,7 +41,7 @@ Required: Yes ## See Also 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/CodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md index d35e8561..589a046c 100644 --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -14,7 +14,7 @@ Required: No ## See Also 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/CodeSigningPolicies) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningPolicies) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md index 2fb185a9..c1339bf1 100644 --- a/doc_source/API_Concurrency.md +++ b/doc_source/API_Concurrency.md @@ -11,7 +11,7 @@ Required: No ## See Also 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/Concurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Concurrency) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md index 33ef85bd..a8976da5 100644 --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -148,12 +148,12 @@ HTTP Status Code: 429 ## See Also 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/CreateAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateAlias) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateAlias) \ No newline at end of file diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md index 01be275e..1e35f971 100644 --- a/doc_source/API_CreateCodeSigningConfig.md +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -88,12 +88,12 @@ HTTP Status Code: 500 ## See Also 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/CreateCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index c10c1f12..697e4ca8 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -379,12 +379,12 @@ HTTP Status Code: 429 ## See Also 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/CreateEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateEventSourceMapping) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 675dda2a..e64d96e1 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -478,12 +478,12 @@ HTTP Status Code: 429 ## See Also 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/CreateFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunction) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunction) \ No newline at end of file diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md index e958b423..8f8df1e7 100644 --- a/doc_source/API_DeadLetterConfig.md +++ b/doc_source/API_DeadLetterConfig.md @@ -13,7 +13,7 @@ Required: No ## See Also 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/DeadLetterConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeadLetterConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md index 3ecd3ad8..95780d00 100644 --- a/doc_source/API_DeleteAlias.md +++ b/doc_source/API_DeleteAlias.md @@ -65,12 +65,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteAlias) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteAlias) \ No newline at end of file diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md index af2018a0..fe427fa2 100644 --- a/doc_source/API_DeleteCodeSigningConfig.md +++ b/doc_source/API_DeleteCodeSigningConfig.md @@ -53,12 +53,12 @@ HTTP Status Code: 500 ## See Also 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/DeleteCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 9a7ed927..c3e55997 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -207,12 +207,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteEventSourceMapping) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md index f2ce995b..be3e5628 100644 --- a/doc_source/API_DeleteFunction.md +++ b/doc_source/API_DeleteFunction.md @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunction) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunction) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md index 3727e079..f6953190 100644 --- a/doc_source/API_DeleteFunctionCodeSigningConfig.md +++ b/doc_source/API_DeleteFunctionCodeSigningConfig.md @@ -67,12 +67,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md index 38f30490..44efacac 100644 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ b/doc_source/API_DeleteFunctionConcurrency.md @@ -63,12 +63,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteFunctionConcurrency) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionConcurrency) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md index 58e0a053..c326c4a8 100644 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md index 44a8a967..9e60611c 100644 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -49,12 +49,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteLayerVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteLayerVersion) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteLayerVersion) \ No newline at end of file diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md index 7781aacb..43d7413c 100644 --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ b/doc_source/API_DeleteProvisionedConcurrencyConfig.md @@ -69,12 +69,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md index 6e7375b2..cbd7d1ce 100644 --- a/doc_source/API_DestinationConfig.md +++ b/doc_source/API_DestinationConfig.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/DestinationConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DestinationConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md index 97ce945c..2e4a1fa9 100644 --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -13,7 +13,7 @@ Required: No ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file ++ [ 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md index 94ce5d75..64090a24 100644 --- a/doc_source/API_EnvironmentError.md +++ b/doc_source/API_EnvironmentError.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/EnvironmentError) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentError) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md index 7bbc27d4..d1aac97f 100644 --- a/doc_source/API_EnvironmentResponse.md +++ b/doc_source/API_EnvironmentResponse.md @@ -18,7 +18,7 @@ Required: No ## See Also 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/EnvironmentResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentResponse) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index b035d9d8..1eb5193e 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -135,7 +135,7 @@ Required: No ## See Also 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/EventSourceMappingConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md index 4e3ecc1f..bbd04dfc 100644 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -21,7 +21,7 @@ Required: Yes ## See Also 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/FileSystemConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FileSystemConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index ea8dcf57..df9dc97b 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -36,7 +36,7 @@ Required: No ## See Also 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/FunctionCode) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCode) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md index 59c99331..05f28abb 100644 --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -27,7 +27,7 @@ Required: No ## See Also 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/FunctionCodeLocation) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCodeLocation) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index c6105cf6..72a0cd26 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -184,7 +184,7 @@ Required: No ## See Also 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/FunctionConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md index e2ca486e..af74b844 100644 --- a/doc_source/API_FunctionEventInvokeConfig.md +++ b/doc_source/API_FunctionEventInvokeConfig.md @@ -39,7 +39,7 @@ Required: No ## See Also 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/FunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md index a2da9476..ecdcac45 100644 --- a/doc_source/API_GetAccountSettings.md +++ b/doc_source/API_GetAccountSettings.md @@ -64,12 +64,12 @@ HTTP Status Code: 429 ## See Also 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/GetAccountSettings) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAccountSettings) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAccountSettings) \ No newline at end of file diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md index b6e3e516..ab1becc5 100644 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -111,12 +111,12 @@ HTTP Status Code: 429 ## See Also 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/GetAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAlias) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAlias) \ No newline at end of file diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md index 459415c7..1bd1717a 100644 --- a/doc_source/API_GetCodeSigningConfig.md +++ b/doc_source/API_GetCodeSigningConfig.md @@ -71,12 +71,12 @@ HTTP Status Code: 500 ## See Also 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/GetCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index b23d8210..111f34e4 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -201,12 +201,12 @@ HTTP Status Code: 429 ## See Also 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/GetEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetEventSourceMapping) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index ee3d29e0..236dc6bc 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -169,12 +169,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunction) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunction) \ No newline at end of file diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md index 3e3c1b64..29a92bef 100644 --- a/doc_source/API_GetFunctionCodeSigningConfig.md +++ b/doc_source/API_GetFunctionCodeSigningConfig.md @@ -85,12 +85,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunctionCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md index 143a3c22..9a367326 100644 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -71,12 +71,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunctionConcurrency) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConcurrency) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 5ed5e329..b44033b1 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -287,12 +287,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunctionConfiguration) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConfiguration) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md index a1ff02fc..56a8d428 100644 --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -113,12 +113,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index 260e345b..d8de27de 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -117,12 +117,12 @@ HTTP Status Code: 429 ## See Also 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/GetLayerVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersion) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersion) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index 90ea2d4d..c9f75752 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -113,12 +113,12 @@ HTTP Status Code: 429 ## See Also 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/GetLayerVersionByArn) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionByArn) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionByArn) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index c81c02ab..caec1a40 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -73,12 +73,12 @@ HTTP Status Code: 429 ## See Also 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/GetLayerVersionPolicy) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionPolicy) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionPolicy) \ No newline at end of file diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md index 7e9d820e..93a818c7 100644 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -80,12 +80,12 @@ HTTP Status Code: 429 ## See Also 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/GetPolicy) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetPolicy) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetPolicy) \ No newline at end of file diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md index 4248db3d..02bd2717 100644 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -109,12 +109,12 @@ HTTP Status Code: 429 ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [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) \ No newline at end of file ++ [ 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ 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) \ No newline at end of file diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md index ac7ed0bb..21848202 100644 --- a/doc_source/API_ImageConfig.md +++ b/doc_source/API_ImageConfig.md @@ -25,7 +25,7 @@ Required: No ## See Also 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/ImageConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md index 2e0f10d5..ea1b2c36 100644 --- a/doc_source/API_ImageConfigError.md +++ b/doc_source/API_ImageConfigError.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/ImageConfigError) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigError) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md index a71f8502..59a14f95 100644 --- a/doc_source/API_ImageConfigResponse.md +++ b/doc_source/API_ImageConfigResponse.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/ImageConfigResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigResponse) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 8ee0f24c..8876a4ea 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -212,12 +212,12 @@ HTTP Status Code: 415 ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) -+ [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) \ No newline at end of file ++ [ 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) ++ [ 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) \ No newline at end of file diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md index 69395006..f47bf60e 100644 --- a/doc_source/API_InvokeAsync.md +++ b/doc_source/API_InvokeAsync.md @@ -77,12 +77,12 @@ HTTP Status Code: 500 ## See Also 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/InvokeAsync) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/InvokeAsync) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/InvokeAsync) \ No newline at end of file diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index 7f3231c3..ee4be690 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -31,7 +31,7 @@ Required: No ## See Also 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/Layer) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Layer) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md index 0e082bcc..b85670b3 100644 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -31,7 +31,7 @@ Required: No ## See Also 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/LayerVersionContentInput) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentInput) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index 9ad0560e..8cb77ffd 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -32,7 +32,7 @@ Required: No ## See Also 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/LayerVersionContentOutput) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentOutput) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 9171a195..729496ba 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -43,7 +43,7 @@ Required: No ## See Also 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/LayerVersionsListItem) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionsListItem) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md index d87156c7..a6e1947c 100644 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -26,7 +26,7 @@ Required: No ## See Also 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/LayersListItem) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayersListItem) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md index 355812a0..1e286834 100644 --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -100,12 +100,12 @@ HTTP Status Code: 429 ## See Also 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/ListAliases) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListAliases) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListAliases) \ No newline at end of file diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md index 2317b88d..9dc64827 100644 --- a/doc_source/API_ListCodeSigningConfigs.md +++ b/doc_source/API_ListCodeSigningConfigs.md @@ -75,12 +75,12 @@ HTTP Status Code: 500 ## See Also 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/ListCodeSigningConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index fc36e832..d48d8aed 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -131,12 +131,12 @@ HTTP Status Code: 429 ## See Also 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/ListEventSourceMappings) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListEventSourceMappings) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListEventSourceMappings) \ No newline at end of file diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md index b689c65c..60f2ced3 100644 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -99,12 +99,12 @@ HTTP Status Code: 429 ## See Also 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/ListFunctionEventInvokeConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) \ No newline at end of file diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index e99ef63e..252c72fb 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -151,12 +151,12 @@ HTTP Status Code: 429 ## See Also 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/ListFunctions) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctions) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctions) \ No newline at end of file diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md index a2cc5696..0440a9ac 100644 --- a/doc_source/API_ListFunctionsByCodeSigningConfig.md +++ b/doc_source/API_ListFunctionsByCodeSigningConfig.md @@ -73,12 +73,12 @@ HTTP Status Code: 500 ## See Also 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/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index db472ea6..b003b710 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -89,12 +89,12 @@ HTTP Status Code: 429 ## See Also 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/ListLayerVersions) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayerVersions) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayerVersions) \ No newline at end of file diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 3f0ec3fe..64d1eb41 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -83,12 +83,12 @@ HTTP Status Code: 429 ## See Also 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/ListLayers) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) \ No newline at end of file diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md index 77a1530d..93df5308 100644 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -92,12 +92,12 @@ HTTP Status Code: 429 ## See Also 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/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) \ No newline at end of file diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md index d2dc7f0b..39ccd31a 100644 --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -65,12 +65,12 @@ HTTP Status Code: 429 ## See Also 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/ListTags) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListTags) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListTags) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListTags) \ No newline at end of file diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index 87a9b031..aff8498d 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also 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/ListVersionsByFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListVersionsByFunction) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListVersionsByFunction) \ No newline at end of file diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md index 46402c85..7c74fab6 100644 --- a/doc_source/API_OnFailure.md +++ b/doc_source/API_OnFailure.md @@ -14,7 +14,7 @@ Required: No ## See Also 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/OnFailure) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnFailure) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md index ae14a7ea..f2b35f42 100644 --- a/doc_source/API_OnSuccess.md +++ b/doc_source/API_OnSuccess.md @@ -14,7 +14,7 @@ Required: No ## See Also 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/OnSuccess) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnSuccess) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md index 73d4e84e..4c1a03bb 100644 --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ b/doc_source/API_ProvisionedConcurrencyConfigListItem.md @@ -47,7 +47,7 @@ Required: No ## See Also 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/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 35fb23e5..162ffdf6 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -159,12 +159,12 @@ HTTP Status Code: 429 ## See Also 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/PublishLayerVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishLayerVersion) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishLayerVersion) \ No newline at end of file diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index ef95166a..40de9968 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -319,12 +319,12 @@ HTTP Status Code: 429 ## See Also 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/PublishVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishVersion) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishVersion) \ No newline at end of file diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md index 8263662a..e6364276 100644 --- a/doc_source/API_PutFunctionCodeSigningConfig.md +++ b/doc_source/API_PutFunctionCodeSigningConfig.md @@ -105,12 +105,12 @@ HTTP Status Code: 429 ## See Also 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/PutFunctionCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md index 367942bc..f1448835 100644 --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -90,12 +90,12 @@ HTTP Status Code: 429 ## See Also 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/PutFunctionConcurrency) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionConcurrency) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index 2818b8f5..774ee816 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -156,12 +156,12 @@ HTTP Status Code: 429 ## See Also 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/PutFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md index 5123b441..cb76f8d3 100644 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -120,12 +120,12 @@ HTTP Status Code: 429 ## See Also 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/PutProvisionedConcurrencyConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md index 769a97a1..d0cb44c6 100644 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also 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/RemoveLayerVersionPermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemoveLayerVersionPermission) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemoveLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md index f7533bc9..c85f9254 100644 --- a/doc_source/API_RemovePermission.md +++ b/doc_source/API_RemovePermission.md @@ -77,12 +77,12 @@ HTTP Status Code: 429 ## See Also 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/RemovePermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemovePermission) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemovePermission) \ No newline at end of file diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md index 0c6fbb53..27ce6673 100644 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/SelfManagedEventSource) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedEventSource) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 4cb6fbc6..996c0e54 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -27,7 +27,7 @@ Required: No ## See Also 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/SourceAccessConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SourceAccessConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md index 81d0c506..82a06bef 100644 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -68,12 +68,12 @@ HTTP Status Code: 429 ## See Also 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/TagResource) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TagResource) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/TagResource) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TagResource) \ No newline at end of file diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 48a8dba7..4ff92965 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -13,7 +13,7 @@ Required: No ## See Also 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/TracingConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md index acfdfabb..cb3c0e8c 100644 --- a/doc_source/API_TracingConfigResponse.md +++ b/doc_source/API_TracingConfigResponse.md @@ -13,7 +13,7 @@ Required: No ## See Also 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/TracingConfigResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfigResponse) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md index eb23ed5e..e2d5bacb 100644 --- a/doc_source/API_UntagResource.md +++ b/doc_source/API_UntagResource.md @@ -60,12 +60,12 @@ HTTP Status Code: 429 ## See Also 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/UntagResource) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UntagResource) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UntagResource) \ No newline at end of file diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md index e1d3748f..0a163ec3 100644 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also 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/UpdateAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateAlias) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateAlias) \ No newline at end of file diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md index a12662bc..f6e7e8b9 100644 --- a/doc_source/API_UpdateCodeSigningConfig.md +++ b/doc_source/API_UpdateCodeSigningConfig.md @@ -98,12 +98,12 @@ HTTP Status Code: 500 ## See Also 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/UpdateCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index b834fc9f..8e9025f0 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -327,12 +327,12 @@ HTTP Status Code: 429 ## See Also 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/UpdateEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateEventSourceMapping) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index d266387b..c6e04232 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -365,12 +365,12 @@ HTTP Status Code: 429 ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) -+ [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) \ No newline at end of file ++ [ 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) ++ [ 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) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 24c67918..77e5ac07 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -431,12 +431,12 @@ HTTP Status Code: 429 ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [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) \ No newline at end of file ++ [ 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ 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) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index 0d90c5ef..38046cdb 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also 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/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md index d2610bb6..c44d94f0 100644 --- a/doc_source/API_VpcConfig.md +++ b/doc_source/API_VpcConfig.md @@ -19,7 +19,7 @@ Required: No ## See Also 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/VpcConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md index b68675f5..66609593 100644 --- a/doc_source/API_VpcConfigResponse.md +++ b/doc_source/API_VpcConfigResponse.md @@ -24,7 +24,7 @@ Required: No ## See Also 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/VpcConfigResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfigResponse) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 5e13d816..197c620b 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -63,7 +63,7 @@ Create an application in the Lambda console\. In Lambda, an application is an AW 1. Configure application settings\. + **Application name** – **my\-app**\. - + **Runtime** – **Node\.js 10\.x**\. + + **Runtime** – **Node\.js 14\.x**\. + **Source control service** – **CodeCommit**\. + **Repository name** – **my\-app\-repo**\. + **Permissions** – **Create roles and permissions boundary**\. @@ -148,7 +148,7 @@ To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTa Properties: CodeUri: ./ Handler: src/handlers/hello-from-lambda.helloFromLambdaHandler - Runtime: nodejs10.x + Runtime: nodejs14.x MemorySize: 128 Timeout: 60 Description: A Lambda function that returns a static string. @@ -237,7 +237,7 @@ Next, update the function code to use the table\. The following code uses the Dy Properties: CodeUri: ./ Handler: src/handlers/index.handler - Runtime: nodejs10.x + Runtime: nodejs14.x ``` 1. Commit and push the change\. @@ -261,7 +261,7 @@ After the code change is deployed, invoke the function a few times to update the ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-ddbtable.png) -Lambda creates additional instances of your function to handle multiple concurrent invocations\. Each log stream in the CloudWatch Logs log group corresponds to a function instance\. A new function instance is also created when you change your function's code or configuration\. For more information on scaling, see [AWS Lambda function scaling](invocation-scaling.md)\. +Lambda creates additional instances of your function to handle multiple concurrent invocations\. Each log stream in the CloudWatch Logs log group corresponds to a function instance\. A new function instance is also created when you change your function's code or configuration\. For more information on scaling, see [Lambda function scaling](invocation-scaling.md)\. ## Next steps diff --git a/doc_source/applications-usecases.md b/doc_source/applications-usecases.md index 771016c8..5066ea83 100644 --- a/doc_source/applications-usecases.md +++ b/doc_source/applications-usecases.md @@ -1,10 +1,10 @@ # Common Lambda application types and use cases -When building applications on AWS Lambda the core components are Lambda functions and triggers\. A trigger is the AWS service or application that invokes a function, and a Lambda function is the code and runtime that process events\. To illustrate, consider the following scenarios: +Lambda functions and triggers are the core components of building applications on AWS Lambda\. A Lambda function is the code and runtime that process events, while a trigger is the AWS service or application that invokes the function\. To illustrate, consider the following scenarios: + **File processing** – Suppose you have a photo sharing application\. People use your application to upload photos, and the application stores these user photos in an Amazon S3 bucket\. Then, your application creates a thumbnail version of each user's photos and displays them on the user's profile page\. In this scenario, you may choose to create a Lambda function that creates a thumbnail automatically\. Amazon S3 is one of the supported AWS event sources that can publish *object\-created events* and invoke your Lambda function\. Your Lambda function code can read the photo object from the S3 bucket, create a thumbnail version, and then save it in another S3 bucket\. + **Data and analytics** – Suppose you are building an analytics application and storing raw data in a DynamoDB table\. When you write, update, or delete items in a table, DynamoDB streams can publish item update events to a stream associated with the table\. In this case, the event data provides the item key, event name \(such as insert, update, and delete\), and other relevant details\. You can write a Lambda function to generate custom metrics by aggregating raw data\. + **Websites** – Suppose you are creating a website and you want to host the backend logic on Lambda\. You can invoke your Lambda function over HTTP using Amazon API Gateway as the HTTP endpoint\. Now, your web client can invoke the API, and then API Gateway can route the request to Lambda\. -+ **Mobile applications** – Suppose you have a custom mobile application that produces events\. You can create a Lambda function to process events published by your custom application\. For example, in this scenario you can configure a Lambda function to process the clicks within your custom mobile application\. ++ **Mobile applications** – Suppose you have a custom mobile application that produces events\. You can create a Lambda function to process events published by your custom application\. For example, you can configure a Lambda function to process the clicks within your custom mobile application\. AWS Lambda supports many AWS services as event sources\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. When you configure these event sources to trigger a Lambda function, the Lambda function is invoked automatically when events occur\. You define *event source mapping*, which is how you identify what events to track and which Lambda function to invoke\. @@ -46,4 +46,4 @@ The diagram illustrates the following sequence: 1. The Lambda function is invoked with the incoming event\. -When working with stream\-based event sources, you create event source mappings in AWS Lambda\. Lambda reads items from the stream invokes the function synchronously\. You don't need to grant Lambda permission to invoke the function, but it does need permission to read from the stream\. \ No newline at end of file +When working with stream\-based event sources, you create event source mappings in AWS Lambda\. Lambda reads items from the stream and invokes the function synchronously\. You don't need to grant Lambda permission to invoke the function, but it does need permission to read from the stream\. \ No newline at end of file diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index f1cfbbbb..72bc63ea 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -111,7 +111,7 @@ To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIAL If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PREJIT environment variable to improve the latency for functions that use provisioned concurrency\. The \.NET runtime lazily compiles and initializes each library that your code calls for the first time\. As a result, the first invocation of a Lambda function can take longer than subsequent invocations\. When you set AWS\_LAMBDA\_DOTNET\_PREJIT to `ProvisionedConcurrency`, Lambda performs ahead\-of\-time JIT compilation for common system dependencies\. Lambda performs this initialization optimization for provisioned concurrency instances only, which results in faster performance for the first invocation\. If you set the environment variable to `Always`, Lambda performs ahead\-of\-time JIT compilation for every initialization\. If you set the environment variable to `Never`, ahead\-of\-time JIT compilation is disabled\. The default value for AWS\_LAMBDA\_DOTNET\_PREJIT is `ProvisionedConcurrency`\. -For provisioned concurrency instances, your function's [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. +For provisioned concurrency instances, your function's [initialization code](foundation-progmodel.md) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index b263c785..fd5e3380 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -1,6 +1,6 @@ # Using AWS Lambda environment variables -You can use environment variables to adjust your function's behavior without updating code\. An environment variable is a pair of strings that are stored in a function's version\-specific configuration\. The Lambda runtime makes environment variables available to your code and sets additional environment variables that contain information about the function and invocation request\. +You can use environment variables to adjust your function's behavior without updating code\. An environment variable is a pair of strings that is stored in a function's version\-specific configuration\. The Lambda runtime makes environment variables available to your code and sets additional environment variables that contain information about the function and invocation request\. **Note** To increase database security, we recommend that you use AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. @@ -20,7 +20,7 @@ Environment variables are not evaluated prior to the function invocation\. Any v You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-function-common.md)\. -You create an environment variable on your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\. +You create an environment variable for your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\. **To set environment variables in the Lambda console** diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 143492e9..907835cc 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -2,7 +2,7 @@ If you use Amazon Virtual Private Cloud \(Amazon VPC\) to host your AWS resources, you can establish a connection between your VPC and Lambda\. You can use this connection to invoke your Lambda function without crossing the public internet\. -To establish a private connection between your VPC and Lambda, create an [interface VPC endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html)\. Interface endpoints are powered by [AWS PrivateLink](http://aws.amazon.com/privatelink), which enables you to privately access Lambda APIs without an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection\. Instances in your VPC don't need public IP addresses to communicate with Lambda APIs\. Traffic between your VPC and Lambda does not leave the AWS network\. +To establish a private connection between your VPC and Lambda, create an [interface VPC endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html)\. Interface endpoints are powered by [AWS PrivateLink](http://aws.amazon.com/privatelink), which enables you to privately access Lambda APIs without an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection\. Instances in your VPC don't need public IP addresses to communicate with Lambda APIs\. Traffic between your VPC and Lambda does not leave the AWS network\. Each interface endpoint is represented by one or more [elastic network interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in your subnets\. A network interface provides a private IP address that serves as an entry point for traffic to Lambda\. @@ -35,7 +35,7 @@ Traffic between peered VPCs stays on the AWS network and does not traverse the p ## Creating an interface endpoint for Lambda -You can create an interface endpoint for Lambda using either the Amazon VPC console or the AWS Command Line Interface \(AWS CLI\)\. For more information, see [Creating an interface endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#create-interface-endpoint) in the *Amazon VPC User Guide*\. +You can create an interface endpoint for Lambda using either the Amazon VPC console or the AWS Command Line Interface \(AWS CLI\)\. For more information, see [Creating an interface endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#create-interface-endpoint) in the *Amazon VPC User Guide*\. **To create an interface endpoint for Lambda \(console\)** @@ -57,7 +57,7 @@ You can create an interface endpoint for Lambda using either the Amazon VPC cons To use the private DNS option, you must set the `enableDnsHostnames` and `enableDnsSupportattributes` of your VPC\. For more information, see [Viewing and updating DNS support for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-updating) in the *Amazon VPC User Guide*\. If you enable private DNS for the interface endpoint, you can make API requests to Lambda using its default DNS name for the Region, for example, `lambda.us-east-1.amazonaws.com`\. For more service endpoints, see [Service endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html) in the *AWS General Reference*\. -For more information, see [Accessing a service through an interface endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#access-service-though-endpoint) in the *Amazon VPC User Guide*\. +For more information, see [Accessing a service through an interface endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#access-service-though-endpoint) in the *Amazon VPC User Guide*\. For information about creating and configuring an endpoint using AWS CloudFormation, see the [AWS::EC2::VPCEndpoint](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpcendpoint.html) resource in the *AWS CloudFormation User Guide*\. @@ -76,7 +76,7 @@ To control who can use your interface endpoint and which Lambda functions the us + The actions that the principal can perform\. + The resources on which the principal can perform actions\. -For more information, see [Controlling access to services with VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) in the *Amazon VPC User Guide*\. +For more information, see [Controlling access to services with VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-access.html) in the *Amazon VPC User Guide*\. **Example: Interface endpoint policy for Lambda actions** The following is an example of an endpoint policy for Lambda\. When attached to an endpoint, this policy allows user `MyUser` to invoke the function `my-function`\. @@ -99,4 +99,4 @@ The following is an example of an endpoint policy for Lambda\. When attached to } ] } -``` +``` \ No newline at end of file diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index bae18fb8..380253fe 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -74,7 +74,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/foundation-console.md b/doc_source/foundation-console.md index b930fbfc..1cb4d6d6 100644 --- a/doc_source/foundation-console.md +++ b/doc_source/foundation-console.md @@ -1,4 +1,4 @@ -# Using the Lambda console +# Lambda console You can use the Lambda console to configure applications, functions, code signing configurations, and layers\. diff --git a/doc_source/foundation-progmodel.md b/doc_source/foundation-progmodel.md new file mode 100644 index 00000000..8dbf5585 --- /dev/null +++ b/doc_source/foundation-progmodel.md @@ -0,0 +1,27 @@ +# Lambda programming model + +Lambda provides a programming model that is common to all of the runtimes\. The programming model defines the interface between your code and the Lambda system\. You tell Lambda the entry point to your function by defining a *handler* in the function configuration\. The runtime passes in objects to the handler that contain the invocation *event* and the *context*, such as the function name and request ID\. + +When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in *initialization code* can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. + +When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) + +Your function also has access to local storage in the `/tmp` directory\. Instances of your function that are serving requests remain active for a few hours before being recycled\. + +The runtime captures logging output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an error, the runtime returns that error to the invoker\. + +**Note** +Logging is subject to [CloudWatch Logs quotas](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html)\. Log data can be lost due to throttling or, in some cases, when an instance of your function is stopped\. + +For a hands\-on introduction to the programming model in your preferred programming language, see the following chapters\. ++ [Building Lambda functions with Node\.js](lambda-nodejs.md) ++ [Building Lambda functions with Python](lambda-python.md) ++ [Building Lambda functions with Ruby](lambda-ruby.md) ++ [Building Lambda functions with Java](lambda-java.md) ++ [Building Lambda functions with Go](lambda-golang.md) ++ [Building Lambda functions with C\#](lambda-csharp.md) ++ [Building Lambda functions with PowerShell](lambda-powershell.md) + +Lambda scales your function by running additional instances of it as demand increases, and by stopping instances as demand decreases\. Unless noted otherwise, incoming requests might be processed out of order or concurrently\. Store your application's state in other services, and don't rely on instances of your function being long lived\. Use local storage and class\-level objects to increase performance, but keep to a minimum the size of your deployment package and the amount of data that you transfer onto the execution environment\. \ No newline at end of file diff --git a/doc_source/functions-code-editor.md b/doc_source/functions-code-editor.md deleted file mode 100644 index 8c68efd3..00000000 --- a/doc_source/functions-code-editor.md +++ /dev/null @@ -1,158 +0,0 @@ -# Creating functions using the AWS Lambda console editor - -The Lambda console provides a code editor for languages that do not require compiling, such as Node\.js or Python\. The code editor in the AWS Lambda console enables you to write, test, and view the execution results of your Lambda function code\. - -The code editor includes the *menu bar*, *windows*, and the *editor pane*\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) - -For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. - -**Topics** -+ [Working with files and folders](#functions-code-editor-files) -+ [Working with code](#functions-code-editor-code) -+ [Working in fullscreen mode](#functions-code-editor-fullscreen) -+ [Working with preferences](#functions-code-editor-prefs) - -## Working with files and folders - -You can use the **Environment** window in the code editor to create, open, and manage files for your function\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env.png) - -**To show or hide the Environment window**, choose the **Environment** button\. If the **Environment** button is not visible, choose **Window, Environment** on the menu bar\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-button.png) - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) - - - -**To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. - -**To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. - -**To create a new file**, do one of the following: -+ In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. -+ Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -+ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) - - - -**To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. - -**To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. - -**To rename a file or folder**, right\-click the file or folder in the **Environment** window\. Type the replacement name, and then press Enter \. - -**To delete files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Delete**\. Then confirm the deletion by choosing **Yes** \(for a single selection\) or **Yes to All**\. - -**To cut, copy, paste, or duplicate files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Cut**, **Copy**, **Paste**, or **Duplicate**, respectively\. - -**To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) - -**To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. - -## Working with code - -Use the editor pane in the code editor to view and write code\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) - - - -### Working with tab buttons - -Use the *tab buttons bar* to select, view, and create files\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) - - - -**To display an open file's contents**, do one of the following: -+ Choose the file's tab\. -+ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) - - - -**To close an open file**, do one of the following: -+ Choose the **X** icon in the file's tab\. -+ Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. - -**To close multiple open files**, choose the drop\-down menu in the tab buttons bar, and then choose **Close All Tabs in All Panes** or **Close All But Current Tab** as needed\. - -**To create a new file**, choose the **\+** button in the tab buttons bar, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. - -### Working with the status bar - -Use the status bar to move quickly to a line in the active file and to change how code is displayed\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) - - - -**To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) - - - -**To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) - -**To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-spaces-tabs.png) - -**To change for all files whether to show or hide invisible characters or the gutter, auto\-pair brackets or quotes, wrap lines, or the font size**, choose the gear icon, and then choose the new settings\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) - - - -## Working in fullscreen mode - -You can expand the code editor to get more room to work with your code\. - -To expand the code editor to the edges of the web browser window, choose the **Toggle fullscreen** button in the menu bar\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) - - - -To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. - -In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. - -## Working with preferences - -You can change various code editor settings such as which coding hints and warnings are displayed, code folding behaviors, code autocompletion behaviors, and much more\. - -To change code editor settings, choose the **Preferences** gear icon in the menu bar\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-preferences.png) - -For a list of what the settings do, see the following references in the *AWS Cloud9 User Guide*\. -+ [Project setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-project.html#settings-project-change) -+ [User setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-user.html#settings-user-change) - -Note that some of the settings listed in those references are not available in the code editor\. \ No newline at end of file diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 59006aec..90bea1d8 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -1,18 +1,15 @@ # Create a Lambda function with the console -In the following getting started exercises, you create Lambda functions using the console\. - -In the first exercise, you create a function and use the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. - -In the next exercise, you create a function defined as a container image\. First, create a container image for your function code, and then use the Lambda console to create a function from the container image\. +In this getting started exercise, you create a Lambda function using the console\.The function uses the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. **Topics** -+ [Create a Lambda function with default function code](#gettingstarted-zip-function) -+ [Create a function defined as a container image](#gettingstarted-images) ++ [Create the function](#gettingstarted-zip-function) ++ [Invoke the Lambda function](#get-started-invoke-manually) ++ [Clean up](#gettingstarted-cleanup) -## Create a Lambda function with default function code +## Create the function -In this getting started exercise, you create a Node\.js Lambda function using the Lambda console\. Lambda automatically creates default code for the function\. Next, you manually invoke the Lambda function using sample event data\. Lambda runs the function and returns results\. You then verify the results, including the logs that your Lambda function created and various Amazon CloudWatch metrics\. +You create a Node\.js Lambda function using the Lambda console\. Lambda automatically creates default code for the function\. **To create a Lambda function with the console** @@ -30,13 +27,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th Lambda creates a Node\.js function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. The Lambda function assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. -### Use the function overview - -The **Function overview** shows a visualization of your function, including any triggers, destinations, and layer that you have configured for the function\. - -![\[A Lambda function with no triggers, destinations or layers.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) - -### Invoke the Lambda function +## Invoke the Lambda function Invoke your Lambda function using the sample event data provided in the console\. @@ -70,7 +61,7 @@ Invoke your Lambda function using the sample event data provided in the console\ For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. -### Clean up +## Clean up If you are done working with the example function, delete it\. You can also delete the log group that stores the function's logs, and the execution role that the console created\. @@ -104,241 +95,4 @@ If you are done working with the example function, delete it\. You can also dele 1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS Command Line Interface \(AWS CLI\)\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. - -## Create a function defined as a container image - -In this getting started exercise, you use the Docker CLI to create a container image and then use the Lambda console to create a function from the container image\. - -**Topics** -+ [Prerequisites](#gettingstarted-images-prereq) -+ [Create the container image](#gettingstarted-images-package) -+ [Upload the image to the Amazon ECR repository](#gettingstarted-create-upload) -+ [Update the user permissions](#gettingstarted-images-permissions) -+ [Create a Lambda function defined as a container image](#gettingstarted-images-function) -+ [Invoke the Lambda function](#get-started-invoke-function) -+ [Clean up](#gettingstarted-image-cleanup) - -### Prerequisites - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -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 exercise uses Docker CLI commands to create the container image\. To install the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. - -### Create the container image - -AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [ AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. - -In the following commands, replace `123456789012` with your AWS account ID\. - -**To create an image using the AWS Node\.js 12 base image** - -1. On your local machine, create a project directory for your new function\. - -1. Create a file named `app.js` in your project directory\. Add the following code to `app.js`: - - ``` - exports.handler = async (event) => { - // TODO implement - const response = { - statusCode: 200, - body: JSON.stringify('Hello from Lambda!'), - }; - return response; - }; - ``` - -1. Use a text editor to create a new file named `Dockerfile` in your project directory\. Add the following content to `Dockerfile`: - - ``` - FROM public.ecr.aws/lambda/nodejs:12 - - # Copy function code and package.json - COPY app.js package.json /var/task/ - - # Install NPM dependencies for function - RUN npm install - - # Set the CMD to your handler - CMD [ "app.handler" ] - ``` - -1. Create the `package.json` file\. From your project directory, run the `npm init` command\. Accept all of the default values: - - ``` - npm init - ``` - -1. Build your Docker image\. From your project directory, run the following command: - - ``` - docker build -t hello-world . - ``` - -1. \(Optional\) AWS base images include the Lambda runtime interface emulator, so you can test your function locally\. - - 1. Run your Docker image\. From your project directory, run the `docker run` command: - - ``` - docker run -p 9000:8080 hello-world:latest - ``` - - 1. Test your Lambda function\. In a new terminal window, run a `curl` command to invoke your function: - - ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - ``` - -### Upload the image to the Amazon ECR repository - -1. Authenticate the Docker CLI to your Amazon ECR registry\. - - ``` - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com - ``` - -1. Create a repository in Amazon ECR using the `create-repository` command\. - - ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE - ``` - -1. Tag your image to match your repository name using the `docker tag` command\. - - ``` - docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` - -1. Deploy the image to Amazon ECR using the `docker push` command\. - - ``` - docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` - -### Update the user permissions - -Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about user permissions to access images in the Amazon ECR repository, see [ Amazon ECR permissions](configuration-images.md#configuration-images-permissions) - -For example, use the IAM console to create a role with the following policy: - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], - "Resource": "arn:aws:ecr:::repository//" - } - ] -} -``` - -### Create a Lambda function defined as a container image - -Use the Lambda console to create a function defined as a container image\. - -**To create the function with the console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose **Create function**\. - -1. Choose the **Container image** option\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter **my\-function**\. - - 1. For **Container image URI**, enter the URI of the Amazon ECR image that you created previously\. - -1. Choose **Create function**\. - -Lambda creates your function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. Lambda assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. - -### Invoke the Lambda function - -Invoke your Lambda function using the sample event data provided in the console\. - -**To invoke a function** - -1. After selecting your function, choose the **Test** tab\. - -1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: - - ``` - { - "key1": "value1", - "key2": "value2", - "key3": "value3" - } - ``` - -1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. - - Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. - -1. Upon successful completion, view the results in the console\. - + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. - + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. - + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. - -1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. - -1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - - For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. - -### Clean up - -If you are finished with the container image, see [Deleting an image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html) in the *Amazon Elastic Container Registry User Guide* - -If you are done working with your function, delete it\. You can also delete the log group that stores the function's logs and the execution role that the console created\. - -**To delete a Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Actions**, **Delete**\. - -1. In the **Delete function** dialog box, choose **Delete**\. - -**To delete the log group** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. - -1. Select the function's log group \(`/aws/lambda/my-function`\)\. - -1. Choose **Actions**, **Delete log group\(s\)**\. - -1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the IAM console\. - -1. Select the function's role \(`my-function-role-31exxmpl`\)\. - -1. Choose **Delete role**\. - -1. In the **Delete role** dialog box, choose **Yes, delete**\. - -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS Command Line Interface \(AWS CLI\)\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md index ab68ad07..61859eb6 100644 --- a/doc_source/getting-started.md +++ b/doc_source/getting-started.md @@ -9,14 +9,9 @@ As a best practice, create an AWS Identity and Access Management \(IAM\) user wi You can author functions in the Lambda console, or with an IDE toolkit, command line tools, or the AWS SDKs\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. The [AWS Command Line Interface \(AWS CLI\)](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. You deploy your function code to Lambda using a deployment package\. Lambda supports two types of deployment packages: -+ A \.zip file archive that contains your function code and its dependencies\. For an example tutorial, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. -+ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. For an example tutorial, see [Create a function defined as a container image](getting-started-create-function.md#gettingstarted-images)\. ++ A \.zip file archive that contains your function code and its dependencies\. For an example tutorial, see [Create a Lambda function with the console](getting-started-create-function.md)\. ++ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. For an example tutorial, see [Create a function defined as a container image](gettingstarted-images.md)\. **Topics** + [Create a Lambda function with the console](getting-started-create-function.md) -+ [Creating functions using the AWS Lambda console editor](functions-code-editor.md) -+ [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) -+ [Lambda concepts](gettingstarted-concepts.md) -+ [Lambda features](gettingstarted-features.md) -+ [Lambda deployment packages](gettingstarted-package.md) -+ [Lambda quotas](gettingstarted-limits.md) \ No newline at end of file ++ [Create a function defined as a container image](gettingstarted-images.md) \ No newline at end of file diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index b145cf67..4e003bb0 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -1,4 +1,4 @@ -# Using AWS Lambda with the AWS Command Line Interface +# Using Lambda with the AWS CLI You can use the AWS Command Line Interface to manage functions and other AWS Lambda resources\. The AWS CLI uses the AWS SDK for Python \(Boto\) to interact with the Lambda API\. You can use it to learn about the API, and apply that knowledge in building applications that use Lambda with the AWS SDK\. @@ -30,6 +30,31 @@ This tutorial uses the AWS Command Line Interface \(AWS CLI\) to call service AP Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. To create an execution role with the AWS CLI, use the `create-role` command\. +In the following example, you specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. + +``` +aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' +``` + +You can also define the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role using a JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. + +**Example trust\-policy\.json** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] +} +``` + ``` aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json ``` @@ -60,31 +85,6 @@ You should see the following output: } ``` -The `trust-policy.json` file is a JSON file in the current directory that defines the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. - -**Example trust\-policy\.json** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] -} -``` - -You can also specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. - -``` -aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' -``` - To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 6b394aa1..6c82bbe9 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -1,6 +1,6 @@ # Lambda concepts -With Lambda, you run functions to process events\. To send events to your function, you can invoke it using the Lambda API, or you can configure an AWS service or resource to invoke it\. +Lambda runs instances of your function to process events\. To send events to your function, you can invoke it using the Lambda API, or you can configure an AWS service or resource to invoke it\. **Topics** + [Function](#gettingstarted-concepts-function) @@ -19,11 +19,11 @@ With Lambda, you run functions to process events\. To send events to your functi A *function* is a resource that you can invoke to run your code in Lambda\. A function has code to process the [events](#gettingstarted-concepts-event) that you pass into the function or that other AWS services send to the function\. -For more information, see [Managing AWS Lambda functions](lambda-functions.md)\. +For more information, see [Configuring AWS Lambda functions](lambda-functions.md)\. ## Trigger -A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that you can configure to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. +A *trigger* is a resource or configuration that invokes a Lambda function\. Triggers include AWS services that you can configure to invoke a function and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. ## Event diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 709727ba..520eda6f 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -3,7 +3,6 @@ Lambda provides a management console and API for managing and invoking functions\. It provides runtimes that support a standard set of features so that you can easily switch between languages and frameworks, depending on your needs\. In addition to functions, you can also create versions, aliases, layers, and custom runtimes\. **Topics** -+ [Programming model](#gettingstarted-features-programmingmodel) + [Scaling](#gettingstarted-features-scaling) + [Concurrency controls](#gettingstarted-features-concurrency) + [Asynchronous invocation](#gettingstarted-features-async) @@ -13,41 +12,13 @@ Lambda provides a management console and API for managing and invoking functions + [Testing and deployment tools](#gettingstarted-features-tools) + [Application templates](#gettingstarted-features-templates) -## Programming model - -Authoring specifics vary between runtimes, but all runtimes share a common programming model that defines the interface between your code and the runtime code\. You tell the runtime which method to run by defining a *handler* in the function configuration, and the runtime runs that method\. The runtime passes in objects to the handler that contain the invocation *event* and the *context*, such as the function name and request ID\. - -When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in *initialization code* can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. - -When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) - -Your function also has access to local storage in the `/tmp` directory\. Instances of your function that are serving requests remain active for a few hours before being recycled\. - -The runtime captures logging output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an error, the runtime returns that error to the invoker\. - -**Note** -Logging is subject to [CloudWatch Logs quotas](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html)\. Log data can be lost due to throttling or, in some cases, when an instance of your function is stopped\. - -For a hands\-on introduction to the programming model in your preferred programming language, see the following chapters\. -+ [Building Lambda functions with Node\.js](lambda-nodejs.md) -+ [Building Lambda functions with Python](lambda-python.md) -+ [Building Lambda functions with Ruby](lambda-ruby.md) -+ [Building Lambda functions with Java](lambda-java.md) -+ [Building Lambda functions with Go](lambda-golang.md) -+ [Building Lambda functions with C\#](lambda-csharp.md) -+ [Building Lambda functions with PowerShell](lambda-powershell.md) - -Lambda scales your function by running additional instances of it as demand increases, and by stopping instances as demand decreases\. Unless noted otherwise, incoming requests might be processed out of order or concurrently\. Store your application's state in other services, and don't rely on instances of your function being long lived\. Use local storage and class\-level objects to increase performance, but keep to a minimum the size of your deployment package and the amount of data that you transfer onto the execution environment\. - ## Scaling Lambda manages the infrastructure that runs your code, and scales automatically in response to incoming requests\. When your function is invoked more quickly than a single instance of your function can process events, Lambda scales up by running additional instances\. When traffic subsides, inactive instances are frozen or stopped\. You only pay for the time that your function is initializing or processing events\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling.png) -For more information, see [AWS Lambda function scaling](invocation-scaling.md)\. +For more information, see [Lambda function scaling](invocation-scaling.md)\. ## Concurrency controls diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md new file mode 100644 index 00000000..7061a86d --- /dev/null +++ b/doc_source/gettingstarted-images.md @@ -0,0 +1,227 @@ +# Create a function defined as a container image + +In this getting started exercise, you create a function defined as a container image\. First, you use the Docker CLI to create a container image for your function code, and then use the Lambda console to create a function from the container image\. + +**Topics** ++ [Prerequisites](#gettingstarted-images-prereq) ++ [Create the container image](#gettingstarted-images-package) ++ [Upload the image to the Amazon ECR repository](#gettingstarted-create-upload) ++ [Update the user permissions](#gettingstarted-images-permissions) ++ [Create a Lambda function defined as a container image](#gettingstarted-images-function) ++ [Invoke the Lambda function](#get-started-invoke-function) ++ [Clean up](#gettingstarted-image-cleanup) + +## Prerequisites + +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +aws --version +``` + +You should see the following output: + +``` +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 +``` + +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 exercise uses Docker CLI commands to create the container image\. To install the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. + +## Create the container image + +AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [ AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. + +In the following commands, replace `123456789012` with your AWS account ID\. + +**To create an image using the AWS Node\.js 12 base image** + +1. On your local machine, create a project directory for your new function\. + +1. Create a file named `app.js` in your project directory\. Add the following code to `app.js`: + + ``` + exports.handler = async (event) => { + // TODO implement + const response = { + statusCode: 200, + body: JSON.stringify('Hello from Lambda!'), + }; + return response; + }; + ``` + +1. Use a text editor to create a new file named `Dockerfile` in your project directory\. Add the following content to `Dockerfile`: + + ``` + FROM public.ecr.aws/lambda/nodejs:14 + + # Copy function code + COPY app.js ${LAMBDA_TASK_ROOT} + + # Set the CMD to your handler + CMD [ "app.handler" ] + ``` + +1. Build your Docker image\. From your project directory, run the following command: + + ``` + docker build -t hello-world . + ``` + +1. \(Optional\) AWS base images include the Lambda runtime interface emulator, so you can test your function locally\. + + 1. Run your Docker image\. From your project directory, run the `docker run` command: + + ``` + docker run -p 9000:8080 hello-world:latest + ``` + + 1. Test your Lambda function\. In a new terminal window, run a `curl` command to invoke your function: + + ``` + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' + ``` + +## Upload the image to the Amazon ECR repository + +1. Authenticate the Docker CLI to your Amazon ECR registry\. + + ``` + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com + ``` + +1. Create a repository in Amazon ECR using the `create-repository` command\. + + ``` + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + ``` + +1. Tag your image to match your repository name using the `docker tag` command\. + + ``` + docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + ``` + +1. Deploy the image to Amazon ECR using the `docker push` command\. + + ``` + docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + ``` + +## Update the user permissions + +Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about user permissions to access images in the Amazon ECR repository, see [ Amazon ECR permissions](configuration-images.md#configuration-images-permissions) + +For example, use the IAM console to create a role with the following policy: + +``` +{ +"Version": "2012-10-17", +"Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], + "Resource": "arn:aws:ecr:::repository//" + } +] +} +``` + +## Create a Lambda function defined as a container image + +Use the Lambda console to create a function defined as a container image\. + +**To create the function with the console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose **Create function**\. + +1. Choose the **Container image** option\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter **my\-function**\. + + 1. For **Container image URI**, enter the URI of the Amazon ECR image that you created previously\. + +1. Choose **Create function**\. + +Lambda creates your function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. Lambda assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. + +## Invoke the Lambda function + +Invoke your Lambda function using the sample event data provided in the console\. + +**To invoke a function** + +1. After selecting your function, choose the **Test** tab\. + +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: + + ``` + { + "key1": "value1", + "key2": "value2", + "key3": "value3" + } + ``` + +1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. + + Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. + +1. Upon successful completion, view the results in the console\. + + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. + +1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. + +1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) + + For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. + +## Clean up + +If you are finished with the container image, see [Deleting an image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html) in the *Amazon Elastic Container Registry User Guide* + +If you are done working with your function, delete it\. You can also delete the log group that stores the function's logs and the execution role that the console created\. + +**To delete a Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Actions**, **Delete**\. + +1. In the **Delete function** dialog box, choose **Delete**\. + +**To delete the log group** + +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. + +1. Select the function's log group \(`/aws/lambda/my-function`\)\. + +1. Choose **Actions**, **Delete log group\(s\)**\. + +1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the IAM console\. + +1. Select the function's role \(`my-function-role-31exxmpl`\)\. + +1. Choose **Delete role**\. + +1. In the **Delete role** dialog box, choose **Yes, delete**\. + +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index a30ebad6..9977f037 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -10,7 +10,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can | Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | -For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. +For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [Lambda function scaling](invocation-scaling.md)\. The following quotas apply to function configuration, deployments, and execution\. They cannot be changed\. @@ -19,7 +19,7 @@ The following quotas apply to function configuration, deployments, and execution | --- | --- | | Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | | Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | -| Function [environment variables](configuration-envvars.md) | 4 KB | +| Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | five layers | | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index ee9506f4..c9ae5298 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -24,7 +24,7 @@ Lambda provides the following tools and libraries for the Go runtime: **Tools and libraries for Go** + [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. + [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. -+ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing execution context information from the [context object](golang-context.md)\. ++ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing context information from the [context object](golang-context.md)\. + [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. + [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 94755a2a..86ac0456 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -56,7 +56,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 3d64771e..33ceee1d 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -93,14 +93,19 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do + LAMBDA\_TASK\_ROOT=/var/task + LAMBDA\_RUNTIME\_DIR=/var/runtime - The following shows an example Dockerfile for Node\.js version 14\. : + Install any dependencies under the $\{LAMBDA\_TASK\_ROOT\} directory alongside the function handler to ensure that the Lambda runtime can locate them when the function is invoked\. + + The following shows an example Dockerfile for Node\.js, Python, and Ruby: + +------ +#### [ Node\.js 14 ] ``` FROM public.ecr.aws/lambda/nodejs:14 # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 # Assumes your function is named "app.js", and there is a package.json file in the app directory. - COPY app.js package.json /var/task/ + COPY app.js package.json ${LAMBDA_TASK_ROOT} # Install NPM dependencies for function RUN npm install @@ -109,6 +114,47 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do CMD [ "app.handler" ] ``` +------ +#### [ Python 3\.8 ] + + ``` + FROM public.ecr.aws/lambda/python:3.8 + + # Copy function code + COPY app.py ${LAMBDA_TASK_ROOT} + + # Install the function's dependencies using file requirements.txt + # from your project folder. + + COPY requirements.txt . + RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" + + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) + CMD [ "app.handler" ] + ``` + +------ +#### [ Ruby 2\.7 ] + + ``` + FROM public.ecr.aws/lambda/ruby:2.7 + + # Copy function code + COPY app.rb ${LAMBDA_TASK_ROOT} + + # Copy dependency management file + COPY Gemfile ${LAMBDA_TASK_ROOT} + + # Install dependencies under LAMBDA_TASK_ROOT + ENV GEM_HOME=${LAMBDA_TASK_ROOT} + RUN bundle install + + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) + CMD [ "app.LambdaFunction::Handler.process" ] + ``` + +------ + 1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. ``` diff --git a/doc_source/index.md b/doc_source/index.md index c193c4d8..f841dc4a 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -18,11 +18,15 @@ Amazon's trademarks and trade dress may not be used in + [Setting up with Lambda](lambda-settingup.md) + [Getting started with Lambda](getting-started.md) + [Create a Lambda function with the console](getting-started-create-function.md) - + [Creating functions using the AWS Lambda console editor](functions-code-editor.md) - + [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) + + [Create a function defined as a container image](gettingstarted-images.md) ++ [AWS Lambda foundations](lambda-foundation.md) + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + + [Lambda programming model](foundation-progmodel.md) + + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + + [Lambda console](foundation-console.md) + + [Using Lambda with the AWS CLI](gettingstarted-awscli.md) + [Lambda quotas](gettingstarted-limits.md) + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) @@ -30,8 +34,7 @@ Amazon's trademarks and trade dress may not be used in + [Identity-based IAM policies for Lambda](access-control-identity-based.md) + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) -+ [Managing AWS Lambda functions](lambda-functions.md) - + [Using the Lambda console](foundation-console.md) ++ [Configuring AWS Lambda functions](lambda-functions.md) + [Creating Lambda functions defined as .zip file archives](configuration-function-zip.md) + [Creating and sharing Lambda layers](configuration-layers.md) + [Creating Lambda functions defined as container images](configuration-images.md) @@ -53,7 +56,6 @@ Amazon's trademarks and trade dress may not be used in + [Asynchronous invocation](invocation-async.md) + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) + [Monitoring the state of a function with the Lambda API](functions-states.md) - + [AWS Lambda function scaling](invocation-scaling.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index 8d4abdf1..b3f26109 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -2,6 +2,15 @@ Several AWS services, such as Amazon Simple Storage Service \(Amazon S3\) and Amazon Simple Notification Service \(Amazon SNS\), invoke functions asynchronously to process events\. When you invoke a function asynchronously, you don't wait for a response from the function code\. You hand off the event to Lambda and Lambda handles the rest\. You can configure how Lambda handles errors, and can send invocation records to a downstream resource to chain together components of your application\. +**Topics** ++ [How Lambda handles asynchronous invocations](#async-overview) ++ [Configuring error handling for asynchronous invocation](#invocation-async-errors) ++ [Configuring destinations for asynchronous invocation](#invocation-async-destinations) ++ [Asynchronous invocation configuration API](#invocation-async-api) ++ [AWS Lambda function dead\-letter queues](#dlq) + +## How Lambda handles asynchronous invocations + The following diagram shows clients invoking a Lambda function asynchronously\. Lambda queues the events before sending them to the function\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-async.png) @@ -48,12 +57,6 @@ You can also configure Lambda to send an invocation record to another service\. The invocation record contains details about the request and response in JSON format\. You can configure separate destinations for events that are processed successfully, and events that fail all processing attempts\. Alternatively, you can configure an SQS queue or SNS topic as a [dead\-letter queue](#dlq) for discarded events\. For dead\-letter queues, Lambda only sends the content of the event, without details about the response\. -**Topics** -+ [Configuring error handling for asynchronous invocation](#invocation-async-errors) -+ [Configuring destinations for asynchronous invocation](#invocation-async-destinations) -+ [Asynchronous invocation configuration API](#invocation-async-api) -+ [AWS Lambda function dead\-letter queues](#dlq) - ## Configuring error handling for asynchronous invocation Use the Lambda console to configure error handling settings on a function, a version, or an alias\. @@ -205,11 +208,13 @@ You should see the following output: As an alternative to an [on\-failure destination](#invocation-async-destinations), you can configure your function with a dead\-letter queue to save discarded events for further processing\. A dead\-letter queue acts the same as an on\-failure destination in that it is used when an event fails all processing attempts or expires without being processed\. However, a dead\-letter queue is part of a function's version\-specific configuration, so it is locked in when you publish a version\. On\-failure destinations also support additional targets and include details about the function's response in the invocation record\. -If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. -+ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. You can retrieve events manually, or you can [configure Lambda to read from the queue](with-sqs.md) and invoke a function\. +To reprocess events in a dead\-letter queue, you can set it as an event source for your Lambda function\. Alternatively, you can manually retrieve the events\. + +You can choose an Amazon SQS queue or Amazon SNS topic for your dead\-letter queue\. If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. ++ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. Create a queue in the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. -+ [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. You can configure a topic to send events to an email address, a Lambda function, or an HTTP endpoint\. ++ [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using Lambda with Amazon SNS](with-sqs.md)\. Create a topic in the [Amazon SNS console](https://console.aws.amazon.com/sns/home)\. diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md index 38f3c55d..009e8b5f 100644 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -1,4 +1,4 @@ -# AWS Lambda function scaling +# Lambda function scaling The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event\. When the function returns a response, it stays active and waits to process additional events\. If you invoke the function again while the first event is being processed, Lambda initializes another instance, and the function processes the two events concurrently\. As more events come in, Lambda routes them to available instances and creates new instances as needed\. When the number of requests decreases, Lambda stops unused instances to free up scaling capacity for other functions\. @@ -24,7 +24,7 @@ The function continues to scale until the account's concurrency limit for the fu The regional concurrency limit starts at 1,000\. You can increase the limit by submitting a request in the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency creates a pool that can only be used by its function, and also prevents its function from using unreserved concurrency\. -When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](configuration-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. +When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](foundation-progmodel.md) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](configuration-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 0b66d6a4..c599c164 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -38,7 +38,7 @@ The [Lambda runtime](lambda-runtimes.md) receives an event as a JSON\-formatted + `package.Class::method` – Full format\. For example: `example.Handler::handleRequest`\. + `package.Class` – Abbreviated format for functions that implement a [handler interface](#java-handler-interfaces)\. For example: `example.Handler`\. -You can add [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) outside of your handler method to reuse resources across multiple invocations\. When the runtime loads your handler, it runs static code and the class constructor\. Resources that are created during initialization stay in memory between invocations, and can be reused by the handler thousands of times\. +You can add [initialization code](foundation-progmodel.md) outside of your handler method to reuse resources across multiple invocations\. When the runtime loads your handler, it runs static code and the class constructor\. Resources that are created during initialization stay in memory between invocations, and can be reused by the handler thousands of times\. In the following example, the logger, serializer, and AWS SDK client are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. @@ -57,7 +57,7 @@ public class Handler implements RequestHandler{ String response = new String(); // call Lambda API logger.info("Getting account settings"); - CompletableFuture accountSettings = + CompletableFuture accountSettings = lambdaClient.getAccountSettings(GetAccountSettingsRequest.builder().build()); // log execution details logger.info("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index ccc18e0e..294ab1c8 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -55,7 +55,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md new file mode 100644 index 00000000..6a5146eb --- /dev/null +++ b/doc_source/lambda-foundation.md @@ -0,0 +1,13 @@ +# AWS Lambda foundations + +The Lambda function is the foundational principle of Lambda\. You can configure your functions using the Lambda console, Lambda API, AWS CloudFormation or AWS SAM\. You create code for the function and upload the code using a deployment package\. Lambda invokes the function when an event occurs\. Lambda runs multiple instances of your function in parallel, governed by concurrency and scaling limits\. + +**Topics** ++ [Lambda concepts](gettingstarted-concepts.md) ++ [Lambda features](gettingstarted-features.md) ++ [Lambda programming model](foundation-progmodel.md) ++ [Lambda function scaling](invocation-scaling.md) ++ [Lambda deployment packages](gettingstarted-package.md) ++ [Lambda console](foundation-console.md) ++ [Using Lambda with the AWS CLI](gettingstarted-awscli.md) ++ [Lambda quotas](gettingstarted-limits.md) \ No newline at end of file diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 60e6c31b..2c1d4d68 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -1,6 +1,8 @@ -# Managing AWS Lambda functions +# Configuring AWS Lambda functions -You can use the AWS Lambda API or console to create functions and configure function settings\. [Basic function settings](configuration-function-common.md) include the description and the execution role that you specify when you create a function in the Lambda console\. You can configure more settings after you create a function, or use the API to modify configuration settings such as the handler name, memory allocation, and security groups during creation\. +You can use the AWS Lambda API or console to create functions and configure function settings\. The workflow to create a function is different for a function deployed as a [container image](configuration-images.md) and for a function deployed as a [\.zip file archive](configuration-function-zip.md)\. + +After you create the function, you can configure settings for many [function capabilities and options ](configuration-function-common.md) such as permissions, environment variables, tags, and layers\. To keep secrets out of your function code, store them in the function's configuration and read them from the execution environment during initialization\. [Environment variables](configuration-envvars.md) are always encrypted at rest, and can be encrypted client\-side as well\. Use environment variables to make your function code portable by removing connection strings, passwords, and endpoints for external resources\. diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 319081ad..7d80d110 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -14,7 +14,7 @@ Lambda provides the following tools and libraries for the Go runtime: **Tools and libraries for Go** + [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. + [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. -+ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing execution context information from the [context object](golang-context.md)\. ++ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing context information from the [context object](golang-context.md)\. + [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. + [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index bce78b63..2e6e17c1 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -63,6 +63,31 @@ To learn more, see [Generate policies based on access activity](https://docs.aws To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the `create-role` command\. +In the following example, you specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. + +``` +aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' +``` + +You can also define the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role using a JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. + +**Example trust\-policy\.json** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] +} +``` + ``` aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json ``` @@ -93,31 +118,6 @@ You should see the following output: } ``` -The `trust-policy.json` file is a JSON file in the current directory that defines the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. - -**Example trust\-policy\.json** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] -} -``` - -You can also specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. - -``` -aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' -``` - To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index a446b1a4..d92a1452 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -10,14 +10,13 @@ To process items from a stream or queue, you can create an [event source mapping Other AWS services and resources invoke your function directly\. For example, you can configure CloudWatch Events to invoke your function on a timer, or you can configure Amazon S3 to invoke your function when an object is created\. Each service varies in the method it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. -Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [AWS Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. +Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. **Topics** + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) + [Monitoring the state of a function with the Lambda API](functions-states.md) -+ [AWS Lambda function scaling](invocation-scaling.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) diff --git a/doc_source/lambda-managing.md b/doc_source/lambda-managing.md index 2f751d0e..41d90511 100644 --- a/doc_source/lambda-managing.md +++ b/doc_source/lambda-managing.md @@ -1,12 +1,8 @@ # Managing AWS Lambda functions -Concurrency is the number of instances of your function that are active\. Scaling is how quickly Lambda increases the the number of instances\. +[Configuring AWS Lambda functions](lambda-functions.md) describes the how to configure the core capabilities and options for a function\. Lambda also provides advanced features such as concurrency control, network access, database interworking, file systems, and code signing\. -Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [AWS Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. - - - -As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development\. Use [layers](configuration-layers.md) to manage your function's dependencies independently and keep your deployment package small\. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions\. +[Concurrency](configuration-concurrency.md) is the number of instances of your function that are active\. Lambda provides two types of concurrency controls: reserved concurrency and provisioned concurrency\. To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 68f22226..80a32d32 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -12,7 +12,7 @@ When you use a \.zip file archive for the deployment package, you choose a runti + Image – Custom + Linux kernel – 4\.14\.165\-102\.205\.amzn2\.x86\_64 -When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. When an [execution environment](runtimes-context.md) is reused, time is saved because your resources, such as database connections and temporary files, do not have to be recreated before your function runs\. +Lambda invokes your function in an [execution environment](runtimes-context.md)\. The execution environment provides a secure and isolated runtime environment that manages the resources required to run your function\. Lambda re\-uses the execution environment from a previous invocation if one is available, or it can create a new execution environment\. A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](runtime-support-policy.md) when the version reaches end of life\. @@ -99,4 +99,4 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- + [Modifying the runtime environment](runtimes-modify.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) -+ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) ++ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index e3ab82dc..a83541ff 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -90,7 +90,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/python-image.md b/doc_source/python-image.md index b7f6ee42..b9008b74 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -69,45 +69,28 @@ When you build a container image for Python using an AWS base image, you only ne return 'Hello from AWS Lambda using Python' + sys.version + '!' ``` -1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. +1. In your project directory, add a file named `requirements.txt`\. List each required library as a separate line in this file\. Leave the file empty if there are no dependencies\. - ``` - FROM public.ecr.aws/lambda/python:3.8 - - COPY app.py ./ - CMD ["app.handler"] - ``` - -1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base.title)\. - -### Adding dependencies when you create a Python image - -If your Lambda function depends on external Python libraries, modify the previous procedure as follows: - -1. In your project directory, add a file named `requirements.txt`\. List each required library as a separate line in this file\. - -1. Modify your Dockerfile to add the required libraries to the container image\. The following example copies the requirements file and installs the required libraries into the `app` directory\. Do not install the dependencies globally or in user space\. +1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. Install any dependencies under the $\{LAMBDA\_TASK\_ROOT\} directory alongside the function handler to ensure that the Lambda runtime can locate them when the function is invoked\. ``` FROM public.ecr.aws/lambda/python:3.8 - - # Create function directory - WORKDIR /app - # Install the function's dependencies - # Copy file requirements.txt from your project folder and install - # the requirements in the app directory. + # Copy function code + COPY app.py ${LAMBDA_TASK_ROOT} - COPY requirements.txt . - RUN pip3 install -r requirements.txt + # Install the function's dependencies using file requirements.txt + # from your project folder. - # Copy handler function (from the local app directory) - COPY app.py . + COPY requirements.txt . + RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" - # Overwrite the command by providing a different command directly in the template. - CMD ["/app/app.handler"] + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) + CMD [ "app.handler" ] ``` +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. + ## Create a Python image from an alternative base image For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 79fb10c2..22221d64 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -40,7 +40,7 @@ environ({'AWS_LAMBDA_LOG_GROUP_NAME': '/aws/lambda/my-function', 'AWS_LAMBDA_LOG ## EVENT {'key': 'value'} END RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 -REPORT RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Duration: 15.74 ms Billed Duration: 16 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 130.49 ms +REPORT RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Duration: 15.74 ms Billed Duration: 16 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 130.49 ms XRAY TraceId: 1-5e34a614-10bdxmplf1fb44f07bc535a1 SegmentId: 07f5xmpl2d1f6f85 Sampled: true ``` @@ -218,6 +218,6 @@ START RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Version: $LATEST [INFO] 2020-01-31T22:12:58.535Z 1c8df7d3-xmpl-46da-9778-518e6eca8125 {'key': 'value'} END RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 -REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 3 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms +REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 3 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms XRAY TraceId: 1-5e34a66a-474xmpl7c2534a87870b4370 SegmentId: 073cxmpl3e442861 Sampled: true ``` \ No newline at end of file diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index a2f536ae..732f0120 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -302,11 +302,11 @@ Create the \.zip file that Lambda uses as your deployment package\. ``` import requests - def main(event, context): + def main(event, context): response = requests.get("https://www.test.com/") print(response.text) return response.text - if __name__ == "__main__": + if __name__ == "__main__": main('', '') ``` @@ -434,7 +434,7 @@ You can now delete the resources that you created for this tutorial, unless you + Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. ``` - aws lambda delete-function --function-name my-sourcecode-function + aws lambda delete-function --function-name my-function ``` This command produces no output\. @@ -451,4 +451,4 @@ You can now delete the resources that you created for this tutorial, unless you ``` aws iam delete-role --role-name lambda-ex - ``` + ``` \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index b3129243..57dcf1ac 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -71,7 +71,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 3cb98410..45a3011b 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -46,4 +46,45 @@ gem install aws_lambda_ric For package details, see [Lambda RIC](https://rubygems.org/gems/aws_lambda_ric) on [RubyGems\.org](https://rubygems.org/pages/about)\. -You can also download the [Ruby runtime interface client](https://github.com/aws/aws-lambda-ruby-runtime-interface-client) from GitHub\. \ No newline at end of file +You can also download the [Ruby runtime interface client](https://github.com/aws/aws-lambda-ruby-runtime-interface-client) from GitHub\. + +## Deploying Ruby with an AWS base image + +When you build a container image for Ruby using an AWS base image, you only need to copy the ruby app to the container and install any dependencies\. + +**To build and deploy a Ruby function with the `ruby:2.7` base image\.** + +1. On your local machine, create a project directory for your new function\. + +1. In your project directory, add a file named `app.rb` containing your function code\. The following example shows a simple Ruby handler\. + + ``` + module LambdaFunction + class Handler + def self.process(event:,context:) + "Hello from Ruby 2.7 container image!" + end + end + end + ``` + +1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. Install any dependencies under the $\{LAMBDA\_TASK\_ROOT\} directory alongside the function handler to ensure that the Lambda runtime can locate them when the function is invoked\. + + ``` + FROM public.ecr.aws/lambda/ruby:2.7 + + # Copy function code + COPY app.rb ${LAMBDA_TASK_ROOT} + + # Copy dependency management file + COPY Gemfile ${LAMBDA_TASK_ROOT} + + # Install dependencies under LAMBDA_TASK_ROOT + ENV GEM_HOME=${LAMBDA_TASK_ROOT} + RUN bundle install + + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) + CMD [ "app.LambdaFunction::Handler.process" ] + ``` + +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. \ No newline at end of file diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index ee881ffb..df3ebaa3 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -70,7 +70,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/security-configuration.md b/doc_source/security-configuration.md index 68aee0f3..c995e7a0 100644 --- a/doc_source/security-configuration.md +++ b/doc_source/security-configuration.md @@ -2,6 +2,6 @@ AWS Lambda provides [runtimes](lambda-runtimes.md) that run your function code in an Amazon Linux–based execution environment\. Lambda is responsible for keeping software in the runtime and execution environment up to date, releasing new runtimes for new languages and frameworks, and deprecating runtimes when the underlying software is no longer supported\. -If you use additional libraries with your function, you're responsible for updating the libraries\. You can include additional libraries in the [deployment package](getting-started-create-function.md#gettingstarted-images-package), or in [layers](configuration-layers.md) that you attach to your function\. You can also build [custom runtimes](runtimes-custom.md) and use layers to share them with other accounts\. +If you use additional libraries with your function, you're responsible for updating the libraries\. You can include additional libraries in the [deployment package](gettingstarted-images.md#gettingstarted-images-package), or in [layers](configuration-layers.md) that you attach to your function\. You can also build [custom runtimes](runtimes-custom.md) and use layers to share them with other accounts\. Lambda deprecates runtimes when the software on the runtime or its execution environment reaches end of life\. When Lambda deprecates a runtime, you're responsible for migrating your functions to a supported runtime for the same language or framework\. For details, see [Runtime support policy](runtime-support-policy.md)\. \ No newline at end of file diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 2c25ed53..9c6e2690 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -34,6 +34,6 @@ Additionally, you can use the following features to customize how environment va For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. -Lambda always encrypts files that you upload to Lambda, including [deployment packages](getting-started-create-function.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. +Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-images.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md index 2f4dff9d..0aa543bb 100644 --- a/doc_source/security-resilience.md +++ b/doc_source/security-resilience.md @@ -6,7 +6,7 @@ For more information about AWS Regions and Availability Zones, see [AWS global i In addition to the AWS global infrastructure, Lambda offers several features to help support your data resiliency and backup needs\. + **Versioning** – You can use versioning in Lambda to save your function's code and configuration as you develop it\. Together with aliases, you can use versioning to perform blue/green and rolling deployments\. For details, see [Lambda function versions](configuration-versions.md)\. -+ **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [quota](gettingstarted-limits.md) that can be increased if needed\. For details, see [AWS Lambda function scaling](invocation-scaling.md)\. ++ **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [quota](gettingstarted-limits.md) that can be increased if needed\. For details, see [Lambda function scaling](invocation-scaling.md)\. + **High availability** – Lambda runs your function in multiple Availability Zones to ensure that it is available to process events in case of a service interruption in a single zone\. If you configure your function to connect to a virtual private cloud \(VPC\) in your account, specify subnets in multiple Availability Zones to ensure high availability\. For details, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. + **Reserved concurrency** – To make sure that your function can always scale to handle additional requests, you can reserve concurrency for it\. Setting reserved concurrency for a function ensures that it can scale to, but not exceed, a specified number of concurrent invocations\. This ensures that you don't lose requests due to other functions consuming all of the available concurrency\. For details, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. + **Retries** – For asynchronous invocations and a subset of invocations triggered by other services, Lambda automatically retries on error with delays between retries\. Other clients and AWS services that invoke functions synchronously are responsible for performing retries\. For details, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. diff --git a/doc_source/welcome.md b/doc_source/welcome.md index a436a30a..a6b1bedb 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -73,7 +73,7 @@ If you are a first\-time user of Lambda, we recommend that you start with the fo 1. **To create and test a Lambda function using the Lambda console, try the [console\-based getting started exercise](getting-started.md)\.** This exercise teaches you about the Lambda programming model and other concepts\. -1. **If you are familiar with container image workflows, try the getting started exercise to [create a Lambda function defined as a container image](getting-started-create-function.md#gettingstarted-images)\.** +1. **If you are familiar with container image workflows, try the getting started exercise to [create a Lambda function defined as a container image](gettingstarted-images.md)\.** AWS also provides the following resources for learning about serverless applications and Lambda: + The [AWS Compute Blog](http://aws.amazon.com/blogs/compute/ ) includes useful articles about Lambda\. @@ -92,8 +92,8 @@ If you are a first\-time user of Lambda, we recommend that you start with the fo ## Accessing Lambda You can create, invoke, and manage your Lambda functions using any of the following interfaces: -+ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Using the Lambda console](foundation-console.md)\. -+ **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. ++ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Lambda console](foundation-console.md)\. ++ **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using Lambda with the AWS CLI](gettingstarted-awscli.md)\. + **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. + **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(CDK\)](http://aws.amazon.com/cdk)\. + **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [AWS SAM](lambda-settingup.md#lambda-settingup-awssam)\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 783c19fc..1bfce67b 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -10,7 +10,7 @@ To minimize latency and maximize read throughput, you can create a data stream c For details about Kinesis data streams, see [Reading Data from Amazon Kinesis Data Streams](https://docs.aws.amazon.com/kinesis/latest/dev/building-consumers.html)\. -Lambda reads records from the data stream and invokes your function [synchronously](invocation-sync.md) with an event that contains stream records\. Lambda reads records in batches and invokes your function to process records from the batch\. +Lambda reads records from the data stream and invokes your function [synchronously](invocation-sync.md) with an event that contains stream records\. Lambda reads records in batches and invokes your function to process records from the batch\. Each batch contains records from a single shard/data stream\. **Example Kinesis record event** @@ -123,7 +123,7 @@ To send records of failed batches to a queue or topic, your function needs addit ## Configuring a stream as an event source -Create an event source mapping to tell Lambda to send records from your data stream to a Lambda function\. You can create multiple event source mappings to process the same data with multiple Lambda functions, or to process items from multiple data streams with a single function\. +Create an event source mapping to tell Lambda to send records from your data stream to a Lambda function\. You can create multiple event source mappings to process the same data with multiple Lambda functions, or to process items from multiple data streams with a single function\. When processing items from multiple data streams, each batch will only contain records from a single shard/stream\. To configure your function to read from Kinesis in the Lambda console, create a **Kinesis** trigger\. diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 512f60f8..3ae31b37 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -184,7 +184,6 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | | BatchSize | N | 100 | Maximum: 10,000 | -| DestinationConfig | N | none | | | Enabled | N | Enabled | | | EventSourceArn | Y | | Can set only on Create | | FunctionName | Y | | | diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index 5921f6c6..5464af60 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -182,14 +182,14 @@ exports.handler = async (event, context, callback) => { return; } - // Check that the image type is supported + // Check that the image type is supported const imageType = typeMatch[1].toLowerCase(); if (imageType != "jpg" && imageType != "png") { console.log(`Unsupported image type: ${imageType}`); return; } - // Download the image from the S3 source bucket. + // Download the image from the S3 source bucket. try { const params = { @@ -201,19 +201,19 @@ exports.handler = async (event, context, callback) => { } catch (error) { console.log(error); return; - } + } // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. const width = 200; // Use the sharp module to resize the image and save in a buffer. - try { + try { var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - + } catch (error) { console.log(error); return; - } + } // Upload the thumbnail image to the destination bucket try { @@ -224,15 +224,15 @@ exports.handler = async (event, context, callback) => { ContentType: "image" }; - const putResult = await s3.putObject(destparams).promise(); - + const putResult = await s3.putObject(destparams).promise(); + } catch (error) { console.log(error); return; - } - + } + console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); + ' and uploaded to ' + dstBucket + '/' + dstKey); }; ``` @@ -580,7 +580,7 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. 1. Invoke the function with the following invoke command\. Note that the command requests asynchronous execution \(`--invocation-type Event`\)\. Optionally, you can invoke the function synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. ``` - aws lambda invoke + aws lambda invoke --function-name CreateThumbnail \ --invocation-type Event \ --payload file://inputFile.txt outputfile.txt From 78a1a2ec216effb3f5c5181b2c2ef313bdc23c6c Mon Sep 17 00:00:00 2001 From: Felipe Alvarez <275621+felipe1982@users.noreply.github.com> Date: Thu, 12 Aug 2021 11:30:05 +1000 Subject: [PATCH 65/94] removed suggestion that CMK means customer managed key CKM is not customer managed key. --- doc_source/security-dataprotection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 9c6e2690..0da22207 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -29,11 +29,11 @@ For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.a You can use environment variables to store secrets securely for use with Lambda functions\. Lambda always encrypts environment variables at rest\. Additionally, you can use the following features to customize how environment variables are encrypted\. -+ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* customer master keys \(CMKs\) or customer managed keys\. If you don't configure a customer managed key, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. ++ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* customer master keys \(CMKs\)\. If you don't configure a customer managed key, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. + **Encryption helpers** – The Lambda console lets you encrypt environment variable values client side, before sending them to Lambda\. This enhances security further by preventing secrets from being displayed unencrypted in the Lambda console, or in function configuration that's returned by the Lambda API\. The console also provides sample code that you can adapt to decrypt the values in your function handler\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-images.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. -Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file +Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. From 0f31cd417a9f9e64fec91cd36470bd75084e8e84 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 17 Aug 2021 17:44:16 -0600 Subject: [PATCH 66/94] Remove period in Docker comment for consistency No other commented sentence includes one --- doc_source/images-create.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 33ceee1d..c9466515 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -104,7 +104,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do FROM public.ecr.aws/lambda/nodejs:14 # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 - # Assumes your function is named "app.js", and there is a package.json file in the app directory. + # Assumes your function is named "app.js", and there is a package.json file in the app directory COPY app.js package.json ${LAMBDA_TASK_ROOT} # Install NPM dependencies for function @@ -297,4 +297,4 @@ You can use the AWS Serverless Application Model \(AWS SAM\) toolkit to create a In your AWS SAM template, you set the `Runtime` type to `Image` and provide the URI of the base image\. -For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file +For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. From 72e689d6f9a4939a7c0425ca061c090accc42ab6 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Fri, 20 Aug 2021 13:40:13 -0700 Subject: [PATCH 67/94] Add note in java-events pointing to java-events-v1sdk examples if necessary --- sample-apps/java-events/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sample-apps/java-events/README.md b/sample-apps/java-events/README.md index a8a0b7d8..d99fa3b1 100644 --- a/sample-apps/java-events/README.md +++ b/sample-apps/java-events/README.md @@ -2,6 +2,8 @@ This sample application shows the use of the `aws-lambda-java-events` library with various event types. To keep the deployment size minimal, it includes only types that can be used without adding the AWS SDK as a dependency. A separate handler class is defined for each input type. +**Note: To use these examples, you must be using version 3.0.0 or newer of the `aws-lambda-java-events` dependency.** If you are on an older version, see the [`java-events-v1sdk` package](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) for deprecated examples. If possible, update your `aws-lambda-java-events` dependency to version 3.0.0 or newer. + ![Architecture](/sample-apps/java-events/images/sample-java-events.png) The project includes function code and supporting resources: From 2d2df77e214d59b20385d96a9f7bbfa8c776e63a Mon Sep 17 00:00:00 2001 From: Saintmalik Date: Sun, 22 Aug 2021 08:05:56 +0000 Subject: [PATCH 68/94] fix typos in doc --- doc_source/API_Invoke.md | 4 ++-- doc_source/troubleshooting-images.md | 4 ++-- doc_source/with-sns-example.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 8876a4ea..22c31332 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -118,7 +118,7 @@ HTTP Status Code: 502 HTTP Status Code: 502 **EFSIOException** -An error occured when reading from or writing to a connected file system\. +An error occurred when reading from or writing to a connected file system\. HTTP Status Code: 410 **EFSMountConnectivityException** @@ -220,4 +220,4 @@ For more information about using this API in one of the language\-specific AWS S + [ 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) + [ 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) \ No newline at end of file ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md index dbfc8d50..d0f78cc5 100644 --- a/doc_source/troubleshooting-images.md +++ b/doc_source/troubleshooting-images.md @@ -6,7 +6,7 @@ Verify that the ENTRYPOINT to your container image includes the absolute path as the location\. Also verify that the image does not contain a symlink as the ENTRYPOINT\. -## Lambda: System provisioning additonal capacity +## Lambda: System provisioning additional capacity **Error:** *“Error: We currently do not have sufficient capacity in the region you requested\. Our system will be working on provisioning additional capacity\.* @@ -16,4 +16,4 @@ Retry the function invocation\. If the retry fails, validate that the files requ **Error:** *You are using an AWS CloudFormation template, and your container ENTRYPOINT is being overridden with a null or empty value\.* -Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. \ No newline at end of file +Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index 03e2fffe..0d23320b 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -130,7 +130,7 @@ Do not use the `--source-account` parameter to add a source account to the Lambd **Note** If the account with the SNS topic is hosted in an opt\-in region, you need to specify the region in the principal\. For an example, see [Invoking Lambda functions using Amazon SNS notifications](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) in the *Amazon Simple Notification Service Developer Guide*\. -## Create a subscription +## Create a subscription From account B, subscribe the Lambda function to the topic\. When a message is sent to the `sns-topic-for-lambda` topic in account A \(01234567891A\), Amazon SNS invokes the `Function-With-SNS` function in account B \(01234567891B\)\. @@ -207,4 +207,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the subscription you created\. -1. Choose **Delete**, **Delete**\. \ No newline at end of file +1. Choose **Delete**, **Delete**\. From acde21cb1eeba558955f5b71090bae97684c5de7 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Fri, 27 Aug 2021 10:14:21 -0700 Subject: [PATCH 69/94] Remove instructions for Node.js 10.x base image --- doc_source/nodejs-image.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 60c1a5ee..1638ca99 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -25,7 +25,6 @@ AWS provides the following base images for Node\.js: | --- | --- | --- | --- | | 14 | NodeJS 14\.x | Amazon Linux 2 | [Dockerfile for Node\.js 14\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | | 12 | NodeJS 12\.x | Amazon Linux 2 | [Dockerfile for Node\.js 12\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | -| 10 | NodeJS 10\.x | Amazon Linux 2 | [Dockerfile for Node\.js 10\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs10.x/Dockerfile.nodejs10.x) | Docker Hub repository: amazon/aws\-lambda\-nodejs @@ -47,4 +46,4 @@ npm install aws-lambda-ric For package details, see [Lambda RIC](http://npmjs.com/package/aws-lambda-ric) on the npm website\. -You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. \ No newline at end of file +You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. From b8d8cb99ad742034f01f3c17d6e0e48c883dd26c Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Thu, 2 Sep 2021 15:27:05 -0700 Subject: [PATCH 70/94] Node.js 10.x EOS phase 2 start is now Sept 17th --- doc_source/runtime-support-policy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index 87a4c1ad..b44d706a 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -21,7 +21,7 @@ The following runtimes have reached or are scheduled for end of support: | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Sept 20, 2021 | Oct 20, 2021 | | Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | | Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Aug 30, 2021 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Sept 17, 2021 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | @@ -38,4 +38,4 @@ In almost all cases, the end\-of\-life date of a language version or operating s + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) + **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/doc/devel/release.html) -+ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file ++ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) From b8305f75aa5ea26d5cdd6645b185cfc1996aea52 Mon Sep 17 00:00:00 2001 From: NiumXp <43611165+NiumXp@users.noreply.github.com> Date: Fri, 10 Sep 2021 01:55:18 -0300 Subject: [PATCH 71/94] fix typo in configuration-function-commom.md --- doc_source/configuration-function-common.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md index 72202d40..079c5ac0 100644 --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -1,6 +1,6 @@ # Configuring Lambda function options -After you create a function, you can configure additional capabilities for the function, such as triggers, network acccess, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\. +After you create a function, you can configure additional capabilities for the function, such as triggers, network access, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\. You can also create and edit test events to test your function using the console\. @@ -158,4 +158,4 @@ Saved test events are also available from the **Code** tab, under the **Test** m 1. Choose **Test**\. -1. Expand the **Execution result** panel to display details about the test\. \ No newline at end of file +1. Expand the **Execution result** panel to display details about the test\. From db8b7396901dc07a3377e888359862e072f8a64f Mon Sep 17 00:00:00 2001 From: maxday Date: Thu, 16 Sep 2021 20:43:27 -0400 Subject: [PATCH 72/94] fix incorrect value for maxBytes + add missing comma + format --- doc_source/runtimes-logs-api.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index 82e9c6db..e25263ad 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -79,20 +79,21 @@ The following example shows a request to subscribe to the platform and function ``` PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 -{ "schemaVersion": "2020-08-15", - "types": [ - "platform", - "function" +{ + "schemaVersion": "2020-08-15", + "types": [ + "platform", + "function" ], - "buffering": { - "maxItems": 1000, - "maxBytes": 10240, - "timeoutMs": 100 + "buffering": { + "maxItems": 1000, + "maxBytes": 262144, + "timeoutMs": 100 + }, + "destination": { + "protocol": "HTTP", + "URI": "http://sandbox.localdomain:8080/lambda_logs" } - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox.localdomain:8080/lambda_logs" - } } ``` From 99d79a302a66334721b0abc757265c7f955e4cad Mon Sep 17 00:00:00 2001 From: Michael Roloff Date: Sat, 18 Sep 2021 18:59:57 +0200 Subject: [PATCH 73/94] d --- sample-apps/blank-python/.idea/.gitignore | 8 ++++++++ sample-apps/blank-python/.idea/aws.xml | 17 +++++++++++++++++ sample-apps/blank-python/.idea/blank-python.iml | 8 ++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++++ sample-apps/blank-python/.idea/misc.xml | 4 ++++ sample-apps/blank-python/.idea/modules.xml | 8 ++++++++ sample-apps/blank-python/.idea/vcs.xml | 6 ++++++ sample-apps/blank-python/1-create-bucket.sh | 8 ++++---- 8 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 sample-apps/blank-python/.idea/.gitignore create mode 100644 sample-apps/blank-python/.idea/aws.xml create mode 100644 sample-apps/blank-python/.idea/blank-python.iml create mode 100644 sample-apps/blank-python/.idea/inspectionProfiles/profiles_settings.xml create mode 100644 sample-apps/blank-python/.idea/misc.xml create mode 100644 sample-apps/blank-python/.idea/modules.xml create mode 100644 sample-apps/blank-python/.idea/vcs.xml diff --git a/sample-apps/blank-python/.idea/.gitignore b/sample-apps/blank-python/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/sample-apps/blank-python/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/sample-apps/blank-python/.idea/aws.xml b/sample-apps/blank-python/.idea/aws.xml new file mode 100644 index 00000000..2c4ea32b --- /dev/null +++ b/sample-apps/blank-python/.idea/aws.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/blank-python.iml b/sample-apps/blank-python/.idea/blank-python.iml new file mode 100644 index 00000000..9b31378a --- /dev/null +++ b/sample-apps/blank-python/.idea/blank-python.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/inspectionProfiles/profiles_settings.xml b/sample-apps/blank-python/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/sample-apps/blank-python/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/misc.xml b/sample-apps/blank-python/.idea/misc.xml new file mode 100644 index 00000000..d1e22ecb --- /dev/null +++ b/sample-apps/blank-python/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/modules.xml b/sample-apps/blank-python/.idea/modules.xml new file mode 100644 index 00000000..92f039cd --- /dev/null +++ b/sample-apps/blank-python/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/vcs.xml b/sample-apps/blank-python/.idea/vcs.xml new file mode 100644 index 00000000..b2bdec2d --- /dev/null +++ b/sample-apps/blank-python/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/1-create-bucket.sh b/sample-apps/blank-python/1-create-bucket.sh index 64a5f749..160f00ed 100755 --- a/sample-apps/blank-python/1-create-bucket.sh +++ b/sample-apps/blank-python/1-create-bucket.sh @@ -1,5 +1,5 @@ #!/bin/bash -BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') -BUCKET_NAME=lambda-artifacts-$BUCKET_ID -echo $BUCKET_NAME > bucket-name.txt -aws s3 mb s3://$BUCKET_NAME +# BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') +# BUCKET_NAME=lambda-artifacts-$BUCKET_ID +# echo $BUCKET_NAME > bucket-name.txt +# aws s3 mb s3://$BUCKET_NAME From c70b3a8173d16f46d9f1b6e3e92c1c960282a052 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 20 Sep 2021 17:21:25 +0000 Subject: [PATCH 74/94] Documentation updates --- doc_source/API_AccountLimit.md | 12 +- doc_source/API_AccountUsage.md | 4 +- doc_source/API_AddLayerVersionPermission.md | 34 +- doc_source/API_AddPermission.md | 37 +- doc_source/API_AliasConfiguration.md | 14 +- doc_source/API_AliasRoutingConfiguration.md | 2 +- doc_source/API_AllowedPublishers.md | 2 +- doc_source/API_CodeSigningConfig.md | 16 +- doc_source/API_CodeSigningPolicies.md | 2 +- doc_source/API_Concurrency.md | 4 +- doc_source/API_CreateAlias.md | 36 +- doc_source/API_CreateCodeSigningConfig.md | 18 +- doc_source/API_CreateEventSourceMapping.md | 123 ++--- doc_source/API_CreateFunction.md | 164 +++---- doc_source/API_DeadLetterConfig.md | 2 +- doc_source/API_DeleteAlias.md | 12 +- doc_source/API_DeleteCodeSigningConfig.md | 10 +- doc_source/API_DeleteEventSourceMapping.md | 72 +-- doc_source/API_DeleteFunction.md | 16 +- .../API_DeleteFunctionCodeSigningConfig.md | 14 +- doc_source/API_DeleteFunctionConcurrency.md | 12 +- .../API_DeleteFunctionEventInvokeConfig.md | 16 +- doc_source/API_DeleteLayerVersion.md | 8 +- .../API_DeleteProvisionedConcurrencyConfig.md | 14 +- doc_source/API_DestinationConfig.md | 8 +- doc_source/API_Environment.md | 2 +- doc_source/API_EnvironmentError.md | 4 +- doc_source/API_EnvironmentResponse.md | 6 +- .../API_EventSourceMappingConfiguration.md | 60 +-- doc_source/API_FileSystemConfig.md | 4 +- doc_source/API_FunctionCode.md | 10 +- doc_source/API_FunctionCodeLocation.md | 8 +- doc_source/API_FunctionConfiguration.md | 78 +-- doc_source/API_FunctionEventInvokeConfig.md | 12 +- doc_source/API_GetAccountSettings.md | 12 +- doc_source/API_GetAlias.md | 26 +- doc_source/API_GetCodeSigningConfig.md | 12 +- doc_source/API_GetEventSourceMapping.md | 70 +-- doc_source/API_GetFunction.md | 26 +- .../API_GetFunctionCodeSigningConfig.md | 14 +- doc_source/API_GetFunctionConcurrency.md | 14 +- doc_source/API_GetFunctionConfiguration.md | 94 ++-- .../API_GetFunctionEventInvokeConfig.md | 26 +- doc_source/API_GetLayerVersion.md | 32 +- doc_source/API_GetLayerVersionByArn.md | 30 +- doc_source/API_GetLayerVersionPolicy.md | 18 +- doc_source/API_GetPolicy.md | 16 +- .../API_GetProvisionedConcurrencyConfig.md | 26 +- doc_source/API_ImageConfig.md | 6 +- doc_source/API_ImageConfigError.md | 4 +- doc_source/API_ImageConfigResponse.md | 8 +- doc_source/API_Invoke.md | 78 +-- doc_source/API_InvokeAsync.md | 18 +- doc_source/API_Layer.md | 8 +- doc_source/API_LayerVersionContentInput.md | 8 +- doc_source/API_LayerVersionContentOutput.md | 10 +- doc_source/API_LayerVersionsListItem.md | 14 +- doc_source/API_LayersListItem.md | 8 +- doc_source/API_ListAliases.md | 22 +- doc_source/API_ListCodeSigningConfigs.md | 14 +- doc_source/API_ListEventSourceMappings.md | 22 +- .../API_ListFunctionEventInvokeConfigs.md | 22 +- doc_source/API_ListFunctions.md | 22 +- .../API_ListFunctionsByCodeSigningConfig.md | 16 +- doc_source/API_ListLayerVersions.md | 24 +- doc_source/API_ListLayers.md | 20 +- .../API_ListProvisionedConcurrencyConfigs.md | 20 +- doc_source/API_ListTags.md | 16 +- doc_source/API_ListVersionsByFunction.md | 20 +- doc_source/API_OnFailure.md | 2 +- doc_source/API_OnSuccess.md | 2 +- doc_source/API_Operations.md | 116 ++--- ...PI_ProvisionedConcurrencyConfigListItem.md | 14 +- doc_source/API_PublishLayerVersion.md | 48 +- doc_source/API_PublishVersion.md | 106 ++-- .../API_PutFunctionCodeSigningConfig.md | 20 +- doc_source/API_PutFunctionConcurrency.md | 22 +- .../API_PutFunctionEventInvokeConfig.md | 38 +- .../API_PutProvisionedConcurrencyConfig.md | 28 +- .../API_RemoveLayerVersionPermission.md | 20 +- doc_source/API_RemovePermission.md | 20 +- doc_source/API_SelfManagedEventSource.md | 2 +- doc_source/API_SourceAccessConfiguration.md | 4 +- doc_source/API_TagResource.md | 14 +- doc_source/API_TracingConfig.md | 2 +- doc_source/API_TracingConfigResponse.md | 2 +- doc_source/API_Types.md | 72 +-- doc_source/API_UntagResource.md | 14 +- doc_source/API_UpdateAlias.md | 40 +- doc_source/API_UpdateCodeSigningConfig.md | 22 +- doc_source/API_UpdateEventSourceMapping.md | 109 +++-- doc_source/API_UpdateFunctionCode.md | 118 ++--- doc_source/API_UpdateFunctionConfiguration.md | 150 +++--- .../API_UpdateFunctionEventInvokeConfig.md | 36 +- doc_source/API_VpcConfig.md | 4 +- doc_source/API_VpcConfigResponse.md | 6 +- doc_source/access-control-identity-based.md | 4 +- doc_source/access-control-resource-based.md | 2 +- doc_source/applications-usecases.md | 12 +- doc_source/configuration-aliases.md | 2 +- doc_source/configuration-concurrency.md | 182 +------ doc_source/configuration-envvars.md | 4 +- doc_source/configuration-filesystem.md | 2 +- doc_source/configuration-function-common.md | 19 +- doc_source/configuration-images.md | 2 +- doc_source/configuration-vpc-endpoints.md | 6 +- doc_source/configuration-vpc.md | 4 +- doc_source/csharp-exceptions.md | 2 +- doc_source/csharp-image.md | 14 +- doc_source/csharp-logging.md | 2 +- doc_source/csharp-package-toolkit.md | 5 +- doc_source/csharp-tracing.md | 2 +- doc_source/foundation-progmodel.md | 2 - doc_source/functions-states.md | 42 +- doc_source/gettingstarted-concepts.md | 2 +- doc_source/gettingstarted-features.md | 2 +- doc_source/gettingstarted-images.md | 2 +- doc_source/gettingstarted-limits.md | 59 ++- doc_source/go-image.md | 17 +- doc_source/golang-exceptions.md | 2 +- doc_source/golang-logging.md | 2 +- doc_source/golang-tracing.md | 2 +- doc_source/images-create.md | 4 +- doc_source/index.md | 12 +- doc_source/invocation-async.md | 19 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/invocation-images.md | 6 +- doc_source/java-context.md | 1 - doc_source/java-exceptions.md | 3 +- doc_source/java-handler.md | 1 - doc_source/java-image.md | 15 +- doc_source/java-logging.md | 3 +- doc_source/java-package.md | 2 +- doc_source/java-samples.md | 6 +- doc_source/java-tracing.md | 3 +- doc_source/lambda-api-permissions-ref.md | 2 +- doc_source/lambda-intro-execution-role.md | 4 +- doc_source/lambda-invocation.md | 2 +- doc_source/lambda-java.md | 10 +- doc_source/lambda-nodejs.md | 6 +- doc_source/lambda-python.md | 11 +- doc_source/lambda-releases.md | 8 +- doc_source/lambda-runtimes.md | 9 +- doc_source/lambda-samples.md | 1 - doc_source/lambda-services.md | 2 +- doc_source/monitoring-cloudwatchlogs.md | 10 +- doc_source/monitoring-metrics.md | 4 +- doc_source/nodejs-exceptions.md | 2 +- doc_source/nodejs-handler.md | 2 + doc_source/nodejs-image.md | 14 +- doc_source/nodejs-logging.md | 2 +- doc_source/nodejs-package.md | 2 - doc_source/nodejs-tracing.md | 2 +- doc_source/powershell-exceptions.md | 2 +- doc_source/powershell-logging.md | 2 +- doc_source/provisioned-concurrency.md | 177 +++++++ doc_source/python-context.md | 2 +- doc_source/python-exceptions.md | 4 +- doc_source/python-handler.md | 9 +- doc_source/python-image.md | 18 +- doc_source/python-logging.md | 4 +- doc_source/python-package-create.md | 454 ------------------ doc_source/python-package-update.md | 215 --------- doc_source/python-package.md | 201 +++++++- doc_source/python-tracing.md | 4 +- doc_source/ruby-exceptions.md | 2 +- doc_source/ruby-image.md | 17 +- doc_source/ruby-logging.md | 2 +- doc_source/ruby-package.md | 2 - doc_source/ruby-tracing.md | 2 +- doc_source/runtime-support-policy.md | 4 +- doc_source/runtimes-context.md | 2 +- doc_source/runtimes-custom.md | 2 - doc_source/runtimes-extensions-api.md | 3 +- doc_source/runtimes-images.md | 2 +- doc_source/runtimes-modify.md | 1 + doc_source/samples-blank.md | 12 +- doc_source/samples-errorprocessor.md | 10 +- doc_source/samples-listmanager.md | 8 +- doc_source/security-dataprotection.md | 4 +- doc_source/security-iam.md | 2 +- doc_source/security-infrastructure.md | 2 +- doc_source/security-resilience.md | 4 +- doc_source/services-alexa.md | 3 +- doc_source/services-apigateway-blueprint.md | 29 +- .../services-cloudwatchevents-tutorial.md | 2 +- doc_source/services-cloudwatchevents.md | 3 + doc_source/services-ec2-tutorial.md | 6 - doc_source/services-s3-object-lambda.md | 5 + doc_source/services-xray.md | 8 +- doc_source/troubleshooting-images.md | 2 +- doc_source/troubleshooting-invocation.md | 6 +- doc_source/using-extensions.md | 3 +- doc_source/with-android-example.md | 2 - doc_source/with-ddb.md | 16 +- doc_source/with-kafka.md | 58 ++- doc_source/with-kinesis-example.md | 4 +- doc_source/with-kinesis.md | 16 +- doc_source/with-mq.md | 10 +- doc_source/with-msk.md | 50 +- doc_source/with-sns-example.md | 2 +- doc_source/with-sqs-example.md | 60 +-- doc_source/with-sqs.md | 10 +- 203 files changed, 2158 insertions(+), 2539 deletions(-) create mode 100644 doc_source/provisioned-concurrency.md delete mode 100644 doc_source/python-package-create.md delete mode 100644 doc_source/python-package-update.md create mode 100644 doc_source/services-s3-object-lambda.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md index be2309f9..8f1ca0c8 100644 --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -4,28 +4,28 @@ Limits that are related to concurrency and storage\. All file and storage sizes ## Contents - **CodeSizeUnzipped** + ** CodeSizeUnzipped ** The maximum size of a function's deployment package and layers when they're extracted\. Type: Long Required: No - **CodeSizeZipped** + ** CodeSizeZipped ** The maximum size of a deployment package when it's uploaded directly to Lambda\. Use Amazon S3 for larger files\. Type: Long Required: No - **ConcurrentExecutions** + ** ConcurrentExecutions ** The maximum number of simultaneous function executions\. Type: Integer Required: No - **TotalCodeSize** + ** TotalCodeSize ** The amount of storage space that you can use for all deployment packages and layer archives\. Type: Long Required: No - **UnreservedConcurrentExecutions** -The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. + ** UnreservedConcurrentExecutions ** +The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. Type: Integer Valid Range: Minimum value of 0\. Required: No diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md index aab1e7ab..d316b7b8 100644 --- a/doc_source/API_AccountUsage.md +++ b/doc_source/API_AccountUsage.md @@ -4,12 +4,12 @@ The number of functions and amount of storage in use\. ## Contents - **FunctionCount** + ** FunctionCount ** The number of Lambda functions\. Type: Long Required: No - **TotalCodeSize** + ** TotalCodeSize ** The amount of storage space, in bytes, that's being used by deployment packages and layer archives\. Type: Long Required: No diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index 2a0fa673..f06b3e02 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -2,7 +2,7 @@ Adds permissions to the resource\-based policy of a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. -To revoke permission, call [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. +To revoke permission, call [ RemoveLayerVersionPermission ](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. ## Request Syntax @@ -22,16 +22,16 @@ Content-type: application/json The request uses the following URI parameters\. - ** [LayerName](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ LayerName ](#API_AddLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [RevisionId](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ RevisionId ](#API_AddLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [VersionNumber](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ VersionNumber ](#API_AddLayerVersionPermission_RequestSyntax) ** The version number\. Required: Yes @@ -39,27 +39,27 @@ Required: Yes The request accepts the following data in JSON format\. - ** [Action](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ Action ](#API_AddLayerVersionPermission_RequestSyntax) ** The API action that grants access to the layer\. For example, `lambda:GetLayerVersion`\. Type: String Length Constraints: Maximum length of 22\. Pattern: `lambda:GetLayerVersion` Required: Yes - ** [OrganizationId](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ OrganizationId ](#API_AddLayerVersionPermission_RequestSyntax) ** With the principal set to `*`, grant permission to all accounts in the specified organization\. Type: String Length Constraints: Maximum length of 34\. Pattern: `o-[a-z0-9]{10,32}` Required: No - ** [Principal](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ Principal ](#API_AddLayerVersionPermission_RequestSyntax) ** An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts \(if `organizationId` is not specified\)\. For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer\. Type: String Pattern: `\d{12}|\*|arn:(aws[a-zA-Z-]*):iam::\d{12}:root` Required: Yes - ** [StatementId](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ StatementId ](#API_AddLayerVersionPermission_RequestSyntax) ** An identifier that distinguishes the policy from others on the same layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 100\. @@ -84,41 +84,41 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [RevisionId](#API_AddLayerVersionPermission_ResponseSyntax) ** + ** [ RevisionId ](#API_AddLayerVersionPermission_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String - ** [Statement](#API_AddLayerVersionPermission_ResponseSyntax) ** + ** [ Statement ](#API_AddLayerVersionPermission_ResponseSyntax) ** The permission statement\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PolicyLengthExceededException** + ** PolicyLengthExceededException ** The permissions policy for the resource is too large\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) HTTP Status Code: 400 - **PreconditionFailedException** + ** 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** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index a0852996..4889c9d4 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -1,6 +1,6 @@ # AddPermission -Grants an AWS service or another account permission to use a function\. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias\. If you use a qualifier, the invoker must use the full Amazon Resource Name \(ARN\) of that version or alias to invoke the function\. +Grants an AWS service or another account permission to use a function\. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias\. If you use a qualifier, the invoker must use the full Amazon Resource Name \(ARN\) of that version or alias to invoke the function\. Note: Lambda does not support adding policies to version $LATEST\. To grant permission to another account, specify the account ID as the `Principal`\. For AWS services, the principal is a domain\-style identifier defined by the service, like `s3.amazonaws.com` or `sns.amazonaws.com`\. For AWS services, you can also specify the ARN of the associated resource as the `SourceArn`\. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function\. @@ -27,7 +27,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_AddPermission_RequestSyntax) ** + ** [ FunctionName ](#API_AddPermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -39,7 +39,7 @@ 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 - ** [Qualifier](#API_AddPermission_RequestSyntax) ** + ** [ Qualifier ](#API_AddPermission_RequestSyntax) ** Specify a version or alias to add permissions to a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -48,44 +48,45 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [Action](#API_AddPermission_RequestSyntax) ** + ** [ Action ](#API_AddPermission_RequestSyntax) ** The action that the principal can use on the function\. For example, `lambda:InvokeFunction` or `lambda:GetFunction`\. Type: String Pattern: `(lambda:[*]|lambda:[a-zA-Z]+|[*])` Required: Yes - ** [EventSourceToken](#API_AddPermission_RequestSyntax) ** + ** [ EventSourceToken ](#API_AddPermission_RequestSyntax) ** For Alexa Smart Home functions, a token that must be supplied by the invoker\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Pattern: `[a-zA-Z0-9._\-]+` Required: No - ** [Principal](#API_AddPermission_RequestSyntax) ** + ** [ Principal ](#API_AddPermission_RequestSyntax) ** The AWS service or account that invokes the function\. If you specify a service, use `SourceArn` or `SourceAccount` to limit who can invoke the function through that service\. Type: String Pattern: `[^\s]+` Required: Yes - ** [RevisionId](#API_AddPermission_RequestSyntax) ** + ** [ RevisionId ](#API_AddPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. Type: String Required: No - ** [SourceAccount](#API_AddPermission_RequestSyntax) ** + ** [ SourceAccount ](#API_AddPermission_RequestSyntax) ** For Amazon S3, the ID of the account that owns the resource\. Use this together with `SourceArn` to ensure that the resource is owned by the specified account\. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account\. Type: String Length Constraints: Maximum length of 12\. Pattern: `\d{12}` Required: No - ** [SourceArn](#API_AddPermission_RequestSyntax) ** + ** [ SourceArn ](#API_AddPermission_RequestSyntax) ** For AWS services, the ARN of the AWS resource that invokes the function\. For example, an Amazon S3 bucket or Amazon SNS topic\. +Note that Lambda configures the comparison using the `StringLike` operator\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - ** [StatementId](#API_AddPermission_RequestSyntax) ** + ** [ StatementId ](#API_AddPermission_RequestSyntax) ** A statement identifier that differentiates the statement from others in the same policy\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 100\. @@ -109,37 +110,37 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [Statement](#API_AddPermission_ResponseSyntax) ** + ** [ Statement ](#API_AddPermission_ResponseSyntax) ** The permission statement that's added to the function policy\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PolicyLengthExceededException** + ** PolicyLengthExceededException ** The permissions policy for the resource is too large\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) HTTP Status Code: 400 - **PreconditionFailedException** + ** 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** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md index 53569649..13d6487b 100644 --- a/doc_source/API_AliasConfiguration.md +++ b/doc_source/API_AliasConfiguration.md @@ -4,40 +4,40 @@ Provides configuration information about a Lambda function [alias](https://docs. ## Contents - **AliasArn** + ** AliasArn ** The Amazon Resource Name \(ARN\) of the alias\. 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-_]+))?` Required: No - **Description** + ** Description ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - **FunctionVersion** + ** FunctionVersion ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: No - **Name** + ** Name ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` Required: No - **RevisionId** + ** RevisionId ** A unique identifier that changes when you update the alias\. Type: String Required: No - **RoutingConfig** + ** RoutingConfig ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object Required: No ## See Also diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md index 3bbc94a7..8eab8c2a 100644 --- a/doc_source/API_AliasRoutingConfiguration.md +++ b/doc_source/API_AliasRoutingConfiguration.md @@ -4,7 +4,7 @@ The [traffic\-shifting](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traf ## Contents - **AdditionalVersionWeights** + ** AdditionalVersionWeights ** The second version, and the percentage of traffic that's routed to it\. Type: String to double map Key Length Constraints: Minimum length of 1\. Maximum length of 1024\. diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md index d4de5f7f..1060d3b2 100644 --- a/doc_source/API_AllowedPublishers.md +++ b/doc_source/API_AllowedPublishers.md @@ -4,7 +4,7 @@ List of signing profiles that can sign a code package\. ## Contents - **SigningProfileVersionArns** + ** SigningProfileVersionArns ** The Amazon Resource Name \(ARN\) for each of the signing profiles\. A signing profile defines a trusted user who can sign a code package\. Type: Array of strings Array Members: Minimum number of 1 item\. Maximum number of 20 items\. diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md index 9f2849ef..10c2381f 100644 --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -4,36 +4,36 @@ Details about a [Code signing configuration](https://docs.aws.amazon.com/lambda/ ## Contents - **AllowedPublishers** + ** AllowedPublishers ** List of allowed publishers\. -Type: [AllowedPublishers](API_AllowedPublishers.md) object +Type: [ AllowedPublishers ](API_AllowedPublishers.md) object Required: Yes - **CodeSigningConfigArn** + ** CodeSigningConfigArn ** The Amazon Resource Name \(ARN\) of the Code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: Yes - **CodeSigningConfigId** + ** CodeSigningConfigId ** Unique identifer for the Code signing configuration\. Type: String Pattern: `csc-[a-zA-Z0-9-_\.]{17}` Required: Yes - **CodeSigningPolicies** + ** CodeSigningPolicies ** The code signing policy controls the validation failure action for signature mismatch or expiry\. -Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object +Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object Required: Yes - **Description** + ** Description ** Code signing configuration description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - **LastModified** + ** LastModified ** The date and time that the Code signing configuration was last modified, in ISO\-8601 format \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String Required: Yes diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md index 589a046c..fdeb3b45 100644 --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -4,7 +4,7 @@ Code signing configuration [policies](https://docs.aws.amazon.com/lambda/latest/ ## Contents - **UntrustedArtifactOnDeployment** + ** UntrustedArtifactOnDeployment ** Code signing configuration policy for deployment validation failure\. If you set the policy to `Enforce`, Lambda blocks the deployment request if signature validation checks fail\. If you set the policy to `Warn`, Lambda allows the deployment and creates a CloudWatch log\. Default value: `Warn` Type: String diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md index c1339bf1..b9c53c9d 100644 --- a/doc_source/API_Concurrency.md +++ b/doc_source/API_Concurrency.md @@ -2,8 +2,8 @@ ## Contents - **ReservedConcurrentExecutions** -The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. + ** ReservedConcurrentExecutions ** +The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. Type: Integer Valid Range: Minimum value of 0\. Required: No diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md index a8976da5..710f21c9 100644 --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -26,7 +26,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_CreateAlias_RequestSyntax) ** + ** [ FunctionName ](#API_CreateAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -42,29 +42,29 @@ Required: Yes The request accepts the following data in JSON format\. - ** [Description](#API_CreateAlias_RequestSyntax) ** + ** [ Description ](#API_CreateAlias_RequestSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [FunctionVersion](#API_CreateAlias_RequestSyntax) ** + ** [ FunctionVersion ](#API_CreateAlias_RequestSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: Yes - ** [Name](#API_CreateAlias_RequestSyntax) ** + ** [ Name ](#API_CreateAlias_RequestSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` Required: Yes - ** [RoutingConfig](#API_CreateAlias_RequestSyntax) ** + ** [ RoutingConfig ](#API_CreateAlias_RequestSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object Required: No ## Response Syntax @@ -93,55 +93,55 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [AliasArn](#API_CreateAlias_ResponseSyntax) ** + ** [ AliasArn ](#API_CreateAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. 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-_]+))?` - ** [Description](#API_CreateAlias_ResponseSyntax) ** + ** [ Description ](#API_CreateAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [FunctionVersion](#API_CreateAlias_ResponseSyntax) ** + ** [ FunctionVersion ](#API_CreateAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [Name](#API_CreateAlias_ResponseSyntax) ** + ** [ Name ](#API_CreateAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [RevisionId](#API_CreateAlias_ResponseSyntax) ** + ** [ RevisionId ](#API_CreateAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [RoutingConfig](#API_CreateAlias_ResponseSyntax) ** + ** [ RoutingConfig ](#API_CreateAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md index 1e35f971..eaa6639a 100644 --- a/doc_source/API_CreateCodeSigningConfig.md +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -27,17 +27,17 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [AllowedPublishers](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [ AllowedPublishers ](#API_CreateCodeSigningConfig_RequestSyntax) ** Signing profiles for this code signing configuration\. -Type: [AllowedPublishers](API_AllowedPublishers.md) object +Type: [ AllowedPublishers ](API_AllowedPublishers.md) object Required: Yes - ** [CodeSigningPolicies](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningPolicies ](#API_CreateCodeSigningConfig_RequestSyntax) ** The code signing policies define the actions to take if the validation checks fail\. -Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object +Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object Required: No - ** [Description](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [ Description ](#API_CreateCodeSigningConfig_RequestSyntax) ** Descriptive name for this code signing configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. @@ -71,17 +71,17 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfig](#API_CreateCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfig ](#API_CreateCodeSigningConfig_ResponseSyntax) ** The code signing configuration\. -Type: [CodeSigningConfig](API_CodeSigningConfig.md) object +Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 697e4ca8..c16ceb8e 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -2,10 +2,10 @@ Creates a mapping between an event source and an AWS Lambda function\. Lambda reads items from the event source and triggers the function\. -For details about each event source type, see the following topics\. In particular, each of the topics describes the required and optional parameters for the specific event source\. +For details about each event source type, see the following topics\. + [ Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) + [ Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) -+ [ Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) ++ [ Configuring an Amazon SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) + [ Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) + [ Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) + [ Configuring Self\-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) @@ -69,8 +69,8 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [BatchSize](#API_CreateEventSourceMapping_RequestSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_CreateEventSourceMapping_RequestSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. @@ -80,22 +80,23 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No - ** [DestinationConfig](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ DestinationConfig ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - ** [Enabled](#API_CreateEventSourceMapping_RequestSyntax) ** -If true, the event source mapping is active\. Set to false to pause polling and invocation\. + ** [ Enabled ](#API_CreateEventSourceMapping_RequestSyntax) ** +When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. +Default: True Type: Boolean Required: No - ** [EventSourceArn](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ EventSourceArn ](#API_CreateEventSourceMapping_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. @@ -105,7 +106,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ FunctionName ](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -119,38 +120,40 @@ 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 - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ FunctionResponseTypes ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. + ** [ MaximumBatchingWindowInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ MaximumRetryAttempts ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - ** [ParallelizationFactor](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ ParallelizationFactor ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - ** [Queues](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ Queues ](#API_CreateEventSourceMapping_RequestSyntax) ** \(MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -158,29 +161,29 @@ Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` Required: No - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ SelfManagedEventSource ](#API_CreateEventSourceMapping_RequestSyntax) ** The Self\-Managed Apache Kafka cluster to send records\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object Required: No - ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ SourceAccessConfigurations ](#API_CreateEventSourceMapping_RequestSyntax) ** An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ StartingPosition ](#API_CreateEventSourceMapping_RequestSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No - ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ StartingPositionTimestamp ](#API_CreateEventSourceMapping_RequestSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp Required: No - ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ Topics ](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -188,7 +191,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ TumblingWindowInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. @@ -248,131 +251,135 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [BatchSize](#API_CreateEventSourceMapping_ResponseSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_CreateEventSourceMapping_ResponseSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [DestinationConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ DestinationConfig ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [EventSourceArn](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ EventSourceArn ](#API_CreateEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionArn](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ FunctionArn ](#API_CreateEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda 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-_]+))?` - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ FunctionResponseTypes ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ LastModified ](#API_CreateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [LastProcessingResult](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ LastProcessingResult ](#API_CreateEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** [ MaximumBatchingWindowInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ ParallelizationFactor ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [Queues](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ Queues ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ SelfManagedEventSource ](#API_CreateEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ SourceAccessConfigurations ](#API_CreateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ StartingPosition ](#API_CreateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ StartingPositionTimestamp ](#API_CreateEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ State ](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [StateTransitionReason](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ StateTransitionReason ](#API_CreateEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ Topics ](#API_CreateEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ TumblingWindowInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ UUID ](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index e64d96e1..45fcf6b0 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -6,17 +6,17 @@ You set the package type to `Image` if the deployment package is a [container im You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. -When you create 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 or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. +When you create 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 or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. A function has an unpublished version, and can have published versions and aliases\. The unpublished version changes when you update your function's code and configuration\. A published version is a snapshot of your function code and configuration that can't be changed\. An alias is a named resource that maps to a version, and can be changed to map to a different version\. Use the `Publish` parameter to create version `1` of your function from its initial configuration\. -The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. +The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([ TagResource ](API_TagResource.md)\) and per\-function concurrency limits \([ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\)\. -You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. +You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [ UpdateFunctionCode ](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. -If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. +If another account or an AWS service invokes your function, use [ AddPermission ](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. -To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. +To invoke your function directly, use [ Invoke ](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([ CreateEventSourceMapping ](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. ## Request Syntax @@ -84,41 +84,41 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [Code](#API_CreateFunction_RequestSyntax) ** + ** [ Code ](#API_CreateFunction_RequestSyntax) ** The code for the function\. -Type: [FunctionCode](API_FunctionCode.md) object +Type: [ FunctionCode ](API_FunctionCode.md) object Required: Yes - ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_CreateFunction_RequestSyntax) ** To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: No - ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** + ** [ DeadLetterConfig ](#API_CreateFunction_RequestSyntax) ** 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 +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object Required: No - ** [Description](#API_CreateFunction_RequestSyntax) ** + ** [ Description ](#API_CreateFunction_RequestSyntax) ** A description of the function\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [Environment](#API_CreateFunction_RequestSyntax) ** + ** [ Environment ](#API_CreateFunction_RequestSyntax) ** Environment variables that are accessible from function code during execution\. -Type: [Environment](API_Environment.md) object +Type: [ Environment ](API_Environment.md) object Required: No - ** [FileSystemConfigs](#API_CreateFunction_RequestSyntax) ** + ** [ FileSystemConfigs ](#API_CreateFunction_RequestSyntax) ** Connection settings for an Amazon EFS file system\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - ** [FunctionName](#API_CreateFunction_RequestSyntax) ** + ** [ FunctionName ](#API_CreateFunction_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -131,79 +131,79 @@ 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 - ** [Handler](#API_CreateFunction_RequestSyntax) ** + ** [ Handler ](#API_CreateFunction_RequestSyntax) ** 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 - ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** + ** [ ImageConfig ](#API_CreateFunction_RequestSyntax) ** Container image [configuration values](https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-settings) that override the values in the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object +Type: [ ImageConfig ](API_ImageConfig.md) object Required: No - ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** + ** [ KMSKeyArn ](#API_CreateFunction_RequestSyntax) ** 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_CreateFunction_RequestSyntax) ** + ** [ Layers ](#API_CreateFunction_RequestSyntax) ** 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\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` Required: No - ** [MemorySize](#API_CreateFunction_RequestSyntax) ** + ** [ MemorySize ](#API_CreateFunction_RequestSyntax) ** The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - ** [PackageType](#API_CreateFunction_RequestSyntax) ** + ** [ PackageType ](#API_CreateFunction_RequestSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. Type: String Valid Values:` Zip | Image` Required: No - ** [Publish](#API_CreateFunction_RequestSyntax) ** + ** [ Publish ](#API_CreateFunction_RequestSyntax) ** Set to true to publish the first version of the function during creation\. Type: Boolean Required: No - ** [Role](#API_CreateFunction_RequestSyntax) ** + ** [ Role ](#API_CreateFunction_RequestSyntax) ** 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: Yes - ** [Runtime](#API_CreateFunction_RequestSyntax) ** + ** [ Runtime ](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [Tags](#API_CreateFunction_RequestSyntax) ** + ** [ Tags ](#API_CreateFunction_RequestSyntax) ** A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. Type: String to string map Required: No - ** [Timeout](#API_CreateFunction_RequestSyntax) ** -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\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. + ** [ Timeout ](#API_CreateFunction_RequestSyntax) ** +The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No - ** [TracingConfig](#API_CreateFunction_RequestSyntax) ** + ** [ TracingConfig ](#API_CreateFunction_RequestSyntax) ** Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [TracingConfig](API_TracingConfig.md) object +Type: [ TracingConfig ](API_TracingConfig.md) object Required: No - ** [VpcConfig](#API_CreateFunction_RequestSyntax) ** + ** [ VpcConfig ](#API_CreateFunction_RequestSyntax) ** 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 +Type: [ VpcConfig ](API_VpcConfig.md) object Required: No ## Response Syntax @@ -291,187 +291,187 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [CodeSha256](#API_CreateFunction_ResponseSyntax) ** + ** [ CodeSha256 ](#API_CreateFunction_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_CreateFunction_ResponseSyntax) ** + ** [ CodeSize ](#API_CreateFunction_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_CreateFunction_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_CreateFunction_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_CreateFunction_ResponseSyntax) ** + ** [ Description ](#API_CreateFunction_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_CreateFunction_ResponseSyntax) ** + ** [ Environment ](#API_CreateFunction_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_CreateFunction_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_CreateFunction_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_CreateFunction_ResponseSyntax) ** + ** [ FunctionArn ](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [ FunctionName ](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [ Handler ](#API_CreateFunction_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_CreateFunction_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [ LastModified ](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [ LastUpdateStatus ](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [ LastUpdateStatusReason ](#API_CreateFunction_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_CreateFunction_ResponseSyntax) ** + ** [ Layers ](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_CreateFunction_ResponseSyntax) ** + ** [ MasterArn ](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [ MemorySize ](#API_CreateFunction_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_CreateFunction_ResponseSyntax) ** + ** [ PackageType ](#API_CreateFunction_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** + ** [ RevisionId ](#API_CreateFunction_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_CreateFunction_ResponseSyntax) ** + ** [ Role ](#API_CreateFunction_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [Runtime](#API_CreateFunction_ResponseSyntax) ** + ** [ Runtime ](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** + ** [ SigningJobArn ](#API_CreateFunction_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_CreateFunction_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_CreateFunction_ResponseSyntax) ** + ** [ State ](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [ StateReason ](#API_CreateFunction_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** + ** [ StateReasonCode ](#API_CreateFunction_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_CreateFunction_ResponseSyntax) ** + ** [ Timeout ](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [ TracingConfig ](#API_CreateFunction_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_CreateFunction_ResponseSyntax) ** + ** [ Version ](#API_CreateFunction_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [VpcConfig](#API_CreateFunction_ResponseSyntax) ** + ** [ VpcConfig ](#API_CreateFunction_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **CodeStorageExceededException** + ** 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 - **CodeVerificationFailedException** + ** CodeVerificationFailedException ** The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. HTTP Status Code: 400 - **InvalidCodeSignatureException** + ** InvalidCodeSignatureException ** The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md index 8f8df1e7..472781c8 100644 --- a/doc_source/API_DeadLetterConfig.md +++ b/doc_source/API_DeadLetterConfig.md @@ -4,7 +4,7 @@ The [dead\-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation ## Contents - **TargetArn** + ** TargetArn ** The Amazon Resource Name \(ARN\) of an Amazon SQS queue or Amazon SNS topic\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md index 95780d00..a2009314 100644 --- a/doc_source/API_DeleteAlias.md +++ b/doc_source/API_DeleteAlias.md @@ -12,7 +12,7 @@ DELETE /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteAlias_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ 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 - ** [Name](#API_DeleteAlias_RequestSyntax) ** + ** [ Name ](#API_DeleteAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -46,19 +46,19 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md index fe427fa2..4736a717 100644 --- a/doc_source/API_DeleteCodeSigningConfig.md +++ b/doc_source/API_DeleteCodeSigningConfig.md @@ -12,7 +12,7 @@ DELETE /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 The request uses the following URI parameters\. - ** [CodeSigningConfigArn](#API_DeleteCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_DeleteCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -34,19 +34,19 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index c3e55997..614c5471 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -1,6 +1,6 @@ # DeleteEventSourceMapping -Deletes an [event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html)\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. +Deletes an [event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html)\. You can get the identifier of a mapping from the output of [ ListEventSourceMappings ](API_ListEventSourceMappings.md)\. When you delete an event source mapping, it enters a `Deleting` state and might not be completely deleted for several seconds\. @@ -14,7 +14,7 @@ DELETE /2015-03-31/event-source-mappings/UUID HTTP/1.1 The request uses the following URI parameters\. - ** [UUID](#API_DeleteEventSourceMapping_RequestSyntax) ** + ** [ UUID ](#API_DeleteEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -76,131 +76,135 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [BatchSize](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_DeleteEventSourceMapping_ResponseSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [BisectBatchOnFunctionError](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [DestinationConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ DestinationConfig ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [EventSourceArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ EventSourceArn ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ FunctionArn ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda 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-_]+))?` - ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ FunctionResponseTypes ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ LastModified ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [LastProcessingResult](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ LastProcessingResult ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** [ MaximumBatchingWindowInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ ParallelizationFactor ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [Queues](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ Queues ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ SelfManagedEventSource ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ SourceAccessConfigurations ](#API_DeleteEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ StartingPosition ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ StartingPositionTimestamp ](#API_DeleteEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ State ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [StateTransitionReason](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ StateTransitionReason ](#API_DeleteEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ Topics ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ TumblingWindowInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ UUID ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceInUseException** + ** ResourceInUseException ** The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md index be3e5628..2b753d6f 100644 --- a/doc_source/API_DeleteFunction.md +++ b/doc_source/API_DeleteFunction.md @@ -2,7 +2,7 @@ Deletes a Lambda function\. To delete a specific function version, use the `Qualifier` parameter\. Otherwise, all versions and aliases are deleted\. -To delete Lambda event source mappings that invoke a function, use [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md)\. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it\. +To delete Lambda event source mappings that invoke a function, use [ DeleteEventSourceMapping ](API_DeleteEventSourceMapping.md)\. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it\. ## Request Syntax @@ -14,7 +14,7 @@ DELETE /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteFunction_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteFunction_RequestSyntax) ** The name of the Lambda function or version\. **Name formats** @@ -26,7 +26,7 @@ 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 - ** [Qualifier](#API_DeleteFunction_RequestSyntax) ** + ** [ Qualifier ](#API_DeleteFunction_RequestSyntax) ** Specify a version to delete\. You can't delete a version that's referenced by an alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -47,23 +47,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md index f6953190..140631dd 100644 --- a/doc_source/API_DeleteFunctionCodeSigningConfig.md +++ b/doc_source/API_DeleteFunctionCodeSigningConfig.md @@ -12,7 +12,7 @@ DELETE /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -40,27 +40,27 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md index 44efacac..a5d54266 100644 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ b/doc_source/API_DeleteFunctionConcurrency.md @@ -12,7 +12,7 @@ DELETE /2017-10-31/functions/FunctionName/concurrency HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteFunctionConcurrency_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -40,23 +40,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md index c326c4a8..8ae03cdb 100644 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Deletes the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ DELETE /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifie The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ 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 - ** [Qualifier](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** + ** [ Qualifier ](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -47,23 +47,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md index 9e60611c..7b64f0e2 100644 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -12,13 +12,13 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 The request uses the following URI parameters\. - ** [LayerName](#API_DeleteLayerVersion_RequestSyntax) ** + ** [ LayerName ](#API_DeleteLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [VersionNumber](#API_DeleteLayerVersion_RequestSyntax) ** + ** [ VersionNumber ](#API_DeleteLayerVersion_RequestSyntax) ** The version number\. Required: Yes @@ -38,11 +38,11 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md index 43d7413c..3bbd703f 100644 --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ b/doc_source/API_DeleteProvisionedConcurrencyConfig.md @@ -12,7 +12,7 @@ DELETE /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qual The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ 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 - ** [Qualifier](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ Qualifier ](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -46,23 +46,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md index cbd7d1ce..a0fb8fc5 100644 --- a/doc_source/API_DestinationConfig.md +++ b/doc_source/API_DestinationConfig.md @@ -4,14 +4,14 @@ A configuration object that specifies the destination of an event after Lambda p ## Contents - **OnFailure** + ** OnFailure ** The destination configuration for failed invocations\. -Type: [OnFailure](API_OnFailure.md) object +Type: [ OnFailure ](API_OnFailure.md) object Required: No - **OnSuccess** + ** OnSuccess ** The destination configuration for successful invocations\. -Type: [OnSuccess](API_OnSuccess.md) object +Type: [ OnSuccess ](API_OnSuccess.md) object Required: No ## See Also diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md index 2e4a1fa9..0c18270f 100644 --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -4,7 +4,7 @@ A function's environment variable settings\. You can use environment variables t ## Contents - **Variables** + ** Variables ** Environment variable key\-value pairs\. For more information, see [Using Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: String to string map Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md index 64090a24..1532e16f 100644 --- a/doc_source/API_EnvironmentError.md +++ b/doc_source/API_EnvironmentError.md @@ -4,12 +4,12 @@ Error messages for environment variables that couldn't be applied\. ## Contents - **ErrorCode** + ** ErrorCode ** The error code\. Type: String Required: No - **Message** + ** Message ** The error message\. Type: String Required: No diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md index d1aac97f..f1dadee3 100644 --- a/doc_source/API_EnvironmentResponse.md +++ b/doc_source/API_EnvironmentResponse.md @@ -4,12 +4,12 @@ The results of an operation to update or read environment variables\. If the ope ## Contents - **Error** + ** Error ** Error messages for environment variables that couldn't be applied\. -Type: [EnvironmentError](API_EnvironmentError.md) object +Type: [ EnvironmentError ](API_EnvironmentError.md) object Required: No - **Variables** + ** Variables ** Environment variable key\-value pairs\. Type: String to string map Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 1eb5193e..6303741e 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -1,79 +1,83 @@ # EventSourceMappingConfiguration -A mapping between an AWS resource and a Lambda function\. For details, see [CreateEventSourceMapping](API_CreateEventSourceMapping.md)\. +A mapping between an AWS resource and a Lambda function\. For details, see [ CreateEventSourceMapping ](API_CreateEventSourceMapping.md)\. ## Contents - **BatchSize** -The maximum number of items to retrieve in a single batch\. + ** BatchSize ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - **BisectBatchOnFunctionError** + ** BisectBatchOnFunctionError ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean Required: No - **DestinationConfig** + ** DestinationConfig ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - **EventSourceArn** + ** EventSourceArn ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - **FunctionArn** + ** FunctionArn ** The ARN of the Lambda 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-_]+))?` Required: No - **FunctionResponseTypes** + ** FunctionResponseTypes ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - **LastModified** + ** LastModified ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp Required: No - **LastProcessingResult** + ** LastProcessingResult ** The result of the last Lambda invocation of your function\. Type: String Required: No - **MaximumBatchingWindowInSeconds** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** MaximumBatchingWindowInSeconds ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - **MaximumRecordAgeInSeconds** + ** MaximumRecordAgeInSeconds ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - **MaximumRetryAttempts** + ** MaximumRetryAttempts ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - **ParallelizationFactor** + ** ParallelizationFactor ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - **Queues** + ** Queues ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -81,39 +85,39 @@ Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` Required: No - **SelfManagedEventSource** + ** SelfManagedEventSource ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object Required: No - **SourceAccessConfigurations** + ** SourceAccessConfigurations ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - **StartingPosition** + ** StartingPosition ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No - **StartingPositionTimestamp** + ** StartingPositionTimestamp ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp Required: No - **State** + ** State ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String Required: No - **StateTransitionReason** + ** StateTransitionReason ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String Required: No - **Topics** + ** Topics ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -121,13 +125,13 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No - **TumblingWindowInSeconds** + ** TumblingWindowInSeconds ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No - **UUID** + ** UUID ** The identifier of the event source mapping\. Type: String Required: No diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md index bbd04dfc..9c5257df 100644 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -4,14 +4,14 @@ Details about the connection between a Lambda function and an [Amazon EFS file s ## Contents - **Arn** + ** Arn ** The Amazon Resource Name \(ARN\) of the Amazon EFS access point that provides access to the file system\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:aws[a-zA-Z-]*:elasticfilesystem:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:access-point/fsap-[a-f0-9]{17}` Required: Yes - **LocalMountPath** + ** LocalMountPath ** The path where the function can access the file system, starting with `/mnt/`\. Type: String Length Constraints: Maximum length of 160\. diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index df9dc97b..0a3dfa0f 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -4,31 +4,31 @@ The code for the Lambda function\. You can specify either an object in Amazon S3 ## Contents - **ImageUri** + ** ImageUri ** URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry\. Type: String Required: No - **S3Bucket** + ** S3Bucket ** 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\.\-_]*(? + ** S3Key ** The Amazon S3 key of the deployment package\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - **S3ObjectVersion** + ** S3ObjectVersion ** 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** + ** ZipFile ** 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 diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md index 05f28abb..d21a8936 100644 --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -4,22 +4,22 @@ Details about a function's deployment package\. ## Contents - **ImageUri** + ** ImageUri ** URI of a container image in the Amazon ECR registry\. Type: String Required: No - **Location** + ** Location ** A presigned URL that you can use to download the deployment package\. Type: String Required: No - **RepositoryType** + ** RepositoryType ** The service that's hosting the file\. Type: String Required: No - **ResolvedImageUri** + ** ResolvedImageUri ** The resolved URI for the image\. Type: String Required: No diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 72a0cd26..3f9d6178 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -4,181 +4,181 @@ Details about a function's configuration\. ## Contents - **CodeSha256** + ** CodeSha256 ** The SHA256 hash of the function's deployment package\. Type: String Required: No - **CodeSize** + ** CodeSize ** The size of the function's deployment package, in bytes\. Type: Long Required: No - **DeadLetterConfig** + ** DeadLetterConfig ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object Required: No - **Description** + ** Description ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - **Environment** + ** Environment ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object Required: No - **FileSystemConfigs** + ** FileSystemConfigs ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - **FunctionArn** + ** FunctionArn ** 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-_]+))?` Required: No - **FunctionName** + ** FunctionName ** 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-_]+))?` Required: No - **Handler** + ** Handler ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` Required: No - **ImageConfigResponse** + ** ImageConfigResponse ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object Required: No - **KMSKeyArn** + ** KMSKeyArn ** 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-.]+:.*)|()` Required: No - **LastModified** + ** LastModified ** 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 Required: No - **LastUpdateStatus** + ** LastUpdateStatus ** 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` Required: No - **LastUpdateStatusReason** + ** LastUpdateStatusReason ** The reason for the last update that was performed on the function\. Type: String Required: No - **LastUpdateStatusReasonCode** + ** LastUpdateStatusReasonCode ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No - **Layers** + ** Layers ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects Required: No - **MasterArn** + ** MasterArn ** 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-_]+))?` Required: No - **MemorySize** + ** MemorySize ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - **PackageType** + ** PackageType ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` Required: No - **RevisionId** + ** RevisionId ** The latest updated revision of the function or alias\. Type: String Required: No - **Role** + ** Role ** 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** + ** Runtime ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - **SigningJobArn** + ** SigningJobArn ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - **SigningProfileVersionArn** + ** SigningProfileVersionArn ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - **State** + ** State ** 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` Required: No - **StateReason** + ** StateReason ** The reason for the function's current state\. Type: String Required: No - **StateReasonCode** + ** StateReasonCode ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No - **Timeout** + ** Timeout ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. Required: No - **TracingConfig** + ** TracingConfig ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object Required: No - **Version** + ** Version ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: No - **VpcConfig** + ** VpcConfig ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object Required: No ## See Also diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md index af74b844..1ea75549 100644 --- a/doc_source/API_FunctionEventInvokeConfig.md +++ b/doc_source/API_FunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ ## Contents - **DestinationConfig** + ** DestinationConfig ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -10,27 +10,27 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - **FunctionArn** + ** FunctionArn ** The Amazon Resource Name \(ARN\) of the 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-_]+))?` Required: No - **LastModified** + ** LastModified ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp Required: No - **MaximumEventAgeInSeconds** + ** MaximumEventAgeInSeconds ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - **MaximumRetryAttempts** + ** MaximumRetryAttempts ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md index ecdcac45..f18742f2 100644 --- a/doc_source/API_GetAccountSettings.md +++ b/doc_source/API_GetAccountSettings.md @@ -43,21 +43,21 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [AccountLimit](#API_GetAccountSettings_ResponseSyntax) ** + ** [ AccountLimit ](#API_GetAccountSettings_ResponseSyntax) ** Limits that are related to concurrency and code storage\. -Type: [AccountLimit](API_AccountLimit.md) object +Type: [ AccountLimit ](API_AccountLimit.md) object - ** [AccountUsage](#API_GetAccountSettings_ResponseSyntax) ** + ** [ AccountUsage ](#API_GetAccountSettings_ResponseSyntax) ** The number of functions and amount of storage in use\. -Type: [AccountUsage](API_AccountUsage.md) object +Type: [ AccountUsage ](API_AccountUsage.md) object ## Errors - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md index ab1becc5..9c1f7756 100644 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetAlias_RequestSyntax) ** + ** [ FunctionName ](#API_GetAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ 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 - ** [Name](#API_GetAlias_RequestSyntax) ** + ** [ Name ](#API_GetAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -60,51 +60,51 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [AliasArn](#API_GetAlias_ResponseSyntax) ** + ** [ AliasArn ](#API_GetAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. 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-_]+))?` - ** [Description](#API_GetAlias_ResponseSyntax) ** + ** [ Description ](#API_GetAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [FunctionVersion](#API_GetAlias_ResponseSyntax) ** + ** [ FunctionVersion ](#API_GetAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [Name](#API_GetAlias_ResponseSyntax) ** + ** [ Name ](#API_GetAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [RevisionId](#API_GetAlias_ResponseSyntax) ** + ** [ RevisionId ](#API_GetAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [RoutingConfig](#API_GetAlias_ResponseSyntax) ** + ** [ RoutingConfig ](#API_GetAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md index 1bd1717a..7c2d839d 100644 --- a/doc_source/API_GetCodeSigningConfig.md +++ b/doc_source/API_GetCodeSigningConfig.md @@ -12,7 +12,7 @@ GET /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 The request uses the following URI parameters\. - ** [CodeSigningConfigArn](#API_GetCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_GetCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -50,21 +50,21 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfig](#API_GetCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfig ](#API_GetCodeSigningConfig_ResponseSyntax) ** The code signing configuration -Type: [CodeSigningConfig](API_CodeSigningConfig.md) object +Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index 111f34e4..cb995038 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -1,6 +1,6 @@ # GetEventSourceMapping -Returns details about an event source mapping\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. +Returns details about an event source mapping\. You can get the identifier of a mapping from the output of [ ListEventSourceMappings ](API_ListEventSourceMappings.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2015-03-31/event-source-mappings/UUID HTTP/1.1 The request uses the following URI parameters\. - ** [UUID](#API_GetEventSourceMapping_RequestSyntax) ** + ** [ UUID ](#API_GetEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -74,127 +74,131 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [BatchSize](#API_GetEventSourceMapping_ResponseSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_GetEventSourceMapping_ResponseSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [BisectBatchOnFunctionError](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [DestinationConfig](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ DestinationConfig ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [EventSourceArn](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ EventSourceArn ](#API_GetEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionArn](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ FunctionArn ](#API_GetEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda 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-_]+))?` - ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ FunctionResponseTypes ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ LastModified ](#API_GetEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [LastProcessingResult](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ LastProcessingResult ](#API_GetEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** [ MaximumBatchingWindowInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ ParallelizationFactor ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [Queues](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ Queues ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ SelfManagedEventSource ](#API_GetEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ SourceAccessConfigurations ](#API_GetEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ StartingPosition ](#API_GetEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ StartingPositionTimestamp ](#API_GetEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ State ](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [StateTransitionReason](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ StateTransitionReason ](#API_GetEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ Topics ](#API_GetEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ TumblingWindowInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ UUID ](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index 236dc6bc..1335cd85 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunction_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunction_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,7 +24,7 @@ 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-_]+))?` Required: Yes - ** [Qualifier](#API_GetFunction_RequestSyntax) ** + ** [ Qualifier ](#API_GetFunction_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -132,37 +132,37 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Code](#API_GetFunction_ResponseSyntax) ** + ** [ Code ](#API_GetFunction_ResponseSyntax) ** The deployment package of the function or version\. -Type: [FunctionCodeLocation](API_FunctionCodeLocation.md) object +Type: [ FunctionCodeLocation ](API_FunctionCodeLocation.md) object - ** [Concurrency](#API_GetFunction_ResponseSyntax) ** + ** [ Concurrency ](#API_GetFunction_ResponseSyntax) ** The function's [reserved concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. -Type: [Concurrency](API_Concurrency.md) object +Type: [ Concurrency ](API_Concurrency.md) object - ** [Configuration](#API_GetFunction_ResponseSyntax) ** + ** [ Configuration ](#API_GetFunction_ResponseSyntax) ** The configuration of the function or version\. -Type: [FunctionConfiguration](API_FunctionConfiguration.md) object +Type: [ FunctionConfiguration ](API_FunctionConfiguration.md) object - ** [Tags](#API_GetFunction_ResponseSyntax) ** + ** [ Tags ](#API_GetFunction_ResponseSyntax) ** The function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. Type: String to string map ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md index 29a92bef..ebfabc08 100644 --- a/doc_source/API_GetFunctionCodeSigningConfig.md +++ b/doc_source/API_GetFunctionCodeSigningConfig.md @@ -12,7 +12,7 @@ GET /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -46,13 +46,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfigArn](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfigArn ](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - ** [FunctionName](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** + ** [ FunctionName ](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** The name of the Lambda function\. **Name formats** @@ -66,19 +66,19 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md index 9a367326..017f6474 100644 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -1,6 +1,6 @@ # GetFunctionConcurrency -Returns details about the reserved concurrency configuration for a function\. To set a concurrency limit for a function, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. +Returns details about the reserved concurrency configuration for a function\. To set a concurrency limit for a function, use [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/concurrency HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunctionConcurrency_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -45,26 +45,26 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ReservedConcurrentExecutions](#API_GetFunctionConcurrency_ResponseSyntax) ** + ** [ ReservedConcurrentExecutions ](#API_GetFunctionConcurrency_ResponseSyntax) ** The number of simultaneous executions that are reserved for the function\. Type: Integer Valid Range: Minimum value of 0\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index b44033b1..b3307f36 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -1,8 +1,8 @@ # GetFunctionConfiguration -Returns the version\-specific settings of a Lambda function or version\. The output includes only options that can vary between versions of a function\. To modify these settings, use [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. +Returns the version\-specific settings of a Lambda function or version\. The output includes only options that can vary between versions of a function\. To modify these settings, use [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. -To get all of a function's details, including function\-level settings, use [GetFunction](API_GetFunction.md)\. +To get all of a function's details, including function\-level settings, use [ GetFunction ](API_GetFunction.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2015-03-31/functions/FunctionName/configuration?Qualifier=Qualifier HTTP/1. The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunctionConfiguration_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunctionConfiguration_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ 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-_]+))?` Required: Yes - ** [Qualifier](#API_GetFunctionConfiguration_RequestSyntax) ** + ** [ Qualifier ](#API_GetFunctionConfiguration_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -120,167 +120,167 @@ 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [ CodeSha256 ](#API_GetFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ CodeSize ](#API_GetFunctionConfiguration_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Description ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Environment ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_GetFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ FunctionArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [ FunctionName ](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Handler ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [ LastModified ](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatus ](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatusReason ](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Layers ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ MasterArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [ MemorySize ](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ PackageType ](#API_GetFunctionConfiguration_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ RevisionId ](#API_GetFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Role ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Runtime ](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ SigningJobArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ State ](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [ StateReason ](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ StateReasonCode ](#API_GetFunctionConfiguration_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Timeout ](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [ TracingConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Version ](#API_GetFunctionConfiguration_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [VpcConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ VpcConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md index 56a8d428..4f593364 100644 --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Retrieves the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier H The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ 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 - ** [Qualifier](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** + ** [ Qualifier ](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -63,7 +63,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [DestinationConfig](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ DestinationConfig ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -71,42 +71,42 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [FunctionArn](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ FunctionArn ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the 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-_]+))?` - ** [LastModified](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ LastModified ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [MaximumEventAgeInSeconds](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [MaximumRetryAttempts](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index d8de27de..b32f1a07 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -12,13 +12,13 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 The request uses the following URI parameters\. - ** [LayerName](#API_GetLayerVersion_RequestSyntax) ** + ** [ LayerName ](#API_GetLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [VersionNumber](#API_GetLayerVersion_RequestSyntax) ** + ** [ VersionNumber ](#API_GetLayerVersion_RequestSyntax) ** The version number\. Required: Yes @@ -56,61 +56,61 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CompatibleRuntimes](#API_GetLayerVersion_ResponseSyntax) ** + ** [ CompatibleRuntimes ](#API_GetLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [Content](#API_GetLayerVersion_ResponseSyntax) ** + ** [ Content ](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. -Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object +Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object - ** [CreatedDate](#API_GetLayerVersion_ResponseSyntax) ** + ** [ CreatedDate ](#API_GetLayerVersion_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [Description](#API_GetLayerVersion_ResponseSyntax) ** + ** [ Description ](#API_GetLayerVersion_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [LayerArn](#API_GetLayerVersion_ResponseSyntax) ** + ** [ LayerArn ](#API_GetLayerVersion_ResponseSyntax) ** The ARN of the layer\. Type: String 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-_]+` - ** [LayerVersionArn](#API_GetLayerVersion_ResponseSyntax) ** + ** [ LayerVersionArn ](#API_GetLayerVersion_ResponseSyntax) ** The ARN of the layer version\. Type: String 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]+` - ** [LicenseInfo](#API_GetLayerVersion_ResponseSyntax) ** + ** [ LicenseInfo ](#API_GetLayerVersion_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [Version](#API_GetLayerVersion_ResponseSyntax) ** + ** [ Version ](#API_GetLayerVersion_ResponseSyntax) ** The version number\. Type: Long ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index c9f75752..fcbd7e96 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -12,7 +12,7 @@ GET /2018-10-31/layers?find=LayerVersion&Arn=Arn HTTP/1.1 The request uses the following URI parameters\. - ** [Arn](#API_GetLayerVersionByArn_RequestSyntax) ** + ** [ Arn ](#API_GetLayerVersionByArn_RequestSyntax) ** The ARN of the layer version\. 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]+` @@ -52,61 +52,61 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CompatibleRuntimes](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ CompatibleRuntimes ](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ Content ](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. -Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object +Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object - ** [CreatedDate](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ CreatedDate ](#API_GetLayerVersionByArn_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [Description](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ Description ](#API_GetLayerVersionByArn_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [LayerArn](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ LayerArn ](#API_GetLayerVersionByArn_ResponseSyntax) ** The ARN of the layer\. Type: String 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-_]+` - ** [LayerVersionArn](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ LayerVersionArn ](#API_GetLayerVersionByArn_ResponseSyntax) ** The ARN of the layer version\. Type: String 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]+` - ** [LicenseInfo](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ LicenseInfo ](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [Version](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ Version ](#API_GetLayerVersionByArn_ResponseSyntax) ** The version number\. Type: Long ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index caec1a40..4fe6a68b 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -1,6 +1,6 @@ # GetLayerVersionPolicy -Returns the permission policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. +Returns the permission policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md)\. ## Request Syntax @@ -12,13 +12,13 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber/policy HTTP/1.1 The request uses the following URI parameters\. - ** [LayerName](#API_GetLayerVersionPolicy_RequestSyntax) ** + ** [ LayerName ](#API_GetLayerVersionPolicy_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [VersionNumber](#API_GetLayerVersionPolicy_RequestSyntax) ** + ** [ VersionNumber ](#API_GetLayerVersionPolicy_RequestSyntax) ** The version number\. Required: Yes @@ -44,29 +44,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Policy](#API_GetLayerVersionPolicy_ResponseSyntax) ** + ** [ Policy ](#API_GetLayerVersionPolicy_ResponseSyntax) ** The policy document\. Type: String - ** [RevisionId](#API_GetLayerVersionPolicy_ResponseSyntax) ** + ** [ RevisionId ](#API_GetLayerVersionPolicy_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md index 93a818c7..c8bac1f3 100644 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/policy?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetPolicy_RequestSyntax) ** + ** [ FunctionName ](#API_GetPolicy_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,7 +24,7 @@ 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-_]+))?` Required: Yes - ** [Qualifier](#API_GetPolicy_RequestSyntax) ** + ** [ Qualifier ](#API_GetPolicy_RequestSyntax) ** Specify a version or alias to get the policy for that resource\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -51,29 +51,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Policy](#API_GetPolicy_ResponseSyntax) ** + ** [ Policy ](#API_GetPolicy_ResponseSyntax) ** The resource\-based policy\. Type: String - ** [RevisionId](#API_GetPolicy_ResponseSyntax) ** + ** [ RevisionId ](#API_GetPolicy_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md index 02bd2717..16674dc4 100644 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifi The request uses the following URI parameters\. - ** [FunctionName](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ FunctionName ](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ 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 - ** [Qualifier](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ Qualifier ](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -56,53 +56,53 @@ 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) ** + ** [ AllocatedProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. - ** [AvailableProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ AvailableProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. - ** [LastModified](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ LastModified ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** 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 - ** [RequestedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ RequestedProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. - ** [Status](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ Status ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` - ** [StatusReason](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ StatusReason ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ProvisionedConcurrencyConfigNotFoundException** + ** ProvisionedConcurrencyConfigNotFoundException ** The specified configuration does not exist\. HTTP Status Code: 404 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md index 21848202..151d0ad7 100644 --- a/doc_source/API_ImageConfig.md +++ b/doc_source/API_ImageConfig.md @@ -4,19 +4,19 @@ Configuration values that override the container image Dockerfile settings\. See ## Contents - **Command** + ** Command ** Specifies parameters that you want to pass in with ENTRYPOINT\. Type: Array of strings Array Members: Maximum number of 1500 items\. Required: No - **EntryPoint** + ** EntryPoint ** Specifies the entry point to their application, which is typically the location of the runtime executable\. Type: Array of strings Array Members: Maximum number of 1500 items\. Required: No - **WorkingDirectory** + ** WorkingDirectory ** Specifies the working directory\. Type: String Length Constraints: Maximum length of 1000\. diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md index ea1b2c36..f64556b5 100644 --- a/doc_source/API_ImageConfigError.md +++ b/doc_source/API_ImageConfigError.md @@ -4,12 +4,12 @@ Error response to GetFunctionConfiguration\. ## Contents - **ErrorCode** + ** ErrorCode ** Error code\. Type: String Required: No - **Message** + ** Message ** Error message\. Type: String Required: No diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md index 59a14f95..3337f9ed 100644 --- a/doc_source/API_ImageConfigResponse.md +++ b/doc_source/API_ImageConfigResponse.md @@ -4,14 +4,14 @@ Response to GetFunctionConfiguration request\. ## Contents - **Error** + ** Error ** Error response to GetFunctionConfiguration\. -Type: [ImageConfigError](API_ImageConfigError.md) object +Type: [ ImageConfigError ](API_ImageConfigError.md) object Required: No - **ImageConfig** + ** ImageConfig ** Configuration values that override the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object +Type: [ ImageConfig ](API_ImageConfig.md) object Required: No ## See Also diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 22c31332..2f449d7b 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -29,10 +29,10 @@ Payload The request uses the following URI parameters\. - ** [ClientContext](#API_Invoke_RequestSyntax) ** + ** [ ClientContext ](#API_Invoke_RequestSyntax) ** Up to 3583 bytes of base64\-encoded data about the invoking client to pass to the function in the context object\. - ** [FunctionName](#API_Invoke_RequestSyntax) ** + ** [ FunctionName ](#API_Invoke_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -44,18 +44,18 @@ 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-_]+))?` Required: Yes - ** [InvocationType](#API_Invoke_RequestSyntax) ** + ** [ InvocationType ](#API_Invoke_RequestSyntax) ** Choose from the following options\. + `RequestResponse` \(default\) \- Invoke the function synchronously\. Keep the connection open until the function returns a response or times out\. The API response includes the function response and additional data\. + `Event` \- Invoke the function asynchronously\. Send events that fail multiple times to the function's dead\-letter queue \(if it's configured\)\. The API response only includes a status code\. + `DryRun` \- Validate parameter values and verify that the user or role has permission to invoke the function\. Valid Values:` Event | RequestResponse | DryRun` - ** [LogType](#API_Invoke_RequestSyntax) ** -Set to `Tail` to include the execution log in the response\. + ** [ LogType ](#API_Invoke_RequestSyntax) ** +Set to `Tail` to include the execution log in the response\. Applies to synchronously invoked functions only\. Valid Values:` None | Tail` - ** [Qualifier](#API_Invoke_RequestSyntax) ** + ** [ Qualifier ](#API_Invoke_RequestSyntax) ** Specify a version or alias to invoke a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -64,7 +64,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following binary data\. - ** [Payload](#API_Invoke_RequestSyntax) ** + ** [ Payload ](#API_Invoke_RequestSyntax) ** The JSON that you want to provide to your Lambda function as input\. ## Response Syntax @@ -82,130 +82,130 @@ Payload If the action is successful, the service sends back the following HTTP response\. - ** [StatusCode](#API_Invoke_ResponseSyntax) ** + ** [ StatusCode ](#API_Invoke_ResponseSyntax) ** The HTTP status code is in the 200 range for a successful request\. For the `RequestResponse` invocation type, this status code is 200\. For the `Event` invocation type, this status code is 202\. For the `DryRun` invocation type, the status code is 204\. The response returns the following HTTP headers\. - ** [ExecutedVersion](#API_Invoke_ResponseSyntax) ** + ** [ ExecutedVersion ](#API_Invoke_ResponseSyntax) ** The version of the function that executed\. When you invoke a function with an alias, this indicates which version the alias resolved to\. Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [FunctionError](#API_Invoke_ResponseSyntax) ** + ** [ FunctionError ](#API_Invoke_ResponseSyntax) ** If present, indicates that an error occurred during function execution\. Details about the error are included in the response payload\. - ** [LogResult](#API_Invoke_ResponseSyntax) ** + ** [ LogResult ](#API_Invoke_ResponseSyntax) ** The last 4 KB of the execution log, which is base64 encoded\. The response returns the following as the HTTP body\. - ** [Payload](#API_Invoke_ResponseSyntax) ** + ** [ Payload ](#API_Invoke_ResponseSyntax) ** The response from the function, or an error object\. ## Errors - **EC2AccessDeniedException** + ** EC2AccessDeniedException ** Need additional permissions to configure VPC settings\. HTTP Status Code: 502 - **EC2ThrottledException** + ** 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** + ** EC2UnexpectedException ** AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function\. HTTP Status Code: 502 - **EFSIOException** + ** EFSIOException ** An error occurred when reading from or writing to a connected file system\. HTTP Status Code: 410 - **EFSMountConnectivityException** + ** EFSMountConnectivityException ** The function couldn't make a network connection to the configured file system\. HTTP Status Code: 408 - **EFSMountFailureException** + ** EFSMountFailureException ** The function couldn't mount the configured file system due to a permission or configuration issue\. HTTP Status Code: 403 - **EFSMountTimeoutException** + ** 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** + ** 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 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **InvalidRequestContentException** + ** InvalidRequestContentException ** The request body could not be parsed as JSON\. HTTP Status Code: 400 - **InvalidRuntimeException** + ** InvalidRuntimeException ** The runtime or runtime version specified is not supported\. HTTP Status Code: 502 - **InvalidSecurityGroupIDException** + ** InvalidSecurityGroupIDException ** The Security Group ID provided in the Lambda function VPC configuration is invalid\. HTTP Status Code: 502 - **InvalidSubnetIDException** + ** InvalidSubnetIDException ** The Subnet ID provided in the Lambda function VPC configuration is invalid\. HTTP Status Code: 502 - **InvalidZipFileException** + ** InvalidZipFileException ** AWS Lambda could not unzip the deployment package\. HTTP Status Code: 502 - **KMSAccessDeniedException** + ** 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** + ** 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** + ** 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** + ** 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** + ** 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** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ResourceNotReadyException** + ** 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** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **SubnetIPAddressLimitReachedException** + ** 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** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 - **UnsupportedMediaTypeException** + ** UnsupportedMediaTypeException ** The content type of the `Invoke` request body is not JSON\. HTTP Status Code: 415 @@ -220,4 +220,4 @@ For more information about using this API in one of the language\-specific AWS S + [ 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) + [ 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) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) \ No newline at end of file diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md index f47bf60e..0ed67594 100644 --- a/doc_source/API_InvokeAsync.md +++ b/doc_source/API_InvokeAsync.md @@ -3,7 +3,7 @@ *This action has been deprecated\.* **Important** -For asynchronous function invocation, use [Invoke](API_Invoke.md)\. +For asynchronous function invocation, use [ Invoke ](API_Invoke.md)\. Invokes a function asynchronously\. @@ -19,7 +19,7 @@ InvokeArgs The request uses the following URI parameters\. - ** [FunctionName](#API_InvokeAsync_RequestSyntax) ** + ** [ FunctionName ](#API_InvokeAsync_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -35,7 +35,7 @@ Required: Yes The request accepts the following binary data\. - ** [InvokeArgs](#API_InvokeAsync_RequestSyntax) ** + ** [ InvokeArgs ](#API_InvokeAsync_RequestSyntax) ** The JSON that you want to provide to your Lambda function as input\. Required: Yes @@ -49,28 +49,28 @@ HTTP/1.1 Status If the action is successful, the service sends back the following HTTP response\. - ** [Status](#API_InvokeAsync_ResponseSyntax) ** + ** [ Status ](#API_InvokeAsync_ResponseSyntax) ** The status code\. ## Errors - **InvalidRequestContentException** + ** InvalidRequestContentException ** The request body could not be parsed as JSON\. HTTP Status Code: 400 - **InvalidRuntimeException** + ** InvalidRuntimeException ** The runtime or runtime version specified is not supported\. HTTP Status Code: 502 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index ee4be690..8c2f129a 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -4,25 +4,25 @@ An [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuratio ## Contents - **Arn** + ** Arn ** The Amazon Resource Name \(ARN\) of the function layer\. Type: String 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 - **CodeSize** + ** CodeSize ** The size of the layer archive in bytes\. Type: Long Required: No - **SigningJobArn** + ** SigningJobArn ** The Amazon Resource Name \(ARN\) of a signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - **SigningProfileVersionArn** + ** SigningProfileVersionArn ** The Amazon Resource Name \(ARN\) for a signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md index b85670b3..461e603b 100644 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -4,26 +4,26 @@ A ZIP archive that contains the contents of an [ AWS Lambda layer](https://docs. ## Contents - **S3Bucket** + ** S3Bucket ** The Amazon S3 bucket of the layer archive\. Type: String Length Constraints: Minimum length of 3\. Maximum length of 63\. Pattern: `^[0-9A-Za-z\.\-_]*(? + ** S3Key ** The Amazon S3 key of the layer archive\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - **S3ObjectVersion** + ** S3ObjectVersion ** For versioned objects, the version of the layer archive object to use\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - **ZipFile** + ** ZipFile ** The base64\-encoded contents of the layer archive\. AWS SDK and AWS CLI clients handle the encoding for you\. Type: Base64\-encoded binary data object Required: No diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index 8cb77ffd..a56a36b3 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -4,27 +4,27 @@ Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/la ## Contents - **CodeSha256** + ** CodeSha256 ** The SHA\-256 hash of the layer archive\. Type: String Required: No - **CodeSize** + ** CodeSize ** The size of the layer archive in bytes\. Type: Long Required: No - **Location** + ** Location ** A link to the layer archive in Amazon S3 that is valid for 10 minutes\. Type: String Required: No - **SigningJobArn** + ** SigningJobArn ** The Amazon Resource Name \(ARN\) of a signing job\. Type: String Required: No - **SigningProfileVersionArn** + ** SigningProfileVersionArn ** The Amazon Resource Name \(ARN\) for a signing profile version\. Type: String Required: No diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 729496ba..38f30a79 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -4,38 +4,38 @@ Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/la ## Contents - **CompatibleRuntimes** + ** CompatibleRuntimes ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - **CreatedDate** + ** CreatedDate ** The date that the version was created, in ISO 8601 format\. For example, `2018-11-27T15:10:45.123+0000`\. Type: String Required: No - **Description** + ** Description ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - **LayerVersionArn** + ** LayerVersionArn ** The ARN of the layer version\. Type: String 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 - **LicenseInfo** + ** LicenseInfo ** The layer's open\-source license\. Type: String Length Constraints: Maximum length of 512\. Required: No - **Version** + ** Version ** The version number\. Type: Long Required: No diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md index a6e1947c..4064a303 100644 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -4,19 +4,19 @@ Details about an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/d ## Contents - **LatestMatchingVersion** + ** LatestMatchingVersion ** The newest version of the layer\. -Type: [LayerVersionsListItem](API_LayerVersionsListItem.md) object +Type: [ LayerVersionsListItem ](API_LayerVersionsListItem.md) object Required: No - **LayerArn** + ** LayerArn ** The Amazon Resource Name \(ARN\) of the function layer\. Type: String 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-_]+` Required: No - **LayerName** + ** LayerName ** The name of the layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md index 1e286834..96a8f132 100644 --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/aliases?FunctionVersion=FunctionVersion&M The request uses the following URI parameters\. - ** [FunctionName](#API_ListAliases_RequestSyntax) ** + ** [ FunctionName ](#API_ListAliases_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,15 +24,15 @@ 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 - ** [FunctionVersion](#API_ListAliases_RequestSyntax) ** + ** [ FunctionVersion ](#API_ListAliases_RequestSyntax) ** Specify a function version to only list aliases that invoke that version\. Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [Marker](#API_ListAliases_RequestSyntax) ** + ** [ Marker ](#API_ListAliases_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListAliases_RequestSyntax) ** + ** [ MaxItems ](#API_ListAliases_RequestSyntax) ** Limit the number of aliases returned\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -71,29 +71,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Aliases](#API_ListAliases_ResponseSyntax) ** + ** [ Aliases ](#API_ListAliases_ResponseSyntax) ** A list of aliases\. -Type: Array of [AliasConfiguration](API_AliasConfiguration.md) objects +Type: Array of [ AliasConfiguration ](API_AliasConfiguration.md) objects - ** [NextMarker](#API_ListAliases_ResponseSyntax) ** + ** [ NextMarker ](#API_ListAliases_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md index 9dc64827..e5fcdff9 100644 --- a/doc_source/API_ListCodeSigningConfigs.md +++ b/doc_source/API_ListCodeSigningConfigs.md @@ -12,10 +12,10 @@ GET /2020-04-22/code-signing-configs/?Marker=Marker&MaxItems=MaxItems HTTP/1.1 The request uses the following URI parameters\. - ** [Marker](#API_ListCodeSigningConfigs_RequestSyntax) ** + ** [ Marker ](#API_ListCodeSigningConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListCodeSigningConfigs_RequestSyntax) ** + ** [ MaxItems ](#API_ListCodeSigningConfigs_RequestSyntax) ** Maximum number of items to return\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -54,21 +54,21 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfigs](#API_ListCodeSigningConfigs_ResponseSyntax) ** + ** [ CodeSigningConfigs ](#API_ListCodeSigningConfigs_ResponseSyntax) ** The code signing configurations -Type: Array of [CodeSigningConfig](API_CodeSigningConfig.md) objects +Type: Array of [ CodeSigningConfig ](API_CodeSigningConfig.md) objects - ** [NextMarker](#API_ListCodeSigningConfigs_ResponseSyntax) ** + ** [ NextMarker ](#API_ListCodeSigningConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index d48d8aed..05fffac7 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -12,7 +12,7 @@ GET /2015-03-31/event-source-mappings/?EventSourceArn=EventSourceArn&FunctionNam The request uses the following URI parameters\. - ** [EventSourceArn](#API_ListEventSourceMappings_RequestSyntax) ** + ** [ EventSourceArn ](#API_ListEventSourceMappings_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. @@ -20,7 +20,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionName](#API_ListEventSourceMappings_RequestSyntax) ** + ** [ FunctionName ](#API_ListEventSourceMappings_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -32,10 +32,10 @@ The length constraint applies only to the full ARN\. If you specify only the fun 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-_]+))?` - ** [Marker](#API_ListEventSourceMappings_RequestSyntax) ** + ** [ Marker ](#API_ListEventSourceMappings_RequestSyntax) ** A pagination token returned by a previous call\. - ** [MaxItems](#API_ListEventSourceMappings_RequestSyntax) ** + ** [ MaxItems ](#API_ListEventSourceMappings_RequestSyntax) ** The maximum number of event source mappings to return\. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -102,29 +102,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [EventSourceMappings](#API_ListEventSourceMappings_ResponseSyntax) ** + ** [ EventSourceMappings ](#API_ListEventSourceMappings_ResponseSyntax) ** A list of event source mappings\. -Type: Array of [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) objects +Type: Array of [ EventSourceMappingConfiguration ](API_EventSourceMappingConfiguration.md) objects - ** [NextMarker](#API_ListEventSourceMappings_ResponseSyntax) ** + ** [ NextMarker ](#API_ListEventSourceMappings_ResponseSyntax) ** A pagination token that's returned when the response doesn't contain all event source mappings\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md index 60f2ced3..86f29bc5 100644 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -2,7 +2,7 @@ Retrieves a list of configurations for asynchronous invocation for a function\. -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config/list?Marker=Marker&Ma The request uses the following URI parameters\. - ** [FunctionName](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [ FunctionName ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -26,10 +26,10 @@ 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 - ** [Marker](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [ Marker ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [ MaxItems ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** The maximum number of configurations to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -70,29 +70,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [FunctionEventInvokeConfigs](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** + ** [ FunctionEventInvokeConfigs ](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** A list of configurations\. -Type: Array of [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) objects +Type: Array of [ FunctionEventInvokeConfig ](API_FunctionEventInvokeConfig.md) objects - ** [NextMarker](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** + ** [ NextMarker ](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index 252c72fb..ebce0f00 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -5,7 +5,7 @@ Returns a list of Lambda functions, with the version\-specific configuration of Set `FunctionVersion` to `ALL` to include all published versions of each function in addition to the unpublished version\. **Note** -The `ListFunctions` action returns a subset of the [FunctionConfiguration](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [GetFunction](API_GetFunction.md)\. +The `ListFunctions` action returns a subset of the [ FunctionConfiguration ](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [ GetFunction ](API_GetFunction.md)\. ## Request Syntax @@ -17,18 +17,18 @@ GET /2015-03-31/functions/?FunctionVersion=FunctionVersion&Marker=Marker&MasterR The request uses the following URI parameters\. - ** [FunctionVersion](#API_ListFunctions_RequestSyntax) ** + ** [ FunctionVersion ](#API_ListFunctions_RequestSyntax) ** Set to `ALL` to include entries for all published versions of each function\. Valid Values:` ALL` - ** [Marker](#API_ListFunctions_RequestSyntax) ** + ** [ Marker ](#API_ListFunctions_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MasterRegion](#API_ListFunctions_RequestSyntax) ** + ** [ MasterRegion ](#API_ListFunctions_RequestSyntax) ** For Lambda@Edge functions, the AWS Region of the master function\. For example, `us-east-1` filters the list of functions to only include Lambda@Edge functions replicated from a master function in US East \(N\. Virginia\)\. If specified, you must set `FunctionVersion` to `ALL`\. Pattern: `ALL|[a-z]{2}(-gov)?-[a-z]+-\d{1}` - ** [MaxItems](#API_ListFunctions_RequestSyntax) ** + ** [ MaxItems ](#API_ListFunctions_RequestSyntax) ** The maximum number of functions to return in the response\. Note that `ListFunctions` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -126,25 +126,25 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Functions](#API_ListFunctions_ResponseSyntax) ** + ** [ Functions ](#API_ListFunctions_ResponseSyntax) ** A list of Lambda functions\. -Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects +Type: Array of [ FunctionConfiguration ](API_FunctionConfiguration.md) objects - ** [NextMarker](#API_ListFunctions_ResponseSyntax) ** + ** [ NextMarker ](#API_ListFunctions_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md index 0440a9ac..04be90ec 100644 --- a/doc_source/API_ListFunctionsByCodeSigningConfig.md +++ b/doc_source/API_ListFunctionsByCodeSigningConfig.md @@ -12,16 +12,16 @@ GET /2020-04-22/code-signing-configs/CodeSigningConfigArn/functions?Marker=Marke The request uses the following URI parameters\. - ** [CodeSigningConfigArn](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: Yes - ** [Marker](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [ Marker ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [ MaxItems ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** Maximum number of items to return\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -47,26 +47,26 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [FunctionArns](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** + ** [ FunctionArns ](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** The function ARNs\. Type: Array of strings 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-_]+))?` - ** [NextMarker](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** + ** [ NextMarker ](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index b003b710..29e89342 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -12,20 +12,20 @@ GET /2018-10-31/layers/LayerName/versions?CompatibleRuntime=CompatibleRuntime&Ma The request uses the following URI parameters\. - ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** + ** [ CompatibleRuntime ](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** + ** [ LayerName ](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [Marker](#API_ListLayerVersions_RequestSyntax) ** + ** [ Marker ](#API_ListLayerVersions_RequestSyntax) ** A pagination token returned by a previous call\. - ** [MaxItems](#API_ListLayerVersions_RequestSyntax) ** + ** [ MaxItems ](#API_ListLayerVersions_RequestSyntax) ** The maximum number of versions to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -60,29 +60,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [LayerVersions](#API_ListLayerVersions_ResponseSyntax) ** + ** [ LayerVersions ](#API_ListLayerVersions_ResponseSyntax) ** A list of versions\. -Type: Array of [LayerVersionsListItem](API_LayerVersionsListItem.md) objects +Type: Array of [ LayerVersionsListItem ](API_LayerVersionsListItem.md) objects - ** [NextMarker](#API_ListLayerVersions_ResponseSyntax) ** + ** [ NextMarker ](#API_ListLayerVersions_ResponseSyntax) ** A pagination token returned when the response doesn't contain all versions\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 64d1eb41..6aa4022b 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -12,14 +12,14 @@ GET /2018-10-31/layers?CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItem The request uses the following URI parameters\. - ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** + ** [ CompatibleRuntime ](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [Marker](#API_ListLayers_RequestSyntax) ** + ** [ Marker ](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. - ** [MaxItems](#API_ListLayers_RequestSyntax) ** + ** [ MaxItems ](#API_ListLayers_RequestSyntax) ** The maximum number of layers to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -58,25 +58,25 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Layers](#API_ListLayers_ResponseSyntax) ** + ** [ Layers ](#API_ListLayers_ResponseSyntax) ** A list of function layers\. -Type: Array of [LayersListItem](API_LayersListItem.md) objects +Type: Array of [ LayersListItem ](API_LayersListItem.md) objects - ** [NextMarker](#API_ListLayers_ResponseSyntax) ** + ** [ NextMarker ](#API_ListLayers_ResponseSyntax) ** A pagination token returned when the response doesn't contain all layers\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md index 93df5308..bd1e9916 100644 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?List=ALL&Marker=M The request uses the following URI parameters\. - ** [FunctionName](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [ FunctionName ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,10 +24,10 @@ 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 - ** [Marker](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [ Marker ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [ MaxItems ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** Specify a number to limit the number of configurations returned\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -63,29 +63,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [NextMarker](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** + ** [ NextMarker ](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String - ** [ProvisionedConcurrencyConfigs](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** + ** [ ProvisionedConcurrencyConfigs ](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** A list of provisioned concurrency configurations\. -Type: Array of [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) objects +Type: Array of [ ProvisionedConcurrencyConfigListItem ](API_ProvisionedConcurrencyConfigListItem.md) objects ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md index 39ccd31a..394361bc 100644 --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -1,6 +1,6 @@ # ListTags -Returns a function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. You can also view tags with [GetFunction](API_GetFunction.md)\. +Returns a function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. You can also view tags with [ GetFunction ](API_GetFunction.md)\. ## Request Syntax @@ -12,8 +12,8 @@ GET /2017-03-31/tags/ARN HTTP/1.1 The request uses the following URI parameters\. - ** [ARN](#API_ListTags_RequestSyntax) ** -The function's Amazon Resource Name \(ARN\)\. + ** [ ARN ](#API_ListTags_RequestSyntax) ** +The function's Amazon Resource Name \(ARN\)\. Note: Lambda does not support adding tags to aliases or versions\. 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 @@ -40,25 +40,25 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Tags](#API_ListTags_ResponseSyntax) ** + ** [ Tags ](#API_ListTags_ResponseSyntax) ** The function's tags\. Type: String to string map ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index aff8498d..a82e1aed 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/versions?Marker=Marker&MaxItems=MaxItems The request uses the following URI parameters\. - ** [FunctionName](#API_ListVersionsByFunction_RequestSyntax) ** + ** [ FunctionName ](#API_ListVersionsByFunction_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,10 +24,10 @@ 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-_]+))?` Required: Yes - ** [Marker](#API_ListVersionsByFunction_RequestSyntax) ** + ** [ Marker ](#API_ListVersionsByFunction_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListVersionsByFunction_RequestSyntax) ** + ** [ MaxItems ](#API_ListVersionsByFunction_RequestSyntax) ** The maximum number of versions to return\. Note that `ListVersionsByFunction` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -125,29 +125,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [NextMarker](#API_ListVersionsByFunction_ResponseSyntax) ** + ** [ NextMarker ](#API_ListVersionsByFunction_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String - ** [Versions](#API_ListVersionsByFunction_ResponseSyntax) ** + ** [ Versions ](#API_ListVersionsByFunction_ResponseSyntax) ** A list of Lambda function versions\. -Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects +Type: Array of [ FunctionConfiguration ](API_FunctionConfiguration.md) objects ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md index 7c74fab6..e85b7838 100644 --- a/doc_source/API_OnFailure.md +++ b/doc_source/API_OnFailure.md @@ -4,7 +4,7 @@ A destination for events that failed processing\. ## Contents - **Destination** + ** Destination ** The Amazon Resource Name \(ARN\) of the destination resource\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 350\. diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md index f2b35f42..5447b3fa 100644 --- a/doc_source/API_OnSuccess.md +++ b/doc_source/API_OnSuccess.md @@ -4,7 +4,7 @@ A destination for events that were processed successfully\. ## Contents - **Destination** + ** Destination ** The Amazon Resource Name \(ARN\) of the destination resource\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 350\. diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md index 70a90b0c..8c67257d 100644 --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -1,61 +1,61 @@ # Actions The following actions are supported: -+ [AddLayerVersionPermission](API_AddLayerVersionPermission.md) -+ [AddPermission](API_AddPermission.md) -+ [CreateAlias](API_CreateAlias.md) -+ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [CreateFunction](API_CreateFunction.md) -+ [DeleteAlias](API_DeleteAlias.md) -+ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -+ [DeleteFunction](API_DeleteFunction.md) -+ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) -+ [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) -+ [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) -+ [DeleteLayerVersion](API_DeleteLayerVersion.md) -+ [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) -+ [GetAccountSettings](API_GetAccountSettings.md) -+ [GetAlias](API_GetAlias.md) -+ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [GetFunction](API_GetFunction.md) -+ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) -+ [GetFunctionConcurrency](API_GetFunctionConcurrency.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) -+ [GetLayerVersion](API_GetLayerVersion.md) -+ [GetLayerVersionByArn](API_GetLayerVersionByArn.md) -+ [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) -+ [GetPolicy](API_GetPolicy.md) -+ [GetProvisionedConcurrencyConfig](API_GetProvisionedConcurrencyConfig.md) -+ [Invoke](API_Invoke.md) -+ [InvokeAsync](API_InvokeAsync.md) -+ [ListAliases](API_ListAliases.md) -+ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) -+ [ListFunctions](API_ListFunctions.md) -+ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) -+ [ListLayers](API_ListLayers.md) -+ [ListLayerVersions](API_ListLayerVersions.md) -+ [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) -+ [ListTags](API_ListTags.md) -+ [ListVersionsByFunction](API_ListVersionsByFunction.md) -+ [PublishLayerVersion](API_PublishLayerVersion.md) -+ [PublishVersion](API_PublishVersion.md) -+ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) -+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) -+ [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) -+ [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) -+ [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) -+ [RemovePermission](API_RemovePermission.md) -+ [TagResource](API_TagResource.md) -+ [UntagResource](API_UntagResource.md) -+ [UpdateAlias](API_UpdateAlias.md) -+ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md) \ No newline at end of file ++ [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md) ++ [ AddPermission ](API_AddPermission.md) ++ [ CreateAlias ](API_CreateAlias.md) ++ [ CreateCodeSigningConfig ](API_CreateCodeSigningConfig.md) ++ [ CreateEventSourceMapping ](API_CreateEventSourceMapping.md) ++ [ CreateFunction ](API_CreateFunction.md) ++ [ DeleteAlias ](API_DeleteAlias.md) ++ [ DeleteCodeSigningConfig ](API_DeleteCodeSigningConfig.md) ++ [ DeleteEventSourceMapping ](API_DeleteEventSourceMapping.md) ++ [ DeleteFunction ](API_DeleteFunction.md) ++ [ DeleteFunctionCodeSigningConfig ](API_DeleteFunctionCodeSigningConfig.md) ++ [ DeleteFunctionConcurrency ](API_DeleteFunctionConcurrency.md) ++ [ DeleteFunctionEventInvokeConfig ](API_DeleteFunctionEventInvokeConfig.md) ++ [ DeleteLayerVersion ](API_DeleteLayerVersion.md) ++ [ DeleteProvisionedConcurrencyConfig ](API_DeleteProvisionedConcurrencyConfig.md) ++ [ GetAccountSettings ](API_GetAccountSettings.md) ++ [ GetAlias ](API_GetAlias.md) ++ [ GetCodeSigningConfig ](API_GetCodeSigningConfig.md) ++ [ GetEventSourceMapping ](API_GetEventSourceMapping.md) ++ [ GetFunction ](API_GetFunction.md) ++ [ GetFunctionCodeSigningConfig ](API_GetFunctionCodeSigningConfig.md) ++ [ GetFunctionConcurrency ](API_GetFunctionConcurrency.md) ++ [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) ++ [ GetFunctionEventInvokeConfig ](API_GetFunctionEventInvokeConfig.md) ++ [ GetLayerVersion ](API_GetLayerVersion.md) ++ [ GetLayerVersionByArn ](API_GetLayerVersionByArn.md) ++ [ GetLayerVersionPolicy ](API_GetLayerVersionPolicy.md) ++ [ GetPolicy ](API_GetPolicy.md) ++ [ GetProvisionedConcurrencyConfig ](API_GetProvisionedConcurrencyConfig.md) ++ [ Invoke ](API_Invoke.md) ++ [ InvokeAsync ](API_InvokeAsync.md) ++ [ ListAliases ](API_ListAliases.md) ++ [ ListCodeSigningConfigs ](API_ListCodeSigningConfigs.md) ++ [ ListEventSourceMappings ](API_ListEventSourceMappings.md) ++ [ ListFunctionEventInvokeConfigs ](API_ListFunctionEventInvokeConfigs.md) ++ [ ListFunctions ](API_ListFunctions.md) ++ [ ListFunctionsByCodeSigningConfig ](API_ListFunctionsByCodeSigningConfig.md) ++ [ ListLayers ](API_ListLayers.md) ++ [ ListLayerVersions ](API_ListLayerVersions.md) ++ [ ListProvisionedConcurrencyConfigs ](API_ListProvisionedConcurrencyConfigs.md) ++ [ ListTags ](API_ListTags.md) ++ [ ListVersionsByFunction ](API_ListVersionsByFunction.md) ++ [ PublishLayerVersion ](API_PublishLayerVersion.md) ++ [ PublishVersion ](API_PublishVersion.md) ++ [ PutFunctionCodeSigningConfig ](API_PutFunctionCodeSigningConfig.md) ++ [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md) ++ [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md) ++ [ PutProvisionedConcurrencyConfig ](API_PutProvisionedConcurrencyConfig.md) ++ [ RemoveLayerVersionPermission ](API_RemoveLayerVersionPermission.md) ++ [ RemovePermission ](API_RemovePermission.md) ++ [ TagResource ](API_TagResource.md) ++ [ UntagResource ](API_UntagResource.md) ++ [ UpdateAlias ](API_UpdateAlias.md) ++ [ UpdateCodeSigningConfig ](API_UpdateCodeSigningConfig.md) ++ [ UpdateEventSourceMapping ](API_UpdateEventSourceMapping.md) ++ [ UpdateFunctionCode ](API_UpdateFunctionCode.md) ++ [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md) ++ [ UpdateFunctionEventInvokeConfig ](API_UpdateFunctionEventInvokeConfig.md) \ No newline at end of file diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md index 4c1a03bb..4f1830eb 100644 --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ b/doc_source/API_ProvisionedConcurrencyConfigListItem.md @@ -4,42 +4,42 @@ Details about the provisioned concurrency configuration for a function alias or ## Contents - **AllocatedProvisionedConcurrentExecutions** + ** AllocatedProvisionedConcurrentExecutions ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. Required: No - **AvailableProvisionedConcurrentExecutions** + ** AvailableProvisionedConcurrentExecutions ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. Required: No - **FunctionArn** + ** FunctionArn ** The Amazon Resource Name \(ARN\) of the alias or version\. 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-_]+))?` Required: No - **LastModified** + ** LastModified ** 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 Required: No - **RequestedProvisionedConcurrentExecutions** + ** RequestedProvisionedConcurrentExecutions ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. Required: No - **Status** + ** Status ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` Required: No - **StatusReason** + ** StatusReason ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String Required: No diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 162ffdf6..cbbeb2c9 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -2,7 +2,7 @@ Creates an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. -Add layers to your function with [CreateFunction](API_CreateFunction.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. +Add layers to your function with [ CreateFunction ](API_CreateFunction.md) or [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. ## Request Syntax @@ -27,7 +27,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [LayerName](#API_PublishLayerVersion_RequestSyntax) ** + ** [ LayerName ](#API_PublishLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` @@ -37,25 +37,25 @@ Required: Yes The request accepts the following data in JSON format\. - ** [CompatibleRuntimes](#API_PublishLayerVersion_RequestSyntax) ** -A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. + ** [ CompatibleRuntimes ](#API_PublishLayerVersion_RequestSyntax) ** +A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ ListLayers ](API_ListLayers.md) and [ ListLayerVersions ](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [Content](#API_PublishLayerVersion_RequestSyntax) ** + ** [ Content ](#API_PublishLayerVersion_RequestSyntax) ** The function layer archive\. -Type: [LayerVersionContentInput](API_LayerVersionContentInput.md) object +Type: [ LayerVersionContentInput ](API_LayerVersionContentInput.md) object Required: Yes - ** [Description](#API_PublishLayerVersion_RequestSyntax) ** + ** [ Description ](#API_PublishLayerVersion_RequestSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [LicenseInfo](#API_PublishLayerVersion_RequestSyntax) ** + ** [ LicenseInfo ](#API_PublishLayerVersion_RequestSyntax) ** The layer's software license\. It can be any of the following: + An [SPDX license identifier](https://spdx.org/licenses/)\. For example, `MIT`\. + The URL of a license hosted on the internet\. For example, `https://opensource.org/licenses/MIT`\. @@ -94,65 +94,65 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [CompatibleRuntimes](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ CompatibleRuntimes ](#API_PublishLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ Content ](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. -Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object +Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object - ** [CreatedDate](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ CreatedDate ](#API_PublishLayerVersion_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [Description](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ Description ](#API_PublishLayerVersion_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [LayerArn](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ LayerArn ](#API_PublishLayerVersion_ResponseSyntax) ** The ARN of the layer\. Type: String 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-_]+` - ** [LayerVersionArn](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ LayerVersionArn ](#API_PublishLayerVersion_ResponseSyntax) ** The ARN of the layer version\. Type: String 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]+` - ** [LicenseInfo](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ LicenseInfo ](#API_PublishLayerVersion_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [Version](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ Version ](#API_PublishLayerVersion_ResponseSyntax) ** The version number\. Type: Long ## Errors - **CodeStorageExceededException** + ** 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** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 40de9968..dc6a4d58 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -2,9 +2,9 @@ Creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) from the current code and configuration of a function\. Use versions to create a snapshot of your function code and configuration that doesn't change\. - AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [UpdateFunctionCode](API_UpdateFunctionCode.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. + AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [ UpdateFunctionCode ](API_UpdateFunctionCode.md) or [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. -Clients can invoke versions directly or with an alias\. To create an alias, use [CreateAlias](API_CreateAlias.md)\. +Clients can invoke versions directly or with an alias\. To create an alias, use [ CreateAlias ](API_CreateAlias.md)\. ## Request Syntax @@ -23,7 +23,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PublishVersion_RequestSyntax) ** + ** [ FunctionName ](#API_PublishVersion_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -39,18 +39,18 @@ Required: Yes The request accepts the following data in JSON format\. - ** [CodeSha256](#API_PublishVersion_RequestSyntax) ** -Only publish a version if the hash value matches the value that's specified\. Use this option to avoid publishing a version if the function code has changed since you last updated it\. You can get the hash for the version that you uploaded from the output of [UpdateFunctionCode](API_UpdateFunctionCode.md)\. + ** [ CodeSha256 ](#API_PublishVersion_RequestSyntax) ** +Only publish a version if the hash value matches the value that's specified\. Use this option to avoid publishing a version if the function code has changed since you last updated it\. You can get the hash for the version that you uploaded from the output of [ UpdateFunctionCode ](API_UpdateFunctionCode.md)\. Type: String Required: No - ** [Description](#API_PublishVersion_RequestSyntax) ** + ** [ Description ](#API_PublishVersion_RequestSyntax) ** A description for the version to override the description in the function configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [RevisionId](#API_PublishVersion_RequestSyntax) ** + ** [ RevisionId ](#API_PublishVersion_RequestSyntax) ** Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid publishing a version if the function configuration has changed since you last updated it\. Type: String Required: No @@ -140,179 +140,179 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [CodeSha256](#API_PublishVersion_ResponseSyntax) ** + ** [ CodeSha256 ](#API_PublishVersion_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_PublishVersion_ResponseSyntax) ** + ** [ CodeSize ](#API_PublishVersion_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_PublishVersion_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_PublishVersion_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_PublishVersion_ResponseSyntax) ** + ** [ Description ](#API_PublishVersion_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_PublishVersion_ResponseSyntax) ** + ** [ Environment ](#API_PublishVersion_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_PublishVersion_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_PublishVersion_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_PublishVersion_ResponseSyntax) ** + ** [ FunctionArn ](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [ FunctionName ](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [ Handler ](#API_PublishVersion_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_PublishVersion_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [ LastModified ](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [ LastUpdateStatus ](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [ LastUpdateStatusReason ](#API_PublishVersion_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_PublishVersion_ResponseSyntax) ** + ** [ Layers ](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_PublishVersion_ResponseSyntax) ** + ** [ MasterArn ](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [ MemorySize ](#API_PublishVersion_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_PublishVersion_ResponseSyntax) ** + ** [ PackageType ](#API_PublishVersion_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** + ** [ RevisionId ](#API_PublishVersion_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_PublishVersion_ResponseSyntax) ** + ** [ Role ](#API_PublishVersion_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [Runtime](#API_PublishVersion_ResponseSyntax) ** + ** [ Runtime ](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** + ** [ SigningJobArn ](#API_PublishVersion_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_PublishVersion_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_PublishVersion_ResponseSyntax) ** + ** [ State ](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [ StateReason ](#API_PublishVersion_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** + ** [ StateReasonCode ](#API_PublishVersion_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_PublishVersion_ResponseSyntax) ** + ** [ Timeout ](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [ TracingConfig ](#API_PublishVersion_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_PublishVersion_ResponseSyntax) ** + ** [ Version ](#API_PublishVersion_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [VpcConfig](#API_PublishVersion_ResponseSyntax) ** + ** [ VpcConfig ](#API_PublishVersion_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **CodeStorageExceededException** + ** 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** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** 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** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md index e6364276..f8d5b31e 100644 --- a/doc_source/API_PutFunctionCodeSigningConfig.md +++ b/doc_source/API_PutFunctionCodeSigningConfig.md @@ -17,7 +17,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** + ** [ FunctionName ](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -33,7 +33,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. @@ -58,13 +58,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfigArn ](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - ** [FunctionName](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** + ** [ FunctionName ](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** The name of the Lambda function\. **Name formats** @@ -78,27 +78,27 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md index f1448835..20dac787 100644 --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -2,9 +2,9 @@ Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level\. -Concurrency settings apply to the function as a whole, including all published versions and the unpublished version\. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level\. Use [GetFunction](API_GetFunction.md) to see the current setting for a function\. +Concurrency settings apply to the function as a whole, including all published versions and the unpublished version\. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level\. Use [ GetFunction ](API_GetFunction.md) to see the current setting for a function\. -Use [GetAccountSettings](API_GetAccountSettings.md) to see your Regional concurrency limit\. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per\-function limit\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. +Use [ GetAccountSettings ](API_GetAccountSettings.md) to see your Regional concurrency limit\. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per\-function limit\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. ## Request Syntax @@ -21,7 +21,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PutFunctionConcurrency_RequestSyntax) ** + ** [ FunctionName ](#API_PutFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -37,7 +37,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_RequestSyntax) ** + ** [ ReservedConcurrentExecutions ](#API_PutFunctionConcurrency_RequestSyntax) ** The number of simultaneous executions to reserve for the function\. Type: Integer Valid Range: Minimum value of 0\. @@ -60,30 +60,30 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_ResponseSyntax) ** -The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. + ** [ ReservedConcurrentExecutions ](#API_PutFunctionConcurrency_ResponseSyntax) ** +The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. Type: Integer Valid Range: Minimum value of 0\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index 774ee816..306e9aaf 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -1,8 +1,8 @@ # PutFunctionEventInvokeConfig -Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md)\. +Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [ UpdateFunctionEventInvokeConfig ](API_UpdateFunctionEventInvokeConfig.md)\. -By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. +By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. To send an invocation record to a queue, topic, function, or event bus, specify a [destination](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations)\. You can configure separate destinations for successful invocations \(on\-success\) and events that fail all processing attempts \(on\-failure\)\. You can configure destinations in addition to or instead of a dead\-letter queue\. @@ -30,7 +30,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ FunctionName ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -42,7 +42,7 @@ 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 - ** [Qualifier](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ Qualifier ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -51,7 +51,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ DestinationConfig ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -59,16 +59,16 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ MaximumRetryAttempts ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -102,7 +102,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ DestinationConfig ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -110,46 +110,46 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [FunctionArn](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ FunctionArn ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the 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-_]+))?` - ** [LastModified](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ LastModified ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md index cb76f8d3..7dca3a23 100644 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -17,7 +17,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ FunctionName ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -29,7 +29,7 @@ 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 - ** [Qualifier](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ Qualifier ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -39,7 +39,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ ProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The amount of provisioned concurrency to allocate for the version or alias\. Type: Integer Valid Range: Minimum value of 1\. @@ -67,53 +67,53 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [AllocatedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ AllocatedProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. - ** [AvailableProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ AvailableProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. - ** [LastModified](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ LastModified ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** 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 - ** [RequestedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ RequestedProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. - ** [Status](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ Status ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` - ** [StatusReason](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ StatusReason ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md index d0cb44c6..c9d5478d 100644 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -1,6 +1,6 @@ # RemoveLayerVersionPermission -Removes a statement from the permissions policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. +Removes a statement from the permissions policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md)\. ## Request Syntax @@ -12,22 +12,22 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber/policy/StatementId?Re The request uses the following URI parameters\. - ** [LayerName](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [ LayerName ](#API_RemoveLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [RevisionId](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [ RevisionId ](#API_RemoveLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [StatementId](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [ StatementId ](#API_RemoveLayerVersionPermission_RequestSyntax) ** The identifier that was specified when the statement was added\. Length Constraints: Minimum length of 1\. Maximum length of 100\. Pattern: `([a-zA-Z0-9-_]+)` Required: Yes - ** [VersionNumber](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [ VersionNumber ](#API_RemoveLayerVersionPermission_RequestSyntax) ** The version number\. Required: Yes @@ -47,23 +47,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** 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 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md index c85f9254..bc601ef3 100644 --- a/doc_source/API_RemovePermission.md +++ b/doc_source/API_RemovePermission.md @@ -1,6 +1,6 @@ # RemovePermission -Revokes function\-use permission from an AWS service or another account\. You can get the ID of the statement from the output of [GetPolicy](API_GetPolicy.md)\. +Revokes function\-use permission from an AWS service or another account\. You can get the ID of the statement from the output of [ GetPolicy ](API_GetPolicy.md)\. ## Request Syntax @@ -12,7 +12,7 @@ DELETE /2015-03-31/functions/FunctionName/policy/StatementId?Qualifier=Qualifier The request uses the following URI parameters\. - ** [FunctionName](#API_RemovePermission_RequestSyntax) ** + ** [ FunctionName ](#API_RemovePermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,15 +24,15 @@ 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 - ** [Qualifier](#API_RemovePermission_RequestSyntax) ** + ** [ Qualifier ](#API_RemovePermission_RequestSyntax) ** Specify a version or alias to remove permissions from a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` - ** [RevisionId](#API_RemovePermission_RequestSyntax) ** + ** [ RevisionId ](#API_RemovePermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [StatementId](#API_RemovePermission_RequestSyntax) ** + ** [ StatementId ](#API_RemovePermission_RequestSyntax) ** Statement ID of the permission to remove\. Length Constraints: Minimum length of 1\. Maximum length of 100\. Pattern: `([a-zA-Z0-9-_.]+)` @@ -54,23 +54,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** 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 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md index 27ce6673..26ec3da5 100644 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -4,7 +4,7 @@ The self\-managed Apache Kafka cluster for your event source\. ## Contents - **Endpoints** + ** Endpoints ** The list of bootstrap servers for your Kafka brokers in the following format: `"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]`\. Type: String to array of strings map Map Entries: Maximum number of 2 items\. diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 996c0e54..5b108d1c 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -4,7 +4,7 @@ To secure and define access to your event source, you can specify the authentica ## Contents - **Type** + ** Type ** The type of authentication protocol, VPC components, or virtual host for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. + `BASIC_AUTH` \- \(Amazon MQ\) The AWS Secrets Manager secret that stores your broker credentials\. + `BASIC_AUTH` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers\. @@ -17,7 +17,7 @@ Type: String Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST` Required: No - **URI** + ** URI ** The value for your chosen configuration in `Type`\. For example: `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 200\. diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md index 82a06bef..45444747 100644 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -19,7 +19,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ARN](#API_TagResource_RequestSyntax) ** + ** [ ARN ](#API_TagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. 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 @@ -28,7 +28,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [Tags](#API_TagResource_RequestSyntax) ** + ** [ Tags ](#API_TagResource_RequestSyntax) ** A list of tags to apply to the function\. Type: String to string map Required: Yes @@ -45,23 +45,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 4ff92965..a4348db1 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -4,7 +4,7 @@ The function's [ AWS X\-Ray ](https://docs.aws.amazon.com/lambda/latest/dg/servi ## Contents - **Mode** + ** Mode ** The tracing mode\. Type: String Valid Values:` Active | PassThrough` diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md index cb3c0e8c..9d666f16 100644 --- a/doc_source/API_TracingConfigResponse.md +++ b/doc_source/API_TracingConfigResponse.md @@ -4,7 +4,7 @@ The function's AWS X\-Ray tracing configuration\. ## Contents - **Mode** + ** Mode ** The tracing mode\. Type: String Valid Values:` Active | PassThrough` diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index aaa9f473..f6188166 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -1,39 +1,39 @@ # Data Types The following data types are supported: -+ [AccountLimit](API_AccountLimit.md) -+ [AccountUsage](API_AccountUsage.md) -+ [AliasConfiguration](API_AliasConfiguration.md) -+ [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) -+ [AllowedPublishers](API_AllowedPublishers.md) -+ [CodeSigningConfig](API_CodeSigningConfig.md) -+ [CodeSigningPolicies](API_CodeSigningPolicies.md) -+ [Concurrency](API_Concurrency.md) -+ [DeadLetterConfig](API_DeadLetterConfig.md) -+ [DestinationConfig](API_DestinationConfig.md) -+ [Environment](API_Environment.md) -+ [EnvironmentError](API_EnvironmentError.md) -+ [EnvironmentResponse](API_EnvironmentResponse.md) -+ [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) -+ [FileSystemConfig](API_FileSystemConfig.md) -+ [FunctionCode](API_FunctionCode.md) -+ [FunctionCodeLocation](API_FunctionCodeLocation.md) -+ [FunctionConfiguration](API_FunctionConfiguration.md) -+ [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) -+ [ImageConfig](API_ImageConfig.md) -+ [ImageConfigError](API_ImageConfigError.md) -+ [ImageConfigResponse](API_ImageConfigResponse.md) -+ [Layer](API_Layer.md) -+ [LayersListItem](API_LayersListItem.md) -+ [LayerVersionContentInput](API_LayerVersionContentInput.md) -+ [LayerVersionContentOutput](API_LayerVersionContentOutput.md) -+ [LayerVersionsListItem](API_LayerVersionsListItem.md) -+ [OnFailure](API_OnFailure.md) -+ [OnSuccess](API_OnSuccess.md) -+ [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) -+ [SelfManagedEventSource](API_SelfManagedEventSource.md) -+ [SourceAccessConfiguration](API_SourceAccessConfiguration.md) -+ [TracingConfig](API_TracingConfig.md) -+ [TracingConfigResponse](API_TracingConfigResponse.md) -+ [VpcConfig](API_VpcConfig.md) -+ [VpcConfigResponse](API_VpcConfigResponse.md) \ No newline at end of file ++ [ AccountLimit ](API_AccountLimit.md) ++ [ AccountUsage ](API_AccountUsage.md) ++ [ AliasConfiguration ](API_AliasConfiguration.md) ++ [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) ++ [ AllowedPublishers ](API_AllowedPublishers.md) ++ [ CodeSigningConfig ](API_CodeSigningConfig.md) ++ [ CodeSigningPolicies ](API_CodeSigningPolicies.md) ++ [ Concurrency ](API_Concurrency.md) ++ [ DeadLetterConfig ](API_DeadLetterConfig.md) ++ [ DestinationConfig ](API_DestinationConfig.md) ++ [ Environment ](API_Environment.md) ++ [ EnvironmentError ](API_EnvironmentError.md) ++ [ EnvironmentResponse ](API_EnvironmentResponse.md) ++ [ EventSourceMappingConfiguration ](API_EventSourceMappingConfiguration.md) ++ [ FileSystemConfig ](API_FileSystemConfig.md) ++ [ FunctionCode ](API_FunctionCode.md) ++ [ FunctionCodeLocation ](API_FunctionCodeLocation.md) ++ [ FunctionConfiguration ](API_FunctionConfiguration.md) ++ [ FunctionEventInvokeConfig ](API_FunctionEventInvokeConfig.md) ++ [ ImageConfig ](API_ImageConfig.md) ++ [ ImageConfigError ](API_ImageConfigError.md) ++ [ ImageConfigResponse ](API_ImageConfigResponse.md) ++ [ Layer ](API_Layer.md) ++ [ LayersListItem ](API_LayersListItem.md) ++ [ LayerVersionContentInput ](API_LayerVersionContentInput.md) ++ [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) ++ [ LayerVersionsListItem ](API_LayerVersionsListItem.md) ++ [ OnFailure ](API_OnFailure.md) ++ [ OnSuccess ](API_OnSuccess.md) ++ [ ProvisionedConcurrencyConfigListItem ](API_ProvisionedConcurrencyConfigListItem.md) ++ [ SelfManagedEventSource ](API_SelfManagedEventSource.md) ++ [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) ++ [ TracingConfig ](API_TracingConfig.md) ++ [ TracingConfigResponse ](API_TracingConfigResponse.md) ++ [ VpcConfig ](API_VpcConfig.md) ++ [ VpcConfigResponse ](API_VpcConfigResponse.md) \ No newline at end of file diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md index e2d5bacb..88cfb1be 100644 --- a/doc_source/API_UntagResource.md +++ b/doc_source/API_UntagResource.md @@ -12,12 +12,12 @@ DELETE /2017-03-31/tags/ARN?tagKeys=TagKeys HTTP/1.1 The request uses the following URI parameters\. - ** [ARN](#API_UntagResource_RequestSyntax) ** + ** [ ARN ](#API_UntagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. 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 - ** [TagKeys](#API_UntagResource_RequestSyntax) ** + ** [ TagKeys ](#API_UntagResource_RequestSyntax) ** A list of tag keys to remove from the function\. Required: Yes @@ -37,23 +37,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md index 0a163ec3..98f85781 100644 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -24,7 +24,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_UpdateAlias_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -36,7 +36,7 @@ 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 - ** [Name](#API_UpdateAlias_RequestSyntax) ** + ** [ Name ](#API_UpdateAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -46,27 +46,27 @@ Required: Yes The request accepts the following data in JSON format\. - ** [Description](#API_UpdateAlias_RequestSyntax) ** + ** [ Description ](#API_UpdateAlias_RequestSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [FunctionVersion](#API_UpdateAlias_RequestSyntax) ** + ** [ FunctionVersion ](#API_UpdateAlias_RequestSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: No - ** [RevisionId](#API_UpdateAlias_RequestSyntax) ** + ** [ RevisionId ](#API_UpdateAlias_RequestSyntax) ** Only update the alias if the revision ID matches the ID that's specified\. Use this option to avoid modifying an alias that has changed since you last read it\. Type: String Required: No - ** [RoutingConfig](#API_UpdateAlias_RequestSyntax) ** + ** [ RoutingConfig ](#API_UpdateAlias_RequestSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object Required: No ## Response Syntax @@ -95,59 +95,59 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [AliasArn](#API_UpdateAlias_ResponseSyntax) ** + ** [ AliasArn ](#API_UpdateAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. 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-_]+))?` - ** [Description](#API_UpdateAlias_ResponseSyntax) ** + ** [ Description ](#API_UpdateAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [FunctionVersion](#API_UpdateAlias_ResponseSyntax) ** + ** [ FunctionVersion ](#API_UpdateAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [Name](#API_UpdateAlias_ResponseSyntax) ** + ** [ Name ](#API_UpdateAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [RevisionId](#API_UpdateAlias_ResponseSyntax) ** + ** [ RevisionId ](#API_UpdateAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [RoutingConfig](#API_UpdateAlias_ResponseSyntax) ** + ** [ RoutingConfig ](#API_UpdateAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** 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** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md index f6e7e8b9..181a153a 100644 --- a/doc_source/API_UpdateCodeSigningConfig.md +++ b/doc_source/API_UpdateCodeSigningConfig.md @@ -23,7 +23,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [CodeSigningConfigArn](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_UpdateCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -33,17 +33,17 @@ Required: Yes The request accepts the following data in JSON format\. - ** [AllowedPublishers](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [ AllowedPublishers ](#API_UpdateCodeSigningConfig_RequestSyntax) ** Signing profiles for this code signing configuration\. -Type: [AllowedPublishers](API_AllowedPublishers.md) object +Type: [ AllowedPublishers ](API_AllowedPublishers.md) object Required: No - ** [CodeSigningPolicies](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningPolicies ](#API_UpdateCodeSigningConfig_RequestSyntax) ** The code signing policy\. -Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object +Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object Required: No - ** [Description](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [ Description ](#API_UpdateCodeSigningConfig_RequestSyntax) ** Descriptive name for this code signing configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. @@ -77,21 +77,21 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfig](#API_UpdateCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfig ](#API_UpdateCodeSigningConfig_ResponseSyntax) ** The code signing configuration -Type: [CodeSigningConfig](API_CodeSigningConfig.md) object +Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 8e9025f0..8d4f4782 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -47,7 +47,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [UUID](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ UUID ](#API_UpdateEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -55,8 +55,8 @@ Required: Yes The request accepts the following data in JSON format\. - ** [BatchSize](#API_UpdateEventSourceMapping_RequestSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_UpdateEventSourceMapping_RequestSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. @@ -66,22 +66,23 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No - ** [DestinationConfig](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ DestinationConfig ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - ** [Enabled](#API_UpdateEventSourceMapping_RequestSyntax) ** -If true, the event source mapping is active\. Set to false to pause polling and invocation\. + ** [ Enabled ](#API_UpdateEventSourceMapping_RequestSyntax) ** +When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. +Default: True Type: Boolean Required: No - ** [FunctionName](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -95,44 +96,46 @@ 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: No - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ FunctionResponseTypes ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. + ** [ MaximumBatchingWindowInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ MaximumRetryAttempts ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - ** [ParallelizationFactor](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ ParallelizationFactor ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ SourceAccessConfigurations ](#API_UpdateEventSourceMapping_RequestSyntax) ** An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ TumblingWindowInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. @@ -192,135 +195,139 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [BatchSize](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_UpdateEventSourceMapping_ResponseSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [DestinationConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ DestinationConfig ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [EventSourceArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ EventSourceArn ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ FunctionArn ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda 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-_]+))?` - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ FunctionResponseTypes ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ LastModified ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [LastProcessingResult](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ LastProcessingResult ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** [ MaximumBatchingWindowInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ ParallelizationFactor ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [Queues](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ Queues ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ SelfManagedEventSource ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ SourceAccessConfigurations ](#API_UpdateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ StartingPosition ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ StartingPositionTimestamp ](#API_UpdateEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ State ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [StateTransitionReason](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ StateTransitionReason ](#API_UpdateEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ Topics ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ TumblingWindowInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ UUID ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceInUseException** + ** ResourceInUseException ** The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index c6e04232..dd684e92 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -29,7 +29,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateFunctionCode_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -45,46 +45,46 @@ Required: Yes The request accepts the following data in JSON format\. - ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ DryRun ](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean Required: No - ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ ImageUri ](#API_UpdateFunctionCode_RequestSyntax) ** URI of a container image in the Amazon ECR registry\. Type: String Required: No - ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** -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\. + ** [ Publish ](#API_UpdateFunctionCode_RequestSyntax) ** +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) ** + ** [ RevisionId ](#API_UpdateFunctionCode_RequestSyntax) ** 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) ** + ** [ S3Bucket ](#API_UpdateFunctionCode_RequestSyntax) ** 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\.\-_]*(? + ** [ S3Key ](#API_UpdateFunctionCode_RequestSyntax) ** 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) ** + ** [ S3ObjectVersion ](#API_UpdateFunctionCode_RequestSyntax) ** 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) ** + ** [ ZipFile ](#API_UpdateFunctionCode_RequestSyntax) ** 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 @@ -174,191 +174,191 @@ 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) ** + ** [ CodeSha256 ](#API_UpdateFunctionCode_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ CodeSize ](#API_UpdateFunctionCode_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Description ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Environment ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_UpdateFunctionCode_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ FunctionArn ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ FunctionName ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ Handler ](#API_UpdateFunctionCode_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ LastModified ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ LastUpdateStatus ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ LastUpdateStatusReason ](#API_UpdateFunctionCode_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Layers ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ MasterArn ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ MemorySize ](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ PackageType ](#API_UpdateFunctionCode_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ RevisionId ](#API_UpdateFunctionCode_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Role ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ Runtime ](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ SigningJobArn ](#API_UpdateFunctionCode_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_UpdateFunctionCode_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ State ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ StateReason ](#API_UpdateFunctionCode_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ StateReasonCode ](#API_UpdateFunctionCode_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Timeout ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ TracingConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Version ](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [ VpcConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **CodeStorageExceededException** + ** 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 - **CodeVerificationFailedException** + ** CodeVerificationFailedException ** The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. HTTP Status Code: 400 - **InvalidCodeSignatureException** + ** InvalidCodeSignatureException ** The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** 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** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 77e5ac07..a2cb4777 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -2,11 +2,11 @@ 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)\. +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)\. +To configure function concurrency, use [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. To grant invoke permissions to an account or AWS service, use [ AddPermission ](API_AddPermission.md)\. ## Request Syntax @@ -57,7 +57,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateFunctionConfiguration_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -73,90 +73,90 @@ Required: Yes The request accepts the following data in JSON format\. - ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ DeadLetterConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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 +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object Required: No - ** [Description](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ Description ](#API_UpdateFunctionConfiguration_RequestSyntax) ** A description of the function\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [Environment](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ Environment ](#API_UpdateFunctionConfiguration_RequestSyntax) ** Environment variables that are accessible from function code during execution\. -Type: [Environment](API_Environment.md) object +Type: [ Environment ](API_Environment.md) object Required: No - ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ FileSystemConfigs ](#API_UpdateFunctionConfiguration_RequestSyntax) ** Connection settings for an Amazon EFS file system\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - ** [Handler](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ Handler ](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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 - ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** - [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object + ** [ ImageConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Docker file\. +Type: [ ImageConfig ](API_ImageConfig.md) object Required: No - ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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) ** + ** [ Layers ](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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\. 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) ** + ** [ MemorySize ](#API_UpdateFunctionConfiguration_RequestSyntax) ** The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ RevisionId ](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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) ** + ** [ Role ](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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) ** + ** [ Runtime ](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** -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\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. + ** [ Timeout ](#API_UpdateFunctionConfiguration_RequestSyntax) ** +The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No - ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ TracingConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [TracingConfig](API_TracingConfig.md) object +Type: [ TracingConfig ](API_TracingConfig.md) object Required: No - ** [VpcConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ VpcConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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 +Type: [ VpcConfig ](API_VpcConfig.md) object Required: No ## Response Syntax @@ -244,187 +244,187 @@ 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) ** + ** [ CodeSha256 ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ CodeSize ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Description ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Environment ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ FunctionArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ FunctionName ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ Handler ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ LastModified ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ LastUpdateStatus ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ LastUpdateStatusReason ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Layers ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ MasterArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ MemorySize ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ PackageType ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ RevisionId ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Role ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ Runtime ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ SigningJobArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ State ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ StateReason ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ StateReasonCode ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Timeout ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ TracingConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Version ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [ VpcConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **CodeVerificationFailedException** + ** CodeVerificationFailedException ** The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. HTTP Status Code: 400 - **InvalidCodeSignatureException** + ** InvalidCodeSignatureException ** The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** 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** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index 38046cdb..35d1ba27 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Updates the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -28,7 +28,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -40,7 +40,7 @@ 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 - ** [Qualifier](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ Qualifier ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -49,7 +49,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ DestinationConfig ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -57,16 +57,16 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ MaximumRetryAttempts ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -100,7 +100,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ DestinationConfig ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -108,46 +108,46 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [FunctionArn](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ FunctionArn ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the 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-_]+))?` - ** [LastModified](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ LastModified ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md index c44d94f0..5cf2d276 100644 --- a/doc_source/API_VpcConfig.md +++ b/doc_source/API_VpcConfig.md @@ -4,13 +4,13 @@ The VPC security groups and subnets that are attached to a Lambda function\. For ## Contents - **SecurityGroupIds** + ** SecurityGroupIds ** A list of VPC security groups IDs\. Type: Array of strings Array Members: Maximum number of 5 items\. Required: No - **SubnetIds** + ** SubnetIds ** A list of VPC subnet IDs\. Type: Array of strings Array Members: Maximum number of 16 items\. diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md index 66609593..af0b36fd 100644 --- a/doc_source/API_VpcConfigResponse.md +++ b/doc_source/API_VpcConfigResponse.md @@ -4,19 +4,19 @@ The VPC security groups and subnets that are attached to a Lambda function\. ## Contents - **SecurityGroupIds** + ** SecurityGroupIds ** A list of VPC security groups IDs\. Type: Array of strings Array Members: Maximum number of 5 items\. Required: No - **SubnetIds** + ** SubnetIds ** A list of VPC subnet IDs\. Type: Array of strings Array Members: Maximum number of 16 items\. Required: No - **VpcId** + ** VpcId ** The ID of the VPC\. Type: String Required: No diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index daf049a0..fec9dded 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -45,7 +45,7 @@ The following shows an example of a permissions policy with limited scope\. It a "lambda:GetFunctionConcurrency", "lambda:ListEventSourceMappings", "lambda:ListFunctions", - "lambda:ListTags" + "lambda:ListTags", "iam:ListRoles" ], "Resource": "*" @@ -112,7 +112,7 @@ The permissions in the policy are organized into statements based on the [resour "lambda:GetFunctionConcurrency", "lambda:ListEventSourceMappings", "lambda:ListFunctions", - "lambda:ListTags" + "lambda:ListTags", "iam:ListRoles" ], "Resource": "*" diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 400ace4b..f1bb64c7 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function:*", "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" diff --git a/doc_source/applications-usecases.md b/doc_source/applications-usecases.md index 5066ea83..dcc91b89 100644 --- a/doc_source/applications-usecases.md +++ b/doc_source/applications-usecases.md @@ -12,11 +12,9 @@ The following are introductory examples of event sources and how the end\-to\-en ## Example 1: Amazon S3 pushes events and invokes a Lambda function -Amazon S3 can publish events of different types, such as PUT, POST, COPY, and DELETE object events on a bucket\. Using the bucket notification feature, you can configure an event source mapping that directs Amazon S3 to invoke a Lambda function when a specific type of event occurs, as shown in the following illustration\. +Amazon S3 can publish events of different types, such as PUT, POST, COPY, and DELETE object events on a bucket\. Using the bucket notification feature, you can configure an event source mapping that directs Amazon S3 to invoke a Lambda function when a specific type of event occurs\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/push-s3-example-10.png) - -The diagram illustrates the following sequence: +The following is a typical sequence: 1. The user creates an object in a bucket\. @@ -34,11 +32,7 @@ For poll\-based event sources, AWS Lambda polls the source and then invokes the + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -The following diagram shows how a custom application writes records to a Kinesis stream\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/kinesis-pull-10.png) - -The diagram illustrates the following sequence: +The following steps describe how a custom application writes records to a Kinesis stream: 1. The custom application writes records to a Kinesis stream\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 1ceeea73..1b3f53ba 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -90,7 +90,7 @@ Note that Lambda uses a simple probabilistic model to distribute the traffic bet You can point an alias to a maximum of two Lambda function versions\. The versions must meet the following criteria: + Both versions must have the same [execution role](lambda-intro-execution-role.md)\. -+ Both versions must have the same [dead\-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) configuration, or no dead\-letter queue configuration\. ++ Both versions must have the same [dead\-letter queue](invocation-async.md#invocation-dlq) configuration, or no dead\-letter queue configuration\. + Both versions must be published\. The alias cannot point to `$LATEST`\. **To configure routing on an alias** diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 72bc63ea..eece79db 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -1,29 +1,17 @@ -# Managing concurrency for a Lambda function - -Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. Concurrency is subject to a Regional [quota](gettingstarted-limits.md) that is shared by all functions in a Region\. +# Managing Lambda reserved concurrency There are two types of concurrency controls available: + Reserved concurrency – Reserved concurrency guarantees the maximum number of concurrent instances for the function\. When a function has reserved concurrency, no other function can use that concurrency\. There is no charge for configuring reserved concurrency for a function\. + Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond immediately to your function's invocations\. Note that configuring provisioned concurrency incurs charges to your AWS account\. -This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. - -To ensure that a function can always reach a certain level of concurrency, configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. - -When Lambda allocates an instance of your function, the [runtime](lambda-runtimes.md) loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. As your function [scales up](invocation-scaling.md), this causes the portion of requests that are served by new instances to have higher latency than the rest\. +This topic details how to manage and configure reserved concurrency\. If you want to decrease latency for your functions, use [provisioned concurrency](provisioned-concurrency.md)\. -To enable your function to scale without fluctuations in latency, use [provisioned concurrency](#configuration-concurrency-provisioned)\. By allocating provisioned concurrency before an increase in invocations, you can ensure that all requests are served by initialized instances with very low latency\. You can configure provisioned concurrency on a version of a function, or on an alias\. +Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. The total concurrency for all of the functions in your account is subject to a per\-region quota\. -Lambda also integrates with [Application Auto Scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/)\. You can configure Application Auto Scaling to manage provisioned concurrency on a schedule or based on utilization\. Use scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. To increase provisioned concurrency automatically as needed, use [the Application Auto Scaling API](#configuration-concurrency-api) to register a target and create a scaling policy\. - -Provisioned concurrency counts towards a function's reserved concurrency and Regional quotas\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \(`$LATEST`\), which prevents it from executing\. - -**Note** -You can't allocate more provisioned concurrency than reserved concurrency for a function\. +To learn about how concurrency interacts with scaling, [see Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. **Topics** + [Configuring reserved concurrency](#configuration-concurrency-reserved) -+ [Configuring provisioned concurrency](#configuration-concurrency-provisioned) + [Configuring concurrency with the Lambda API](#configuration-concurrency-api) ## Configuring reserved concurrency @@ -62,84 +50,13 @@ Reserving concurrency has the following effects\. Setting per\-function concurrency can impact the concurrency pool that is available to other functions\. To avoid issues, limit the number of users who can use the `PutFunctionConcurrency` and `DeleteFunctionConcurrency` API operations\. -## Configuring provisioned concurrency - -To manage provisioned concurrency settings for a version or alias, use the Lambda console\. - -**To provision concurrency for an alias** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Concurrency**\. - -1. Under **Provisioned concurrency configurations**, choose **Add configuration**\. - -1. Choose an alias or version\. - -1. Enter the amount of provisioned concurrency to allocate\. - -1. Choose **Save**\. - -You can manage provisioned concurrency for all aliases and versions from the function configuration page\. The list of provisioned concurrency configurations shows the allocation progress of each configuration\. Provisioned concurrency settings are also available on the configuration page for each version and alias\. - -In the following example, the `my-function-DEV` and `my-function-PROD` functions are configured with both reserved and provisioned concurrency\. For `my-function-DEV`, the full pool of reserved concurrency is also provisioned concurrency\. In this case, all invocations either run on provisioned concurrency or are throttled\. For `my-function-PROD`, a portion of the reserved concurrency pool is standard concurrency\. When all provisioned concurrency is in use, the function scales on standard concurrency to serve any additional requests\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency-provisioned.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.concurrency.png) Function concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.reserved.png) Reserved concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.unreserved.png) Unreserved concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.throttling.png) Throttling - -Provisioned concurrency does not come online immediately after you configure it\. Lambda starts allocating provisioned concurrency after a minute or two of preparation\. Similar to how functions [scale under load](invocation-scaling.md), up to 3000 instances of the function can be initialized at once, depending on the Region\. After the initial burst, instances are allocated at a steady rate of 500 per minute until the request is fulfilled\. When you request provisioned concurrency for multiple functions or versions of a function in the same Region, scaling quotas apply across all requests\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency - -To optimize latency, you can customize the initialization behavior for functions that use provisioned concurrency \. You can run initialization code for provisioned concurrency instances without impacting latency, because the initialization code runs at allocation time\. However, the initialization code for an on\-demand instance directly impacts the latency of the first invocation\. For an on\-demand instance, you may choose to defer initialization for a specific capability until the function needs that capability\. - -To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIALIZATION\_TYPE\. Lambda sets this environment variable to `provisioned-concurrency` or `on-demand`\. The value of AWS\_LAMBDA\_INITIALIZATION\_TYPE is immutable and does not change over the lifetime of the execution environment\. - -If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PREJIT environment variable to improve the latency for functions that use provisioned concurrency\. The \.NET runtime lazily compiles and initializes each library that your code calls for the first time\. As a result, the first invocation of a Lambda function can take longer than subsequent invocations\. When you set AWS\_LAMBDA\_DOTNET\_PREJIT to `ProvisionedConcurrency`, Lambda performs ahead\-of\-time JIT compilation for common system dependencies\. Lambda performs this initialization optimization for provisioned concurrency instances only, which results in faster performance for the first invocation\. If you set the environment variable to `Always`, Lambda performs ahead\-of\-time JIT compilation for every initialization\. If you set the environment variable to `Never`, ahead\-of\-time JIT compilation is disabled\. The default value for AWS\_LAMBDA\_DOTNET\_PREJIT is `ProvisionedConcurrency`\. - -For provisioned concurrency instances, your function's [initialization code](foundation-progmodel.md) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. - -Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. - -When you change the version that an alias points to, provisioned concurrency is deallocated from the old version and then allocated to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. However, you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. - -Lambda emits the following metrics for provisioned concurrency: - -**Provisioned concurrency metrics** -+ `ProvisionedConcurrentExecutions` -+ `ProvisionedConcurrencyInvocations` -+ `ProvisionedConcurrencySpilloverInvocations` -+ `ProvisionedConcurrencyUtilization` - -For details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. - ## Configuring concurrency with the Lambda API -To manage concurrency settings and autoscaling with the AWS CLI or AWS SDK, use the following API operations\. +To manage concurrency settings the AWS CLI or AWS SDK, use the following API operations\. + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [GetFunctionConcurrency](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConcurrency.html) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) -+ [PutProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutProvisionedConcurrencyConfig.html) -+ [GetProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetProvisionedConcurrencyConfig.html) -+ [ListProvisionedConcurrencyConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListProvisionedConcurrencyConfigs.html) -+ [DeleteProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteProvisionedConcurrencyConfig.html) + [GetAccountSettings](API_GetAccountSettings.md) -+ \(Application Auto Scaling\) [RegisterScalableTarget](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html) -+ \(Application Auto Scaling\) [PutScalingPolicy](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PutScalingPolicy.html) To configure reserved concurrency with the AWS CLI, use the `put-function-concurrency` command\. The following command reserves a concurrency of 100 for a function named `my-function`: @@ -153,93 +70,4 @@ You should see the following output: { "ReservedConcurrentExecutions": 100 } -``` - -To allocate provisioned concurrency for a function, use `put-provisioned-concurrency-config`\. The following command allocates a concurrency of 100 for the `BLUE` alias of a function named `my-function`: - -``` -aws lambda put-provisioned-concurrency-config --function-name my-function \ ---qualifier BLUE --provisioned-concurrent-executions 100 -``` - -You should see the following output: - -``` -{ - "Requested ProvisionedConcurrentExecutions": 100, - "Allocated ProvisionedConcurrentExecutions": 0, - "Status": "IN_PROGRESS", - "LastModified": "2019-11-21T19:32:12+0000" -} -``` - -To configure Application Auto Scaling to manage provisioned concurrency, use the Application Auto Scaling to configure [target tracking scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html)\. First, register a function's alias as a scaling target\. The following example registers the `BLUE` alias of a function named `my-function`: - -``` -aws application-autoscaling register-scalable-target --service-namespace lambda \ - --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ - --scalable-dimension lambda:function:ProvisionedConcurrency -``` - -Next, apply a scaling policy to the target\. The following example configures Application Auto Scaling to adjust the provisioned concurrency configuration for an alias to keep utilization near 70 percent: - -``` -aws application-autoscaling put-scaling-policy --service-namespace lambda \ ---scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ ---policy-name my-policy --policy-type TargetTrackingScaling \ ---target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' -``` - -You should see the following output: - -``` -{ - "PolicyARN": "arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:12266dbb-1524-xmpl-a64e-9a0a34b996fa:resource/lambda/function:my-function:BLUE:policyName/my-policy", - "Alarms": [ - { - "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7", - "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7" - }, - { - "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66", - "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66" - } - ] -} -``` - -Application Auto Scaling creates two alarms in CloudWatch\. The first alarm triggers when the utilization of provisioned concurrency consistently exceeds 70 percent\. When this happens, Application Auto Scaling allocates more provisioned concurrency to reduce utilization\. The second alarm triggers when utilization is consistently less than 63 percent \(90 percent of the 70 percent target\)\. When this happens, Application Auto Scaling reduces the alias's provisioned concurrency\. - -In the following example, a function scales between a minimum and maximum amount of provisioned concurrency based on utilization\. When the number of open requests increases, Application Auto Scaling increases provisioned concurrency in large steps until it reaches the configured maximum\. The function continues to scale on standard concurrency until utilization starts to drop\. When utilization is consistently low, Application Auto Scaling decreases provisioned concurrency in smaller periodic steps\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency - -To view your account's concurrency quotas in a Region, use `get-account-settings`\. - -``` -aws lambda get-account-settings -``` - -You should see the following output: - -``` -{ - "AccountLimit": { - "TotalCodeSize": 80530636800, - "CodeSizeUnzipped": 262144000, - "CodeSizeZipped": 52428800, - "ConcurrentExecutions": 1000, - "UnreservedConcurrentExecutions": 900 - }, - "AccountUsage": { - "TotalCodeSize": 174913095, - "FunctionCount": 52 - } -} ``` \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index fd5e3380..6a130191 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -182,7 +182,7 @@ Lambda [runtimes](lambda-runtimes.md) set several environment variables during i + `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` – The amount of memory available to the function in MB\. + `AWS_LAMBDA_FUNCTION_VERSION` – The version of the function being executed\. - `AWS_LAMBDA_INITIALIZATION_TYPE` – The initialization type of the function, which is either `on-demand` or `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. + `AWS_LAMBDA_INITIALIZATION_TYPE` – The initialization type of the function, which is either `on-demand` or `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](provisioned-concurrency.md)\. + `AWS_LAMBDA_LOG_GROUP_NAME`, `AWS_LAMBDA_LOG_STREAM_NAME` – The name of the Amazon CloudWatch Logs group and stream for the function\. + `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` – The access keys obtained from the function's [execution role](lambda-intro-execution-role.md)\. + `AWS_LAMBDA_RUNTIME_API` – \([Custom runtime](runtimes-custom.md)\) The host and port of the [runtime API](runtimes-api.md)\. @@ -201,7 +201,7 @@ The following additional environment variables aren't reserved and can be extend + `GEM_PATH` – \([Ruby](lambda-ruby.md)\) The Ruby library path \(`$LAMBDA_TASK_ROOT/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0`\)\. + `AWS_XRAY_CONTEXT_MISSING` – For X\-Ray tracing, Lambda sets this to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. + `AWS_XRAY_DAEMON_ADDRESS` – For X\-Ray tracing, the IP address and port of the X\-Ray daemon\. -+ `AWS_LAMBDA_DOTNET_PREJIT` – For the \.NET 3\.1 runtime, set this variable to enable or disable \.NET 3\.1 specific runtime optimizations\. Values include `always`, `never`, and `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `AWS_LAMBDA_DOTNET_PREJIT` – For the \.NET 3\.1 runtime, set this variable to enable or disable \.NET 3\.1 specific runtime optimizations\. Values include `always`, `never`, and `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](provisioned-concurrency.md)\. The sample values shown reflect the latest runtimes\. The presence of specific variables or their values can vary on earlier runtimes\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index bd90009b..9c510546 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -87,7 +87,7 @@ To connect a function to a file system, use the `update-function-configuration` ``` ARN=arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd aws lambda update-function-configuration --function-name my-function \ - --fs-config FileSystemArn=$ARN,LocalMountPath=/mnt/efs0 + --file-system-configs Arn=$ARN,LocalMountPath=/mnt/efs0 ``` You can get the ARN of a file system's access point with the `describe-access-points` command\. diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md index 079c5ac0..a62fe9f9 100644 --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -30,26 +30,25 @@ The **Function overview** shows a visualization of your function and its upstrea ## Configuring functions \(console\) -For most function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **configuration** tab provides the following sections: +For the following function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **configuration** tab provides the following sections: + **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function timeout and the execution role\. -+ **Triggers** – Configure [triggers](#configuration-common-triggers)\. + **Permissions** – Configure the execution role and other [permissions](lambda-permissions.md)\. -+ **Destinations** – Configure [destinations](invocation-async.md#invocation-async-destinations) for asynchronous invocations \. + **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. + **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. Tags apply to the entire function, including all versions and aliases\. + **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. + **Monitoring and operations tools** – configure CloudWatch and other monitoring tools\. -+ **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. - - Reserved concurrency applies to the entire function, including all versions and aliases\. -+ **Asynchronous invocation** – [Configure error handling behavior](invocation-async.md) to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them\. [Configure a dead\-letter queue](invocation-async.md#dlq) to retain discarded events\. ++ **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. Reserved concurrency applies to the entire function, including all versions and aliases\. - You can configure on a function, version, or alias\. -+ **Code signing** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. +You can configure the following options on a function, a function version, or an alias\. ++ **Triggers** – Configure [triggers](#configuration-common-triggers)\. ++ **Destinations** – Configure [destinations](invocation-async.md#invocation-async-destinations) for asynchronous invocations \. ++ **Asynchronous invocation** – [Configure error handling behavior](invocation-async.md) to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them\. [Configure a dead\-letter queue](invocation-async.md#invocation-dlq) to retain discarded events\. ++ **Code signing** – To use [Code signing](configuration-codesigning.md) with your function, configure the function to include a code\-signing configuration\. + **Database proxies** – [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\. + **File systems** – Connect your function to a [file system](configuration-filesystem.md)\. ++ **State machines** – Use a state machine to orchestrate and apply error handling to your function\. The console provides separate tabs to configure aliases and versions: + **Aliases** – An alias is a named resource that maps to a function version\. You can change an alias to map to a different function version\. @@ -159,3 +158,5 @@ Saved test events are also available from the **Code** tab, under the **Test** m 1. Choose **Test**\. 1. Expand the **Execution result** panel to display details about the test\. + +You can also invoke your function without saving your test event by choosing **Test** before saving\. This creates an unsaved test event that Lambda will preserve for the duration of the session\. You can access your unsaved test events from either the **Test** or **Code** tab\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index f6839867..e980dd4e 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -5,7 +5,7 @@ When you create a Lambda function, you use a [deployment package](gettingstarted You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. **Note** -You cannot convert an existing \.zip file archive function to use a container image\. You must create a new function\. +You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. When you select an image using an image tag, Lambda translates the tag to the underlying image digest\. To retrieve the digest for your image, use the [GetFunctionConfiguration](API_GetFunctionConfiguration.md) API operation\. To update the function to a newer image version, you must use the Lambda console to [update the function code](#configuration-images-update), or use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. Configuration operations such as [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) do not update the function's container image\. diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 907835cc..6f84d7d5 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -81,6 +81,9 @@ For more information, see [Controlling access to services with VPC endpoints](ht **Example: Interface endpoint policy for Lambda actions** The following is an example of an endpoint policy for Lambda\. When attached to an endpoint, this policy allows user `MyUser` to invoke the function `my-function`\. +**Note** +You need to include both the qualified and the unqualified function ARN in the resource\. + ``` { "Statement":[ @@ -94,7 +97,8 @@ The following is an example of an endpoint policy for Lambda\. When attached to "lambda:InvokeFunction" ], "Resource": [ - "arn:aws:lambda:us-east-2:123456789012:function:my-function” + "arn:aws:lambda:us-east-2:123456789012:function:my-function”, + "arn:aws:lambda:us-east-2:123456789012:function:my-function:*” ] } ] diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 13f14522..829b2388 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -4,9 +4,9 @@ You can configure a Lambda function to connect to private subnets in a virtual p 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 subnet in your function's VPC configuration\. This process can take several minutes\. -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)\. +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 [Lambda function states](functions-states.md)\. -Multiple functions can share a network interface, if the functions share the same subnet and security group\. 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\. +Multiple functions can share a network interface, if the functions share the same subnet and security group\. Connecting additional functions to the same VPC configuration \(subnet and security group\) 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\. diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index 043d1252..3d4ec84d 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -143,7 +143,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 6132f93a..d8893f72 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -14,7 +14,13 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. + +**Topics** ++ [AWS base images for \.NET](#csharp-image-base) ++ [Using a \.NET base image](#csharp-image-instructions) ++ [\.NET runtime interface clients](#csharp-image-clients) ++ [Deploy the container image](#csharp-image-deploy) ## AWS base images for \.NET @@ -39,4 +45,8 @@ The instructions are also available on [Lambda base images for \.NET](https://hu ## \.NET runtime interface clients -Download the \.NET runtime interface client from the [AWS Lambda for \.NET Core](https://github.com/aws/aws-lambda-dotnet) repository on GitHub\. \ No newline at end of file +Download the \.NET runtime interface client from the [AWS Lambda for \.NET Core](https://github.com/aws/aws-lambda-dotnet) repository on GitHub\. + +## Deploy the container image + +For a new function, you deploy the container image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index 2d009821..02a49dc3 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -103,7 +103,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md index 8b9a182c..316b45f8 100644 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -29,8 +29,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A } ``` -1. Open the **Function\.cs** file\. You are provided with a template to implement your Lambda function handler code\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambda-function.png) +1. Open the **Function\.cs** file\. You are provided with a template to implement your Lambda function handler code\. 1. Once you have written the code that represents your Lambda function, upload it by opening the context \(right\-click\) menu for the **Project** node in your application and then choosing **Publish to AWS Lambda**\. @@ -42,7 +41,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A + **Memory** – The amount of memory available to the function at runtime\. Choose an amount [between 128 MB and 10,240 MB](gettingstarted-limits.md) in 1\-MB increments\. + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is three seconds\. The maximum allowed value is 900 seconds\. + **VPC** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. - + **DLQ** – If your function is invoked asynchronously, [choose a dead\-letter queue](invocation-async.md#dlq) to receive failed invocations\. + + **DLQ** – If your function is invoked asynchronously, [choose a dead\-letter queue](invocation-async.md#invocation-dlq) to receive failed invocations\. + **Enable active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](services-xray.md)\. 1. Choose **Next**, and then choose **Upload** to deploy your application\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index 380253fe..21a62e9f 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/foundation-progmodel.md b/doc_source/foundation-progmodel.md index 8dbf5585..4d8c87cc 100644 --- a/doc_source/foundation-progmodel.md +++ b/doc_source/foundation-progmodel.md @@ -6,8 +6,6 @@ When the handler finishes processing the first event, the runtime sends it anoth When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) - Your function also has access to local storage in the `/tmp` directory\. Instances of your function that are serving requests remain active for a few hours before being recycled\. The runtime captures logging output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an error, the runtime returns that error to the invoker\. diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index 6ff428af..4a90a65a 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -1,12 +1,16 @@ -# Monitoring the state of a function with the Lambda API +# Lambda function states -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\. +When you create or update a function, AWS Lambda provisions the compute and networking resources that enable it to run\. In most cases your function is ready to be invoked or modified after a few seconds\. However, there are situations where this action can take longer, for example, configuring your function to connect to a virtual private cloud \(VPC\)\. This may lead to situations where invocation of your function fails due to resources not being available\. To indicate when your function is ready to invoke, Lambda includes a state field in the function configuration for all functions\. `State` provides information about the current status of the function, including whether you can successfully invoke the function\. -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\. +Function states do not change the behavior of function invocations or how your function runs the code\. Function states include: ++ `Pending` – After Lambda creates the function, it sets the state to pending\. While in pending state, Lambda attempts to create or configure resources for the function, such as VPC or EFS resources\. Lambda does not invoke a function during pending state\. Any invocations or other API actions that operate on the function will fail\. ++ `Active` – Your function transitions to active state after Lambda completes resource configuration and provisioning\. Functions can only be successfully invoked while active\. ++ `Failed` – Indicates that resource configuration or provisioning encountered an error\. ++ `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -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\. +Check a function's state before invocation to verify that it is active\. You can do this using the Lambda API action [GetFunctionConfiguration](API_GetFunctionConfiguration.md), or by configuring a waiter with the [AWS SDK for Java API Reference](https://docs.aws.amazon.com/sdk-for-java/latest/reference/AWSLambdaWaiters.html)\. -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\. +To view the function's state with the AWS CLI, use `get-function-configuration`\. ``` aws lambda get-function-configuration --function-name my-function @@ -30,15 +34,23 @@ You should see the following output: } ``` -The `StateReason` and `StateReasonCode` contain additional information about the state when it is not `Active`\. The following operations fail while function creation is pending: +Functions have two other attributes, `StateReason` and `StateReasonCode`\. These provide information and context about the function’s state when it is not active for troubleshooting issues\. + +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) -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`\. +## Function states while updating + +Lambda provides additional context for functions undergoing updates with the `LastUpdateStatus` attribute, which can have the following statuses: ++ `InProgress` – An update is happening on an existing function\. While a function update is in progress, invocations go to the function’s previous code and configuration\. ++ `Successful` – The update has completed\. Once Lambda finishes the update, this stays set until a further update\. ++ `Failed` – The function update has failed\. Lambda aborts the update and the function’s previous code and configuration remain available\. -**Example Function configuration – Connecting to a VPC** +**Example** +The following is the result of `get-function-configuration` on a function undergoing an update\. ``` { @@ -62,17 +74,9 @@ When you update a function's configuration, the update can trigger an asynchrono } ``` +[FunctionConfiguration](API_FunctionConfiguration.md) has two other attributes, `LastUpdateStatusReason` and `LastUpdateStatusReasonCode`, to help troubleshoot issues with updating\. + 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\. -+ `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)\. \ No newline at end of file ++ [PublishVersion](API_PublishVersion.md) \ No newline at end of file diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 6c82bbe9..73a69950 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -104,7 +104,7 @@ For more information, see [Using Lambda extensions](using-extensions.md)\. *Concurrency* is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda provisions an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function's concurrency\. -Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region level\. You can configure individual functions to limit their concurrency, or to enable them to reach a specific level of concurrency\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region level\. You can configure individual functions to limit their concurrency, or to enable them to reach a specific level of concurrency\. For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. ## Qualifier diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 520eda6f..47b34567 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -30,7 +30,7 @@ To enable functions to scale without fluctuations in latency, use *provisioned c ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) -For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. ## Asynchronous invocation diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md index 7061a86d..fbf47dbd 100644 --- a/doc_source/gettingstarted-images.md +++ b/doc_source/gettingstarted-images.md @@ -37,7 +37,7 @@ AWS provides a set of base images in the Amazon Elastic Container Registry \(Ama In the following commands, replace `123456789012` with your AWS account ID\. -**To create an image using the AWS Node\.js 12 base image** +**To create an image using the AWS Node\.js 14 base image** 1. On your local machine, create a project directory for your new function\. diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 9977f037..68d60802 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -1,46 +1,57 @@ # Lambda quotas +## Compute and storage + Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per AWS Region and can be increased\. For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*\. | Resource | Default quota | Can be increased up to | | --- | --- | --- | -| Concurrent executions | 1,000 | Tens of thousands | -| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | -| Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | -| [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | +| Concurrent executions | 1,000 | Tens of thousands | +| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | +| Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [Lambda function scaling](invocation-scaling.md)\. -The following quotas apply to function configuration, deployments, and execution\. They cannot be changed\. +## Function configuration, deployment, and execution + +The following quotas apply to function configuration, deployment, and execution\. They cannot be changed\. + +**Note** +The Lambda documentation, log messages, and console use the abbreviation MB \(rather than MiB\) to refer to 1024 KB\. | Resource | Quota | | --- | --- | -| Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | -| Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | -| Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | -| Function [resource\-based policy](access-control-resource-based.md) | 20 KB | -| Function [layers](configuration-layers.md) | five layers | -| Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | -| [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | -| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | -| [Container image](lambda-images.md) code package size | 10 GB | -| Test events \(console editor\) | 10 | -| `/tmp` directory storage | 512 MB | -| File descriptors | 1,024 | -| Execution processes/threads | 1,024 | +| Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | +| Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | +| Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | +| Function [resource\-based policy](access-control-resource-based.md) | 20 KB | +| Function [layers](configuration-layers.md) | five layers | +| Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | +| [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | +| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped\) This quota applies to all the files you upload, including layers and custom runtimes\. 3 MB \(console editor\) | +| [Container image](lambda-images.md) code package size | 10 GB | +| Test events \(console editor\) | 10 | +| `/tmp` directory storage | 512 MB | +| File descriptors | 1,024 | +| Execution processes/threads | 1,024 | + +## Lambda API requests The following quotas are associated with Lambda API requests\. | Resource | Quota | | --- | --- | -| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md), all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md), non\-AWS sources\) | -| Invocation requests per Region \(requests per second\) for asynchronous [AWS service sources](lambda-services.md) | Unlimited requests accepted\. Execution rate is based on concurrency available to the function\. See [Asynchronous invocation](invocation-async.md)\. | -| Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota applies only to functions that use provisioned concurrency\. | -| [GetFunction](API_GetFunction.md) API requests | 100 requests per second | -| [GetPolicy](API_GetPolicy.md) API requests | 15 requests per second | -| Remainder of the control plane API requests \(excludes invocation, GetFunction, and GetPolicy requests\) | 15 requests per second | +| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md), all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md), non\-AWS sources\) | +| Invocation requests per Region \(requests per second\) for asynchronous [AWS service sources](lambda-services.md) | Unlimited requests accepted\. Execution rate is based on concurrency available to the function\. See [Asynchronous invocation](invocation-async.md)\. | +| Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota applies only to functions that use provisioned concurrency\. | +| [GetFunction](API_GetFunction.md) API requests | 100 requests per second | +| [GetPolicy](API_GetPolicy.md) API requests | 15 requests per second | +| Remainder of the control plane API requests \(excludes invocation, GetFunction, and GetPolicy requests\) | 15 requests per second | + +## Other services Quotas for other services, such as AWS Identity and Access Management \(IAM\), Amazon CloudFront \(Lambda@Edge\), and Amazon Virtual Private Cloud \(Amazon VPC\), can impact your Lambda functions\. For more information, see [AWS service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) in the *Amazon Web Services General Reference*, and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/go-image.md b/doc_source/go-image.md index c55879cf..39b72669 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -14,14 +14,15 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for Go](#go-image-base) + [Go runtime interface clients](#go-image-clients) + [Using the Go:1\.x base image](#go-image-v1) -+ [Deploying Go with the `provided.al2` base image](#go-image-al2) -+ [Deploying Go with an alternative base image](#go-image-other) ++ [Create a Go image from the `provided.al2` base image](#go-image-al2) ++ [Create a Go image from an alternative base image](#go-image-other) ++ [Deploy the container image](#go-image-deploy) ## AWS base images for Go @@ -46,7 +47,7 @@ For instructions on how to use the base image for Go:1\.x, choose the **usage** The instructions are also available on [Lambda base images for Go](https://hub.docker.com/r/amazon/aws-lambda-go) in the *Docker Hub repository*\. -## Deploying Go with the `provided.al2` base image +## Create a Go image from the `provided.al2` base image To build a container image for Go that runs on Amazon Linux 2, use the `provided.al2` base image\. For more information about this base image, see [provided](https://gallery.ecr.aws/lambda/provided) in the Amazon ECR public gallery\. @@ -108,7 +109,7 @@ Note that the first three steps are identical whether you deploy your function a Now that your container image resides in the Amazon ECR container registry, you can [create](configuration-images.md) the Lambda function and deploy the image\. -## Deploying Go with an alternative base image +## Create a Go image from an alternative base image You can build a container image for Go from an alternative base image\. The following example Dockerfile uses [alpine](https://gallery.ecr.aws/h1a5s9h8/alpine) as the base image\. @@ -183,4 +184,8 @@ If you do not want to add the RIE to your image, you can test your image locally This command invokes the function running in the container image and returns a response\. -Now that your container image resides in the Amazon ECR container registry, you can you can [create](configuration-images.md) the Lambda function and deploy the image\. \ No newline at end of file +Now that your container image resides in the Amazon ECR container registry, you can you can [create](configuration-images.md) the Lambda function and deploy the image\. + +## Deploy the container image + +For a new function, you deploy the Go image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index 79406118..5f18cfbc 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -61,7 +61,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 89a50954..a6dac31c 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -88,7 +88,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 86ac0456..c7564059 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/images-create.md b/doc_source/images-create.md index c9466515..d2337734 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -104,7 +104,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do FROM public.ecr.aws/lambda/nodejs:14 # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 - # Assumes your function is named "app.js", and there is a package.json file in the app directory + # Assumes your function is named "app.js", and there is a package.json file in the app directory COPY app.js package.json ${LAMBDA_TASK_ROOT} # Install NPM dependencies for function @@ -297,4 +297,4 @@ You can use the AWS Serverless Application Model \(AWS SAM\) toolkit to create a In your AWS SAM template, you set the `Runtime` type to `Image` and provide the URI of the base image\. -For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. +For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index f841dc4a..69d4573c 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -43,7 +43,8 @@ Amazon's trademarks and trade dress may not be used in + [Lambda function versions](configuration-versions.md) + [Lambda function aliases](configuration-aliases.md) + [Managing AWS Lambda functions](lambda-managing.md) - + [Managing concurrency for a Lambda function](configuration-concurrency.md) + + [Managing Lambda reserved concurrency](configuration-concurrency.md) + + [Managing Lambda provisioned concurrency](provisioned-concurrency.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) + [Configuring database access for a Lambda function](configuration-database.md) @@ -55,7 +56,7 @@ Amazon's trademarks and trade dress may not be used in + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) - + [Monitoring the state of a function with the Lambda API](functions-states.md) + + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) @@ -132,13 +133,14 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + + [Transforming S3 Objects with S3 Object Lambda](services-s3-object-lambda.md) + [Using AWS Lambda with Secrets Manager](with-secrets-manager.md) + [Using AWS Lambda with Amazon SES](services-ses.md) + [Using Lambda with Amazon SNS](with-sns.md) + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) + [Sample function code](with-sns-create-package.md) + [Using AWS Lambda with Amazon SQS](with-sqs.md) - + [Tutorial: Using AWS Lambda with Amazon Simple Queue Service](with-sqs-example.md) + + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + [Using AWS Lambda with AWS X-Ray](services-xray.md) @@ -161,8 +163,6 @@ Amazon's trademarks and trade dress may not be used in + [Building Lambda functions with Python](lambda-python.md) + [Lambda function handler in Python](python-handler.md) + [Deploy Python Lambda functions with .zip file archives](python-package.md) - + [Tutorial: Creating a Lambda function in Python 3.8](python-package-create.md) - + [Updating a Lambda function in Python 3.8](python-package-update.md) + [Deploy Python Lambda functions with container images](python-image.md) + [AWS Lambda context object in Python](python-context.md) + [AWS Lambda function logging in Python](python-logging.md) @@ -177,7 +177,6 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda function errors in Ruby](ruby-exceptions.md) + [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) + [Building Lambda functions with Java](lambda-java.md) - + [Java sample applications for AWS Lambda](java-samples.md) + [AWS Lambda function handler in Java](java-handler.md) + [Deploy Java Lambda functions with .zip or JAR file archives](java-package.md) + [Deploy Java Lambda functions with container images](java-image.md) @@ -186,6 +185,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda function errors in Java](java-exceptions.md) + [Instrumenting Java code in AWS Lambda](java-tracing.md) + [Creating a deployment package using Eclipse](java-package-eclipse.md) + + [Java sample applications for AWS Lambda](java-samples.md) + [Building Lambda functions with Go](lambda-golang.md) + [AWS Lambda function handler in Go](golang-handler.md) + [AWS Lambda context object in Go](golang-context.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index b3f26109..792b6e0a 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -7,7 +7,7 @@ Several AWS services, such as Amazon Simple Storage Service \(Amazon S3\) and Am + [Configuring error handling for asynchronous invocation](#invocation-async-errors) + [Configuring destinations for asynchronous invocation](#invocation-async-destinations) + [Asynchronous invocation configuration API](#invocation-async-api) -+ [AWS Lambda function dead\-letter queues](#dlq) ++ [Dead\-letter queues](#invocation-dlq) ## How Lambda handles asynchronous invocations @@ -37,14 +37,8 @@ The output file \(`response.json`\) doesn't contain any information, but is stil Lambda manages the function's asynchronous event queue and attempts to retry on errors\. If the function returns an error, Lambda attempts to run it two more times, with a one\-minute wait between the first two attempts, and two minutes between the second and third attempts\. Function errors include errors returned by the function's code and errors returned by the function's runtime, such as timeouts\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/invocation-types-retries.png) - If the function doesn't have enough concurrency available to process all events, additional requests are throttled\. For throttling errors \(429\) and system errors \(500\-series\), Lambda returns the event to the queue and attempts to run the function again for up to 6 hours\. The retry interval increases exponentially from 1 second after the first attempt to a maximum of 5 minutes\. If the queue contains many entries, Lambda increases the retry interval and reduces the rate at which it reads events from the queue\. -The following example shows an event that was successfully added to the queue, but is still pending one hour later due to throttling\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/invocation-types-throttle.png) - Even if your function doesn't return an error, it's possible for it to receive the same event from Lambda multiple times because the queue itself is eventually consistent\. If the function can't keep up with incoming events, events might also be deleted from the queue without being sent to the function\. Ensure that your function code gracefully handles duplicate events, and that you have enough concurrency available to handle all invocations\. When the queue is very long, new events might age out before Lambda has a chance to send them to your function\. When an event expires or fails all processing attempts, Lambda discards it\. You can [configure error handling](#invocation-async-errors) for a function to reduce the number of retries that Lambda performs, or to discard unprocessed events more quickly\. @@ -55,7 +49,10 @@ You can also configure Lambda to send an invocation record to another service\. + **AWS Lambda** – A Lambda function\. + **Amazon EventBridge** – An EventBridge event bus\. -The invocation record contains details about the request and response in JSON format\. You can configure separate destinations for events that are processed successfully, and events that fail all processing attempts\. Alternatively, you can configure an SQS queue or SNS topic as a [dead\-letter queue](#dlq) for discarded events\. For dead\-letter queues, Lambda only sends the content of the event, without details about the response\. +The invocation record contains details about the request and response in JSON format\. You can configure separate destinations for events that are processed successfully, and events that fail all processing attempts\. Alternatively, you can configure an Amazon SQS queue or Amazon SNS topic as a [dead\-letter queue](#invocation-dlq) for discarded events\. For dead\-letter queues, Lambda only sends the content of the event, without details about the response\. + +**Note** +To prevent a function from triggering, you can set the function's reserved concurrency to zero\. When you set reserved concurrency to zero for an asynchronously\-invoked function, Lambda immediately sends all events to the configured [dead\-letter queue](#invocation-dlq) or the on\-failure [event destination](#invocation-async-destinations), without any retries\. To process events that were sent while reserved concurrency was set to zero, you need to consume the events from the dead\-letter queue or the on\-failure event destination\. ## Configuring error handling for asynchronous invocation @@ -90,7 +87,7 @@ The following example shows a function that is processing asynchronous invocatio To send events to a destination, your function needs additional permissions\. Add a policy with the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Each destination service requires a different permission, as follows: + **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) + **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) -+ **Lambda** – [lambda:InvokeFunction](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html) ++ **Lambda** – [InvokeFunction](API_Invoke.md) + **EventBridge** – [events:PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) Add destinations to your function in the Lambda console's function visualization\. @@ -204,14 +201,14 @@ You should see the following output: } ``` -## AWS Lambda function dead\-letter queues +## Dead\-letter queues As an alternative to an [on\-failure destination](#invocation-async-destinations), you can configure your function with a dead\-letter queue to save discarded events for further processing\. A dead\-letter queue acts the same as an on\-failure destination in that it is used when an event fails all processing attempts or expires without being processed\. However, a dead\-letter queue is part of a function's version\-specific configuration, so it is locked in when you publish a version\. On\-failure destinations also support additional targets and include details about the function's response in the invocation record\. To reprocess events in a dead\-letter queue, you can set it as an event source for your Lambda function\. Alternatively, you can manually retrieve the events\. You can choose an Amazon SQS queue or Amazon SNS topic for your dead\-letter queue\. If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. -+ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ++ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md) and invoke a function\. Create a queue in the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using Lambda with Amazon SNS](with-sqs.md)\. diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 8ebd736e..9065b832 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -13,7 +13,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md index b0027372..1ae816c4 100644 --- a/doc_source/invocation-images.md +++ b/doc_source/invocation-images.md @@ -9,13 +9,13 @@ For a Lambda function defined as a container image, function behavior during inv ## Function lifecycle -Lambda optimizes a new or updated container image in preparation for the function to receive invocations\. The optimization process can take a few seconds\. The function remains in the `Pending` state until the process completes\. The function then transitions to the `Active` state\. While the state is `Pending`, you can invoke the function, but other operations on the function fail\. Invocations that occur while an image update is in progress run the code from the previous image\. +After you upload a new or updated container image, Lambda optimizes the image before the function can process invocations\. The optimization process can take a few seconds\. The function remains in the `Pending` state until the process completes\. The function then transitions to the `Active` state\. While the state is `Pending`, you can invoke the function, but other operations on the function fail\. Invocations that occur while an image update is in progress run the code from the previous image\. If a function is not invoked for multiple weeks, Lambda reclaims its optimized version, and the function transitions to the `Inactive` state\. To reactivate the function, you must invoke it\. Lambda rejects the first invocation and the function enters the `Pending` state until Lambda re\-optimizes the image\. The function then returns to the `Active` state\. -Lambda periodically fetches the associated container image from the Amazon Elastic Container Registry \(Amazon ECR\) repository\. If the corresponding container image no longer exists on Amazon ECR, the function enters the `Failed` state, and Lambda returns a failure for any function invocations\. +Lambda periodically fetches the associated container image from the Amazon Elastic Container Registry \(Amazon ECR\) repository\. If the corresponding container image no longer exists on Amazon ECR or permissions are revoked, the function enters the `Failed` state, and Lambda returns a failure for any function invocations\. -You can use the Lambda API to get information about a function's state\. For more information, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. +You can use the Lambda API to get information about a function's state\. For more information, see [Lambda function states](functions-states.md)\. ## Invoking the function diff --git a/doc_source/java-context.md b/doc_source/java-context.md index 54e09cc3..653ab0d4 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -102,7 +102,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 16cb08af..1948d663 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -61,7 +61,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Creating a function that returns exceptions @@ -212,7 +212,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index c599c164..6f41740c 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -173,7 +173,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: diff --git a/doc_source/java-image.md b/doc_source/java-image.md index e6dc8fe7..a8a43259 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -14,7 +14,13 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. + +**Topics** ++ [AWS base images for Java](#java-image-base) ++ [Using a Java base image](#java-image-instructions) ++ [Java runtime interface clients](#java-image-clients) ++ [Deploy the container image](#java-image-deploy) ## AWS base images for Java @@ -55,7 +61,6 @@ You can also view the Java client source code in the [AWS Lambda Java Support Li After your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. -**Topics** -+ [AWS base images for Java](#java-image-base) -+ [Using a Java base image](#java-image-instructions) -+ [Java runtime interface clients](#java-image-clients) \ No newline at end of file +## Deploy the container image + +For a new function, you deploy the Java image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 28e895dc..6302d70b 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -102,7 +102,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. @@ -329,7 +329,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 5a441306..4bf6634f 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -20,6 +20,7 @@ Lambda provides the following libraries for Java functions: + [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. + [com\.amazonaws:aws\-lambda\-java\-events](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events) – Input types for events from services that invoke Lambda functions\. + [com\.amazonaws:aws\-lambda\-java\-log4j2](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2) – An appender library for Apache Log4j 2 that you can use to add the request ID for the current invocation to your [function logs](java-logging.md)\. ++ [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2) – The official AWS SDK for the Java programming language\. These libraries are available through [Maven Central Repository](https://search.maven.org/search?q=g:com.amazonaws)\. Add them to your build definition as follows: @@ -332,5 +333,4 @@ For a complete working example, see the following sample applications: + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](#java-package) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](#java-package) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index cf1a95f8..74378b5b 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -6,7 +6,6 @@ The GitHub repository for this guide provides sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. Use the `blank-java` sample app to learn the basics, or as a starting point for your own application\. It shows the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. It uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times when you are iterating on your function code\. The project requires minimal setup and can be deployed from the command line in less than a minute\. @@ -36,14 +35,13 @@ public class HandlerStream implements RequestStreamHandler { ... ``` -The `java-events` and `java-events-v1sdk` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. For event types like `DynamodbEvent` that require types from the AWS SDK for Java, `java-events-v1sdk` includes the SDK in its build configuration\. +The `java-events` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. -**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** +**Example [java\-events/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** ``` import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; -import com.amazonaws.services.dynamodbv2.model.Record; ... // Handler value: example.HandlerDynamoDB public class HandlerDynamoDB implements RequestHandler{ diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 294ab1c8..db2726ad 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. @@ -152,7 +152,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have active tracing enabled for Lambda functions\. The `blank-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index 942b41f8..ee55ebda 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -78,7 +78,7 @@ For more information on resources and conditions for Lambda and other AWS servic You reference a Lambda function in a policy statement using an Amazon Resource Names \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function, a function [version](configuration-versions.md), or an [alias](configuration-aliases.md)\. -When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax) parameter, or by setting a value in the [https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax) parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with the `FunctionName` passed in the API calls\. +When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [GetFunction](API_GetFunction.md) `FunctionName` parameter, or by setting a value in the [GetFunction](API_GetFunction.md) `Qualifier` parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with the `FunctionName` passed in the API calls\. You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 2e6e17c1..81eac920 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -10,8 +10,7 @@ A Lambda function's execution role is an AWS Identity and Access Management \(IA 1. Choose **Configuration** and then choose **Permissions**\. -1. Under **Resource summary**, view the services and resources that the function can access\. The following example shows the CloudWatch Logs permissions that Lambda adds to an execution role when you create it in the Lambda console\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/permissions-executionrole.png) +1. Under **Resource summary**, view the services and resources that the function can access\. 1. Choose a service from the dropdown list to see permissions related to that service\. @@ -136,6 +135,7 @@ The following AWS managed policies provide permissions that are required to use + **AWSLambdaVPCAccessExecutionRole** – Permission to manage elastic network interfaces to connect your function to a virtual private cloud \(VPC\)\. + **AWSXRayDaemonWriteAccess** – Permission to upload trace data to X\-Ray\. + **CloudWatchLambdaInsightsExecutionRolePolicy** – Permission to write runtime metrics to CloudWatch Lambda Insights\. ++ **AmazonS3ObjectLambdaExecutionRolePolicy** – Permission to interact with Amazon S3 Object Lambda\. For some features, the Lambda console attempts to add missing permissions to your execution role in a customer managed policy\. These policies can become numerous\. To avoid creating extra policies, add the relevant AWS managed policies to your execution role before enabling features\. diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index d92a1452..f74d5090 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -16,7 +16,7 @@ Depending on who invokes your function and how it's invoked, scaling behavior an + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) -+ [Monitoring the state of a function with the Lambda API](functions-states.md) ++ [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index db10e560..c5f091d0 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -13,6 +13,12 @@ Lambda supports the following Java runtimes\. | Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | | Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | +Lambda provides the following libraries for Java functions: ++ [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. ++ [com\.amazonaws:aws\-lambda\-java\-events](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events) – Input types for events from services that invoke Lambda functions\. ++ [com\.amazonaws:aws\-lambda\-java\-log4j2](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2) – An appender library for Apache Log4j 2 that you can use to add the request ID for the current invocation to your [function logs](java-logging.md)\. ++ [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2) – The official AWS SDK for the Java programming language\. + Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. **To create an execution role** @@ -66,7 +72,6 @@ The function runtime passes a context object to the handler, in addition to the Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](java-logging.md) during invocation\. If your function [returns an error](java-exceptions.md), Lambda formats the error and returns it to the invoker\. **Topics** -+ [Java sample applications for AWS Lambda](java-samples.md) + [AWS Lambda function handler in Java](java-handler.md) + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + [Deploy Java Lambda functions with container images](java-image.md) @@ -74,4 +79,5 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function errors in Java](java-exceptions.md) + [Instrumenting Java code in AWS Lambda](java-tracing.md) -+ [Creating a deployment package using Eclipse](java-package-eclipse.md) \ No newline at end of file ++ [Creating a deployment package using Eclipse](java-package-eclipse.md) ++ [Java sample applications for AWS Lambda](java-samples.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 0dfaa908..5d0a13db 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,9 +9,9 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.880\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.880\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 469cdeda..04feb72f 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -5,13 +5,14 @@ You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtim Lambda supports the following Python runtimes\. **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. **Python runtimes** | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | +| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | | Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | | Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | | Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | @@ -25,7 +26,7 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in 1. Configure the following settings: + **Name** – **my\-function**\. - + **Runtime** – **Python 3\.8**\. + + **Runtime** – **Python 3\.9**\. + **Role** – **Choose an existing role**\. + **Existing role** – **lambda\-role**\. @@ -44,16 +45,10 @@ The console creates a Lambda function with a single source file named `lambda_fu **Note** The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. -The `lambda_function` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](python-handler.md) that Lambda calls when the function is invoked\. The Python function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. - -When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](python-package.md) to upload your code to the Lambda function\. - **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](python-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. - Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](python-logging.md) during invocation\. If your function [returns an error](python-exceptions.md), Lambda formats the error and returns it to the invoker\. **Topics** diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index c2068ea7..02d80f28 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,8 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Python 3\.9 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Python 3\.9\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 16, 2021 | +| [New runtime versions for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtime versions are available for Node\.js, Python, and Java\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | July 21, 2021 | | [Support for RabbitMQ as an event source on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ for RabbitMQ as an event source\. Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | July 7, 2021 | | [SASL/PLAIN authentication for self\-managed Kafka on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss) | SASL/PLAIN is now a supported authentication mechanism for self\-managed Kafka event sources on Lambda Customers already using SASL/PLAIN on their self\-managed Kafka cluster can now easily use Lambda to build consumer applications without having to modify the way they authenticate\. For details, see [Using Lambda with self\-managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss)\. | June 29, 2021 | | [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | General availability for Lambda extensions\. Use extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | May 24, 2021 | @@ -26,7 +28,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | | [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | | [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](http://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | -| [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/API_FunctionConfiguration.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConfiguration.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | +| [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | | [Provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss) | You can now allocate provisioned concurrency for a function version or alias\. Provisioned concurrency enables a function to scale without fluctuations in latency\. For details, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Create a database proxy](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss) | You can now use the Lambda console to create a database proxy for a Lambda function\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. For details, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Percentiles support for the duration metric](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | You can now filter the duration metric based on percentiles\. For details, see [AWS Lambda metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | November 26, 2019 | @@ -44,7 +46,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [CloudWatch Logs Insights integration](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-access-metrics.html?icmpid=docs_lambda_rss) | The monitoring page in the Lambda console now includes reports from Amazon CloudWatch Logs Insights\. For details, see [Monitoring functions in the AWS Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-access-metrics.html?icmpid=docs_lambda_rss)\. | June 18, 2019 | | [Amazon Linux 2018\.03](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html?icmpid=docs_lambda_rss) | The Lambda execution environment is being updated to use Amazon Linux 2018\.03\. For details, see [Execution environment](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html?icmpid=docs_lambda_rss)\. | May 21, 2019 | | [Node\.js 10](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | A new runtime is available for Node\.js 10, nodejs10\.x\. This runtime uses Node\.js 10\.15 and will be updated with the latest point release of Node\.js 10 periodically\. Node\.js 10 is also the first runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | May 13, 2019 | -| [GetLayerVersionByArn API](https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersionByArn.html?icmpid=docs_lambda_rss) | Use the [GetLayerVersionByArn](https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersionByArn.html?icmpid=docs_lambda_rss) API to download layer version information with the version ARN as input\. Compared to GetLayerVersion, GetLayerVersionByArn lets you use the ARN directly instead of parsing it to get the layer name and version number\. | April 25, 2019 | +| [GetLayerVersionByArn API](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | Use the [GetLayerVersionByArn](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) API to download layer version information with the version ARN as input\. Compared to GetLayerVersion, GetLayerVersionByArn lets you use the ARN directly instead of parsing it to get the layer name and version number\. | April 25, 2019 | | [Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Ruby 2\.5 with a new runtime\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | | [Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | With Lambda layers, you can package and deploy libraries, custom runtimes, and other dependencies separately from your function code\. Share your layers with your other accounts or the whole world\. For details, see [Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | | [Custom runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss) | Build a custom runtime to run Lambda functions in your favorite programming language\. For details, see [Custom Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | @@ -73,7 +75,7 @@ The following table describes the important changes in each release of the *AWS | Function and alias revision IDs | AWS Lambda now supports revision IDs on your function versions and aliases\. You can use these IDs to track and apply conditional updates when you are updating your function version or alias resources\. | January 25, 2018 | | Runtime support for Go and \.NET 2\.0 | AWS Lambda has added runtime support for Go and \.NET 2\.0\. For more information, see [Building Lambda functions with Go](lambda-golang.md) and [Building Lambda functions with C\#](lambda-csharp.md)\. | January 15, 2018 | | Console Redesign | AWS Lambda has introduced a new Lambda console to simplify your experience and added a Cloud9 Code Editor to enhance your ability debug and revise your function code\. For more information, see [Edit code using the console editor](foundation-console.md#code-editor)\. | November 30,2017 | -| Setting Concurrency Limits on Individual Functions | AWS Lambda now supports setting concurrency limits on individual functions\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. | November 30,2017 | +| Setting Concurrency Limits on Individual Functions | AWS Lambda now supports setting concurrency limits on individual functions\. For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. | November 30,2017 | | Shifting Traffic with Aliases | AWS Lambda now supports shifting traffic with aliases\. For more information, see [Rolling deployments for Lambda functions ](lambda-rolling-deployments.md)\. | November 28, 2017 | | Gradual Code Deployment | AWS Lambda now supports safely deploying new versions of your Lambda function by leveraging Code Deploy\. For more information, see [ Gradual code deployment](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/automating-updates-to-serverless-apps.html)\. | November 28, 2017 | | China \(Beijing\) Region | AWS Lambda is now available in the China \(Beijing\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | November 9, 2017 | diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 80a32d32..405bbf3f 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -21,9 +21,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.880\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.880\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. @@ -33,13 +33,14 @@ For end of support information about Node\.js 10, see [Runtime support policy](r | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | +| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | | Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | | Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | | Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | | Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | **Important** -Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. +Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. **Ruby runtimes** diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index 8ced5952..0909c007 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -33,7 +33,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ------ diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index c51eea66..b30be145 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -72,7 +72,7 @@ For more information about Lambda service architectures, see [Event driven archi + [Amazon Simple Storage Service Batch](services-s3-batch.md) + [Secrets Manager](with-secrets-manager.md) -For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. +For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. You can disable retries for a function by setting the function's reserved concurrency value to zero\. **Services that invoke Lambda functions asynchronously** + [Amazon Simple Storage Service](with-s3.md) diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md index 8c6012d6..7134c54a 100644 --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -1,6 +1,6 @@ # Accessing Amazon CloudWatch logs for AWS Lambda -AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch\. To help you troubleshoot failures in a function, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs\. +AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch\. To help you troubleshoot failures in a function, after you set up permissions, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs\. You can insert logging statements into your code to help you validate that your code is working as expected\. Lambda automatically integrates with CloudWatch Logs and pushes all logs from your code to a CloudWatch Logs group associated with a Lambda function, which is named /aws/lambda/**\. @@ -18,7 +18,13 @@ It may take 5 to 10 minutes for logs to show up after a function invocation\. ## Prerequisites -Your [execution role](lambda-intro-execution-role.md) needs permission to upload logs to CloudWatch Logs\. You can add CloudWatch Logs permissions using an AWS managed policy provided by Lambda\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md)\. +Your [execution role](lambda-intro-execution-role.md) needs permission to upload logs to CloudWatch Logs\. You can add CloudWatch Logs permissions using the `AWSLambdaBasicExecutionRole` AWS managed policy provided by Lambda\. To add this policy to your role, run the following command: + +``` +aws iam attach-role-policy --role-name your-role --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole +``` + +For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md)\. ## Pricing diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index 5ed52df0..d0d94b1a 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -42,11 +42,11 @@ Invocation metrics are binary indicators of the outcome of an invocation\. For e You should view the following metrics with the `Sum` statistic\. **Invocation metrics** -+ `Invocations` – The number of times your function code is executed, including successful executions and executions that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise resulted in an [invocation error](API_Invoke.md#API_Invoke_Errors)\. This equals the number of requests billed\. ++ `Invocations` – The number of times your function code is executed, including successful executions and executions that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise resulted in an invocation error\. This equals the number of requests billed\. + `Errors` – The number of invocations that result in a function error\. Function errors include exceptions thrown by your code and exceptions thrown by the Lambda runtime\. The runtime returns errors for issues such as timeouts and configuration errors\. To calculate the error rate, divide the value of `Errors` by the value of `Invocations`\. Note that the timestamp on an error metric reflects when the function was invoked, not when the error occurred\. + `DeadLetterErrors` – For [asynchronous invocation](invocation-async.md), the number of times Lambda attempts to send an event to a dead\-letter queue but fails\. Dead\-letter errors can occur due to permissions errors, misconfigured resources, or size limits\. + `DestinationDeliveryFailures` – For asynchronous invocation, the number of times Lambda attempts to send an event to a [destination](gettingstarted-features.md#gettingstarted-features-destinations) but fails\. Delivery errors can occur due to permissions errors, misconfigured resources, or size limits\. -+ `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with [TooManyRequestsException](API_Invoke.md#API_Invoke_Errors)\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. ++ `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with `TooManyRequestsException`\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. + `ProvisionedConcurrencyInvocations` – The number of times your function code is executed on [provisioned concurrency](configuration-concurrency.md)\. + `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 0d486fd1..28a57dee 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -56,7 +56,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index 76841bdf..541044fd 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -23,6 +23,8 @@ The third argument, `callback`, is a function that you can call in [non\-async h For async handlers, you return a response, error, or promise to the runtime instead of using `callback`\. +If your function has additional dependencies, [use npm to include them in your deployment package](nodejs-package.md#nodejs-package-dependencies)\. + ## Async handlers For async handlers, you can use `return` and `throw` to send a response or error, respectively\. Functions must use the `async` keyword to use these methods to return a response or error\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 60c1a5ee..79680e2b 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -14,7 +14,13 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. + +**Topics** ++ [AWS base images for Node\.js](#nodejs-image-base) ++ [Using a Node\.js base image](#nodejs-image-instructions) ++ [Node\.js runtime interface clients](#nodejs-image-clients) ++ [Deploy the container image](#nodejs-image-deploy) ## AWS base images for Node\.js @@ -47,4 +53,8 @@ npm install aws-lambda-ric For package details, see [Lambda RIC](http://npmjs.com/package/aws-lambda-ric) on the npm website\. -You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. \ No newline at end of file +You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. + +## Deploy the container image + +For a new function, you deploy the Node\.js image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 7ba49d9b..d3e16881 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -81,7 +81,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index d04db7f6..a030d52a 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -10,8 +10,6 @@ To create the deployment package for a \.zip file archive, you can use a built\- For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. -This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. - **Topics** + [Prerequisites](#node-package-prereqs) + [Updating a function with no dependencies](#nodejs-package-codeonly) diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index a83541ff..5ee8eef0 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index a5709fb0..02469114 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -80,7 +80,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 451ade07..9043989d 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -91,7 +91,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md new file mode 100644 index 00000000..3521229a --- /dev/null +++ b/doc_source/provisioned-concurrency.md @@ -0,0 +1,177 @@ +# Managing Lambda provisioned concurrency + +There are two types of concurrency controls available: ++ Reserved concurrency – Reserved concurrency guarantees the maximum number of concurrent instances for the function\. When a function has reserved concurrency, no other function can use that concurrency\. There is no charge for configuring reserved concurrency for a function\. ++ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond immediately to your function's invocations\. Note that configuring provisioned concurrency incurs charges to your AWS account\. + +This topic details how to manage and configure provisioned concurrency\. If you want to configure reserved concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. + +When Lambda allocates an instance of your function, the runtime loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. As your function scales up, this causes the portion of requests that are served by new instances to have higher latency than the rest\. + +By allocating provisioned concurrency before an increase in invocations, you can ensure that all requests are served by initialized instances with low latency\. You can configure provisioned concurrency on a version of a function, or on an alias\. + +Provisioned concurrency counts towards a function's reserved concurrency and Regional quotas\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \($LATEST\), which prevents it from executing\. You can't allocate more provisioned concurrency than reserved concurrency for a function\. + +Lambda also integrates with Application Auto Scaling, allowing you to manage provisioned concurrency on a schedule or based on utilization\. + +**Topics** ++ [Configuring provisioned concurrency](#configuring-provisioned-concurrency) ++ [Optimizing latency with provisioned concurrency](#optimizing-latency) ++ [Managing provisioned concurrency with Application Auto Scaling](#managing-provisioned-concurency) + +## Configuring provisioned concurrency + +To manage provisioned concurrency settings for a version or alias, use the Lambda console\. + +**To allocate provisioned concurrency for an alias or version** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configuration** and then choose **Concurrency**\. + +1. Under **Provisioned concurrency configurations**, choose **Add configuration**\. + +1. Choose an alias or version\. + +1. Enter the amount of provisioned concurrency to allocate\. + +1. Choose **Save**\. + +You can also configure provisioned concurrency using the Lambda API with the following operations: ++ [PutProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutProvisionedConcurrencyConfig.html) ++ [GetProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetProvisionedConcurrencyConfig.html) ++ [ListProvisionedConcurrencyConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListProvisionedConcurrencyConfigs.html) ++ [DeleteProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteProvisionedConcurrencyConfig.html) + +To allocate provisioned concurrency for a function, use `put-provisioned-concurrency-config`\. The following command allocates a concurrency of 100 for the `BLUE` alias of a function named `my-function`: + +``` +aws lambda put-provisioned-concurrency-config --function-name my-function \ +--qualifier BLUE --provisioned-concurrent-executions 100 +``` + +You should see the following output: + +``` +{ + "Requested ProvisionedConcurrentExecutions": 100, + "Allocated ProvisionedConcurrentExecutions": 0, + "Status": "IN_PROGRESS", + "LastModified": "2019-11-21T19:32:12+0000" +} +``` + +To view your account's concurrency quotas in a Region, use `get-account-settings`\. + +``` +aws lambda get-account-settings +``` + +You should see the following output: + +``` +{ + "AccountLimit": { + "TotalCodeSize": 80530636800, + "CodeSizeUnzipped": 262144000, + "CodeSizeZipped": 52428800, + "ConcurrentExecutions": 1000, + "UnreservedConcurrentExecutions": 900 + }, + "AccountUsage": { + "TotalCodeSize": 174913095, + "FunctionCount": 52 + } +} +``` + +You can manage provisioned concurrency for all aliases and versions from the function configuration page\. The list of provisioned concurrency configurations shows the allocation progress of each configuration\. Provisioned concurrency settings are also available on the configuration page for each version and alias\. + +Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. + +When you change the version that an alias points to, provisioned concurrency is deallocated from the old version and then allocated to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. However, you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. + +Lambda emits the following metrics for provisioned concurrency: + +**Provisioned concurrency metrics** ++ `ProvisionedConcurrentExecutions` ++ `ProvisionedConcurrencyInvocations` ++ `ProvisionedConcurrencySpilloverInvocations` ++ `ProvisionedConcurrencyUtilization` + +For details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. + +## Optimizing latency with provisioned concurrency + +Provisioned concurrency does not come online immediately after you configure it\. Lambda starts allocating provisioned concurrency after a minute or two of preparation\. Similar to how functions [scale under load](invocation-scaling.md), up to 3000 instances of the function can be initialized at once, depending on the Region\. After the initial burst, instances are allocated at a steady rate of 500 per minute until the request is fulfilled\. When you request provisioned concurrency for multiple functions or versions of a function in the same Region, scaling quotas apply across all requests\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) + +**Legend** ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency + +To optimize latency, you can customize the initialization behavior for functions that use provisioned concurrency \. You can run initialization code for provisioned concurrency instances without impacting latency, because the initialization code runs at allocation time\. However, the initialization code for an on\-demand instance directly impacts the latency of the first invocation\. For an on\-demand instance, you may choose to defer initialization for a specific capability until the function needs that capability\. + +To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIALIZATION\_TYPE\. Lambda sets this environment variable to `provisioned-concurrency` or `on-demand`\. The value of AWS\_LAMBDA\_INITIALIZATION\_TYPE is immutable and does not change over the lifetime of the execution environment\. + +If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PREJIT environment variable to improve the latency for functions that use provisioned concurrency\. The \.NET runtime lazily compiles and initializes each library that your code calls for the first time\. As a result, the first invocation of a Lambda function can take longer than subsequent invocations\. When you set AWS\_LAMBDA\_DOTNET\_PREJIT to `ProvisionedConcurrency`, Lambda performs ahead\-of\-time JIT compilation for common system dependencies\. Lambda performs this initialization optimization for provisioned concurrency instances only, which results in faster performance for the first invocation\. If you set the environment variable to `Always`, Lambda performs ahead\-of\-time JIT compilation for every initialization\. If you set the environment variable to `Never`, ahead\-of\-time JIT compilation is disabled\. The default value for AWS\_LAMBDA\_DOTNET\_PREJIT is `ProvisionedConcurrency`\. + +For provisioned concurrency instances, your function's [initialization code](foundation-progmodel.md) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. + +## Managing provisioned concurrency with Application Auto Scaling + +Application Auto Scaling allows you to manage provisioned concurrency on a schedule or based on utilization\. Use scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. + +To increase provisioned concurrency automatically as needed, use the `RegisterScalableTarget` and `PutScalingPolicy` [Application Auto Scaling API ](configuration-concurrency.md#configuration-concurrency-api) operations to register a target and create a scaling policy: + +1. Register a function's alias as a scaling target\. The following example registers the BLUE alias of a function named `function`my\-: + + ``` + aws application-autoscaling register-scalable-target --service-namespace lambda \ + --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ + --scalable-dimension lambda:function:ProvisionedConcurrency + ``` + +1. Apply a scaling policy to the target\. The following example configures Application Auto Scaling to adjust the provisioned concurrency configuration for an alias to keep utilization near 70 percent\. + + ``` + aws application-autoscaling put-scaling-policy --service-namespace lambda \ + --scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ + --policy-name my-policy --policy-type TargetTrackingScaling \ + --target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' + ``` + + You should see the following output: + + ``` + { + "PolicyARN": "arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:12266dbb-1524-xmpl-a64e-9a0a34b996fa:resource/lambda/function:my-function:BLUE:policyName/my-policy", + "Alarms": [ + { + "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7", + "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7" + }, + { + "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66", + "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66" + } + ] + } + ``` + +Application Auto Scaling creates two alarms in CloudWatch\. The first alarm triggers when the utilization of provisioned concurrency consistently exceeds 70 percent\. When this happens, Application Auto Scaling allocates more provisioned concurrency to reduce utilization\. The second alarm triggers when utilization is consistently less than 63 percent \(90 percent of the 70 percent target\)\. When this happens, Application Auto Scaling reduces the alias's provisioned concurrency\. + +In the following example, a function scales between a minimum and maximum amount of provisioned concurrency based on utilization\. When the number of open requests increases, Application Auto Scaling increases provisioned concurrency in large steps until it reaches the configured maximum\. The function continues to scale on standard concurrency until utilization starts to drop\. When utilization is consistently low, Application Auto Scaling decreases provisioned concurrency in smaller periodic steps\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) + +**Legend** ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency \ No newline at end of file diff --git a/doc_source/python-context.md b/doc_source/python-context.md index 332f2077..6a259e73 100644 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -1,7 +1,7 @@ # AWS Lambda context object in Python **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [Lambda function handler in Python](python-handler.md)\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index 1c7113cd..422d65cf 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,7 +1,7 @@ # AWS Lambda function errors in Python **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. @@ -35,7 +35,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index 9849eb94..f566411b 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -1,7 +1,7 @@ # Lambda function handler in Python **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. @@ -35,12 +35,15 @@ When Lambda invokes your function handler, the [Lambda runtime](lambda-runtimes. ## Returning a value -Optionally, a handler can return a value\. What happens to the returned value depends on the [invocation type](lambda-invocation.md) and the [Using AWS Lambda with other services](lambda-services.md)\. For example: +Optionally, a handler can return a value\. What happens to the returned value depends on the [invocation type](lambda-invocation.md) and the [service](lambda-services.md) that invoked the function\. For example: + If you use the `RequestResponse` invocation type, such as [Synchronous invocation](invocation-sync.md), AWS Lambda returns the result of the Python function call to the client invoking the Lambda function \(in the HTTP response to the invocation request, serialized into JSON\)\. For example, AWS Lambda console uses the `RequestResponse` invocation type, so when you invoke the function on the console, the console will display the returned value\. + If the handler returns objects that can't be serialized by `json.dumps`, the runtime returns an error\. + If the handler returns `None`, as Python functions without a `return` statement implicitly do, the runtime returns `null`\. + If you use an `Event` an [Asynchronous invocation](invocation-async.md) invocation type, the value is discarded\. +**Note** +In Python 3\.9 and later releases, Lambda includes the requestId of the invocation in the error response\. + ## Examples The following section shows examples of Python functions you can use with Lambda\. If you use the Lambda console to author your function, you do not need to attach a [\.zip archive file](python-package.md) to run the functions in this section\. These functions use standard Python libraries which are included with the Lambda runtime you selected\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. @@ -107,7 +110,7 @@ You can use any event data to [invoke the function](https://docs.aws.amazon.com/ Lambda runtimes set several environment variables during initialization\. For more information on the environment variables returned in the response at runtime, see [Using AWS Lambda environment variables](configuration-envvars.md)\. -The function in this example depends on a successful response \(in `200`\) from the Invoke API\. For more information on the Invoke API status, see the [Invoke API Response Syntax](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax)\. +The function in this example depends on a successful response \(in `200`\) from the Invoke API\. For more information on the Invoke API status, see the [Invoke](API_Invoke.md) Response Syntax\. ### Returning a calculation diff --git a/doc_source/python-image.md b/doc_source/python-image.md index b9008b74..b95a618d 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -1,7 +1,7 @@ # Deploy Python Lambda functions with container images **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Python function: + AWS base images for Lambda @@ -17,13 +17,14 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for Python](#python-image-base) + [Python runtime interface clients](#python-image-clients) -+ [Deploying Python with an AWS base image](#python-image-create) ++ [Create a Python image from an AWS base image](#python-image-create) + [Create a Python image from an alternative base image](#python-image-create-alt) ++ [Deploy the container image](#python-image-deploy) ## AWS base images for Python @@ -32,7 +33,8 @@ AWS provides the following base images for Python: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 3, 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | +| 3, 3\.9 | Python 3\.9 | Amazon Linux 2 | [Dockerfile for Python 3\.9 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.9/Dockerfile.python3.9) | +| 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | | 3\.7 | Python 3\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | | 3\.6 | Python 3\.6 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.6 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.6/Dockerfile.python3.6) | | 2, 2\.7 | Python 2\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python2.7/Dockerfile.python2.7) | @@ -53,7 +55,7 @@ For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. -## Deploying Python with an AWS base image +## Create a Python image from an AWS base image When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. @@ -93,4 +95,8 @@ When you build a container image for Python using an AWS base image, you only ne ## Create a Python image from an alternative base image -For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file +For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. + +## Deploy the container image + +For a new function, you deploy the Python image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 22221d64..fdf6f8c0 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -1,7 +1,7 @@ # AWS Lambda function logging in Python **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. @@ -73,7 +73,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md deleted file mode 100644 index 732f0120..00000000 --- a/doc_source/python-package-create.md +++ /dev/null @@ -1,454 +0,0 @@ -# Tutorial: Creating a Lambda function in Python 3\.8 - -This tutorial guides you through building the code and assets to create a Lambda function in Python 3\.8 using the AWS Command Line Interface \(AWS CLI\)\. - -**Topics** -+ [Prerequisites](#python-package-create-prereqs) -+ [Creating a function without runtime dependencies](#python-package-create-no-dependency) -+ [Creating a function with runtime dependencies](#python-package-create-with-dependency) - -## Prerequisites - -This section describes the tools and resources required to complete the steps in the tutorial\. - -### Install the AWS CLI - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -### Create an execution role - -Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AWS Identity and Access Management \(IAM\) role that grants your function permission to access AWS services and resources\. Create an execution role in IAM with [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html) permission\. - -**To create the execution role** - -1. Open a command prompt and use the [create\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/create-role.html) command to create an execution role named `lambda-ex`\. - ------- -#### [ macOS/Linux ] - - ``` - aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' - ``` - ------- -#### [ Windows ] - - ``` - aws iam create-role --role-name lambda-ex --assume-role-policy-document "{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}" - ``` - ------- - - This command produces the following output\. Save the value returned in `Arn`\. - - ``` - { - "Role": { - "Path": "/", - "RoleName": "lambda-ex", - "RoleId": "AROAWNZPPVHULXRJXQJD5", - "Arn": "arn:aws:iam::your-account-id:role/lambda-ex", - "CreateDate": "2021-01-05T18:00:30Z", - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] - } - } - } - ``` - -1. Use the [attach\-role\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/attach-role-policy.html) command to add `AWSLambdaBasicExecutionRole` permissions to the role\. - - ``` - $ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole - ``` - - This command produces no output\. - -## Creating a function without runtime dependencies - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - - For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) - -This section describes how to create a Lambda function without runtime dependencies\. - -**Topics** -+ [Overview](#python-package-create-about-no-dependency) -+ [Create the deployment package](#python-package-create-package-no-dependency) -+ [Create the Lambda function](#python-package-create-createfunction-no-dependency) -+ [Invoke the Lambda function](#python-package-create-invokefunction-no-dependency) -+ [What's next?](#python-package-create-next-no-dependency) -+ [Clean up your resources](#python-package-create-cleanup-no-dependency) - -### Overview - -In this tutorial, you use the [sample code from the AWS SDK for Python \(Boto3\) project on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) to create a Lambda function using the AWS CLI\. You'll learn how to: -+ Set up the directory structure of a deployment package \(\.zip file\)\. -+ Create a deployment package for a Lambda function without any runtime dependencies\. -+ Use the AWS CLI to upload the deployment package and create the Lambda function\. -+ Invoke the Lambda function to return a mathematical calculation\. - -The sample code contains standard math and logging Python libraries, which are used to return a calculation based on user input\. Standard Python libraries are included with the `python3.8` [runtime](lambda-runtimes.md)\. Although the function's code doesn't depend on any other Python libraries and has no additional application dependencies, Lambda still requires a deployment package to create a function\. - -### Create the deployment package - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -Create the \.zip file that Lambda uses as your deployment package\. - -**To create the deployment package** - -1. Open a command prompt and create a `my-math-function` project directory\. For example, on macOS: - - ``` - mkdir my-math-function - ``` - -1. Navigate to the `my-math-function` project directory\. - - ``` - cd my-math-function - ``` - -1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: - - ``` - my-math-function$ - | lambda_function.py - ``` - -1. Add the `lambda_function.py` file to the root of the \.zip file\. - - ``` - zip my-deployment-package.zip lambda_function.py - ``` - - This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: - - ``` - adding: lambda_function.py (deflated 50%) - ``` - -### Create the Lambda function - -Lambda needs to know the [runtime](lambda-runtimes.md) environment to use for your function's code, the [handler](python-handler.md) in your function code, and the [execution role](lambda-intro-execution-role.md) that it can use to invoke your function\. - -Create the Lambda function using the execution role and deployment package that you created in the previous steps\. - -**To create the function** - -1. Navigate to the `my-math-function` project directory\. - - ``` - cd my-math-function - ``` - -1. Create a function named `my-math-function`\. Substitute the value for `role` with the `Arn` you copied in previous steps\. - - ``` - aws lambda create-function --function-name my-math-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.lambda_handler --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex - ``` - - This command produces the following output: - - ``` - { - "FunctionName": "my-math-function", - "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-math-function", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-ex", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 753, - "Description": "", - "Timeout": 3, - "MemorySize": 128, - "LastModified": "2021-01-05T18:39:44.847+0000", - "CodeSha256": "82RtIE7p1ET5Od6bk4xSleJbUybUnZX52m92x/fEH84=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "PassThrough" - }, - "RevisionId": "589e5115-f3c0-446c-bc62-4e05cf0a3c85", - "State": "Active", - "LastUpdateStatus": "Successful" - } - ``` - - The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. - -### Invoke the Lambda function - -Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. - -**To invoke the function** -+ Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. - - ``` - aws lambda invoke \ - --function-name my-math-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"action": "square","number": 3}' output.txt - ``` - - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. - - This command produces the following output: - - ``` - { - "StatusCode": 200, - "ExecutedVersion": "$LATEST" - } - ``` - - For the `RequestResponse` invocation type, the status code is `200`\. For more information, see the [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax) API reference\. - - You should see the following mathematical calculation in `output.txt`: - - ``` - {"result": 9} - ``` - -### What's next? -+ Learn how to update your Lambda function, see [Updating a Lambda function in Python 3\.8](python-package-update.md)\. -+ Learn how to show logging events for your Lambda function, see [AWS Lambda function logging in Python](python-logging.md)\. -+ Explore other [AWS SDK examples in Python on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/python/example_code/lambda)\. - -### Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** -+ Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. - - ``` - aws lambda delete-function --function-name my-function - ``` - - This command produces no output\. - -**To delete the execution role policy** -+ Use the [delete\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-policy.html) command\. - - ``` - aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole - ``` - -**To delete the execution role** -+ Use the [delete\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-role.html) command\. - - ``` - aws iam delete-role --role-name lambda-ex - ``` - -## Creating a function with runtime dependencies - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - -For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) - -This section describes how to create a Lambda function with runtime dependencies\. - -**Topics** -+ [Overview](#python-package-create-about) -+ [Create the deployment package](#python-package-create-package-with-dependency) -+ [Create the Lambda function](#python-package-create-createfunction-with-dependency) -+ [Invoke the Lambda function](#python-package-create-invokefunction-with-dependency) -+ [What's next?](#python-package-create-next-with-dependency) -+ [Clean up your resources](#python-package-create-cleanup-with-dependency) - -### Overview - -In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://www\.test\.com/](https://www.test.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. - -You'll learn how to: -+ Set up the directory structure of a deployment package \(\.zip file\)\. -+ Create a deployment package for a Lambda function with runtime dependencies\. -+ Use the AWS CLI to upload the deployment package and create the Lambda function\. -+ Invoke the Lambda function to return the source code\. - -### Create the deployment package - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -Create the \.zip file that Lambda uses as your deployment package\. - -**To create the deployment package** - -1. Open a command prompt and create a `my-sourcecode-function` project directory\. For example, on macOS: - - ``` - mkdir my-sourcecode-function - ``` - -1. Navigate to the `my-sourcecode-function` project directory\. - - ``` - cd my-sourcecode-function - ``` - -1. Copy the contents of the following sample Python code and save it in a new file named `lambda_function.py`: - - ``` - import requests - def main(event, context): - response = requests.get("https://www.test.com/") - print(response.text) - return response.text - if __name__ == "__main__": - main('', '') - ``` - - Your directory structure should look like this: - - ``` - my-sourcecode-function$ - | lambda_function.py - ``` - -1. Install the requests library to a new `package` directory\. - - ``` - pip install --target ./package requests - ``` - -1. Create a deployment package with the installed library at the root\. - - ``` - cd package - zip -r ../my-deployment-package.zip . - ``` - - This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: - - ``` - adding: chardet/ (stored 0%) - adding: chardet/enums.py (deflated 58%) - ... - ``` - -1. Add the `lambda_function.py` file to the root of the zip file\. - - ``` - cd .. - zip -g my-deployment-package.zip lambda_function.py - ``` - -### Create the Lambda function - -Lambda needs to know the [runtime](lambda-runtimes.md) environment to use for your function's code, the [handler](python-handler.md) in your function code, and the [execution role](lambda-intro-execution-role.md) that it can use to invoke your function\. - -Create the Lambda function using the execution role and deployment package that you created in the previous steps\. - -**To create the function** - -1. Navigate to the `my-sourcecode-function` project directory\. - - ``` - cd my-sourcecode-function - ``` - -1. Create a function named `my-sourcecode-function`\. Substitute the value for `role` with the `Arn` you copied in previous steps\. - - ``` - aws lambda create-function --function-name my-sourcecode-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.main --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex - ``` - - This command produces the following output: - - ``` - { - "FunctionName": "my-sourcecode-function", - "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-sourcecode-function", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-ex", - "Handler": "lambda_function.main", - "CodeSize": 753, - "Description": "", - "Timeout": 3, - "MemorySize": 128, - "LastModified": "2021-01-11T18:39:44.847+0000", - "CodeSha256": "82RtIE7p1ET5Od6bk4xSleJbUybUnZX52m92x/fEH84=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "PassThrough" - }, - "RevisionId": "589e5115-f3c0-446c-bc62-4e05cf0a3c85", - "State": "Active", - "LastUpdateStatus": "Successful" - } - ``` - - The Lambda function in this step uses a function handler of `lambda_function.main`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. - -### Invoke the Lambda function - -Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. - -**To invoke the function** -+ Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. - - ``` - aws lambda invoke \ - --function-name my-sourcecode-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt - ``` - - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. - - This command produces the following output: - - ``` - { - "StatusCode": 200, - "ExecutedVersion": "$LATEST" - } - ``` - - For the `RequestResponse` invocation type, the status code is `200`\. For more information, see the [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax) API reference\. - - You should see the source code in `output.txt`\. - -### What's next? -+ Learn how to update your Lambda function, see [Updating a Lambda function in Python 3\.8](python-package-update.md)\. -+ Learn how to show logging events for your Lambda function, see [AWS Lambda function logging in Python](python-logging.md)\. -+ Explore other [AWS SDK examples in Python on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/python/example_code/lambda)\. - -### Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** -+ Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. - - ``` - aws lambda delete-function --function-name my-function - ``` - - This command produces no output\. - -**To delete the execution role policy** -+ Use the [delete\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-policy.html) command\. - - ``` - aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole - ``` - -**To delete the execution role** -+ Use the [delete\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-role.html) command\. - - ``` - aws iam delete-role --role-name lambda-ex - ``` \ No newline at end of file diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md deleted file mode 100644 index b94099d2..00000000 --- a/doc_source/python-package-update.md +++ /dev/null @@ -1,215 +0,0 @@ -# Updating a Lambda function in Python 3\.8 - -This tutorial guides you through the process of installing a Python library, creating a deployment package, and updating a Lambda function in Python 3\.8 using the AWS Command Line Interface \(AWS CLI\)\. - -The following steps assume that you have created a Lambda function and are updating the \.zip file used as your deployment package\. If you haven't created a function yet, see [Tutorial: Creating a Lambda function in Python 3\.8](python-package-create.md)\. - -**Topics** -+ [Prerequisites](#python-package-update-prereqs) -+ [Updating a function without runtime dependencies](#python-package-update-codeonly) -+ [Updating a function with runtime dependencies](#python-package-update-dependencies) -+ [Using a virtual environment](#python-package-update-venv) - -## Prerequisites - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -## Updating a function without runtime dependencies - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - -For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. - -The following steps show how to create a deployment package that contains only your function code, and upload it to Lambda using the AWS CLI\. - -**To update a Python function without runtime dependencies** - -1. Add function code files to the root of your deployment package\. - - ``` - ~/my-function$ zip my-deployment-package.zip lambda_function.py - ``` - -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 815, - "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", - "Version": "$LATEST", - "RevisionId": "d1e983e3-ca8e-434b-8dc1-7add83d72ebd", - ... - } - ``` - -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. - -## Updating a function with runtime dependencies - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - -For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. - - The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. - -**Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. - -**To update a Python function with dependencies** - -1. Install libraries in a `package` directory with `pip`'s `--target` option\. - - ``` - ~/my-function$ pip install --target ./package requests - ``` -**Note** -To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) such as Ubuntu, you may need to pass the `--system` option\. - -1. Navigate to the `package` directory\. - - ``` - cd package - ``` - -1. Create a deployment package with the installed libraries at the root\. - - ``` - ~/my-function$ zip -r ../my-deployment-package.zip . - ``` - - The last command saves the deployment package to the root of the `my-function` directory\. - -1. Navigate back to the `my-function` directory\. - - ``` - cd .. - ``` - -1. Add function code files to the root of your deployment package\. - - ``` - ~/my-function$ zip -g my-deployment-package.zip lambda_function.py - ``` - - After you complete this step, you should have the following directory structure: - - ``` - my-deployment-package.zip$ - │ lambda_function.py - │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ - ... - ``` - -1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 2269409, - "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", - "Version": "$LATEST", - "RevisionId": "a9c05ffd-8ad6-4d22-b6cd-d34a00c1702c", - ... - } - ``` - -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. - -## Using a virtual environment - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - - For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. - - The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. - -**Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. - -**To update a Python function with a virtual environment** - -1. Activate the virtual environment\. For example: - - ``` - ~/my-function$ source myvenv/bin/activate - ``` - -1. Install libraries with pip\. - - ``` - (myvenv) ~/my-function$ pip install requests - ``` - -1. Deactivate the virtual environment\. - - ``` - (myvenv) ~/my-function$ deactivate - ``` - -1. Create a deployment package with the installed libraries at the root\. - - ``` - ~/my-function$cd myvenv/lib/python3.8/site-packages - zip -r ../../../../my-deployment-package.zip . - ``` - - The last command saves the deployment package to the root of the `my-function` directory\. -**Tip** -A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. - -1. Add function code files to the root of your deployment package\. - - ``` - ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ - ~/my-function$ zip -g my-deployment-package.zip lambda_function.py - ``` - - After you complete this step, you should have the following directory structure: - - ``` - my-deployment-package.zip$ - │ lambda_function.py - │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ - ... - ``` - -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 5912988, - "CodeSha256": "A2P0NUWq1J+LtSbkuP8tm9uNYqs1TAa3M76ptmZCw5g=", - "Version": "$LATEST", - "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", - ... - } - ``` - -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index cf4e4866..2fc0a040 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -1,7 +1,7 @@ # Deploy Python Lambda functions with \.zip file archives **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. @@ -13,19 +13,21 @@ To create the deployment package for a \.zip file archive, you can use a built\- For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. -This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. +**Note** +A python package may contain initialization code in the \_\_init\_\_\.py file\. Prior to Python 3\.9, Lambda did not run the \_\_init\_\_\.py code for packages in the function handler’s directory or parent directories\. In Python 3\.9 and later releases, Lambda runs the init code for packages in these directories during initialization\. +Note that Lambda runs the init code only when the execution environment is first initialized, not for each function invocation in that intialized environment\. **Topics** + [Prerequisites](#python-package-prereqs) + [What is a runtime dependency?](#python-package-dependencies) -+ [Tutorial: Creating a Lambda function in Python 3\.8](python-package-create.md) -+ [Updating a Lambda function in Python 3\.8](python-package-update.md) ++ [Deployment package with no dependencies](#python-package-create-package-no-dependency) ++ [Deployment package with dependencies](#python-package-create-package-with-dependency) ++ [Using a virtual environment](#python-package-update-venv) ++ [Deploy your \.zip file to the function](#python-package-upload-code) ## Prerequisites -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) +You need the AWS Command Line Interface \(AWS CLI\) to call service API operations\. To install the AWS CLI, see [Installing the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) in the AWS Command Line Interface User Guide\. ## What is a runtime dependency? @@ -33,8 +35,185 @@ A [deployment package](gettingstarted-package.md) is required to create or updat A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. -The following example describes a Lambda function without runtime dependencies: -+ If your function's code is in Python 3\.8, and it depends only on standard Python math and logging libraries, you don't need to include the libraries in your \.zip file\. These libraries are included with the `python3.8` runtime\. -+ If your function's code depends only on the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), you don't need to include the boto3 library in your \.zip file\. These libraries are included with the `python3.8` runtime\. +The following describes a Lambda function without runtime dependencies: ++ If your function's code is in Python 3\.8 or later, and it depends only on standard Python math and logging libraries, you don't need to include the libraries in your \.zip file\. These libraries are included with the Python runtime\. ++ If your function's code depends on the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), you don't need to include the boto3 library in your \.zip file\. These libraries are included with Python3\.8 and later runtimes\. + +Note: Lambda periodically updates the Boto3 libraries to enable the latest set of features and security updates\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. + +## Deployment package with no dependencies + +Create the \.zip file for your deployment package\. + +**To create the deployment package** + +1. Open a command prompt and create a `my-math-function` project directory\. For example, on macOS: + + ``` + mkdir my-math-function + ``` + +1. Navigate to the `my-math-function` project directory\. + + ``` + cd my-math-function + ``` + +1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: + + ``` + my-math-function$ + | lambda_function.py + ``` + +1. Add the `lambda_function.py` file to the root of the \.zip file\. + + ``` + zip my-deployment-package.zip lambda_function.py + ``` + + This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: + + ``` + adding: lambda_function.py (deflated 50%) + ``` + +## Deployment package with dependencies + +Create the \.zip file for your deployment package\. + +**To create the deployment package** + +1. Open a command prompt and create a `my-sourcecode-function` project directory\. For example, on macOS: + + ``` + mkdir my-sourcecode-function + ``` + +1. Navigate to the `my-sourcecode-function` project directory\. + + ``` + cd my-sourcecode-function + ``` + +1. Copy the contents of the following sample Python code and save it in a new file named `lambda_function.py`: + + ``` + import requests + def main(event, context): + response = requests.get("https://www.test.com/") + print(response.text) + return response.text + if __name__ == "__main__": + main('', '') + ``` + + Your directory structure should look like this: + + ``` + my-sourcecode-function$ + | lambda_function.py + ``` + +1. Install the requests library to a new `package` directory\. + + ``` + pip install --target ./package requests + ``` + +1. Create a deployment package with the installed library at the root\. + + ``` + cd package + zip -r ../my-deployment-package.zip . + ``` + + This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: + + ``` + adding: chardet/ (stored 0%) + adding: chardet/enums.py (deflated 58%) + ... + ``` + +1. Add the `lambda_function.py` file to the root of the zip file\. + + ``` + cd .. + zip -g my-deployment-package.zip lambda_function.py + ``` + +## Using a virtual environment + +**To update a Python function using a virtual environment** + +1. Activate the virtual environment\. For example: + + ``` + ~/my-function$ source myvenv/bin/activate + ``` + +1. Install libraries with pip\. + + ``` + (myvenv) ~/my-function$ pip install requests + ``` + +1. Deactivate the virtual environment\. + + ``` + (myvenv) ~/my-function$ deactivate + ``` + +1. Create a deployment package with the installed libraries at the root\. + + ``` + ~/my-function$cd myvenv/lib/python3.8/site-packages + zip -r ../../../../my-deployment-package.zip . + ``` + + The last command saves the deployment package to the root of the `my-function` directory\. +**Tip** +A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. + +1. Add function code files to the root of your deployment package\. + + ``` + ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` + + After you complete this step, you should have the following directory structure: + + ``` + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... + ``` + +## Deploy your \.zip file to the function + +To deploy the new code to your function, you upload the new \.zip file deployment package\. You can use the [Lambda console](configuration-function-zip.md#configuration-function-update) to upload a \.zip file to the function, or you can use the [UpdateFunctionCode](API_UpdateFunctionCode.md) CLI command\. + +The following example uploads a file named my\-deployment\-package\.zip\. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) file prefix to upload the binary \.zip file to Lambda\. -For a complete list of AWS SDKs, see [Tools to Build on AWS](http://aws.amazon.com/tools/)\. \ No newline at end of file +``` +~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + { + "FunctionName": "mylambdafunction", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 5912988, + "CodeSha256": "A2P0NUWq1J+LtSbkuP8tm9uNYqs1TAa3M76ptmZCw5g=", + "Version": "$LATEST", + "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", + ... + } +``` \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 57dcf1ac..d83fb5a0 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -1,13 +1,13 @@ # Instrumenting Python code in AWS Lambda **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index 0e87f7b6..eaf8e0ea 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -57,7 +57,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 45a3011b..72a40323 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -14,7 +14,14 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. + +**Topics** ++ [AWS base images for Ruby](#ruby-image-base) ++ [Using a Ruby base image](#ruby-image-instructions) ++ [Ruby runtime interface clients](#ruby-image-clients) ++ [Create a Ruby image from an AWS base image](#ruby-image-create) ++ [Deploy the container image](#ruby-image-deploy) ## AWS base images for Ruby @@ -48,7 +55,7 @@ For package details, see [Lambda RIC](https://rubygems.org/gems/aws_lambda_ric) You can also download the [Ruby runtime interface client](https://github.com/aws/aws-lambda-ruby-runtime-interface-client) from GitHub\. -## Deploying Ruby with an AWS base image +## Create a Ruby image from an AWS base image When you build a container image for Ruby using an AWS base image, you only need to copy the ruby app to the container and install any dependencies\. @@ -87,4 +94,8 @@ When you build a container image for Ruby using an AWS base image, you only need CMD [ "app.LambdaFunction::Handler.process" ] ``` -1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. \ No newline at end of file +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. + +## Deploy the container image + +For a new function, you deploy the Ruby image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 3ee0dbba..9a31503b 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -103,7 +103,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index baa12817..0d124cc1 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -10,8 +10,6 @@ To create the deployment package for a \.zip file archive, you can use a built\- For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. -This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. - **Topics** + [Prerequisites](#ruby-package-prereqs) + [Tools and libraries](#ruby-package-libraries) diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index df3ebaa3..e1da11a2 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index b44d706a..0ae9240f 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -9,7 +9,7 @@ In phase 2, which starts at least 30 days after the start of phase 1, you can no Lambda does not block invocations of functions that use deprecated runtime versions\. Function invocations continue indefinitely after the runtime version reaches end of support\. However, AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. **Important** -Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. +Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. The following runtimes have reached or are scheduled for end of support: @@ -38,4 +38,4 @@ In almost all cases, the end\-of\-life date of a language version or operating s + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) + **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/doc/devel/release.html) -+ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) ++ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index 09fccb9a..0b670b5b 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -15,7 +15,7 @@ The function's runtime and each external extension are processes that run within ## Lambda execution environment lifecycle The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md index 2c973af3..371cc746 100644 --- a/doc_source/runtimes-custom.md +++ b/doc_source/runtimes-custom.md @@ -58,8 +58,6 @@ Initialization counts towards billed execution time and timeout\. When an execut REPORT RequestId: f8ac1208... Init Duration: 48.26 ms Duration: 237.17 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 26 MB ``` -![\[Initialization time in an X-Ray trace.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/runtimes-custom-init.png) - While it runs, a runtime uses the [Lambda runtime interface](runtimes-api.md) to manage incoming events and report errors\. After completing initialization tasks, the runtime processes incoming events in a loop\. In your runtime code, perform the following steps in order\. **Processing tasks** diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index e98d8c92..21057e3d 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -15,6 +15,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support extensions: + Node\.js 14\.x \(`nodejs14.x`\) + Node\.js 12\.x \(`nodejs12.x`\) + Node\.js 10\.x \(`nodejs10.x`\) ++ Python 3\.9 \(`python3.9`\) + Python 3\.8 \(`python3.8`\) + Python 3\.7 \(`python3.7`\) + Ruby 2\.7 \(`ruby2.7`\) @@ -36,7 +37,7 @@ For example extensions and wrapper scripts, see [AWS Lambda Extensions](https:// ## Lambda execution environment lifecycle The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md index 9f42c839..ce22aa51 100644 --- a/doc_source/runtimes-images.md +++ b/doc_source/runtimes-images.md @@ -12,7 +12,7 @@ AWS provides a set of open\-source base images that you can use\. You can also u You can use one of the AWS base images for Lambda to build the container image for your function code\. The base images are preloaded with a language runtime and other components required to run a container image on Lambda\. You add your function code and dependencies to the base image and then package it as a container image\. -AWS will maintain and regularly update these images\. In addition, AWS will release an AWS base images when any new managed runtime becomes available\. +AWS will maintain and regularly update these images\. In addition, AWS will release AWS base images when any new managed runtime becomes available\. Lambda provides base images for the following runtimes: + [Node\.js](nodejs-image.md) diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index 024979c1..a571dd38 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -146,6 +146,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support wrapper scripts: + Node\.js 14\.x + Node\.js 12\.x + Node\.js 10\.x ++ Python 3\.9 + Python 3\.8 + Ruby 2\.7 + Java 11 diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 38688e57..792a6905 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -2,8 +2,6 @@ The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-blank.png) - Variants of this sample application are available for the following languages: **Variants** @@ -72,8 +70,6 @@ The sample application doesn't include an Amazon SQS queue to send events, but u The sample application's resources are defined in an AWS CloudFormation template and deployed with the AWS CLI\. The project includes simple shell scripts that automate the process of setting up, deploying, invoking, and tearing down the application\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-blank-stack.png) - The application template uses an AWS Serverless Application Model \(AWS SAM\) resource type to define the model\. AWS SAM simplifies template authoring for serverless applications by automating the definition of execution roles, APIs, and other resources\. The template defines the resources in the application *stack*\. This includes the function, its execution role, and a Lambda layer that provides the function's library dependencies\. The stack does not include the bucket that the AWS CLI uses during deployment or the CloudWatch Logs log group\. @@ -168,9 +164,7 @@ The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/a ## Instrumentation with the AWS X\-Ray -The sample function is configured for tracing with [AWS X\-Ray](https://console.aws.amazon.com/xray/home)\. With the tracing mode set to active, Lambda records timing information for a subset of invocations and sends it to X\-Ray\. X\-Ray processes the data to generate a *service map* that shows a client node and two service nodes: - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-servicemap-basic.png) +The sample function is configured for tracing with [AWS X\-Ray](https://console.aws.amazon.com/xray/home)\. With the tracing mode set to active, Lambda records timing information for a subset of invocations and sends it to X\-Ray\. X\-Ray processes the data to generate a *service map* that shows a client node and two service nodes\. The first service node \(`AWS::Lambda`\) represents the Lambda service, which validates the invocation request and sends it to the function\. The second node, `AWS::Lambda::Function`, represents the function itself\. @@ -188,12 +182,8 @@ const lambda = new AWS.Lambda() Instrumenting the AWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-servicemap.png) - The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for the AWS SDK call to the `GetAccountSettings` API operation\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-trace.png) - You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes the AWS SDK in the execution environment\. ## Dependency management with layers diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 67e825cc..efac9def 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -2,8 +2,6 @@ The Error Processor sample application demonstrates the use of AWS Lambda to handle events from an [Amazon CloudWatch Logs subscription](services-cloudwatchlogs.md)\. CloudWatch Logs lets you invoke a Lambda function when a log entry matches a pattern\. The subscription in this application monitors the log group of a function for entries that contain the word `ERROR`\. It invokes a processor Lambda function in response\. The processor function retrieves the full log stream and trace data for the request that caused the error, and stores them for later use\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor.png) - Function code is available in the following files: + Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/random-error/index.js) + Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/processor/index.js) @@ -64,13 +62,9 @@ The processor function uses information from the CloudWatch Logs event to downlo ## Instrumentation with AWS X\-Ray -The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. The following service map shows the random error function generating errors for some requests\. It also shows the processor function calling X\-Ray, CloudWatch Logs, and Amazon S3\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -The two Node\.js functions are configured for active tracing in the template, and are instrumented with the AWS X\-Ray SDK for Node\.js in code\. With active tracing, Lambda tags adds a tracing header to incoming requests and sends a trace with timing details to X\-Ray\. Additionally, the random error function uses the X\-Ray SDK to record the request ID and user information in annotations\. The annotations are attached to the trace, and you can use them to locate the trace for a specific request\. +The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-trace.png) +The two Node\.js functions are configured for active tracing in the template, and are instrumented with the AWS X\-Ray SDK for Node\.js in code\. With active tracing, Lambda tags adds a tracing header to incoming requests and sends a trace with timing details to X\-Ray\. Additionally, the random error function uses the X\-Ray SDK to record the request ID and user information in annotations\. The annotations are attached to the trace, and you can use them to locate the trace for a specific request\. The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It uses AWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 7225177f..bcff6ee1 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -2,8 +2,6 @@ The list manager sample application demonstrates the use of AWS Lambda to process records in an Amazon Kinesis data stream\. A Lambda event source mapping reads records from the stream in batches and invokes a Lambda function\. The function uses information from the records to update documents in Amazon DynamoDB and stores the records it processes in Amazon Relational Database Service \(Amazon RDS\)\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png) - Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: @@ -94,14 +92,10 @@ When it's decoded, the data contains a record\. The function uses the record to ## Instrumentation with AWS X\-Ray -The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. The following service map shows the function communicating with two DynamoDB tables and a MySQL database\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-servicemap.png) +The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with an AWS SDK or MySQL client\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-trace.png) - The function uses the AWS SDK for JavaScript in Node\.js to read and write to two tables for each record\. The primary table stores the current state of each combination of list name and user\. The aggregate table stores lists that combine data from multiple users\. ## AWS CloudFormation templates and additional resources diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 0da22207..54f85687 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -29,11 +29,11 @@ For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.a You can use environment variables to store secrets securely for use with Lambda functions\. Lambda always encrypts environment variables at rest\. Additionally, you can use the following features to customize how environment variables are encrypted\. -+ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* customer master keys \(CMKs\)\. If you don't configure a customer managed key, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. ++ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* CMKs\. For functions that do not have a configured customer managed CMK, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. + **Encryption helpers** – The Lambda console lets you encrypt environment variable values client side, before sending them to Lambda\. This enhances security further by preventing secrets from being displayed unencrypted in the Lambda console, or in function configuration that's returned by the Lambda API\. The console also provides sample code that you can adapt to decrypt the values in your function handler\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-images.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. -Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. +Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md index 21dd686a..95765510 100644 --- a/doc_source/security-iam.md +++ b/doc_source/security-iam.md @@ -52,7 +52,7 @@ IAM roles with temporary credentials are useful in the following situations: + **Cross\-account access** – You can use an IAM role to allow someone \(a trusted principal\) in a different account to access resources in your account\. Roles are the primary way to grant cross\-account access\. However, with some AWS services, you can attach a policy directly to a resource \(instead of using a role as a proxy\)\. To learn the difference between roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. + **Cross\-service access** – Some AWS services use features in other AWS services\. For example, when you make a call in a service, it's common for that service to run applications in Amazon EC2 or store objects in Amazon S3\. A service might do this using the calling principal's permissions, using a service role, or using a service\-linked role\. + **Principal permissions** – When you use an IAM user or role to perform actions in AWS, you are considered a principal\. Policies grant permissions to a principal\. When you use some services, you might perform an action that then triggers another action in a different service\. In this case, you must have permissions to perform both actions\. To see whether an action requires additional dependent actions in a policy, see [Actions, Resources, and Condition Keys for AWS Lambda](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) in the *Service Authorization Reference*\. - + **Service role** – A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf\. Service roles provide access only within your account and cannot be used to grant access to services in other accounts\. An IAM administrator can create, modify, and delete a service role from within IAM\. For more information, see [Creating a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*\. + + **Service role** – A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf\. An IAM administrator can create, modify, and delete a service role from within IAM\. For more information, see [Creating a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*\. + **Service\-linked role** – A service\-linked role is a type of service role that is linked to an AWS service\. The service can assume the role to perform an action on your behalf\. Service\-linked roles appear in your IAM account and are owned by the service\. An IAM administrator can view, but not edit the permissions for service\-linked roles\. + **Applications running on Amazon EC2** – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API requests\. This is preferable to storing access keys within the EC2 instance\. To assign an AWS role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance\. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials\. For more information, see [Using an IAM role to grant permissions to applications running on Amazon EC2 instances](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) in the *IAM User Guide*\. diff --git a/doc_source/security-infrastructure.md b/doc_source/security-infrastructure.md index 00003eb3..0484b839 100644 --- a/doc_source/security-infrastructure.md +++ b/doc_source/security-infrastructure.md @@ -1,6 +1,6 @@ # Infrastructure security in AWS Lambda -As a managed service, AWS Lambda is protected by the AWS global network security procedures that are described in the [Amazon Web Services: Overview of security processes](https://d0.awsstatic.com/whitepapers/Security/AWS_Security_Whitepaper.pdf) whitepaper\. +As a managed service, AWS Lambda is protected by the AWS global network security procedures that are described in the [ Best Practices for Security, Identity, and Compliance](http://aws.amazon.com/architecture/security-identity-compliance/)\. You use AWS published API calls to access Lambda through the network\. Clients must support Transport Layer Security \(TLS\) 1\.0 or later\. We recommend TLS 1\.2 or later\. Clients must also support cipher suites with perfect forward secrecy \(PFS\) such as Ephemeral Diffie\-Hellman \(DHE\) or Elliptic Curve Ephemeral Diffie\-Hellman \(ECDHE\)\. Most modern systems such as Java 7 and later support these modes\. diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md index 0aa543bb..4e9450c7 100644 --- a/doc_source/security-resilience.md +++ b/doc_source/security-resilience.md @@ -8,6 +8,6 @@ In addition to the AWS global infrastructure, Lambda offers several features to + **Versioning** – You can use versioning in Lambda to save your function's code and configuration as you develop it\. Together with aliases, you can use versioning to perform blue/green and rolling deployments\. For details, see [Lambda function versions](configuration-versions.md)\. + **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [quota](gettingstarted-limits.md) that can be increased if needed\. For details, see [Lambda function scaling](invocation-scaling.md)\. + **High availability** – Lambda runs your function in multiple Availability Zones to ensure that it is available to process events in case of a service interruption in a single zone\. If you configure your function to connect to a virtual private cloud \(VPC\) in your account, specify subnets in multiple Availability Zones to ensure high availability\. For details, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. -+ **Reserved concurrency** – To make sure that your function can always scale to handle additional requests, you can reserve concurrency for it\. Setting reserved concurrency for a function ensures that it can scale to, but not exceed, a specified number of concurrent invocations\. This ensures that you don't lose requests due to other functions consuming all of the available concurrency\. For details, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. ++ **Reserved concurrency** – To make sure that your function can always scale to handle additional requests, you can reserve concurrency for it\. Setting reserved concurrency for a function ensures that it can scale to, but not exceed, a specified number of concurrent invocations\. This ensures that you don't lose requests due to other functions consuming all of the available concurrency\. For details, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. + **Retries** – For asynchronous invocations and a subset of invocations triggered by other services, Lambda automatically retries on error with delays between retries\. Other clients and AWS services that invoke functions synchronously are responsible for performing retries\. For details, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. -+ **Dead\-letter queue** – For asynchronous invocations, you can configure Lambda to send requests to a dead\-letter queue if all retries fail\. A dead\-letter queue is an Amazon SNS topic or Amazon SQS queue that receives events for troubleshooting or reprocessing\. For details, see [AWS Lambda function dead\-letter queues](invocation-async.md#dlq)\. \ No newline at end of file ++ **Dead\-letter queue** – For asynchronous invocations, you can configure Lambda to send requests to a dead\-letter queue if all retries fail\. A dead\-letter queue is an Amazon SNS topic or Amazon SQS queue that receives events for troubleshooting or reprocessing\. For details, see [Dead\-letter queues](invocation-async.md#invocation-dlq)\. \ No newline at end of file diff --git a/doc_source/services-alexa.md b/doc_source/services-alexa.md index a2daed09..855ce6b5 100644 --- a/doc_source/services-alexa.md +++ b/doc_source/services-alexa.md @@ -3,8 +3,9 @@ You can use Lambda functions to build services that give new skills to Alexa, the Voice assistant on Amazon Echo\. The Alexa Skills Kit provides the APIs, tools, and documentation to create these new skills, powered by your own services running as Lambda functions\. Amazon Echo users can access these new skills by asking Alexa questions or making requests\. The Alexa Skills Kit is available on GitHub\. -+ [Alexa Skills Kit SDK for Node\.js ](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs) + [Alexa Skills Kit SDK for Java](https://github.com/alexa/alexa-skills-kit-sdk-for-java) ++ [Alexa Skills Kit SDK for Node\.js ](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs) ++ [Alexa Skills Kit SDK for Python](https://github.com/alexa/alexa-skills-kit-sdk-for-python) **Example Alexa smart home event** diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md index 58b86895..2ae4edde 100644 --- a/doc_source/services-apigateway-blueprint.md +++ b/doc_source/services-apigateway-blueprint.md @@ -16,16 +16,17 @@ Follow the steps in this section to create a new Lambda function and an API Gate 1. Choose **Create Lambda function**\. -1. Choose **Blueprint**\. +1. Choose **Use a blueprint**\. -1. Enter **microservice** in the search bar\. Choose the **microservice\-http\-endpoint** blueprint and then choose **Configure**\. +1. Enter **microservice** in the search bar\. Choose the **microservice\-http\-endpoint** blueprint\. -1. Configure the following settings\. +1. Configure your function with the following settings\. + **Name** – **lambda\-microservice**\. + **Role** – **Create a new role from AWS policy templates**\. + **Role name** – **lambda\-apigateway\-role**\. + **Policy templates** – **Simple microservice permissions**\. - + **API** – **Create a new API**\. + + **API** – **Create an API**\. + + **API Type** – **HTTP API**\. + **Security** – **Open**\. Choose **Create function**\. @@ -36,11 +37,11 @@ A proxy resource has an `AWS_PROXY` integration type and a catch\-all method `AN ## Test sending an HTTP request -In this step, you will use the console to test the Lambda function\. In addition, you can run a `curl` command to test the end\-to\-end experience\. That is, [send an HTTP request](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) to your API method and have Amazon API Gateway invoke your Lambda function\. In order to complete the steps, make sure you have created a DynamoDB table and named it "MyTable"\. For more information, see [Create a DynamoDB table with a stream enabled](with-ddb-example.md#with-ddb-create-buckets) +In this step, you will use the console to test the Lambda function\. In addition, you can run a `curl` command to test the end\-to\-end experience\. That is, [send an HTTP request](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) to your API method and have Amazon API Gateway invoke your Lambda function\. In order to complete the steps, make sure you have created a DynamoDB table and named it "MyTable"\. For more information, see [Create a DynamoDB table with a stream enabled](with-ddb-example.md#with-ddb-create-buckets)\. **To test the API** -1. With your `lambda-microservice` function still open in the console, choose the **Test** tab\. +1. With your `lambda-microservice` function still open in the Lambda console, choose the **Test** tab\. 1. Choose **New event**\. @@ -59,6 +60,18 @@ In this step, you will use the console to test the Lambda function\. In addition } ``` -1. After entering the text above choose **Create event**\. + This `GET` command scans your DynamoDB table and returns all items found\. -1. Choose the event that you created and choose **Invoke**\. \ No newline at end of file +1. After entering the text above choose **Test**\. + +Verify that the test succeeded\. In the function response, you should see the following: + +``` +{ + "statusCode": "200", + "body": "{\"Items\":[],\"Count\":0,\"ScannedCount\":0}", + "headers": { + "Content-Type": "application/json" + } +} +``` \ No newline at end of file diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 58b5bfdb..6459ae67 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -29,8 +29,8 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an + **Rule** – **Create a new rule**\. + **Rule name** – **CheckWebsiteScheduledEvent**\. + **Rule description** – **CheckWebsiteScheduledEvent trigger**\. + + **Rule type** – **Schedule expression**\. + **Schedule expression** – **rate\(1 minute\)**\. - + **Enabled** – True \(checked\)\. + **Environment variables** + **site** – **https://docs\.aws\.amazon\.com/lambda/latest/dg/welcome\.html**\. + **expected** – **What is AWS Lambda?**\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index 030e742a..8c773506 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -1,5 +1,8 @@ # Using AWS Lambda with Amazon CloudWatch Events +**Note** +Amazon EventBridge is the preferred way to manage your events\. CloudWatch Events and EventBridge are the same underlying service and API, but EventBridge provides more features\. Changes you make in either CloudWatch or EventBridge will appear in each console\. For more information, see the [Amazon EventBridge documentation](https://docs.aws.amazon.com/eventbridge/index.html)\. + [Amazon CloudWatch events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchEvents.html) help you to respond to state changes in your AWS resources\. When your resources change state, they automatically send events into an event stream\. You can create rules that match selected events in the stream and route them to your AWS Lambda function to take action\. For example, you can automatically invoke an AWS Lambda function to log the state of an [EC2 instance](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogEC2InstanceState.html) or [AutoScaling group](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogASGroupState.html)\. CloudWatch Events invokes your function asynchronously with an event document that wraps the event from its source\. The following example shows an event that originated from a database snapshot in Amazon Relational Database Service\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 5b41419f..d19a6f3f 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -4,8 +4,6 @@ You can use the AWS SDK for \.NET to manage Amazon EC2 spot instances with C\# c 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\. @@ -280,12 +278,8 @@ View the logs and trace information to see the spot request ID and sequence of c 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) - 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) - ## Clean up 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\. diff --git a/doc_source/services-s3-object-lambda.md b/doc_source/services-s3-object-lambda.md new file mode 100644 index 00000000..1c80121c --- /dev/null +++ b/doc_source/services-s3-object-lambda.md @@ -0,0 +1,5 @@ +# Transforming S3 Objects with S3 Object Lambda + +With S3 Object Lambda you can add your own code to Amazon S3 GET requests to modify and process data before it is returned to an application\. You can use custom code to modify the data returned by standard S3 GET requests to filter rows, dynamically resize images, redact confidential data, and more\. Powered by AWS Lambda functions, your code runs on infrastructure that is fully managed by AWS, eliminating the need to create and store derivative copies of your data or to run proxies, all with no changes required to applications\. + +For more information, see [Transforming objects with S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html)\. \ No newline at end of file diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index c509f9e0..210cff81 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -2,8 +2,6 @@ You can use AWS X\-Ray to visualize the components of your application, identify performance bottlenecks, and troubleshoot requests that resulted in an error\. Your Lambda functions send trace data to X\-Ray, and X\-Ray processes the data to generate a service map and searchable trace summaries\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - If you've enabled X\-Ray tracing in a service that invokes your function, Lambda sends traces to X\-Ray automatically\. The upstream service, such as Amazon API Gateway, or an application hosted on Amazon EC2 that is instrumented with the X\-Ray SDK, samples incoming requests and adds a tracing header that tells Lambda to send traces or not\. To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. @@ -40,13 +38,9 @@ The `Overhead` subsegment represents the phase that occurs between the time when **Note** -If your Lambda function uses [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), your X\-Ray trace might display a function initialization with a very long duration\. +If your Lambda function uses [provisioned concurrency](provisioned-concurrency.md), your X\-Ray trace might display a function initialization with a very long duration\. Provisioned concurrency initializes function instances in advance, to reduce lag at the time of invocation\. Over time, provisioned concurrency refreshes these instances by creating new instances to replace the old ones\. For workloads with steady traffic, the new instances are initialized well in advance of their first invocation\. The time gap gets recorded in the X\-Ray trace as the initialization duration\. -The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - **Important** In Lambda, you can use the X\-Ray SDK to extend the `Invocation` subsegment with additional subsegments for downstream calls, annotations, and metadata\. You can't access the function segment directly or record work done outside of the handler invocation scope\. diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md index d0f78cc5..0f426b7a 100644 --- a/doc_source/troubleshooting-images.md +++ b/doc_source/troubleshooting-images.md @@ -16,4 +16,4 @@ Retry the function invocation\. If the retry fails, validate that the files requ **Error:** *You are using an AWS CloudFormation template, and your container ENTRYPOINT is being overridden with a null or empty value\.* -Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. +Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. \ No newline at end of file diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index e0776c69..afdc6aef 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -23,7 +23,7 @@ For more information, see [AWS Lambda permissions](lambda-permissions.md)\. When you connect a function to a virtual private cloud \(VPC\) at the time of creation, the function enters a `Pending` state while Lambda creates elastic network interfaces\. During this time, you can't invoke or modify your function\. If you connect your function to a VPC after creation, you can invoke it while the update is pending, but you can't modify its code or configuration\. -For more information, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. +For more information, see [Lambda function states](functions-states.md)\. ## Lambda: Function is stuck in Pending @@ -64,8 +64,8 @@ Lambda uses a simple probabilistic model to distribute the traffic between the t **Issue:** *You see cold starts after enabling provisioned concurrency\.* -When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: -+ [Check that provisioned concurrency is enabled](configuration-concurrency.md#configuration-concurrency-provisioned) on the function version or alias\. +When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](provisioned-concurrency.md), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: ++ [Check that provisioned concurrency is enabled](provisioned-concurrency.md) on the function version or alias\. **Note** Provisioned concurrency is not configurable on the [$LATEST version](configuration-images.md#configuration-images-latest)\. + Ensure that your triggers invoke the correct function version or alias\. For example, if you're using Amazon API Gateway, check that API Gateway invokes the function version or alias with provisioned concurrency, not $LATEST\. To confirm that provisioned concurrency is being used, you can check the [ProvisionedConcurrencyInvocations Amazon CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that the function is processing invocations on initialized execution environments\. diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 6b72a4eb..fa3f7d21 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -17,6 +17,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support extensions: + Node\.js 14\.x \(`nodejs14.x`\) + Node\.js 12\.x \(`nodejs12.x`\) + Node\.js 10\.x \(`nodejs10.x`\) ++ Python 3\.9 \(`python3.9`\) + Python 3\.8 \(`python3.8`\) + Python 3\.7 \(`python3.7`\) + Ruby 2\.7 \(`ruby2.7`\) @@ -39,7 +40,7 @@ You are charged for the execution time that the extension consumes \(in 1 ms inc Lambda invokes your function in an [execution environment](runtimes-context.md), which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function and provides lifecycle support for the function's runtime and extensions\. The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 31bb5ad9..d8b66f15 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -2,8 +2,6 @@ In this tutorial, you create a simple Android mobile application that uses Amazon Cognito to get credentials and invokes a Lambda function\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambda-android.png) - The mobile application retrieves AWS credentials from an Amazon Cognito identity pool and uses them to invoke a Lambda function with an event that contains request data\. The function processes the request and returns a response to the front\-end\. ## Prerequisites diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 0287e764..bbd900f8 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -79,7 +79,7 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [ New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. **Topics** + [Execution role permissions](#events-dynamodb-permissions) @@ -152,7 +152,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping APIs To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) @@ -324,19 +324,15 @@ An increasing trend in iterator age can indicate issues with your function\. For Lambda functions can run continuous stream processing applications\. A stream represents unbounded data that flows continuously through your application\. To analyze information from this continuously updating input, you can bound the included records using a window defined in terms of time\. -Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with windowing enabled, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. - -### Tumbling windows - -Lambda functions can aggregate data using tumbling windows: distinct time windows that open and close at regular intervals\. Tumbling windows enable you to process streaming data sources through contiguous, non\-overlapping time windows\. +Tumbling windows are distinct time windows that open and close at regular intervals\. By default, Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with tumbling windows, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. Each record of a stream belongs to a specific window\. A record is processed only once, when Lambda processes the window that the record belongs to\. In each window, you can perform calculations, such as a sum or average, at the [partition key](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) level within a shard\. ### Aggregation and processing -Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. You can also process records and return a new state, which is passed in the next invocation\. Lambda returns a `TimeWindowEventResponse` in JSON in the following format: +Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. Thus, when using tumbling windows, your Lambda function response must contain a `state` property\. If the response does not contain a `state` property, Lambda considers this a failed invocation\. To satisfy this condition, your function can return a `TimeWindowEventResponse` object, which has the following JSON shape: -**Example `TimeWindowEventReponse` values** +**Example `TimeWindowEventResponse` values** ``` { @@ -349,7 +345,7 @@ Your user managed function is invoked both for aggregation and for processing th ``` **Note** -For Java functions, we recommend using a Map to represent the state\. +For Java functions, we recommend using a `Map` to represent the state\. At the end of the window, the flag `isFinalInvokeForWindow` is set to `true` to indicate that this is the final state and that it’s ready for processing\. After processing, the window completes and your final invocation completes, and then the state is dropped\. diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index ef7a8d36..fafa324b 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -15,20 +15,38 @@ For an example of how to use self\-managed Kafka as an event source, see [Using Lambda sends the batch of messages in the event parameter when it invokes your Lambda function\. The event payload contains an array of messages\. Each array item contains details of the Kafka topic and Kafka partition identifier, together with a timestamp and a base64\-encoded message\. ``` -{ "eventSource": "aws:kafka", - "eventSourceArn": "arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", - "records": { - "mytopic-0": [ - { - "topic": "mytopic" - "partition": "0", - "offset": 15, - "timestamp": 1545084650987, - "timestampType": "CREATE_TIME", - "value": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", - } +{ + "eventSource":"aws:SelfManagedKafka", + "bootstrapServers":"b-2.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092,b-1.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092", + "records":{ + "mytopic-0":[ + { + "topic":"mytopic", + "partition":"0", + "offset":15, + "timestamp":1545084650987, + "timestampType":"CREATE_TIME", + "value":"SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + "headers":[ + { + "headerKey":[ + 104, + 101, + 97, + 100, + 101, + 114, + 86, + 97, + 108, + 117, + 101 + ] + } + ] + } ] - } + } } ``` @@ -114,10 +132,10 @@ Lambda supports several methods to authenticate with your self\-managed Apache K If only Kafka users within your VPC access your Kafka brokers, you must configure the event source with VPC access\. + SASL/SCRAM - With Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication, the cluster encrypts the credentials using SSL encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. Because the credentials are encrypted, the connection to the cluster does not need to be encrypted\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. + Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with TLS encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. Because the credentials are encrypted, the connection to the cluster does not need to be encrypted\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. + SASL/PLAIN - With SASL/PLAIN authentication, credentials are sent as clear text \(unencrypted\) to the server\. Because the credentials are clear text, the connection to the server must use TLS encryption\. + Lambda supports SASL/PLAIN authentication with TLS encryption\. With SASL/PLAIN authentication, credentials are sent as clear text \(unencrypted\) to the server\. Because the credentials are clear text, the connection to the server must use TLS encryption\. For SASL authentication, you must store the user name and password as a secret in Secrets Manager\. For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. @@ -194,7 +212,7 @@ aws lambda create-event-source-mapping --topics AWSKafkaTopic --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +For more information, see the API reference documentation\. #### Using a VPC @@ -211,7 +229,7 @@ aws lambda create-event-source-mapping "abc2.xyz.com:9092"]}}' ``` -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +For more information, see the API reference documentation\. #### Viewing the status using the AWS CLI @@ -226,11 +244,11 @@ aws lambda get-event-source-mapping When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. -Lambda reads event data from the Kafka topics that you specify in [ `Topics`](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [ `StartingPosition`](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. +Lambda reads event data from the Kafka topics that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) `Topics` based on the starting position that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) `StartingPosition`\. After successful processing, your Kafka topic is committed to your Kafka cluster\. If you specify `LATEST` as the starting position, Lambda starts reading from the latest message in each partition belonging to the topic\. Because there can be some delay after trigger configuration before Lambda starts reading the messages, Lambda does not read any messages produced during this window\. -Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. +Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) >`BatchSize`, until the function catches up with the topic\. If your Lambda function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. @@ -251,7 +269,7 @@ To monitor the throughput of your Kafka topic, you can view the Apache Kafka con When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS CLI, Lambda uses APIs to process your request\. To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 23fbf996..ef3459c1 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -1,8 +1,6 @@ # Tutorial: Using AWS Lambda with Amazon Kinesis -In this tutorial, you create a Lambda function to consume events from a Kinesis stream\. The following diagram illustrates the application flow: - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/kinesis-pull-10.png) +In this tutorial, you create a Lambda function to consume events from a Kinesis stream\. 1. Custom app writes records to the stream\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 1bfce67b..58861b70 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -59,7 +59,7 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [ New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. **Topics** + [Configuring your data stream and function](#services-kinesis-configure) @@ -167,7 +167,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping API To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) @@ -342,19 +342,15 @@ An increasing trend in iterator age can indicate issues with your function\. For Lambda functions can run continuous stream processing applications\. A stream represents unbounded data that flows continuously through your application\. To analyze information from this continuously updating input, you can bound the included records using a window defined in terms of time\. -Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with windowing enabled, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. - -### Tumbling windows - -Lambda functions can aggregate data using tumbling windows: distinct time windows that open and close at regular intervals\. Tumbling windows enable you to process streaming data sources through contiguous, non\-overlapping time windows\. +Tumbling windows are distinct time windows that open and close at regular intervals\. By default, Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with tumbling windows, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. Each record of a stream belongs to a specific window\. A record is processed only once, when Lambda processes the window that the record belongs to\. In each window, you can perform calculations, such as a sum or average, at the [partition key](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) level within a shard\. ### Aggregation and processing -Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. You can also process records and return a new state, which is passed in the next invocation\. Lambda returns a `TimeWindowEventResponse` in JSON in the following format: +Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. Thus, when using tumbling windows, your Lambda function response must contain a `state` property\. If the response does not contain a `state` property, Lambda considers this a failed invocation\. To satisfy this condition, your function can return a `TimeWindowEventResponse` object, which has the following JSON shape: -**Example `TimeWindowEventReponse` values** +**Example `TimeWindowEventResponse` values** ``` { @@ -367,7 +363,7 @@ Your user managed function is invoked both for aggregation and for processing th ``` **Note** -For Java functions, we recommend using a Map to represent the state\. +For Java functions, we recommend using a `Map` to represent the state\. At the end of the window, the flag `isFinalInvokeForWindow` is set to `true` to indicate that this is the final state and that it’s ready for processing\. After processing, the window completes and your final invocation completes, and then the state is dropped\. diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index d047239c..b0a3db67 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -38,7 +38,7 @@ Lambda will pull messages until it has processed a maximum of 6 MB, until timeou **Note** The maximum function invocation time is 14 minutes\. -You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. **Example Amazon MQ record events** @@ -82,9 +82,9 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut ``` { "eventSource": "aws:rmq", - "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:pizzaBroker:b-9bcfa592-423a-4942-879d-eb284b418fc8", "rmqMessagesByQueue": { - "test::/": [ + "pizzaQueue::/": [ { "basicProperties": { "contentType": "text/plain", @@ -132,7 +132,7 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut } } ``` -In the RabbitMQ example, `test` is the name of the RabbitMQ queue, and `/` is the name of the virtual host\. When receiving messages, the event source lists messages under `test::/`\. +In the RabbitMQ example, `pizzaQueue` is the name of the RabbitMQ queue, and `/` is the name of the virtual host\. When receiving messages, the event source lists messages under `pizzaQueue::/`\. ## Execution role permissions @@ -182,7 +182,7 @@ To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in ## Event source mapping API To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 3ae31b37..01414df9 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -4,7 +4,7 @@ Amazon MSK as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) -For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. +For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. Also, see [ Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs for a complete tutorial\. Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. @@ -13,20 +13,38 @@ Lambda allows a function to run for up to 14 minutes before stopping it\. Lambda sends the batch of messages in the event parameter when it invokes your function\. The event payload contains an array of messages\. Each array item contains details of the Amazon MSK topic and partition identifier, together with a timestamp and a base64\-encoded message\. ``` -{ "eventSource": "aws:kafka", - "eventSourceArn": "arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", - "records": { - "mytopic-0": [ - { - "topic": "mytopic" - "partition": "0", - "offset": 15, - "timestamp": 1545084650987, - "timestampType": "CREATE_TIME", - "value": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", - } +{ + "eventSource":"aws:kafka", + "eventSourceArn":"arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", + "records":{ + "mytopic-0":[ + { + "topic":"mytopic", + "partition":"0", + "offset":15, + "timestamp":1545084650987, + "timestampType":"CREATE_TIME", + "value":"SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + "headers":[ + { + "headerKey":[ + 104, + 101, + 97, + 100, + 101, + 114, + 86, + 97, + 108, + 117, + 101 + ] + } + ] + } ] - } + } } ``` @@ -76,7 +94,7 @@ By default, IAM users and roles do not have permission to perform Amazon MSK API ### Using SASL/SCRAM authentication -Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Username and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. +Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with TLS encryption\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Username and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. Note that Amazon MSK does not support SASL/PLAIN authentication\. @@ -151,7 +169,7 @@ aws lambda create-event-source-mapping \ --function-name my-kafka-function ``` -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +For more information, see the API reference documentation\. #### Viewing the status using the AWS CLI diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index 0d23320b..1df57f0d 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -207,4 +207,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the subscription you created\. -1. Choose **Delete**, **Delete**\. +1. Choose **Delete**, **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index 037e18ea..c063c40f 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -1,6 +1,6 @@ -# Tutorial: Using AWS Lambda with Amazon Simple Queue Service +# Tutorial: Using Lambda with Amazon SQS -In this tutorial, you create a Lambda function to consume messages from an [Amazon SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/Welcome.html) queue\. +In this tutorial, you create a Lambda function that consumes messages from an [Amazon Simple Queue Service \(Amazon SQS\)](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html) queue\. ## Prerequisites @@ -24,11 +24,11 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 ## Create the execution role -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. +Create an [execution role](lambda-intro-execution-role.md) that gives your function permission to access the required AWS resources\. **To create an execution role** -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the AWS Identity and Access Management \(IAM\) console\. 1. Choose **Create role**\. @@ -37,14 +37,14 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func + **Permissions** – **AWSLambdaSQSQueueExecutionRole**\. + **Role name** – **lambda\-sqs\-role**\. -The **AWSLambdaSQSQueueExecutionRole** policy has the permissions that the function needs to read items from Amazon SQS and write logs to CloudWatch Logs\. +The **AWSLambdaSQSQueueExecutionRole** policy has the permissions that the function needs to read items from Amazon SQS and to write logs to Amazon CloudWatch Logs\. ## Create the function -The following example shows how to process each Amazon SQS message in the event input\. See [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) for an example of an event with multiple messages\. In the example, the code writes each message to a log in CloudWatch Logs\. +Create a Lambda function that processes your Amazon SQS messages\. The following Node\.js 12 code example writes each message to a log in CloudWatch Logs\. **Note** -For sample code in other languages, see [Sample Amazon SQS function code](with-sqs-create-package.md)\. +For code examples in other languages, see [Sample Amazon SQS function code](with-sqs-create-package.md)\. **Example index\.js** @@ -59,8 +59,10 @@ exports.handler = async function(event, context) { ``` **To create the function** +**Note** +Following these steps creates a function in Node\.js 12\. For other languages, the steps are similar, but some details are different\. -1. Copy the sample code into a file named `index.js`\. +1. Save the code example as a file named `index.js`\. 1. Create a deployment package\. @@ -68,7 +70,7 @@ exports.handler = async function(event, context) { zip function.zip index.js ``` -1. Create a Lambda function with the `create-function` command\. +1. Create the function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. ``` aws lambda create-function --function-name ProcessSQSRecord \ @@ -78,11 +80,11 @@ exports.handler = async function(event, context) { ## Test the function -Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command and a sample Amazon Simple Queue Service event\. +Invoke your Lambda function manually using the `invoke` AWS CLI command and a sample Amazon SQS event\. -If the handler returns normally without exceptions, Lambda considers the message processed successfully and begins reading new messages in the queue\. Once a message is processed successfully, it is automatically deleted from the queue\. If the handler throws an exception, Lambda considers the input of messages as not processed and invokes the function with the same batch of messages\. +If the handler returns normally without exceptions, Lambda considers the message successfully processed and begins reading new messages in the queue\. After successfully processing a message, Lambda automatically deletes it from the queue\. If the handler throws an exception, Lambda considers the batch of messages not successfully processed, and Lambda invokes the function with the same batch of messages\. -1. Copy the following JSON into a file and save it as `input.txt`\. +1. Save the following JSON as a file named `input.txt`\. ``` { @@ -107,7 +109,9 @@ If the handler returns normally without exceptions, Lambda considers the message } ``` -1. Run the following `invoke` command\. + The preceding JSON simulates an event that Amazon SQS might send to your Lambda function, where `"body"` contains the actual message from the queue\. + +1. Run the following `invoke` AWS CLI command\. ``` aws lambda invoke --function-name ProcessSQSRecord \ @@ -116,7 +120,7 @@ If the handler returns normally without exceptions, Lambda considers the message The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. -1. Verify the output in the `outputfile.txt` file\. +1. Verify the output in the file `outputfile.txt`\. ## Create an Amazon SQS queue @@ -124,43 +128,43 @@ Create an Amazon SQS queue that the Lambda function can use as an event source\. **To create a queue** -1. Sign in to the AWS Management Console and open the Amazon SQS console at [https://console\.aws\.amazon\.com/sqs/](https://console.aws.amazon.com/sqs/)\. - -1. In the Amazon SQS console, create a queue\. - -1. Write down or otherwise record the identifying queue ARN \(Amazon Resource Name\)\. You need this in the next step when you associate the queue with your Lambda function\. +1. Open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. -Create an event source mapping in AWS Lambda\. This event source mapping associates the Amazon SQS queue with your Lambda function\. After you create this event source mapping, AWS Lambda starts polling the queue\. +1. Choose **Create queue**, and then configure the queue\. For detailed instructions, see [Creating an Amazon SQS queue \(console\)](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-create-queue.html) in the *Amazon Simple Queue Service Developer Guide*\. -Test the end\-to\-end experience\. As you perform queue updates, Amazon Simple Queue Service writes messages to the queue\. AWS Lambda polls the queue, detects new records and invokes your Lambda function on your behalf by passing events, in this case Amazon SQS messages, to the function\. +1. After creating the queue, record its Amazon Resource Name \(ARN\)\. You need this in the next step when you associate the queue with your Lambda function\. ## Configure the event source -To create a mapping between the specified Amazon SQS queue and the Lambda function, run the following AWS CLI `create-event-source-mapping` command\. After the command runs, write down or otherwise record the UUID\. You'll need this UUID to refer to the event source mapping in any other commands, for example, if you choose to delete the event source mapping\. +To create a mapping between your Amazon SQS queue and your Lambda function, run the following `create-event-source-mapping` AWS CLI command\. ``` aws lambda create-event-source-mapping --function-name ProcessSQSRecord --batch-size 10 \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue ``` -You can get the list of event source mappings by running the following command\. +To get a list of your event source mappings, run the following command\. ``` aws lambda list-event-source-mappings --function-name ProcessSQSRecord \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue ``` -The list returns all of the event source mappings you created, and for each mapping it shows the `LastProcessingResult`, among other things\. This field is used to provide an informative message if there are any problems\. Values such as `No records processed` \(indicates that AWS Lambda has not started polling or that there are no records in the queue\) and `OK` \(indicates AWS Lambda successfully read records from the queue and invoked your Lambda function\) indicate that there no issues\. If there are issues, you receive an error message\. - ## Test the setup Now you can test the setup as follows: -1. In the Amazon SQS console, send messages to the queue\. Amazon SQS writes records of these actions to the queue\. +1. Open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + +1. Choose the name of the queue that you created earlier\. + +1. Choose **Send and receive messages**\. + +1. Under **Message body**, enter a test message\. -1. AWS Lambda polls the queue and when it detects updates, it invokes your Lambda function by passing in the event data it finds in the queue\. +1. Choose **Send message**\. -1. Your function runs and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. +Lambda polls the queue for updates\. When there is a new message, Lambda invokes your function with this new event data from the queue\. Your function runs and creates logs in Amazon CloudWatch\. You can view the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. ## Clean up your resources diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index d1eba474..4d89b8bd 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -45,7 +45,7 @@ Lambda polls the queue and invokes your Lambda function [synchronously](invocati } ``` -By default, Lambda invokes your function as soon as records are available in the SQS queue\. Lambda will poll up to 10 messages in your queue at once and will send that batch to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. +By default, Lambda polls up to 10 messages in your queue at once and sends that batch to your function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. For FIFO queues, records contain additional attributes that are related to deduplication and sequencing\. @@ -85,7 +85,7 @@ When Lambda reads a batch, the messages stay in the queue but become hidden for + [Execution role permissions](#events-sqs-permissions) + [Configuring a queue as an event source](#events-sqs-eventsource) + [Event source mapping APIs](#services-dynamodb-api) -+ [Tutorial: Using AWS Lambda with Amazon Simple Queue Service](with-sqs-example.md) ++ [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) @@ -146,7 +146,9 @@ Lambda supports the following options for Amazon SQS event sources\. Metadata is generated by both Lambda and Amazon SQS for each record\. This additional metadata is counted towards the total payload size and may cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields sent by Amazon SQS can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) documentation in the *Amazon Simple Queue Service API Reference*\. + **Batch window ** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. Only applicable to standard queues\. - If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. Set your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. + If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. We recommend setting your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. +**Note** +If your batch window is greater than 0, and `(batch window) + (function timeout) > (queue visibility timeout)`, your effective queue visibility timeout will be `(batch window) + (function timeout) + 30s`\. Lambda processes up to 5 batches at a time\. This means there are a maximum of 5 workers available to batch and process messages in parallel at any one time\. Each worker will show a distinct Lambda invocation for its current batch of messages\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. @@ -161,7 +163,7 @@ Configure your function timeout to allow enough time to process an entire batch ## Event source mapping APIs To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) From 640845bd869baabd7086201321bef3a4c1497e84 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 30 Sep 2021 16:48:59 +0000 Subject: [PATCH 75/94] Documentation for new feature: Lambda functions on Graviton2 --- doc_source/API_CreateEventSourceMapping.md | 22 +- doc_source/API_CreateFunction.md | 21 +- doc_source/API_FunctionConfiguration.md | 11 +- doc_source/API_GetFunction.md | 1 + doc_source/API_GetFunctionConfiguration.md | 11 +- doc_source/API_GetLayerVersion.md | 7 + doc_source/API_GetLayerVersionByArn.md | 7 + doc_source/API_LayerVersionsListItem.md | 7 + doc_source/API_ListFunctions.md | 1 + doc_source/API_ListLayerVersions.md | 9 +- doc_source/API_ListLayers.md | 9 +- doc_source/API_ListVersionsByFunction.md | 1 + doc_source/API_PublishLayerVersion.md | 15 + doc_source/API_PublishVersion.md | 11 +- doc_source/API_UpdateEventSourceMapping.md | 16 + doc_source/API_UpdateFunctionCode.md | 19 +- doc_source/API_UpdateFunctionConfiguration.md | 11 +- doc_source/applications-tutorial.md | 2 +- doc_source/best-practices.md | 2 +- doc_source/configuration-envvars.md | 94 +-- doc_source/configuration-function-common.md | 3 + doc_source/configuration-function-zip.md | 120 +++- doc_source/configuration-images.md | 41 +- doc_source/configuration-layers.md | 57 +- doc_source/configuration-vpc.md | 2 +- doc_source/csharp-exceptions.md | 14 +- doc_source/csharp-image.md | 16 +- doc_source/csharp-package.md | 3 + doc_source/deploying-lambda-apps.md | 3 +- doc_source/foundation-arch.md | 76 +++ doc_source/functions-states.md | 2 +- doc_source/gettingstarted-concepts.md | 11 +- doc_source/gettingstarted-limits.md | 2 +- doc_source/gettingstarted-package.md | 44 +- doc_source/go-image.md | 9 +- doc_source/golang-exceptions.md | 14 +- doc_source/images-create.md | 10 +- doc_source/images-test.md | 34 +- doc_source/index.md | 160 ++--- doc_source/invocation-async.md | 4 +- doc_source/invocation-eventsourcemapping.md | 10 +- doc_source/invocation-images.md | 2 +- doc_source/invocation-layers.md | 25 + doc_source/invocation-scaling.md | 4 +- doc_source/java-exceptions.md | 14 +- doc_source/java-image.md | 9 +- doc_source/lambda-csharp.md | 8 +- doc_source/lambda-foundation.md | 4 +- doc_source/lambda-functions.md | 2 +- doc_source/lambda-golang.md | 6 +- doc_source/lambda-images.md | 4 + doc_source/lambda-invocation.md | 5 +- doc_source/lambda-java.md | 10 +- doc_source/lambda-nodejs.md | 10 +- doc_source/lambda-powershell.md | 8 +- doc_source/lambda-python.md | 14 +- doc_source/lambda-releases.md | 5 +- doc_source/lambda-ruby.md | 8 +- doc_source/lambda-runtimes.md | 64 +- doc_source/lambda-services.md | 167 +++--- doc_source/logging-using-cloudtrail.md | 3 + doc_source/monitoring-code-profiler.md | 3 + doc_source/monitoring-insights.md | 2 +- doc_source/nodejs-exceptions.md | 14 +- doc_source/nodejs-image.md | 9 +- doc_source/nodejs-package.md | 1 + doc_source/powershell-devenv.md | 2 +- doc_source/powershell-exceptions.md | 16 +- doc_source/python-exceptions.md | 14 +- doc_source/python-image.md | 37 +- doc_source/python-package.md | 1 + doc_source/ruby-exceptions.md | 14 +- doc_source/ruby-image.md | 9 +- doc_source/ruby-package.md | 1 + doc_source/runtimes-avx2.md | 3 + doc_source/runtimes-images.md | 3 + doc_source/security-dataprotection.md | 14 +- doc_source/services-apigateway-tutorial.md | 563 ++++++++---------- doc_source/services-apigateway.md | 2 +- .../services-cloudwatchevents-expressions.md | 2 +- .../services-cloudwatchevents-tutorial.md | 8 +- doc_source/services-cloudwatchevents.md | 22 +- doc_source/services-ec2.md | 8 +- doc_source/services-elasticache-tutorial.md | 2 +- doc_source/services-rds-tutorial.md | 2 +- doc_source/services-rds.md | 2 +- doc_source/troubleshooting-deployment.md | 2 +- doc_source/troubleshooting-execution.md | 44 +- doc_source/troubleshooting-images.md | 36 ++ doc_source/with-ddb-example.md | 2 +- doc_source/with-ddb.md | 35 +- doc_source/with-kafka.md | 21 +- doc_source/with-kinesis-example.md | 2 +- doc_source/with-kinesis.md | 36 +- doc_source/with-mq.md | 28 +- doc_source/with-s3-example.md | 2 +- doc_source/with-s3-tutorial.md | 2 +- ...th-scheduledevents-example-use-app-spec.md | 2 +- doc_source/with-sns-example.md | 2 +- doc_source/with-sns.md | 2 +- doc_source/with-sqs-cross-account-example.md | 234 ++++++++ doc_source/with-sqs-example.md | 2 +- doc_source/with-sqs.md | 34 +- 103 files changed, 1665 insertions(+), 859 deletions(-) create mode 100644 doc_source/foundation-arch.md create mode 100644 doc_source/with-sqs-cross-account-example.md diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index c16ceb8e..66941c8f 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -2,13 +2,13 @@ Creates a mapping between an event source and an AWS Lambda function\. Lambda reads items from the event source and triggers the function\. -For details about each event source type, see the following topics\. -+ [ Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) -+ [ Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) -+ [ Configuring an Amazon SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) -+ [ Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) -+ [ Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) -+ [ Configuring Self\-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) +For details about how to configure different event sources, see the following topics\. ++ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) ++ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) ++ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) ++ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) ++ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) ++ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. @@ -17,6 +17,14 @@ The following error handling options are only available for stream sources \(Dyn + `MaximumRetryAttempts` \- Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. + `ParallelizationFactor` \- Process multiple batches from each shard concurrently\. +For information about which configuration parameters apply to each event source, see the following topics\. ++ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params) ++ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params) ++ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params) ++ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params) ++ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms) ++ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms) + ## Request Syntax ``` diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 45fcf6b0..0bfba5c1 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -4,7 +4,7 @@ Creates a Lambda function\. To create a function, you need a [deployment package You set the package type to `Image` if the deployment package is a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)\. For a container image, the code property must include the URI of a container image in the Amazon ECR registry\. You do not need to specify the handler and runtime properties\. -You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. +You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. The code in the deployment package must be compatible with the target instruction set architecture of the function \(`x86-64` or `arm64`\)\. If you do not specify the architecture, the default value is `x86-64`\. When you create 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 or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. @@ -25,6 +25,7 @@ POST /2015-03-31/functions HTTP/1.1 Content-type: application/json { + "Architectures": [ "string" ], "Code": { "ImageUri": "string", "S3Bucket": "string", @@ -84,6 +85,13 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. + ** [ Architectures ](#API_CreateFunction_RequestSyntax) ** +The instruction set architecture that the function supports\. Enter a string array with one of the valid values\. The default value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` +Required: No + ** [ Code ](#API_CreateFunction_RequestSyntax) ** The code for the function\. Type: [ FunctionCode ](API_FunctionCode.md) object @@ -213,6 +221,7 @@ HTTP/1.1 201 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -291,6 +300,12 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_CreateFunction_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_CreateFunction_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -339,7 +354,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_CreateFunction_ResponseSyntax) ** -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\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -366,7 +381,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_CreateFunction_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main 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-_]+))?` diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 3f9d6178..2896643e 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -4,6 +4,13 @@ Details about a function's configuration\. ## Contents + ** Architectures ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` +Required: No + ** CodeSha256 ** The SHA256 hash of the function's deployment package\. Type: String @@ -62,7 +69,7 @@ Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object Required: No ** KMSKeyArn ** -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\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` Required: No @@ -95,7 +102,7 @@ Type: Array of [ Layer ](API_Layer.md) objects Required: No ** MasterArn ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main 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-_]+))?` Required: No diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index 1335cd85..5e0c4c28 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -50,6 +50,7 @@ Content-type: application/json "ReservedConcurrentExecutions": number }, "Configuration": { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index b3307f36..e6d676ba 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -42,6 +42,7 @@ HTTP/1.1 200 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -120,6 +121,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_GetFunctionConfiguration_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_GetFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -168,7 +175,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** -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\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -195,7 +202,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main 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-_]+))?` diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index b32f1a07..16ddd063 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -33,6 +33,7 @@ HTTP/1.1 200 Content-type: application/json { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "Content": { "CodeSha256": "string", @@ -56,6 +57,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ CompatibleArchitectures ](#API_GetLayerVersion_ResponseSyntax) ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntimes ](#API_GetLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index fcbd7e96..8bb8a9d9 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -29,6 +29,7 @@ HTTP/1.1 200 Content-type: application/json { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "Content": { "CodeSha256": "string", @@ -52,6 +53,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ CompatibleArchitectures ](#API_GetLayerVersionByArn_ResponseSyntax) ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntimes ](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 38f30a79..06495845 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -4,6 +4,13 @@ Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/la ## Contents + ** CompatibleArchitectures ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` +Required: No + ** CompatibleRuntimes ** The layer's compatible runtimes\. Type: Array of strings diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index ebce0f00..06195eff 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -45,6 +45,7 @@ Content-type: application/json { "Functions": [ { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index 29e89342..76259787 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -1,17 +1,21 @@ # ListLayerVersions -Lists the versions of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. +Lists the versions of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layer versions that are compatible with that architecture\. ## Request Syntax ``` -GET /2018-10-31/layers/LayerName/versions?CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 +GET /2018-10-31/layers/LayerName/versions?CompatibleArchitecture=CompatibleArchitecture&CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 ``` ## URI Request Parameters The request uses the following URI parameters\. + ** [ CompatibleArchitecture ](#API_ListLayerVersions_RequestSyntax) ** +The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntime ](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` @@ -42,6 +46,7 @@ Content-type: application/json { "LayerVersions": [ { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "CreatedDate": "string", "Description": "string", diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 6aa4022b..a95db624 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -1,17 +1,21 @@ # ListLayers -Lists [ AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. +Lists [ AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layers that are compatible with that [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. ## Request Syntax ``` -GET /2018-10-31/layers?CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 +GET /2018-10-31/layers?CompatibleArchitecture=CompatibleArchitecture&CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 ``` ## URI Request Parameters The request uses the following URI parameters\. + ** [ CompatibleArchitecture ](#API_ListLayers_RequestSyntax) ** +The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntime ](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` @@ -37,6 +41,7 @@ Content-type: application/json "Layers": [ { "LatestMatchingVersion": { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "CreatedDate": "string", "Description": "string", diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index a82e1aed..ad35ed08 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -45,6 +45,7 @@ Content-type: application/json "NextMarker": "string", "Versions": [ { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index cbbeb2c9..2c9adb46 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -11,6 +11,7 @@ POST /2018-10-31/layers/LayerName/versions HTTP/1.1 Content-type: application/json { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "Content": { "S3Bucket": "string", @@ -37,6 +38,13 @@ Required: Yes The request accepts the following data in JSON format\. + ** [ CompatibleArchitectures ](#API_PublishLayerVersion_RequestSyntax) ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` +Required: No + ** [ CompatibleRuntimes ](#API_PublishLayerVersion_RequestSyntax) ** A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ ListLayers ](API_ListLayers.md) and [ ListLayerVersions ](API_ListLayerVersions.md)\. Type: Array of strings @@ -71,6 +79,7 @@ HTTP/1.1 201 Content-type: application/json { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "Content": { "CodeSha256": "string", @@ -94,6 +103,12 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. + ** [ CompatibleArchitectures ](#API_PublishLayerVersion_ResponseSyntax) ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntimes ](#API_PublishLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index dc6a4d58..12c42030 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -62,6 +62,7 @@ HTTP/1.1 201 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -140,6 +141,12 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_PublishVersion_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_PublishVersion_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -188,7 +195,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_PublishVersion_ResponseSyntax) ** -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\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -215,7 +222,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_PublishVersion_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main 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-_]+))?` diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 8d4f4782..09a0dcd3 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -2,6 +2,14 @@ Updates an event source mapping\. You can change the function that AWS Lambda invokes, or pause invocation and resume later from the same location\. +For details about how to configure different event sources, see the following topics\. ++ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) ++ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) ++ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) ++ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) ++ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) ++ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) + The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. + `DestinationConfig` \- Send discarded records to an Amazon SQS queue or Amazon SNS topic\. @@ -9,6 +17,14 @@ The following error handling options are only available for stream sources \(Dyn + `MaximumRetryAttempts` \- Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records are retried until the record expires\. + `ParallelizationFactor` \- Process multiple batches from each shard concurrently\. +For information about which configuration parameters apply to each event source, see the following topics\. ++ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params) ++ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params) ++ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params) ++ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params) ++ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms) ++ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms) + ## Request Syntax ``` diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index dd684e92..1547566f 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -14,6 +14,7 @@ PUT /2015-03-31/functions/FunctionName/code HTTP/1.1 Content-type: application/json { + "Architectures": [ "string" ], "DryRun": boolean, "ImageUri": "string", "Publish": boolean, @@ -45,6 +46,13 @@ Required: Yes The request accepts the following data in JSON format\. + ** [ Architectures ](#API_UpdateFunctionCode_RequestSyntax) ** +The instruction set architecture that the function supports\. Enter a string array with one of the valid values\. The default value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` +Required: No + ** [ DryRun ](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean @@ -96,6 +104,7 @@ HTTP/1.1 200 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -174,6 +183,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_UpdateFunctionCode_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_UpdateFunctionCode_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -222,7 +237,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_UpdateFunctionCode_ResponseSyntax) ** -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\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -249,7 +264,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_UpdateFunctionCode_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main 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-_]+))?` diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index a2cb4777..a32e845b 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -166,6 +166,7 @@ HTTP/1.1 200 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -244,6 +245,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -292,7 +299,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -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\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -319,7 +326,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main 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-_]+))?` diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 197c620b..5f7c9b22 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -6,7 +6,7 @@ In this tutorial, you create the following resources\. + **Application** – A Node\.js Lambda function, build specification, and AWS Serverless Application Model \(AWS SAM\) template\. + **Pipeline** – An AWS CodePipeline pipeline that connects the other resources to enable continuous delivery\. + **Repository** – A Git repository in AWS CodeCommit\. When you push a change, the pipeline copies the source code into an Amazon S3 bucket and passes it to the build project\. -+ **Trigger** – An Amazon CloudWatch Events rule that watches the main branch of the repository and triggers the pipeline\. ++ **Trigger** – An Amazon EventBridge \(CloudWatch Events\) rule that watches the main branch of the repository and triggers the pipeline\. + **Build project** – An AWS CodeBuild build that gets the source code from the pipeline and packages the application\. The source includes a build specification with commands that install dependencies and prepare the application template for deployment\. + **Deployment configuration** – The pipeline's deployment stage defines a set of actions that take the processed AWS SAM template from the build output, and deploy the new version with AWS CloudFormation\. + **Bucket** – An Amazon Simple Storage Service \(Amazon S3\) bucket for deployment artifact storage\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index 0a9fe11f..0cc90bf8 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -62,7 +62,7 @@ For more information about best practices for Lambda applications, see [Applicat + **Leverage your logging library and [AWS Lambda Metrics and Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/lam-metricscollected.html)** to catch app errors \(e\.g\. ERR, ERROR, WARNING, etc\.\) ## Working with streams -+ **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. [BatchSize](API_CreateEventSourceMapping.md#SSS-CreateEventSourceMapping-request-BatchSize) controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. ++ **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. The [CreateEventSourceMapping](API_CreateEventSourceMapping.md) BatchSize parameter controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. + **Increase Kinesis stream processing throughput by adding shards\.** A Kinesis stream is composed of one or more shards\. Lambda will poll each shard with at most one concurrent invocation\. For example, if your stream has 100 active shards, there will be at most 100 Lambda function invocations running concurrently\. Increasing the number of shards will directly increase the number of maximum concurrent Lambda function invocations and can increase your Kinesis stream processing throughput\. If you are increasing the number of shards in a Kinesis stream, make sure you have picked a good partition key \(see [Partition Keys](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key)\) for your data, so that related records end up on the same shards and your data is well distributed\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 6a130191..9c9bcbff 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -207,34 +207,71 @@ The sample values shown reflect the latest runtimes\. The presence of specific v ## Securing environment variables -Lambda encrypts environment variables with a key that it creates in your account \(an AWS managed customer master key \(CMK\)\)\. Use of this key is free\. You can also choose to provide your own key for Lambda to use instead of the default key\. +For securing your environment variables, you can use server\-side encryption to protect your data at rest and client\-side encryption to protect your data in transit\. -When you provide the key, only users in your account with access to the key can view or manage environment variables on the function\. Your organization might also have internal or external requirements to manage keys that are used for encryption and to control when they're rotated\. +**Note** +To increase database security, we recommend that you use AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. -**To use a customer managed CMK** +**Security at rest** +Lambda always provides server\-side encryption at rest with an AWS KMS key\. By default, Lambda uses an AWS managed key\. If this default behavior suits your workflow, you don't need to set anything else up\. Lambda creates the AWS managed key in your account and manages permissions to it for you\. AWS doesn't charge you to use this key\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +If you prefer, you can provide an AWS KMS customer managed key instead\. You might do this to have control over rotation of the KMS key or to meet the requirements of your organization for managing KMS keys\. When you use a customer managed key, only users in your account with access to the KMS key can view or manage environment variables on the function\. -1. Choose a function\. +Customer managed keys incur standard AWS KMS charges\. For more information, see [AWS Key Management Service pricing](https://aws.amazon.com/kms/pricing/), in the *AWS KMS produt pages*\. -1. Choose **Configuration**, then choose **Environment variables**\. +**Security in transit** +For additional security, you can enable helpers for encryption in transit, which ensures that your environment variables are encrypted client\-side for protection in transit\. -1. Under **Environment variables**, choose **Edit**\. +**To configure encryption for your environment variables** + +1. Use the AWS Key Management Service \(AWS KMS\) to create any customer managed keys for Lambda to use for server\-side and client\-side encryption\. For more information, see [Creating keys](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) in the *[AWS Key Management Service Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/)*\. + +1. Using the Lambda console, navigate to the **Edit environment variables** page\. + + 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + + 1. Choose a function\. + + 1. Choose **Configuration**, then choose **Environment variables** from the left navigation bar\. -1. Expand **Encryption configuration**\. + 1. In the **Environment variables** section, choose **Edit**\. -1. Choose **Use a customer master key**\. + 1. Expand **Encryption configuration**\. -1. Choose your customer managed CMK\. +1. Optionally, enable console encryption helpers to use client\-side encryption to protect your data in transit\. + + 1. Under **Encryption in transit**, choose **Enable helpers for encryption in transit**\. + + 1. For each environment variable that you want to enable console encryption helpers for, choose **Encrypt** next ot the environment variable\. + + 1. Under AWS KMS key to encrypt in transit, choose a customer managed key that you created at the beginning of this procedure\. + + 1. Choose **Execution role policy** and copy the policy\. This policy grants permission to your function's execution role to decrypt the environment variables\. + + Save this policy to use in the last step of this procedure\. + + 1. Add code to your function that decrypts the environment variables\. Choose **Decrypt secrets snippet** to see an example\. + +1. Optionally, specify your customer managed key for encryption at rest\. + + 1. Choose **Use a customer master key**\. + + 1. Choose a customer managed key that you created at the beginning of this procedure\. 1. Choose **Save**\. -Customer managed CMKs incur standard [AWS KMS charges](https://aws.amazon.com/kms/pricing/)\. +1. Set up permissions\. + + If you're using a customer managed key with server\-side encryption, grant permissions to any AWS Identity and Access Management \(IAM\) users or roles that you want to be able to view or manange environment variables on the function\. For more information, see [Managing permissions to your server\-side encryption KMS key](#managing-permissions-to-your-server-side-encryption-key)\. -No AWS KMS permissions are required for your user or the function's execution role to use the default encryption key\. To use a customer managed CMK, you need permission to use the key\. Lambda uses your permissions to create a grant on the key\. This allows Lambda to use it for encryption\. + If you're enabling client\-side encryption for security in transit, your function needs permission to call the `kms:Decrypt` API operation\. Add the policy that you saved previously in this procedure to the function's [execution role](lambda-intro-execution-role.md)\. + +### Managing permissions to your server\-side encryption KMS key + +No AWS KMS permissions are required for your user or the function's execution role to use the default encryption key\. To use a customer managed key, you need permission to use the key\. Lambda uses your permissions to create a grant on the key\. This allows Lambda to use it for encryption\. + `kms:ListAliases` – To view keys in the Lambda console\. -+ `kms:CreateGrant`, `kms:Encrypt` – To configure a customer managed CMK on a function\. -+ `kms:Decrypt` – To view and manage environment variables that are encrypted with a customer managed CMK\. ++ `kms:CreateGrant`, `kms:Encrypt` – To configure a customer managed key on a function\. ++ `kms:Decrypt` – To view and manage environment variables that are encrypted with a customer managed key\. You can get these permissions from your user account or from a key's resource\-based permissions policy\. `ListAliases` is provided by the [managed policies for Lambda](access-control-identity-based.md)\. Key policies grant the remaining permissions to users in the **Key users** group\. @@ -260,34 +297,7 @@ Users without `Decrypt` permissions can still manage functions, but they can't v ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/env-accessdenied.png) -For details on managing key permissions, see [Using key policies in AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)\. - -You can also encrypt environment variable values on the client side before sending them to Lambda, and decrypt them in your function code\. This obscures secret values in the Lambda console and API output, even for users who have permission to use the key\. In your code, you retrieve the encrypted value from the environment and decrypt it by using the AWS KMS API\. - -**To encrypt environment variables on the client side** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration**, then choose **Environment variables**\. - -1. Under **Environment variables**, choose **Edit**\. - -1. Expand **Encryption configuration**\. - -1. Choose **Enable helpers for encryption in transit**\. - -1. Choose **Encrypt** next to a variable to encrypt its value\. - -1. Choose **Save**\. - -**Note** -When you use the console encryption helpers, your function needs permission to call the `kms:Decrypt` API operation in its [execution role](lambda-intro-execution-role.md)\. - -To view sample code for your function's language, choose **Code** next to an environment variable\. The sample code shows how to retrieve an environment variable in a function and decrypt its value\. - -Another option is to store passwords in AWS Secrets Manager secrets\. You can reference the secret in your AWS CloudFormation templates to set passwords on databases\. You can also set the value of an environment variable on the Lambda function\. For an example, see the next section\. +For details on managing key permissions, see [Using key policies in AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) in the AWS Key Management Service Developer Guide\. ## Sample code and templates diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md index a62fe9f9..1c963dc4 100644 --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -95,6 +95,9 @@ You can configure the memory of your function in the Lambda console\. If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. +**Note** +Compute Optimizer supports only functions that use x86\_64 architecture\. + When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\. **To accept a function memory recommendation** diff --git a/doc_source/configuration-function-zip.md b/doc_source/configuration-function-zip.md index 32fa7a5e..5e4ed1d7 100644 --- a/doc_source/configuration-function-zip.md +++ b/doc_source/configuration-function-zip.md @@ -1,8 +1,8 @@ # Creating Lambda functions defined as \.zip file archives -When you create a Lambda function, you package your function code into a [deployment package](gettingstarted-package.md)\. Lambda supports two types of deployment packages: [container images](configuration-images.md) and \.zip file archives\. +When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function depends on the deployment package type\. To configure a function defined as a container image, see [Creating Lambda functions defined as container images](configuration-images.md)\. -You can use the Lambda console and the Lambda API to create a function defined with a \.zip file archive\. You can also upload an updated \.zip file to change the function code\. +You can use the Lambda console and the Lambda API to create a function defined with a \.zip file archive\. You can also upload an updated \.zip file to change the function code\. **Note** You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. @@ -11,7 +11,8 @@ You cannot convert an existing container image function to use a \.zip file arch + [Creating a function \(console\)](#configuration-function-create) + [Using the console code editor](#configuration-functions-console-update) + [Updating function code \(console\)](#configuration-function-update) -+ [Configuring runtime settings \(console\)](#configuration-function-runtime) ++ [Change the runtime or runtime version \(console\)](#configuration-function-runtime) ++ [Change the architecture \(console\)](#configuration-function-arch) + [Using the Lambda API](#configuration-function-api) + [AWS CloudFormation](#configuration-function-cloudformation) @@ -33,6 +34,8 @@ When you create a function defined with a \.zip file archive, you choose a code 1. For **Runtime**, choose the language version to use for your function\. + 1. \(Optional\) For **Architecture**, choose the instruction set architecture to use for your function\. The default architecture is x86\_64\. When you build the deployment package for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. + 1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. You can create a new **Execution role** or use an existing role\. 1. \(Optional\) Expand **Advanced settings**\. You can choose a **Code signing configuration** for the function\. You can also configure an \(Amazon VPC\) for the function to access\. @@ -52,7 +55,7 @@ When you save your function code, the Lambda console creates a \.zip file archiv ## Updating function code \(console\) -For scripting languages \(Node\.js, Python, and Ruby\), you can edit your function code in the embedded code [editor](foundation-console.md#code-editor)\. To add libraries, or for languages that the editor doesn't support \(Java, Go, C\#\), you must upload your function code as a \.zip archive\. You can upload the zip archive from your local machine\. If the \.zip archive is larger than 50 MB, upload the file to the function from an Amazon S3 bucket\. +For scripting languages \(Node\.js, Python, and Ruby\), you can edit your function code in the embedded code [editor](foundation-console.md#code-editor)\. If the code is larger than 3MB, or if you need to add libraries, or for languages that the editor doesn't support \(Java, Go, C\#\), you must upload your function code as a \.zip archive\. If the \.zip file archive is smaller than 50 MB, you can upload the \.zip file archive from your local machine\. If the file is larger than 50 MB, upload the file to the function from an Amazon S3 bucket\. **To upload function code as a \.zip archive** @@ -62,19 +65,56 @@ For scripting languages \(Node\.js, Python, and Ruby\), you can edit your functi 1. Under **Code source**, choose **Upload from**\. -1. Choose **\.zip file** and then choose **Upload**\. +1. Choose **\.zip file**, and then choose **Upload**\. - 1. In the file chooser, select the new image version and choose **Open**, then choose **Save**\. + 1. In the file chooser, select the new image version, choose **Open**, and then choose **Save**\. 1. \(Alternative to step 4\) Choose **Amazon S3 location**\. 1. In the text box, enter the S3 link URL of the \.zip file archive, then choose **Save**\. -## Configuring runtime settings \(console\) +## Change the runtime or runtime version \(console\) + +If you update the function configuration to use a new runtime version, you may need to update the function code to be compatible with the new version\. If you update the function configuration to use a different runtime, you **must** provide new function code that is compatible with the runtime and architecture\. For instructions on how to create a deployment package for the function code, see the handler page for the runtime that the function uses\. + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -When you create a function that uses a \.zip file deployment package, you must specify the runtime to use and the name of the function handler\. +------ +#### [ C\# ] -**To update the runtime settings** + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ + +**To change the runtime or runtime version** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -86,6 +126,65 @@ When you create a function that uses a \.zip file deployment package, you must s 1. For **Handler**, specify file name and handler for your function\. + 1. For **Architecture**, choose the instruction set architecture to use for your function\. + +1. Choose **Save**\. + +## Change the architecture \(console\) + +Before you can change the instruction set architecture, you need to ensure that your function's code is compatible with the target architecture\. + +If you use Node\.js, Python, or Ruby and you edit your function code in the embedded [editor](foundation-console.md#code-editor), the existing code may run without modification\. + +However, if you provide your function code using a \.zip file archive deployment package, you must prepare a new \.zip file archive that is compiled and built correctly for the target runtime and instruction\-set architecture\. For instructions, see the handler page for your function runtime\. + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + +------ +#### [ C\# ] + + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ + +**To change the instruction set architecture** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update and choose the **Code** tab\. + +1. Under **Runtime settings**, choose **Edit**\. + +1. For **Architecture**, choose the instruction set architecture to use for your function\. + 1. Choose **Save**\. ## Using the Lambda API @@ -103,4 +202,5 @@ In the `AWS::Lambda::Function` resource, set the following properties to create + AWS::Lambda::Function + PackageType – Set to `Zip`\. + Code – Enter the Amazon S3 bucket name and \.zip file name in the `S3Bucket` and `S3Key`fields\. For Node\.js or Python, you can provide inline source code of your Lambda function\. - + Runtime – Set the runtime value\. \ No newline at end of file + + Runtime – Set the runtime value\. + + Architecture – Set the architecture value to `arm64` to use the AWS Graviton2 processor\. By default, the architecture value is `x86_64`\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index e980dd4e..e0159494 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -1,6 +1,6 @@ # Creating Lambda functions defined as container images -When you create a Lambda function, you use a [deployment package](gettingstarted-package.md) to deploy your function code\. Lambda supports two types of deployment packages: [\.zip file archives](configuration-function-zip.md) and container images\. +When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function is different depending on the deployment package type\. To configure a function defined as a \.zip file archive, see [Creating Lambda functions defined as \.zip file archives](configuration-function-zip.md)\. You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. @@ -85,28 +85,33 @@ To create a function defined as a container image, you must first [create the im 1. For **Function name**, enter the function name\. - 1. For **Container image URI**, enter the Amazon ECR image URI\. + 1. For **Container image URI**, provide a container image that is compatible with the instruction set architecture that you want for your function code\. + + You can enter the Amazon ECR image URI or browse for the Amazon ECR image\. + + Enter the Amazon ECR image URI\. + Or, to browse an Amazon ECR repository for the image, choose **Browse images**\. Select the Amazon ECR repository from the dropdown list, and then select the image\. - 1. \(Optional\) To override configuration settings that are included in the Dockerfile, expand **Container image overrides**\. You can override any of the following settings: - + For **Entrypoint**, enter the full path of the runtime executable\. The following example shows an entrypoint for a Node\.js function: +1. \(Optional\) To override configuration settings that are included in the Dockerfile, expand **Container image overrides**\. You can override any of the following settings: + + For **Entrypoint**, enter the full path of the runtime executable\. The following example shows an entrypoint for a Node\.js function: - ``` - "/usr/bin/npx", "aws-lambda-ric" - ``` - + For **Command**, enter additional parameters to pass in to the image with **Entrypoint**\. The following example shows a command for a Node\.js function: + ``` + "/usr/bin/npx", "aws-lambda-ric" + ``` + + For **Command**, enter additional parameters to pass in to the image with **Entrypoint**\. The following example shows a command for a Node\.js function: - ``` - "app.handler" - ``` - + For **Working directory**, enter the full path of the working directory for the function\. The following example shows the working directory for an AWS base image for Lambda: + ``` + "app.handler" + ``` + + For **Working directory**, enter the full path of the working directory for the function\. The following example shows the working directory for an AWS base image for Lambda: - ``` - "/var/task" - ``` + ``` + "/var/task" + ``` **Note** For the override settings, make sure that you enclose each string in quotation marks \(" "\)\. +1. \(Optional\) For **Architecture**, choose the instruction set architecture for the function\. The default architecture is x86\_64\. Note: when you build the container image for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. + 1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. Then, choose to create a new **Execution role**, or to use an existing role\. 1. Choose **Create function**\. @@ -154,7 +159,11 @@ To manage functions defined as container images, use the following API operation + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. Note that you must create the function from the same account as the container registry in Amazon EFS\. +To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. + +When you create the function, you can specify the instruction set architecture\. The default architecture is `x86-64`\. Make sure that the code in your container image is compatible with the architecture\. + + Note that you must create the function from the same account as the container registry in Amazon ECR\. ``` aws lambda create-function --region sa-east-1 --function-name my-function \ diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 76a659bf..bdff631f 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -22,7 +22,9 @@ When you create a layer, you must bundle all its content into a \.zip file archi ## Compiling the \.zip file archive for your layer -You build your layer code into a \.zip file archive using the same procedure as you would for a function deployment package\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. +You build your layer code into a \.zip file archive using the same procedure that you would use for a function deployment package\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. + +When you create a layer, you can specify whether the layer is compatible with one or both of the instruction set architectures\. You may need to set specific compile flags to build a layer that is compatible with the `arm64` architecture\. One way to ensure that you package libraries correctly for Lambda is to use [AWS Cloud9](http://aws.amazon.com/cloud9/)\. For more information, see [Using Lambda layers to simplify your development process](http://aws.amazon.com/blogs/compute/using-lambda-layers-to-simplify-your-development-process/) on the AWS Compute Blog\. @@ -104,13 +106,43 @@ For more information about path settings in the Lambda execution environment, se ## Language\-specific instructions For language\-specific instructions on how to create a \.zip file archive, see the following topics\. -+ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) -+ [Deploy Python Lambda functions with \.zip file archives](python-package.md) -+ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -+ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) -+ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + +------ +#### [ C\# ] + + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ ## Creating a layer @@ -132,6 +164,8 @@ Layers can have one or more version\. When you create a layer, Lambda sets the l + To upload a \.zip file from your computer, choose **Upload a \.zip file**\. Then, choose **Upload** to select your local \.zip file\. + To upload a file from Amazon S3, choose **Upload a file from Amazon S3**\. Then, for **Amazon S3 link URL**, enter a link to the file\. +1. \(Optional\) For **Compatible instruction set architectures**, choose one value or both values\. + 1. \(Optional\) For **Compatible runtimes**, choose up to 15 runtimes\. 1. \(Optional\) For **License**, enter any necessary license information\. @@ -140,12 +174,13 @@ Layers can have one or more version\. When you create a layer, Lambda sets the l **To create a layer \(API\)** -To create a layer, use the publish\-layer\-version command with a name, description, \.zip file archive, and list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional\. +To create a layer, use the publish\-layer\-version command with a name, description, \.zip file archive, a list of [runtimes](lambda-runtimes.md) and a list of architectures that are compatible with the layer\. The runtimes and architecture parameters are optional\. ``` aws lambda publish-layer-version --layer-name my-layer --description "My layer" \ --license-info "MIT" --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip \ --compatible-runtimes python3.6 python3.7 python3.8 + --compatible-architectures "arm64" "x86_64" ``` You should see output similar to the following: @@ -162,6 +197,10 @@ You should see output similar to the following: "Description": "My layer", "CreatedDate": "2018-11-14T23:03:52.894+0000", "Version": 1, + "CompatibleArchitectures": [ + "arm64", + "x86_64" + ], "LicenseInfo": "MIT", "CompatibleRuntimes": [ "python3.6", diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 829b2388..bb9b45ed 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -287,7 +287,7 @@ By default, Lambda runs your functions in a secure VPC with access to AWS servic **Note** Several AWS services offer [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html)\. You can use VPC endpoints to connect to AWS services from within a VPC without internet access\. -Internet access from a private subnet requires network address translation \(NAT\)\. To give your function access to the internet, route outbound traffic to a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. For more information, see [How do I give internet access to my Lambda function in a VPC?](https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/) +Internet access from a private subnet requires network address translation \(NAT\)\. To give your function access to the internet, route outbound traffic to a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. An idle NAT gateway connection will [ time out after 350 seconds\.](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-troubleshooting.html#nat-gateway-troubleshooting-timeout) For more information, see [How do I give internet access to my Lambda function in a VPC?](https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/) ## VPC tutorials diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index 3d4ec84d..767bfdc4 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -153,19 +153,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index d8893f72..4a8b6105 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -1,12 +1,22 @@ # Deploy \.NET Lambda functions with container images -You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your \.NET function: +You can deploy your Lambda function code as a [container image](images-create.md)\. + +**Note** +Lambda does not support arm64 architecture for \.NET runtimes\. + +AWS provides the following resources to help you build a container image for your \.NET function: + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md index cf47126e..b616ac68 100644 --- a/doc_source/csharp-package.md +++ b/doc_source/csharp-package.md @@ -4,6 +4,9 @@ A \.NET Core deployment package \(\.zip file archive\) contains your function's Although it is possible to create the deployment package with the `dotnet publish` command, we recommend that you create the deployment package with either the [\.NET Core CLI](csharp-package-cli.md) or the [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)\. These are tools optimized specifically for Lambda to ensure that the `lambda-project.runtimeconfig.json` file exists and optimizes the package bundle, including the removal of any non\-Linux\-based dependencies\. +**Note** +Lambda does not support arm64 architecture for \.NET runtimes\. + **Topics** + [\.NET Core CLI](csharp-package-cli.md) + [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) \ No newline at end of file diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index 9e76814a..a8fcdf26 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -16,5 +16,4 @@ For more information about designing Lambda applications, see [Application desig + [Managing applications in the AWS Lambda console](applications-console.md) + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) -+ [Common Lambda application types and use cases](applications-usecases.md) -+ [Best practices for working with AWS Lambda functions](best-practices.md) \ No newline at end of file ++ [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) \ No newline at end of file diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md new file mode 100644 index 00000000..72c0156a --- /dev/null +++ b/doc_source/foundation-arch.md @@ -0,0 +1,76 @@ +# Lambda instruction set architectures + + The *instruction set architecture* of a Lambda function determines the type of computer processor that Lambda uses to run the function\. Lambda provides a choice of instruction set architectures: ++ arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. ++ x86\_64 – 64\-bit x86 architecture, for x86\-based processors\. + +## Advantages of using arm64 architecture + +Lambda functions that use arm64 architecture \(AWS Graviton2 processor\) can achieve significantly better better price and performance than the equivalent function running on x86\_64 architecture\. Consider using arm64 for compute\-intensive applications such as high\-performance computing, video encoding, and simulation workloads\. + +The Graviton2 CPU uses the Neoverse N1 core and supports Armv8\.2 \(including CRC and crypto extensions\) plus several other architectural extensions\. + +Graviton2 reduces memory read time by providing a larger L2 cache per vCPU, which improves the latency performance of web and mobile backends, microservices, and data processing systems\. Graviton2 also provides improved encryption performance and supports instruction sets that improve the latency of CPU\-based machine learning inference\. + +For more information about AWS Graviton2, see [AWS Graviton Processor](http://aws.amazon.com/ec2/graviton)\. + +## Function migration to arm64 architecture + +When you select a Lambda function to migrate to arm64 architecture, to ensure a smooth migration, make sure that your function meets the following requirements: ++ The function currently uses a Lambda Amazon Linux 2 runtime\. ++ The deployment package contains only open\-source components and source code that you control, so that you can make any necessary updates for the migration\. ++ If the function code includes third\-party dependencies, each library or package provides an arm64 version\. + +## Function code compatibility with arm64 architecture + +Your Lambda function code must be compatible with the instruction set architecture of the function\. Before you migrate a function to arm64 architecture, note the following points about the current function code: ++ If you added your function code using the embedded code editor, your code probably runs on either architecture without modification\. ++ If you uploaded your function code, you must upload new code that is compatible with your target architecture\. ++ If your function uses layers, you must [check each layer](invocation-layers.md#configuration-layers-finding) to ensure that it is compatible with the new architecture\. If a layer is not compatible, edit the function to replace the current layer version with a compatible layer version\. ++ If your function uses Lambda extensions, you must check each extension to ensure that it is compatible with the new architecture\. ++ If your function uses a container image deployment package type, you must create a new container image that is compatible with the architecture of the function\. + +## Suggested migration steps + + + +To migrate a Lambda function to the arm64 architecture, we recommend following these steps: + +1. Build the list of dependencies for your application or workload\. Common dependencies include: + + All the libraries and packages that the function uses\. + + The tools that you use to build, deploy, and test the function, such as compilers, test suites, continuous integration and continuous delivery \(CI/CD\) pipelines, provisioning tools, and scripts\. + + The Lambda extensions and third\-party tools that you use to monitor the function in production\. + +1. For each of the dependencies, check the version, and then check whether arm64 versions are available\. + +1. Build an environment to migrate your application\. + +1. Bootstrap the application\. + +1. Test and debug the application\. + +1. Test the performance of the arm64 function\. Compare the performance with the x86\_64 version\. + +1. Update your infrastructure pipeline to support arm64 Lambda functions\. + +1. Stage your deployment to production\. + + For example, use [alias routing configuration](configuration-aliases.md#configuring-alias-routing) to split traffic between the x86 and arm64 versions of the function, and compare the performance and latency\. + +For more information about how to create a code environment for arm64 architecture, including language\-specific information for Java, Go, \.NET, and Python, see the [Getting started with AWS Graviton](https://github.com/aws/aws-graviton-getting-started) GitHub repository\. + +## Configuring the instruction set architecture + +You can configure the instruction set architecture for new Lambda functions using the Lambda console, AWS SDKs, AWS Command Line Interface \(AWS CLI\), or AWS CloudFormation\. You can deploy the function code to Lambda with either a \.zip archive file or a container image deployment package\. + +Lambda provides the following runtimes for the arm64 architecture\. These runtimes all use the Amazon Linux 2 operating system\. ++ Node\.js 12, Node\.js 14 ++ Python 3\.8, Python 3\.9 ++ Java 8 \(AL2\), Java 11 ++ \.NET Core 3\.1 ++ Ruby 2\.7 ++ Custom Runtime on Amazon Linux 2 + +Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 instruction set architecture\. You can use the custom runtime \(provided\.al2\) to run Go functions with arm64 architecture\. + +For an example of how to create a function with arm64 architecture, see [ AWS Lambda Functions Powered by AWS Graviton2 Processor](http://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)\. \ No newline at end of file diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index 4a90a65a..a79655f9 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -8,7 +8,7 @@ Function states do not change the behavior of function invocations or how your f + `Failed` – Indicates that resource configuration or provisioning encountered an error\. + `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -Check a function's state before invocation to verify that it is active\. You can do this using the Lambda API action [GetFunctionConfiguration](API_GetFunctionConfiguration.md), or by configuring a waiter with the [AWS SDK for Java API Reference](https://docs.aws.amazon.com/sdk-for-java/latest/reference/AWSLambdaWaiters.html)\. +Check a function's state before invocation to verify that it is active\. You can do this using the Lambda API action [GetFunctionConfiguration](API_GetFunctionConfiguration.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. To view the function's state with the AWS CLI, use `get-function-configuration`\. diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 73a69950..f910270b 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -1,12 +1,13 @@ # Lambda concepts -Lambda runs instances of your function to process events\. To send events to your function, you can invoke it using the Lambda API, or you can configure an AWS service or resource to invoke it\. +Lambda runs instances of your function to process events\. You can invoke your function directly using the Lambda API, or you can configure an AWS service or resource to invoke your function\. **Topics** + [Function](#gettingstarted-concepts-function) + [Trigger](#gettingstarted-concepts-trigger) + [Event](#gettingstarted-concepts-event) + [Execution environment](#gettingstarted-concepts-ee) ++ [Instruction set architecture](#gettingstarted-concepts-arch) + [Deployment package](#gettingstarted-concepts-dp) + [Runtime](#gettingstarted-concepts-runtime) + [Layer](#gettingstarted-concepts-layer) @@ -64,6 +65,14 @@ An *execution environment* provides a secure and isolated runtime environment fo For more information, see [AWS Lambda execution environment](runtimes-context.md)\. +## Instruction set architecture + + The *instruction set architecture* determines the type of computer processor that Lambda uses to run the function\. Lambda provides a choice of instruction set architectures: ++ arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. ++ x86\_64 – 64\-bit x86 architecture, for x86\-based processors\. + +For more information, see [Lambda instruction set architectures](foundation-arch.md)\. + ## Deployment package You deploy your Lambda function code using a *deployment package*\. Lambda supports two types of deployment packages: diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 68d60802..f19a906e 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -25,7 +25,7 @@ The Lambda documentation, log messages, and console use the abbreviation MB \(ra | Resource | Quota | | --- | --- | | Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | -| Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | +| Function [ timeout](https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/timeout.html) | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | five layers | diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index f48a2107..73502536 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -45,13 +45,43 @@ The following steps demonstrate how to upload a \.zip file as your deployment pa ### Using the AWS CLI You can upload a \.zip file as your deployment package using the AWS Command Line Interface \(AWS CLI\)\. For language\-specific instructions, see the following topics\. -+ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) -+ [Deploy Python Lambda functions with \.zip file archives](python-package.md) -+ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -+ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) -+ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + +------ +#### [ C\# ] + + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ ### Using Amazon S3 diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 39b72669..d1cb58d3 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -4,9 +4,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index 5f18cfbc..b3d6032e 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -71,19 +71,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/images-create.md b/doc_source/images-create.md index d2337734..98a267a9 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -47,6 +47,8 @@ To deploy a container image to Lambda, note the following requirements: 1. Lambda supports only Linux\-based container images\. +1. Lambda provides multi\-architecture base images\. However, the image you build for your function must target only one of the architectures\. Lambda does not support functions that use multi\-architecture container images\. + ## Container image settings Lambda supports the following container image settings in the Dockerfile: @@ -67,7 +69,13 @@ When you specify ENTRYPOINT or CMD in the Dockerfile or as an override, make sur ## Create an image from an AWS base image for Lambda -To build a container image for a new Lambda function, you can start with an AWS base image for Lambda\. +To build a container image for a new Lambda function, you can start with an AWS base image for Lambda\. Lambda provides two types of base images: ++ Multi\-architecture base image + + Specify one of the main image tags \(such as `python:3.9` or `java:11`\) to choose this type of image\. ++ Architecture\-specific base image + + Specify an image tag with an architecture suffix\. For example, specify `3.9-arm64` to choose the arm64 base image for Python 3\.9\. **Note** AWS periodically provides updates to the AWS base images for Lambda\. If your Dockerfile includes the image name in the FROM property, your Docker client pulls the latest version of the image from Docker Hub\. To use the updated base image, you must rebuild your container image and [update the function code](configuration-images.md#configuration-images-update)\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 4ce6881d..3cf4ccd3 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -2,7 +2,7 @@ The AWS Lambda Runtime Interface Emulator \(RIE\) is a proxy for the Lambda Runtime API that allows you to locally test your Lambda function packaged as a container image\. The emulator is a lightweight web server that converts HTTP requests into JSON events to pass to the Lambda function in the container image\. -The AWS base images for Lambda include the RIE component\. If you use an alternate base image, you can test your image without adding RIE to the image\. You can also build the RIE component into your base image\. AWS provides an open\-sourced RIE component on the AWS GitHub repository\. +The AWS base images for Lambda include the RIE component\. If you use an alternate base image, you can test your image without adding RIE to the image\. You can also build the RIE component into your base image\. AWS provides an open\-sourced RIE component on the AWS GitHub repository\. Note that there are separate RIE components for the x86\-64 architecture and the arm64 architecture\. You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your Lambda function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, you can use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. @@ -19,7 +19,7 @@ For examples of how to use the RIE, see [Container image support for Lambda](htt Note the following guidelines when using the Runtime Interface Emulator: + The RIE does not emulate Lambda’s security and authentication configurations, or Lambda orchestration\. -+ The emulator supports only Linux x86\-64 architectures\. ++ Lambda provides an emulator for each of the instruction set architectures\. + The emulator does not support AWS X\-Ray tracing or other Lambda integrations\. ## Environment variables @@ -41,7 +41,7 @@ The emulator does not populate the following Lambda environment variables\. Howe ## Test an image with RIE included in the image -The AWS base images for Lambda include the runtime interface emulator\. You can also follow these steps if you built the RIE into your alternative base image\. +The AWS base images for Lambda include the runtime interface emulator\. You can also follow these steps after you build the RIE into your alternative base image\. **To test your Lambda function with the emulator** @@ -69,7 +69,7 @@ The AWS base images for Lambda include the runtime interface emulator\. You can ## Build RIE into your base image -You can build RIE into a base image\. Download the RIE from GitHub to your local machine and update your Dockerfile to install RIE\. +You can build RIE into a base image\. The following steps show how to download the RIE from GitHub to your local machine and update your Dockerfile to install RIE\. **To build the emulator into your image** @@ -99,13 +99,25 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local fi ``` -1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. +1. Download the runtime interface emulator for your target architecture from GitHub into your project directory\. Lambda provides an emulator for each of the instruction set architectures\. + + x86\_64 – Download [aws\-lambda\-rie](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/aws-lambda-rie) + + arm64 – Download [aws\-lambda\-rie\-arm64](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/aws-lambda-rie-arm64) -1. Copy the script, install the emulator package, and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: +1. Copy the script, install the emulator package, and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile\. + + To use the default x86\-64 architecture: ``` COPY ./entry_script.sh /entry_script.sh - ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie + ADD aws-lambda-rie-x86_64 /usr/local/bin/aws-lambda-rie + ENTRYPOINT [ "/entry_script.sh" ] + ``` + + To use the arm64 architecture: + + ``` + COPY ./entry_script.sh /entry_script.sh + ADD aws-lambda-rie-arm64 /usr/local/bin/aws-lambda-rie ENTRYPOINT [ "/entry_script.sh" ] ``` @@ -121,7 +133,7 @@ You install the runtime interface emulator to your local machine\. When you run **To test an image without adding RIE to the image** -1. From your project directory, run the following command to download the RIE from GitHub and install it on your local machine\. +1. From your project directory, run the following command to download the RIE \(x86\-64 architecture\) from GitHub and install it on your local machine\. ``` mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ @@ -129,6 +141,12 @@ You install the runtime interface emulator to your local machine\. When you run && chmod +x ~/.aws-lambda-rie/aws-lambda-rie ``` + To download the RIE for arm64 architecture, use the previous command with a different GitHub download url\. + + ``` + https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64 \ + ``` + 1. Run your Lambda function using the `docker run` command\. ``` diff --git a/doc_source/index.md b/doc_source/index.md index 69d4573c..b74e136a 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -23,11 +23,11 @@ Amazon's trademarks and trade dress may not be used in + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) + + [Lambda instruction set architectures](foundation-arch.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + [Lambda console](foundation-console.md) + [Using Lambda with the AWS CLI](gettingstarted-awscli.md) - + [Lambda quotas](gettingstarted-limits.md) + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource-based policies for AWS Lambda](access-control-resource-based.md) @@ -60,15 +60,6 @@ Amazon's trademarks and trade dress may not be used in + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) - + [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) - + [Tutorial: Using AWS Lambda with the Mobile SDK for Android](with-android-example.md) - + [Sample function code](with-android-create-package.md) -+ [AWS Lambda applications](deploying-lambda-apps.md) - + [Managing applications in the AWS Lambda console](applications-console.md) - + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) - + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) - + [Common Lambda application types and use cases](applications-usecases.md) - + [Best practices for working with AWS Lambda functions](best-practices.md) + [Lambda runtimes](lambda-runtimes.md) + [Runtime support policy](runtime-support-policy.md) + [AWS Lambda execution environment](runtimes-context.md) @@ -83,75 +74,6 @@ Amazon's trademarks and trade dress may not be used in + [Using container images with Lambda](lambda-images.md) + [Creating Lambda container images](images-create.md) + [Testing Lambda container images locally](images-test.md) -+ [Using AWS Lambda with other services](lambda-services.md) - + [Using AWS Lambda with Alexa](services-alexa.md) - + [Using AWS Lambda with Amazon API Gateway](services-apigateway.md) - + [Tutorial: Using AWS Lambda with Amazon API Gateway](services-apigateway-tutorial.md) - + [Sample function code](services-apigateway-code.md) - + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) - + [AWS SAM template for an API Gateway application](services-apigateway-template.md) - + [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md) - + [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) - + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) - + [Sample function code](with-cloudtrail-create-package.md) - + [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md) - + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) - + [AWS SAM template for a CloudWatch Events application](with-scheduledevents-example-use-app-spec.md) - + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) - + [Using Lambda with CloudWatch Logs](services-cloudwatchlogs.md) - + [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md) - + [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md) - + [Using AWS Lambda with AWS CodeCommit](services-codecommit.md) - + [Using AWS Lambda with AWS CodePipeline](services-codepipeline.md) - + [Using AWS Lambda with Amazon Cognito](services-cognito.md) - + [Using AWS Lambda with AWS Config](services-config.md) - + [Using Lambda with Amazon Connect](services-connect.md) - + [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) - + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) - + [Sample function code](with-ddb-create-package.md) - + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) - + [Using AWS Lambda with Amazon EC2](services-ec2.md) - + [Tutorial: Using AWS SDK for .NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md) - + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) - + [Using AWS Lambda with an Application Load Balancer](services-alb.md) - + [Using Amazon EFS with Lambda](services-efs.md) - + [Using AWS Lambda with AWS IoT](services-iot.md) - + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) - + [Using Lambda with self-managed Apache Kafka](with-kafka.md) - + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) - + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) - + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) - + [Sample function code](with-kinesis-create-package.md) - + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) - + [Using AWS Lambda with Amazon Lex](services-lex.md) - + [Using Lambda with Amazon MQ](with-mq.md) - + [Using Lambda with Amazon MSK](with-msk.md) - + [Using AWS Lambda with Amazon RDS](services-rds.md) - + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) - + [Using AWS Lambda with Amazon S3](with-s3.md) - + [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) - + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) - + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) - + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) - + [Transforming S3 Objects with S3 Object Lambda](services-s3-object-lambda.md) - + [Using AWS Lambda with Secrets Manager](with-secrets-manager.md) - + [Using AWS Lambda with Amazon SES](services-ses.md) - + [Using Lambda with Amazon SNS](with-sns.md) - + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) - + [Sample function code](with-sns-create-package.md) - + [Using AWS Lambda with Amazon SQS](with-sqs.md) - + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) - + [Sample Amazon SQS function code](with-sqs-create-package.md) - + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) - + [Using AWS Lambda with AWS X-Ray](services-xray.md) -+ [Orchestrating functions with Step Functions](lambda-stepfunctions.md) - + [State machine application patterns](stepfunctions-patterns.md) - + [Managing state machines in the Lambda console](stepfunctions-lc.md) - + [Orchestration examples with Step Functions](services-stepfunctions.md) -+ [Lambda sample applications](lambda-samples.md) - + [Blank function sample application for AWS Lambda](samples-blank.md) - + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) - + [List manager sample application for AWS Lambda](samples-listmanager.md) + [Building Lambda functions with Node.js](lambda-nodejs.md) + [AWS Lambda function handler in Node.js](nodejs-handler.md) + [Deploy Node.js Lambda functions with .zip file archives](nodejs-package.md) @@ -212,6 +134,69 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda context object in PowerShell](powershell-context.md) + [AWS Lambda function logging in PowerShell](powershell-logging.md) + [AWS Lambda function errors in PowerShell](powershell-exceptions.md) ++ [Using AWS Lambda with other services](lambda-services.md) + + [Common Lambda application types and use cases](applications-usecases.md) + + [Using AWS Lambda with Alexa](services-alexa.md) + + [Using AWS Lambda with Amazon API Gateway](services-apigateway.md) + + [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) + + [Sample function code](services-apigateway-code.md) + + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) + + [AWS SAM template for an API Gateway application](services-apigateway-template.md) + + [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md) + + [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) + + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + + [Sample function code](with-cloudtrail-create-package.md) + + [Using AWS Lambda with Amazon EventBridge (CloudWatch Events)](services-cloudwatchevents.md) + + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) + + [AWS SAM template for a EventBridge (CloudWatch Events) application](with-scheduledevents-example-use-app-spec.md) + + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) + + [Using Lambda with CloudWatch Logs](services-cloudwatchlogs.md) + + [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md) + + [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md) + + [Using AWS Lambda with AWS CodeCommit](services-codecommit.md) + + [Using AWS Lambda with AWS CodePipeline](services-codepipeline.md) + + [Using AWS Lambda with Amazon Cognito](services-cognito.md) + + [Using AWS Lambda with AWS Config](services-config.md) + + [Using Lambda with Amazon Connect](services-connect.md) + + [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) + + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) + + [Sample function code](with-ddb-create-package.md) + + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) + + [Using AWS Lambda with Amazon EC2](services-ec2.md) + + [Tutorial: Using AWS SDK for .NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md) + + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) + + [Using AWS Lambda with an Application Load Balancer](services-alb.md) + + [Using Amazon EFS with Lambda](services-efs.md) + + [Using AWS Lambda with AWS IoT](services-iot.md) + + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) + + [Using Lambda with self-managed Apache Kafka](with-kafka.md) + + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) + + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) + + [Sample function code](with-kinesis-create-package.md) + + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) + + [Using AWS Lambda with Amazon Lex](services-lex.md) + + [Using Lambda with Amazon MQ](with-mq.md) + + [Using Lambda with Amazon MSK](with-msk.md) + + [Using AWS Lambda with Amazon RDS](services-rds.md) + + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + + [Using AWS Lambda with Amazon S3](with-s3.md) + + [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) + + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + + [Transforming S3 Objects with S3 Object Lambda](services-s3-object-lambda.md) + + [Using AWS Lambda with Secrets Manager](with-secrets-manager.md) + + [Using AWS Lambda with Amazon SES](services-ses.md) + + [Using AWS Lambda with Amazon SNS](with-sns.md) + + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) + + [Sample function code](with-sns-create-package.md) + + [Using AWS Lambda with Amazon SQS](with-sqs.md) + + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + + [Tutorial: Using a cross-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) + + [Sample Amazon SQS function code](with-sqs-create-package.md) + + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + + [Using AWS Lambda with AWS X-Ray](services-xray.md) + [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md) + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) @@ -235,6 +220,23 @@ Amazon's trademarks and trade dress may not be used in + [Troubleshoot execution issues in Lambda](troubleshooting-execution.md) + [Troubleshoot networking issues in Lambda](troubleshooting-networking.md) + [Troubleshoot container image issues in Lambda](troubleshooting-images.md) ++ [AWS Lambda applications](deploying-lambda-apps.md) + + [Managing applications in the AWS Lambda console](applications-console.md) + + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) + + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) + + [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) + + [Tutorial: Using AWS Lambda with the Mobile SDK for Android](with-android-example.md) + + [Sample function code](with-android-create-package.md) ++ [Orchestrating functions with Step Functions](lambda-stepfunctions.md) + + [State machine application patterns](stepfunctions-patterns.md) + + [Managing state machines in the Lambda console](stepfunctions-lc.md) + + [Orchestration examples with Step Functions](services-stepfunctions.md) ++ [Best practices for working with AWS Lambda functions](best-practices.md) ++ [Lambda quotas](gettingstarted-limits.md) ++ [Lambda sample applications](lambda-samples.md) + + [Blank function sample application for AWS Lambda](samples-blank.md) + + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) + + [List manager sample application for AWS Lambda](samples-listmanager.md) + [AWS Lambda releases](lambda-releases.md) + [API reference](API_Reference.md) + [Actions](API_Operations.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index 792b6e0a..abac18f4 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -208,10 +208,10 @@ As an alternative to an [on\-failure destination](#invocation-async-destinations To reprocess events in a dead\-letter queue, you can set it as an event source for your Lambda function\. Alternatively, you can manually retrieve the events\. You can choose an Amazon SQS queue or Amazon SNS topic for your dead\-letter queue\. If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. -+ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md) and invoke a function\. ++ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. Create a queue in the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. -+ [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using Lambda with Amazon SNS](with-sqs.md)\. ++ [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. Create a topic in the [Amazon SNS console](https://console.aws.amazon.com/sns/home)\. diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 9065b832..d6bddbb5 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -13,11 +13,11 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md index 1ae816c4..e8f2e3ac 100644 --- a/doc_source/invocation-images.md +++ b/doc_source/invocation-images.md @@ -25,4 +25,4 @@ Lambda then runs the function by calling the code entry point specified in the f ## Image security -When Lambda first downloads the container image from its original source \(Amazon ECR\), the container image is optimized, encrypted, and stored using authenticated convergent encryption methods\. All keys that are required to decrypt customer data are protected using customer managed AWS Key Management Service \(AWS KMS\) customer master keys \(CMKs\)\. To track and audit Lambda's usage of CMKs, you can view the [AWS CloudTrail logs](logging-using-cloudtrail.md)\. \ No newline at end of file +When Lambda first downloads the container image from its original source \(Amazon ECR\), the container image is optimized, encrypted, and stored using authenticated convergent encryption methods\. All keys that are required to decrypt customer data are protected using AWS KMS customer managed keys\. To track and audit Lambda's usage of customer managed keys, you can view the [AWS CloudTrail logs](logging-using-cloudtrail.md)\. \ No newline at end of file diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md index 98619e6c..ec2ca6c8 100644 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -19,6 +19,31 @@ A Lambda function can use up to five layers at a time\. The total unzipped size If your functions consume a layer that a different AWS account publishes, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function that uses a deleted layer version\. +**Note** +Make sure that the layers that you add to a function are compatible with the runtime and instruction set architecture of the function\. + +Console + +**Configuring a function to use layers \(Console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Under **Layers**, choose **Add a layer** + +1. Under **Add layer**, choose a layer source\. + +1. For the **AWS layers** or **Custom layers** layer source: + + 1. Choose a layer from the pull\-down menu\. + + 1. Choose a layer version from the pull\-down menu\. Each layer version entry lists its compatible runtimes and architectures\. + +1. For the **Specify an ARN** layer source:: + + 1. Enter an ARN in the text box + +API + To add layers to your function, use the update\-function\-configuration command\. The following example adds two layers: one from the same AWS account as the function, and one from a different account\. ``` diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md index 009e8b5f..28d91bcf 100644 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -2,6 +2,8 @@ The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event\. When the function returns a response, it stays active and waits to process additional events\. If you invoke the function again while the first event is being processed, Lambda initializes another instance, and the function processes the two events concurrently\. As more events come in, Lambda routes them to available instances and creates new instances as needed\. When the number of requests decreases, Lambda stops unused instances to free up scaling capacity for other functions\. +The default regional concurrency limit starts at 1,000\. For more information, or to request an increase on this limit, see [Lambda quotas](gettingstarted-limits.md)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. + Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. Note that the burst concurrency quota is not per\-function; it applies to all of your functions in the Region\. **Burst concurrency quotas** @@ -22,8 +24,6 @@ The following example shows a function processing a spike in traffic\. As invoca The function continues to scale until the account's concurrency limit for the function's Region is reached\. The function catches up to demand, requests subside, and unused instances of the function are stopped after being idle for some time\. Unused instances are frozen while they're waiting for requests and don't incur any charges\. -The regional concurrency limit starts at 1,000\. You can increase the limit by submitting a request in the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency creates a pool that can only be used by its function, and also prevents its function from using unreserved concurrency\. - When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](foundation-progmodel.md) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](configuration-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 1948d663..0c6a36c8 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -133,19 +133,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/java-image.md b/doc_source/java-image.md index a8a43259..9e9810fa 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -4,9 +4,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index 82c2db32..3bbe3c5b 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -21,10 +21,10 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ **\.NET runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | **Note** For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md index 6a5146eb..0b30cb7a 100644 --- a/doc_source/lambda-foundation.md +++ b/doc_source/lambda-foundation.md @@ -6,8 +6,8 @@ The Lambda function is the foundational principle of Lambda\. You can configure + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) ++ [Lambda instruction set architectures](foundation-arch.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + [Lambda console](foundation-console.md) -+ [Using Lambda with the AWS CLI](gettingstarted-awscli.md) -+ [Lambda quotas](gettingstarted-limits.md) \ No newline at end of file ++ [Using Lambda with the AWS CLI](gettingstarted-awscli.md) \ No newline at end of file diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 2c1d4d68..02878bd5 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -1,6 +1,6 @@ # Configuring AWS Lambda functions -You can use the AWS Lambda API or console to create functions and configure function settings\. The workflow to create a function is different for a function deployed as a [container image](configuration-images.md) and for a function deployed as a [\.zip file archive](configuration-function-zip.md)\. +You can use the AWS Lambda API or console to create functions and configure function settings\. When you create the function, you chose the type of deployment package for the function\. The deployment package type cannot be changed later\. The workflow to create a function is different for a function deployed as a [container image](configuration-images.md) and for a function deployed as a [\.zip file archive](configuration-function-zip.md)\. After you create the function, you can configure settings for many [function capabilities and options ](configuration-function-common.md) such as permissions, environment variables, tags, and layers\. diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 7d80d110..a23df8db 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -5,9 +5,9 @@ The following sections explain how common programming patterns and core concepts **Go runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| Go 1\.x | `go1.x` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | Lambda provides the following tools and libraries for the Go runtime: diff --git a/doc_source/lambda-images.md b/doc_source/lambda-images.md index 186814f5..47a5c9d1 100644 --- a/doc_source/lambda-images.md +++ b/doc_source/lambda-images.md @@ -6,6 +6,10 @@ AWS provides a set of open\-source base images that you can use to build the con Additionally, AWS provides a runtime interface emulator for you to test your functions locally using tools such as the Docker CLI\. +**Note** +You create each container image to be compatible with one of the instruction set architectures that Lambda supports\. Lambda provides base images for each of the instruction set architectures and Lambda also provides base images that support both architectures\. +The image that you build for your function must target only one of the architectures\. + There is no additional charge for packaging and deploying functions as container images\. When a function deployed as a container image is invoked, you pay for invocation requests and execution duration\. You do incur charges related to storing your container images in Amazon ECR\. For more information, see [Amazon ECR pricing](http://aws.amazon.com/ecr/pricing/)\. **Topics** diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index f74d5090..9ec12a32 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -8,7 +8,7 @@ To use your function to process data automatically, add one or more triggers\. A To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon SQS queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. -Other AWS services and resources invoke your function directly\. For example, you can configure CloudWatch Events to invoke your function on a timer, or you can configure Amazon S3 to invoke your function when an object is created\. Each service varies in the method it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. +Other AWS services and resources invoke your function directly\. For example, you can configure EventBridge \(CloudWatch Events\) to invoke your function on a timer, or you can configure Amazon S3 to invoke your function when an object is created\. Each service varies in the method it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. @@ -19,5 +19,4 @@ Depending on who invokes your function and how it's invoked, scaling behavior an + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) -+ [Invoking functions defined as container images](invocation-images.md) -+ [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) \ No newline at end of file ++ [Invoking functions defined as container images](invocation-images.md) \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index c5f091d0..a663fb65 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -7,11 +7,11 @@ Lambda supports the following Java runtimes\. **Java runtimes** -| Name | Identifier | JDK | Operating system | -| --- | --- | --- | --- | -| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | -| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | -| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | +| Name | Identifier | JDK | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | +| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | +| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | x86\_64 | Lambda provides the following libraries for Java functions: + [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 5d0a13db..930c21b6 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -7,11 +7,11 @@ Lambda supports the following Node\.js runtimes\. **Node\.js runtimes** -| Name | Identifier | SDK for JavaScript | Operating system | -| --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | +| Name | Identifier | SDK for JavaScript | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md index 0645f6d8..9ac3d29e 100644 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -5,10 +5,10 @@ The following sections explain how common programming patterns and core concepts **\.NET runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | Lambda provides the following sample applications for the PowerShell runtime: + [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 04feb72f..34dfa0c5 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -10,13 +10,13 @@ End of support for the Python 2\.7 runtime started on July 15, 2021\. For more i **Python runtimes** -| Name | Identifier | AWS SDK for Python | Operating system | -| --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Name | Identifier | AWS SDK for Python | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | **To create a Python function** diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 02d80f28..7e9f089a 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Lambda on Graviton2](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss) | Lambda now supports Graviton2 for functions using arm64 architecture\. For details, see [Lambda instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss)\. | September 29, 2021 | | [Python 3\.9 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Python 3\.9\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 16, 2021 | | [New runtime versions for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtime versions are available for Node\.js, Python, and Java\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | July 21, 2021 | | [Support for RabbitMQ as an event source on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ for RabbitMQ as an event source\. Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | July 7, 2021 | @@ -28,7 +29,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | | [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | | [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](http://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | -| [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | +| [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | | [Provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss) | You can now allocate provisioned concurrency for a function version or alias\. Provisioned concurrency enables a function to scale without fluctuations in latency\. For details, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Create a database proxy](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss) | You can now use the Lambda console to create a database proxy for a Lambda function\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. For details, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Percentiles support for the duration metric](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | You can now filter the duration metric based on percentiles\. For details, see [AWS Lambda metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | November 26, 2019 | @@ -97,7 +98,7 @@ The following table describes the important changes in each release of the *AWS | Europe \(Frankfurt\) region | Lambda is now available in the Europe \(Frankfurt\) region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | March 14, 2016 | | VPC support | You can now configure a Lambda function to access resources in your VPC\. For more information, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. | February 11, 2016 | | Lambda runtime has been updated\. | The [execution environment](lambda-runtimes.md) has been updated\. | November 4, 2015 | -| Versioning support, Python for developing code for Lambdafunctions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up Lambda to invoke your code on a regular, scheduled basis using the Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | +| Versioning support, Python for developing code for Lambdafunctions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up Lambda to invoke your code on a regular, scheduled basis using the Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | | Support for DynamoDB Streams | DynamoDB Streams is now generally available and you can use it in all the regions where DynamoDB is available\. You can enable DynamoDB Streams for your table and use a Lambda function as a trigger for the table\. Triggers are custom actions you take in response to updates made to the DynamoDB table\. For an example walkthrough, see [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) \. | July 14, 2015 | | Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | | The Lambda console now provides blueprints to easily create Lambda functions and test them\. | Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with Lambda](getting-started.md)\. | July 09, 2015 | diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index b9d679da..d03e8d90 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -7,10 +7,10 @@ Lambda supports the following Ruby runtimes\. **Ruby runtimes** -| Name | Identifier | SDK for Ruby | Operating system | -| --- | --- | --- | --- | -| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | -| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | +| Name | Identifier | SDK for Ruby | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | x86\_64, arm64 | +| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | x86\_64 | **Note** For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 405bbf3f..37de18f6 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -19,11 +19,11 @@ A runtime can support a single version of a language, multiple versions of a lan **Node\.js runtimes** -| Name | Identifier | SDK for JavaScript | Operating system | -| --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | +| Name | Identifier | SDK for JavaScript | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. @@ -31,13 +31,13 @@ For end of support information about Node\.js 10, see [Runtime support policy](r **Python runtimes** -| Name | Identifier | AWS SDK for Python | Operating system | -| --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Name | Identifier | AWS SDK for Python | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. @@ -45,10 +45,10 @@ Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) **Ruby runtimes** -| Name | Identifier | SDK for Ruby | Operating system | -| --- | --- | --- | --- | -| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | -| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | +| Name | Identifier | SDK for Ruby | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | x86\_64, arm64 | +| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | x86\_64 | **Note** For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. @@ -56,26 +56,26 @@ For end of support information about Ruby 2\.5, see [Runtime support policy](run **Java runtimes** -| Name | Identifier | JDK | Operating system | -| --- | --- | --- | --- | -| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | -| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | -| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | +| Name | Identifier | JDK | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | +| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | +| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | x86\_64 | **Go runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| Go 1\.x | `go1.x` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | **\.NET runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | **Note** For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. @@ -85,10 +85,10 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- **Custom runtime** -| Name | Identifier | Operating system | -| --- | --- | --- | -| Custom Runtime | `provided.al2` | Amazon Linux 2 | -| Custom Runtime | `provided` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| Custom Runtime | `provided.al2` | Amazon Linux 2 | x86\_64, arm64 | +| Custom Runtime | `provided` | Amazon Linux | x86\_64 | **Topics** + [Runtime support policy](runtime-support-policy.md) diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index b30be145..d9fe0023 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -1,96 +1,75 @@ # Using AWS Lambda with other services -AWS Lambda integrates with other AWS services to invoke functions\. You can configure triggers to invoke a function in response to resource lifecycle events, respond to incoming HTTP requests, consume events from a queue, or [run on a schedule](services-cloudwatchevents.md)\. - -Each service that integrates with Lambda sends data to your function in JSON as an event\. The structure of the event document is different for each event type, and contains data about the resource or request that triggered the function\. Lambda runtimes convert the event into an object and pass it to your function\. - -The following example shows a test event from an [Application Load Balancer](services-alb.md) that represents a GET request to `/lambda?query=1234ABCD`\. - -**Example event from an Application Load Balancer** - -``` -{ - "requestContext": { - "elb": { - "targetGroupArn": "arn:aws:elasticloadbalancing:us-east-2:123456789012:targetgroup/lambda-279XGJDqGZ5rsrHC2Fjr/49e9d65c45c6791a" - } - }, - "httpMethod": "GET", - "path": "/lambda", - "queryStringParameters": { - "query": "1234ABCD" - }, - "headers": { - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", - "accept-encoding": "gzip", - "accept-language": "en-US,en;q=0.9", - "connection": "keep-alive", - "host": "lambda-alb-123578498.us-east-2.elb.amazonaws.com", - "upgrade-insecure-requests": "1", - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36", - "x-amzn-trace-id": "Root=1-5c536348-3d683b8b04734faae651f476", - "x-forwarded-for": "72.12.164.125", - "x-forwarded-port": "80", - "x-forwarded-proto": "http", - "x-imforwards": "20" - }, - "body": "", - "isBase64Encoded": false -} -``` - -**Note** -The Lambda runtime converts the event document into an object and passes it to your [function handler](gettingstarted-concepts.md)\. For compiled languages, Lambda provides definitions for event types in a library\. See the following topics for more information\. -[Building Lambda functions with Java](lambda-java.md) -[Building Lambda functions with Go](lambda-golang.md) -[Building Lambda functions with C\#](lambda-csharp.md) -[Building Lambda functions with PowerShell](lambda-powershell.md) - -For services that generate a queue or data stream, you create an [event source mapping](invocation-eventsourcemapping.md) in Lambda and grant Lambda permission to access the other service in the [execution role](lambda-intro-execution-role.md)\. Lambda reads data from the other service, creates an event, and invokes your function\. - -**Services that Lambda reads events from** -+ [Amazon DynamoDB](with-ddb.md) -+ [Amazon Kinesis](with-kinesis.md) -+ [Amazon MQ](with-mq.md) -+ [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md) -+ [Amazon Simple Queue Service](with-sqs.md) - -Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. - -For more information about Lambda service architectures, see [Event driven architectures](https://docs.aws.amazon.com/lambda/latest/operatorguide/event-driven-architectures.html) in the *Lambda operator guide*\. - -**Services that invoke Lambda functions synchronously** -+ [Elastic Load Balancing \(Application Load Balancer\)](services-alb.md) -+ [Amazon Cognito](services-cognito.md) -+ [Amazon connect](services-connect.md) -+ [Amazon Lex](services-lex.md) -+ [Amazon Alexa](services-alexa.md) -+ [Amazon API Gateway](services-apigateway.md) -+ [Amazon CloudFront \(Lambda@Edge\)](lambda-edge.md) -+ [Amazon Kinesis Data Firehose](services-kinesisfirehose.md) -+ [Amazon Simple Storage Service Batch](services-s3-batch.md) -+ [Secrets Manager](with-secrets-manager.md) - -For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. You can disable retries for a function by setting the function's reserved concurrency value to zero\. - -**Services that invoke Lambda functions asynchronously** -+ [Amazon Simple Storage Service](with-s3.md) -+ [Amazon Simple Notification Service](with-sns.md) -+ [Amazon Simple Email Service](services-ses.md) -+ [AWS CloudFormation](services-cloudformation.md) -+ [Amazon CloudWatch Logs](services-cloudwatchlogs.md) -+ [Amazon CloudWatch Events](services-cloudwatchevents.md) -+ [AWS CodeCommit](services-codecommit.md) -+ [AWS Config](services-config.md) -+ [AWS IoT](services-iot.md) -+ [AWS IoT Events](services-iotevents.md) -+ [AWS CodePipeline](services-codepipeline.md) - -Additionally, some services integrate with Lambda in other ways that don't involve invoking functions\. - -**Services that integrate with Lambda in other ways** -+ [Amazon Elastic File System](services-efs.md) -+ [AWS X\-Ray](services-xray.md) - -See the topics in this chapter for more details about each service, and example events that you can use to test your function\. \ No newline at end of file +AWS Lambda integrates with other AWS services to invoke functions or take other actions\. These are some common use cases: ++ Invoke a function in response to resource lifecycle events, such as with Amazon Simple Storage Service \(Amazon S3\)\. For more information, see [Using AWS Lambda with Amazon S3](with-s3.md)\. ++ Respond to incoming HTTP requests\. For more information, see [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md)\. ++ Consume events from a queue\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ++ Run a function on a schedule\. For more information, see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. + +Depending on which service you're using with Lambda, the invocation generally works in one of two ways\. An event drives the invocation or Lambda polls a queue or data stream and invokes the function in response to activity in the queue or data stream\. Lambda integrates with Amazon Elastic File System and AWS X\-Ray in a way that doesn't involve invoking functions\. + +For more information, see [Event\-driven invocation](#event-driven-invocation) and [Lambda polling](#lambda-polling)\. Or, look up the service that you want to work with in the following section to find a link to information about using that service with Lambda\. + +## Listing of services and links to more information + +Find the service that you want to work with in the following table, to determine which method of invocation you should use\. Follow the link from the service name to find information about how to set up the integration between the services\. These topics also include example events that you can use to test your function\. + +**Tip** +Entries in this table are alphabetical by service name, excluding the "Amazon" or "AWS" prefix\. You can also use your browser's search functionality to find your service in the list\. + + +**** + +| Service | Method of invocation | +| --- | --- | +| [Amazon Alexa](services-alexa.md) | Event\-driven; synchronous invocation | +| [Amazon Managed Streaming for Apache Kafka](with-msk.md) | Lambda polling | +| [Self\-managed Apache Kafka](with-kafka.md) | Lambda polling | +| [Amazon API Gateway](services-apigateway.md) | Event\-driven; synchronous invocation | +| [AWS CloudFormation](services-cloudformation.md) | Event\-driven; asynchronous invocation | +| [Amazon CloudFront \(Lambda@Edge\)](lambda-edge.md) | Event\-driven; synchronous invocation | +| [Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md) | Event\-driven; asynchronous invocation | +| [Amazon CloudWatch Logs](services-cloudwatchlogs.md) | Event\-driven; asynchronous invocation | +| [AWS CodeCommit](services-codecommit.md) | Event\-driven; asynchronous invocation | +| [AWS CodePipeline](services-codepipeline.md) | Event\-driven; asynchronous invocation | +| [Amazon Cognito](services-cognito.md) | Event\-driven; synchronous invocation | +| [AWS Config](services-config.md) | Event\-driven; asynchronous invocation | +| [Amazon Connect](services-connect.md) | Event\-driven; synchronous invocation | +| [Amazon DynamoDB](with-ddb.md) | Lambda polling | +| [Amazon Elastic File System](services-efs.md) | Special integration | +| [Elastic Load Balancing \(Application Load Balancer\)](services-alb.md) | Event\-driven; synchronous invocation | +| [AWS IoT](services-iot.md) | Event\-driven; asynchronous invocation | +| [AWS IoT Events](services-iotevents.md) | Event\-driven; asynchronous invocation | +| [Amazon Kinesis](with-kinesis.md) | Lambda polling | +| [Amazon Kinesis Data Firehose](services-kinesisfirehose.md) | Event\-driven; synchronous invocation | +| [Amazon Lex](services-lex.md) | Event\-driven; synchronous invocation | +| [Amazon MQ](with-mq.md) | Lambda polling | +| [Amazon Simple Email Service](services-ses.md) | Event\-driven; asynchronous invocation | +| [Amazon Simple Notification Service](with-sns.md) | Event\-driven; asynchronous invocation | +| [Amazon Simple Queue Service \(Amazon S3\)](with-sqs.md) | Lambda polling | +| [Amazon Simple Storage Service](with-s3.md) | Event\-driven; asynchronous invocation | +| [Amazon Simple Storage Service Batch](services-s3-batch.md) | Event\-driven; synchronous invocation | +| [Secrets Manager](with-secrets-manager.md) | Event\-driven; synchronous invocation | +| [AWS X\-Ray](services-xray.md) | Special integration | + +## Event\-driven invocation + +Some services generate events that can invoke your Lambda function\. For more information about designing these types of architectures , see [Event driven architectures](https://docs.aws.amazon.com/lambda/latest/operatorguide/event-driven-architectures.html) in the *Lambda operator guide*\. + +When you implement an event\-driven architecture, you grant the event\-generating service permission to invoke your function in the function's [resource\-based policy](access-control-resource-based.md)\. Then you configure that service to generate events that invoke your function\. + +The events are data structured in JSON format\. The JSON structure varies depending on the service that generates it and the event type, but they all contain the data that the function needs to process the event\. + +Lambda converts the event document into an object and passes it to your [function handler](gettingstarted-concepts.md)\. For compiled languages, Lambda provides definitions for event types in a library\. For more information, see the topic about building functions with your language: [Building Lambda functions with C\#](lambda-csharp.md), [Building Lambda functions with Go](lambda-golang.md), [Building Lambda functions with Java](lambda-java.md), or [Building Lambda functions with PowerShell](lambda-powershell.md)\. + +Depending on the service, the event\-driven invocation can be synchronous or asynchronous\. ++ For synchronous invocation, the service that generates the event waits for the response from your function\. That service defines the data that the function needs to return in the response\. The service controls the error strategy, such as whether to retry on errors\. For more information, see [Synchronous invocation](invocation-sync.md)\. ++ For asynchronous invocation, Lambda queues the event before passing it to your function\. When Lambda queues the event, it immediately sends a success response to the service that generated the event\. After the function processes the event, Lambda doesn’t return a response to the event\-generating service\. For more information, see [Asynchronous invocation](invocation-async.md)\. + +For more information about how Lambda manages error handling for synchronously and asychronously invoked functions, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. + +## Lambda polling + +For services that generate a queue or data stream, you set up an [event source mapping](invocation-eventsourcemapping.md) in Lambda to have Lambda poll the queue or a data stream\. + +When you implement a Lambda polling architecture, you grant Lambda permission to access the other service in the function's [execution role](lambda-intro-execution-role.md)\. Lambda reads data from the other service, creates an event, and invokes your function\. \ No newline at end of file diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md index 2e8afa81..e991b198 100644 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -115,6 +115,9 @@ The `eventName` may include date and version information, such as `"GetFunction2 CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [ Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. +**Note** +CloudTrail logs only authenticated and authorized requests\. CloudTrail does not log requests that fail authentication \(credentials are missing or the provided credentials are not valid\) or requests with credentials that are not authorized to invoke the function\. + ### Using CloudTrail to troubleshoot disabled event sources One data event that can be encountered is a `LambdaESMDisabled` event\. There are five general categories of error that are associated with this event: diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md index fe2f6951..d22d8d66 100644 --- a/doc_source/monitoring-code-profiler.md +++ b/doc_source/monitoring-code-profiler.md @@ -14,6 +14,9 @@ You can activate CodeGuru Profiler from the Lambda console if your function's ru + For Java runtimes, see [ Profiling your Java applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)\. + For Python runtimes, see [ Profiling your Python applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda.html)\. +**Note** +CodeGuru Profiler supports functions that use x86\_64 architecture and arm64 architecture\.????? + ## Activating CodeGuru Profiler from the Lambda console This section describes how to activate CodeGuru Profiler from the Lambda console\. diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index 95336612..250d5255 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -23,7 +23,7 @@ The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for t ## Pricing -For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. +When you enable Lambda Insights for your Lambda function, Lambda Insights reports 8 metrics per function and every function invocation sends about 1KB of log data to CloudWatch\. You only pay for the metrics and logs reported for your function by Lambda Insights\. There are no minimum fees or mandatory service usage polices\. You do not pay for Lambda Insights if the function is not invoked\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. ## Supported runtimes diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 28a57dee..3a33a915 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -66,19 +66,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 79680e2b..b72acc36 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -4,9 +4,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index a030d52a..0ff1e4e3 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -8,6 +8,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ You need to build the deployment package to be compatible with this [instruction set architecture](foundation-arch.md) of the function\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. **Topics** diff --git a/doc_source/powershell-devenv.md b/doc_source/powershell-devenv.md index 0e4feffc..4bac0a7f 100644 --- a/doc_source/powershell-devenv.md +++ b/doc_source/powershell-devenv.md @@ -1,6 +1,6 @@ # Setting Up a PowerShell Development Environment -Lambda provides a set of tools and libraries for the PowerShell runtime\. For installation instructions, see [Lambda tools for Powershell](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) on GitHub\. +Lambda provides a set of tools and libraries for the PowerShell runtime\. For installation instructions, see [Lambda tools for PowerShell](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) on GitHub\. The AWSLambdaPSCore module includes the following cmdlets to help author and publish PowerShell Lambda functions: + **Get\-AWSPowerShellLambdaTemplate** – Returns a list of getting started templates\. diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index 02469114..09ee08eb 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -2,7 +2,7 @@ When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. -This page describes how to view Lambda function invocation errors for the Powershell runtime using the Lambda console and the AWS CLI\. +This page describes how to view Lambda function invocation errors for the PowerShell runtime using the Lambda console and the AWS CLI\. **Topics** + [Syntax](#powershell-exceptions-syntax) @@ -90,19 +90,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index 422d65cf..883eff54 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -45,19 +45,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/python-image.md b/doc_source/python-image.md index b95a618d..ea83bd21 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -7,9 +7,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: @@ -21,9 +26,9 @@ The workflow for a function defined as a container image includes these steps: **Topics** + [AWS base images for Python](#python-image-base) -+ [Python runtime interface clients](#python-image-clients) + [Create a Python image from an AWS base image](#python-image-create) + [Create a Python image from an alternative base image](#python-image-create-alt) ++ [Python runtime interface clients](#python-image-clients) + [Deploy the container image](#python-image-deploy) ## AWS base images for Python @@ -43,18 +48,6 @@ Docker Hub repository: amazon/aws\-lambda\-python Amazon ECR repository: gallery\.ecr\.aws/lambda/python -## Python runtime interface clients - -Install the runtime interface client for Python using the pip package manager: - -``` -pip install awslambdaric -``` - -For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on the Python Package Index \(PyPI\) website\. - -You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. - ## Create a Python image from an AWS base image When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. @@ -95,8 +88,22 @@ When you build a container image for Python using an AWS base image, you only ne ## Create a Python image from an alternative base image +When you use an alternative base image, you need to install the [Python runtime interface client](#python-image-clients) + For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. +## Python runtime interface clients + +Install the [runtime interface client](runtimes-images.md#runtimes-api-client) for Python using the pip package manager: + +``` +pip install awslambdaric +``` + +For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on the Python Package Index \(PyPI\) website\. + +You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. + ## Deploy the container image For a new function, you deploy the Python image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 2fc0a040..513209a5 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -11,6 +11,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ You need to build the deployment package to be compatible with this [instruction set architecture](foundation-arch.md) of the function\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. **Note** diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index eaf8e0ea..b17df846 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -67,19 +67,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 72a40323..07e9023a 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -4,9 +4,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index 0d124cc1..1ce93c9a 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -8,6 +8,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ You need to build the deployment package to be compatible with this [instruction set architecture](foundation-arch.md) of the function\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. **Topics** diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md index a3fa3b30..b68b7491 100644 --- a/doc_source/runtimes-avx2.md +++ b/doc_source/runtimes-avx2.md @@ -2,6 +2,9 @@ Advanced Vector Extensions 2 \(AVX2\) is a vectorization extension to the Intel x86 instruction set that can perform single instruction multiple data \(SIMD\) instructions over vectors of 256 bits\. For vectorizable algorithms with [highly parallelizable](https://en.wikipedia.org/wiki/Massively_parallel) operation, using AVX2 can enhance CPU performance, resulting in lower latencies and higher throughput\. Use the AVX2 instruction set for compute\-intensive workloads such as machine learning inferencing, multimedia processing, scientific simulations, and financial modeling applications\. +**Note** +Lambda arm64 uses NEON SIMD architecture and does not support the x86 AVX2 extensions\. + To use AVX2 with your Lambda function, make sure that your function code is accessing AVX2\-optimized code\. For some languages, you can install the AVX2\-supported version of libraries and packages\. For other languages, you can recompile your code and dependencies with the appropriate compiler flags set \(if the compiler supports auto\-vectorization\)\. You can also compile your code with third\-party libraries that use AVX2 to optimize math operations\. For example, Intel Math Kernel Library \(Intel MKL\), OpenBLAS \(Basic Linear Algebra Subprograms\), and AMD BLAS\-like Library Instantiation Software \(BLIS\)\. Auto\-vectorized languages, such as Java, automatically use AVX2 for computations\. You can create new Lambda workloads or move existing AVX2\-enabled workloads to Lambda at no additional cost\. diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md index ce22aa51..a2e180f8 100644 --- a/doc_source/runtimes-images.md +++ b/doc_source/runtimes-images.md @@ -2,6 +2,9 @@ AWS provides a set of open\-source base images that you can use\. You can also use a preferred community or private base image\. Lambda provides client software that you add to your preferred base image to make it compatible with the Lambda service\. +**Note** +Each base image is compatible with one or more of the instruction set architectures that Lambda supports\. You need to build the function image for only one architcture\. Lambda does not support multi\-architecture images\. + **Topics** + [AWS base images for Lambda](#runtimes-images-lp) + [Base images for custom runtimes](#runtimes-images-custom) diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 54f85687..28df3a13 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -18,21 +18,17 @@ We strongly recommend that you never put confidential or sensitive information, ## Encryption in transit -Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console,AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. +Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console,AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html) in the AWS General Reference\. -When you [connect your function to a file system](configuration-filesystem.md), Lambda uses [Encryption in transit](https://docs.aws.amazon.com/efs/latest/ug/encryption.html) for all connections\. +When you [connect your function to a file system](configuration-filesystem.md), Lambda uses encryption in transit for all connections\. For more information, see [Data encryption in Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/encryption.html) in the *Amazon Elastic File System User Guide*\. -For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html) in the AWS General Reference\. +When you use [environment variables](configuration-envvars.md), you can enable console encryption helpers to use client\-side encryption to protect the environment variables in transit\. For more information, see [Securing environment variables](configuration-envvars.md#configuration-envvars-encryption)\. ## Encryption at rest -You can use environment variables to store secrets securely for use with Lambda functions\. Lambda always encrypts environment variables at rest\. +You can use [environment variables](configuration-envvars.md) to store secrets securely for use with Lambda functions\. Lambda always encrypts environment variables at rest\. By default, Lambda uses an AWS KMS key that Lambda creates in your account to encrypt your environment variables\. This AWS managed key is named `aws/lambda`\. -Additionally, you can use the following features to customize how environment variables are encrypted\. -+ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* CMKs\. For functions that do not have a configured customer managed CMK, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. -+ **Encryption helpers** – The Lambda console lets you encrypt environment variable values client side, before sending them to Lambda\. This enhances security further by preventing secrets from being displayed unencrypted in the Lambda console, or in function configuration that's returned by the Lambda API\. The console also provides sample code that you can adapt to decrypt the values in your function handler\. - -For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. +On a per\-function basis, you can optionally configure Lambda to use a customer managed key instead of the default AWS managed key to encrypt your environment variables\. For more information, see [Securing environment variables](configuration-envvars.md#configuration-envvars-encryption)\. Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-images.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 41828285..6a4cf921 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -1,61 +1,29 @@ -# Tutorial: Using AWS Lambda with Amazon API Gateway +# Tutorial: Using Lambda with API Gateway -In this example you create a simple API using Amazon API Gateway\. An Amazon API Gateway is a collection of resources and methods\. For this tutorial, you create one resource \(`DynamoDBManager`\) and define one method \(`POST`\) on it\. The method is backed by a Lambda function \(`LambdaFunctionOverHttps`\)\. That is, when you call the API through an HTTPS endpoint, Amazon API Gateway invokes the Lambda function\. +In this tutorial, you use Amazon API Gateway to create a REST API and a resource \(`DynamoDBManager`\)\. You define one method \(`POST`\) on the resource, and create a Lambda function \(`LambdaFunctionOverHttps`\) that backs the `POST` method\. That way, when you call the API through an HTTPS endpoint, API Gateway invokes the Lambda function\. -The `POST` method on the `DynamoDBManager` resource supports the following DynamoDB operations: +The `POST` method that you define on the `DynamoDBManager` resource supports the following Amazon DynamoDB operations: + Create, update, and delete an item\. + Read an item\. + Scan an item\. + Other operations \(echo, ping\), not related to DynamoDB, that you can use for testing\. -The request payload you send in the `POST` request identifies the DynamoDB operation and provides necessary data\. For example: -+ The following is a sample request payload for a DynamoDB create item operation: - - ``` - { - "operation": "create", - "tableName": "lambda-apigateway", - "payload": { - "Item": { - "id": "1", - "name": "Bob" - } - } - } - ``` -+ The following is a sample request payload for a DynamoDB read item operation: - - - - ``` - { - "operation": "read", - "tableName": "lambda-apigateway", - "payload": { - "Key": { - "id": "1" - } - } - } - ``` -+ The following is a sample request payload for an `echo` operation\. You send an HTTP POST request to the endpoint, using the following data in the request body\. - - ``` - { - "operation": "echo", - "payload": { - "somekey1": "somevalue1", - "somekey2": "somevalue2" - } - } - ``` +Using API Gateway with Lambda also provides advanced capabilities, such as: ++ **Full request passthrough** – Using the Lambda proxy \(`AWS_PROXY`\) integration type, a Lambda function can receive an entire HTTP request \(instead of just the request body\) and set the HTTP response \(instead of just the response body\)\. ++ **Catch\-all methods** – Using the `ANY` catch\-all method, you can map all methods of an API resource to a single Lambda function with a single mapping\. ++ **Catch\-all resources** – Using a greedy path variable \(`{proxy+}`\), you can map all sub\-paths of a resource to a Lambda function without any additional configuration\. + +For more information about these API Gateway features, see [Set up a proxy integration with a proxy resource](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html) in the *API Gateway Developer Guide*\. -**Note** -API Gateway offers advanced capabilities, such as: -**Pass through the entire request** – A Lambda function can receive the entire HTTP request \(instead of just the request body\) and set the HTTP response \(instead of just the response body\) using the `AWS_PROXY` integration type\. -**Catch\-all methods** – Map all methods of an API resource to a single Lambda function with a single mapping, using the `ANY` catch\-all method\. -**Catch\-all resources** – Map all sub\-paths of a resource to a Lambda function without any additional configuration using the new path parameter \(`{proxy+})`\. -To learn more about these API Gateway features, see [Configure proxy integration for a proxy resource](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html)\. +**Topics** ++ [Prerequisites](#services-apigateway-tutorial-prereqs) ++ [Create an execution role](#services-apigateway-tutorial-role) ++ [Create the function](#services-apigateway-tutorial-function) ++ [Test the function](#services-apigateway-tutorial-test) ++ [Create a REST API using API Gateway](#services-apigateway-tutorial-api) ++ [Create a DynamoDB table](#services-apigateway-tutorial-table) ++ [Test the setup](#services-apigateway-tutorial-test-setup) ++ [Clean up your resources](#cleanup) ## Prerequisites @@ -77,17 +45,17 @@ For long commands, an escape character \(`\`\) is used to split a command over m 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\. -## Create the execution role +## Create an execution role -Create the [execution role](lambda-intro-execution-role.md)\. This role uses a custom policy to give your function permission to access the required AWS resources\. You first create the policy and then create the execution role\. +Create an [execution role](lambda-intro-execution-role.md)\. This AWS Identity and Access Management \(IAM\) role uses a custom policy to give your Lambda function permission to access the required AWS resources\. Note that you must first create the policy and then create the execution role\. **To create a custom policy** -1. Open the [policy page](https://console.aws.amazon.com/iam/home#/policies) in the IAM console\. +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. 1. Choose **Create Policy**\. -1. Choose the **JSON** tab\. Paste the following custom policy into the input box\. +1. Choose the **JSON** tab, and then paste the following custom policy into the JSON editor\. ``` { @@ -120,44 +88,50 @@ Create the [execution role](lambda-intro-execution-role.md)\. This role uses a c } ``` -1. Choose **Next: Tags**\. + This policy includes permissions for your function to access DynamoDB and Amazon CloudWatch Logs\. -1. Choose **Next: Review**\. +1. Choose **Next: Tags**\. -1. For the policy name, enter **lambda\-apigateway\-policy**\. +1. Choose **Next: Review**\. -1. Enter **Create policy**\. +1. Under **Review policy**, for the policy **Name**, enter **lambda\-apigateway\-policy**\. -This policy includes permissions for the function to access DynamoDB and CloudWatch Logs\. +1. Choose **Create policy**\. **To create an execution role** -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. 1. Choose **Create role**\. -1. For the trusted entity, choose **AWS Service**, and for the use case choose **Lambda**\. +1. For the type of trusted entity, choose **AWS service**\. + +1. For the use case, choose **Lambda**\. 1. Choose **Next: Permissions**\. -1. In the policy search box, enter **lambda\-apigateway\-policy**\. +1. In the policy search box, enter **lambda\-apigateway\-policy**\. -1. In the results, select `lambda-apigateway-policy` and choose **Next: Tags**\. +1. In the search results, select the policy that you created \(`lambda-apigateway-policy`\), and then choose **Next: Tags**\. 1. Choose **Next: Review**\. -1. For the role name, enter **lambda\-apigateway\-role**\. +1. Under **Review**, for the **Role name**, enter **lambda\-apigateway\-role**\. + +1. Choose **Create role**\. + +1. On the **Roles** page, choose the name of your role \(`lambda-apigateway-role`\)\. + +1. On the **Summary** page, copy the **Role ARN**\. You need this later in the tutorial\. -1. Enter **Create role**\. - Note the Amazon Resource Name \(ARN\) of the execution role for later use\. ## Create the function -The following example code receives a API Gateway event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. +The following code example receives an API Gateway event input and processes the messages that this input contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. -**Note** -For sample code in other languages, see [Sample function code](services-apigateway-code.md)\. +------ +#### [ Node\.js ] **Example index\.js** @@ -213,7 +187,7 @@ exports.handler = function(event, context, callback) { **To create the function** -1. Copy the sample code into a file named `index.js`\. +1. Save the code example as a file named `index.js`\. 1. Create a deployment package\. @@ -221,7 +195,7 @@ exports.handler = function(event, context, callback) { zip function.zip index.js ``` -1. Create a Lambda function with the `create-function` command\. For the `role` parameter, enter the ARN of the execution role that you created earlier\. +1. Create a Lambda function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. For the `role` parameter, enter the execution role's Amazon Resource Name \(ARN\), which you copied earlier\. ``` aws lambda create-function --function-name LambdaFunctionOverHttps \ @@ -229,339 +203,304 @@ exports.handler = function(event, context, callback) { --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role ``` -## Test the Lambda function +------ +#### [ Python 3 ] + +**Example LambdaFunctionOverHttps\.py** + +``` +from __future__ import print_function + +import boto3 +import json + +print('Loading function') + + +def handler(event, context): + '''Provide an event that contains the following keys: + + - operation: one of the operations in the operations dict below + - tableName: required for operations that interact with DynamoDB + - payload: a parameter to pass to the operation being performed + ''' + #print("Received event: " + json.dumps(event, indent=2)) -Invoke the function manually using the sample event data\. We recommend that you invoke the function using the console because the console UI provides a user\-friendly interface for reviewing the execution results, including the execution summary, logs written by your code, and the results returned by the function \(because the console always performs synchronous execution—invokes the Lambda function using the `RequestResponse` invocation type\)\. + operation = event['operation'] -**To test the Lambda function** + if 'tableName' in event: + dynamo = boto3.resource('dynamodb').Table(event['tableName']) -1. Copy the following JSON into a file and save it as `input.txt`\. + operations = { + 'create': lambda x: dynamo.put_item(**x), + 'read': lambda x: dynamo.get_item(**x), + 'update': lambda x: dynamo.update_item(**x), + 'delete': lambda x: dynamo.delete_item(**x), + 'list': lambda x: dynamo.scan(**x), + 'echo': lambda x: x, + 'ping': lambda x: 'pong' + } + + if operation in operations: + return operations[operation](event.get('payload')) + else: + raise ValueError('Unrecognized operation "{}"'.format(operation)) +``` + +**To create the function** + +1. Save the code example as a file named `LambdaFunctionOverHttps.py`\. + +1. Create a deployment package\. ``` - { - "operation": "echo", - "payload": { - "somekey1": "somevalue1", - "somekey2": "somevalue2" - } - } + zip function.zip LambdaFunctionOverHttps.py ``` -1. Run the following `invoke` command: +1. Create a Lambda function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. For the `role` parameter, enter the execution role's Amazon Resource Name \(ARN\), which you copied earlier\. ``` - aws lambda invoke --function-name LambdaFunctionOverHttps \ - --payload file://input.txt outputfile.txt + aws lambda create-function --function-name LambdaFunctionOverHttps \ + --zip-file fileb://function.zip --handler LambdaFunctionOverHttps.handler --runtime python3.8 \ + --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +------ +#### [ Go ] -## Create an API using Amazon API Gateway +**Example LambdaFunctionOverHttps\.go** -In this step, you associate your Lambda function with a method in the API that you created using Amazon API Gateway and test the end\-to\-end experience\. That is, when an HTTP request is sent to an API method, Amazon API Gateway invokes your Lambda function\. +``` +package main + +import ( + "context" + "fmt" + "github.com/aws/aws-lambda-go/events" + runtime "github.com/aws/aws-lambda-go/lambda" +) -First, you create an API \(`DynamoDBOperations`\) using Amazon API Gateway with one resource \(`DynamoDBManager`\) and one method \(`POST`\)\. You associate the `POST` method with your Lambda function\. Then, you test the end\-to\-end experience\. +func main() { + runtime.Start(handleRequest) +} -### Create the API +func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { + fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestID) + fmt.Printf("Body size = %d.\n", len(request.Body)) -Run the following `create-rest-api` command to create the `DynamoDBOperations` API for this tutorial\. + fmt.Println("Headers:") + for key, value := range request.Headers { + fmt.Printf(" %s: %s\n", key, value) + } -``` -aws apigateway create-rest-api --name DynamoDBOperations + return events.APIGatewayProxyResponse{Body: request.Body, StatusCode: 200}, nil +} ``` -You should see the following output: +**To create the function** -``` -{ - "id": "bs8fqo6bp0", - "name": "DynamoDBOperations", - "createdDate": 1539803980, - "apiKeySource": "HEADER", - "endpointConfiguration": { - "types": [ - "EDGE" - ] - } -} -``` +1. Save the code example as a file named `LambdaFunctionOverHttps.go`\. -Save the API ID for use in further commands\. You also need the ID of the API root resource\. To get the ID, run the `get-resources` command\. +1. Compile your executable\. -``` -API=bs8fqo6bp0 -aws apigateway get-resources --rest-api-id $API -``` + ``` + GOOS=linux go build LambdaFunctionOverHttps.go + ``` -You should see the following output: +1. Create a deployment package\. -``` -{ - "items": [ - { - "path": "/", - "id": "e8kitthgdb" - } - ] -} -``` + ``` + zip function.zip LambdaFunctionOverHttps + ``` -At this time you only have the root resource, but you add more resources in the next step\. +1. Create a Lambda function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. For the `role` parameter, enter the execution role's Amazon Resource Name \(ARN\), which you copied earlier\. -### Create a resource in the API + ``` + aws lambda create-function --function-name LambdaFunctionOverHttps \ + --zip-file fileb://function.zip --handler LambdaFunctionOverHttps --runtime go1.x \ + --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role + ``` -Run the following `create-resource` command to create a resource \(`DynamoDBManager`\) in the API that you created in the preceding section\. +------ -``` -aws apigateway create-resource --rest-api-id $API --path-part DynamoDBManager \ ---parent-id e8kitthgdb -``` +## Test the function -You should see the following output: +Test the Lambda function manually using the following sample event data\. You can invoke the function using the `invoke` AWS CLI command or by [using the Lambda console](configuration-function-common.md#configuration-common-test)\. -``` -{ - "path": "/DynamoDBManager", - "pathPart": "DynamoDBManager", - "id": "iuig5w", - "parentId": "e8kitthgdb" -} -``` +**To test the Lambda function \(AWS CLI\)** -Note the ID in the response\. This is the ID of the `DynamoDBManager` resource that you created\. +1. Save the following JSON as a file named `input.txt`\. -### Create POST method on the resource + ``` + { + "operation": "echo", + "payload": { + "somekey1": "somevalue1", + "somekey2": "somevalue2" + } + } + ``` -Run the following `put-method` command to create a `POST` method on the `DynamoDBManager` resource in your API\. +1. Run the following `invoke` AWS CLI command: -``` -RESOURCE=iuig5w -aws apigateway put-method --rest-api-id $API --resource-id $RESOURCE \ ---http-method POST --authorization-type NONE -``` + ``` + aws lambda invoke --function-name LambdaFunctionOverHttps \ + --payload file://input.txt outputfile.txt + ``` -You should see the following output: + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. -``` -{ - "apiKeyRequired": false, - "httpMethod": "POST", - "authorizationType": "NONE" -} -``` +1. Verify the output in the file `outputfile.txt`\. -We specify `NONE` for the `--authorization-type` parameter, which means that unauthenticated requests for this method are supported\. This is fine for testing but in production you should use either the key\-based or role\-base authentication\. +## Create a REST API using API Gateway -### Set the Lambda function as the destination for the POST method +In this section, you create an API Gateway REST API \(`DynamoDBOperations`\) with one resource \(`DynamoDBManager`\) and one method \(`POST`\)\. You associate the `POST` method with your Lambda function\. Then, you test the setup\. -Run the following command to set the Lambda function as the integration point for the `POST` method\. This is the method Amazon API Gateway invokes when you make an HTTP request for the `POST` method endpoint\. This command and others use ARNs that include your account ID and region\. Save these to variables \(you can find your account ID in the role ARN that you used to create the function\)\. +When your API method receives an HTTP request, API Gateway invokes your Lambda function\. -``` -REGION=us-east-2 -ACCOUNT=123456789012 -aws apigateway put-integration --rest-api-id $API --resource-id $RESOURCE \ ---http-method POST --type AWS --integration-http-method POST \ ---uri arn:aws:apigateway:$REGION:lambda:path/2015-03-31/functions/arn:aws:lambda:$REGION:$ACCOUNT:function:LambdaFunctionOverHttps/invocations -``` +### Create the API -You should see the following output: +In the following steps, you create the `DynamoDBOperations` REST API using the API Gateway console\. -``` -{ - "type": "AWS", - "httpMethod": "POST", - "uri": "arn:aws:apigateway:us-east-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps/invocations", - "passthroughBehavior": "WHEN_NO_MATCH", - "timeoutInMillis": 29000, - "cacheNamespace": "iuig5w", - "cacheKeyParameters": [] -} -``` +**To create the API** -`--integration-http-method` is the method that API Gateway uses to communicate with AWS Lambda\. `--uri` is unique identifier for the endpoint to which Amazon API Gateway can send request\. +1. Open the [API Gateway console](https://console.aws.amazon.com/apigateway)\. -Set `content-type` of the `POST` method response and integration response to JSON as follows: -+ Run the following command to set the `POST` method response to JSON\. This is the response type that your API method returns\. +1. Choose **Create API**\. - ``` - aws apigateway put-method-response --rest-api-id $API \ - --resource-id $RESOURCE --http-method POST \ - --status-code 200 --response-models application/json=Empty - ``` +1. In the **REST API** box, choose **Build**\. - You should see the following output: +1. Under **Create new API**, choose **New API**\. - ``` - { - "statusCode": "200", - "responseModels": { - "application/json": "Empty" - } - } - ``` -+ Run the following command to set the `POST` method integration response to JSON\. This is the response type that Lambda function returns\. +1. Under **Settings**, do the following: - ``` - aws apigateway put-integration-response --rest-api-id $API \ - --resource-id $RESOURCE --http-method POST \ - --status-code 200 --response-templates application/json="" - ``` + 1. For **API name**, enter **DynamoDBOperations**\. - You should see the following output: + 1. For **Endpoint Type**, choose **Regional**\. - ``` - { - "statusCode": "200", - "responseTemplates": { - "application/json": null - } - } - ``` -**Note** -If you encounter an error running this command, you can use escape characters around the response template field for more clarity\. The text `application/json=""` becomes `"{\"application/json"\":""\"\"}""`\. +1. Choose **Create API**\. -### Deploy the API +### Create a resource in the API -In this step, you deploy the API that you created to a stage called `prod`\. +In the following steps, you create a resource named `DynamoDBManager` in your REST API\. -``` -aws apigateway create-deployment --rest-api-id $API --stage-name prod -``` +**To create the resource** -You should see the following output: +1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), in the **Resources** tree of your API, make sure that the root \(`/`\) level is highlighted\. Then, choose **Actions**, **Create Resource**\. -``` -{ - "id": "20vgsz", - "createdDate": 1539820012 -} -``` +1. Under **New child resource**, do the following: -## Grant invoke permission to the API + 1. For **Resource Name**, enter **DynamoDBManager**\. -Now that you have an API created using Amazon API Gateway and you've deployed it, you can test\. First, you need to add permissions so that Amazon API Gateway can invoke your Lambda function when you send HTTP request to the `POST` method\. + 1. Keep **Resource Path** set to `/dynamodbmanager`\. -To do this, you need to add a permission to the permissions policy associated with your Lambda function\. Run the following `add-permission` AWS Lambda command to grant the Amazon API Gateway service principal \(`apigateway.amazonaws.com`\) permissions to invoke your Lambda function \(`LambdaFunctionOverHttps`\)\. +1. Choose **Create Resource**\. -``` -aws lambda add-permission --function-name LambdaFunctionOverHttps \ ---statement-id apigateway-test-2 --action lambda:InvokeFunction \ ---principal apigateway.amazonaws.com \ ---source-arn "arn:aws:execute-api:$REGION:$ACCOUNT:$API/*/POST/DynamoDBManager" -``` +### Create a POST method on the resource -You should see the following output: +In the following steps, you create a `POST` method on the `DynamoDBManager` resource that you created in the previous section\. -``` -{ - "Statement": "{\"Sid\":\"apigateway-test-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1yprki7/*/POST/DynamoDBManager\"}}}" -} -``` +**To create the method** -You must grant this permission to enable testing \(if you go to the Amazon API Gateway and choose **Test** to test the API method, you need this permission\)\. Note the `--source-arn` specifies a wildcard character \(\*\) as the stage value \(indicates testing only\)\. This allows you to test without deploying the API\. +1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), in the **Resources** tree of your API, make sure that `/dynamodbmanager` is highlighted\. Then, choose **Actions**, **Create Method**\. -**Note** -If your function and API are in different regions, the region identifier in the source ARN must match the region of the function, not the region of the API\. +1. In the small dropdown menu that appears under `/dynamodbmanager`, choose `POST`, and then choose the check mark icon\. -Now, run the same command again, but this time you grant to your deployed API permissions to invoke the Lambda function\. +1. In the method's **Setup** pane, do the following: -``` -aws lambda add-permission --function-name LambdaFunctionOverHttps \ ---statement-id apigateway-prod-2 --action lambda:InvokeFunction \ ---principal apigateway.amazonaws.com \ ---source-arn "arn:aws:execute-api:$REGION:$ACCOUNT:$API/prod/POST/DynamoDBManager" -``` + 1. For **Integration type**, choose **Lambda Function**\. -You should see the following output: + 1. For **Lambda Region**, choose the same AWS Region as your Lambda function\. -``` -{ - "Statement": "{\"Sid\":\"apigateway-prod-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1yprki7/prod/POST/DynamoDBManager\"}}}" -} -``` + 1. For **Lambda Function**, enter the name of your function \(**LambdaFunctionOverHttps**\)\. + + 1. Select **Use Default Timeout**\. + + 1. Choose **Save**\. -You grant this permission so that your deployed API has permissions to invoke the Lambda function\. Note that the `--source-arn` specifies a `prod` which is the stage name we used when deploying the API\. +1. In the **Add Permission to Lambda Function** dialog box, choose **OK**\. -## Create a Amazon DynamoDB table +## Create a DynamoDB table -Create the DynamoDB table that the Lambda function uses\. +Create the DynamoDB table that your Lambda function uses\. -**To create a DynamoDB table** +**To create the DynamoDB table** -1. Open the [DynamoDB console](https://console.aws.amazon.com/dynamodb)\. +1. Open the [Tables page](https://console.aws.amazon.com/dynamodbv2#tables) of the DynamoDB console\. 1. Choose **Create table**\. -1. Create a table with the following settings\. - + **Table name** – **lambda\-apigateway** - + **Primary key** – **id** \(string\) +1. Under **Table details**, do the following: -1. Choose **Create**\. + 1. For **Table name**, enter **lambda\-apigateway**\. -## Trigger the function with an HTTP request + 1. For **Partition key**, enter **id**, and keep the data type set as **String**\. -In this step, you are ready to send an HTTP request to the `POST` method endpoint\. You can use either Curl or a method \(`test-invoke-method`\) provided by Amazon API Gateway\. +1. Under **Settings**, keep the **Default settings**\. -You can use Amazon API Gateway CLI commands to send an HTTP `POST` request to the resource \(`DynamoDBManager`\) endpoint\. Because you deployed your Amazon API Gateway, you can use Curl to invoke the methods for the same operation\. +1. Choose **Create table**\. -The Lambda function supports using the `create` operation to create an item in your DynamoDB table\. To request this operation, use the following JSON: +## Test the setup -**Example create\-item\.json** +You're now ready to test the setup\. You can send requests to your `POST` method directly from the API Gateway console\. In this step, you use a `create` operation followed by an `update` operation\. -``` -{ - "operation": "create", - "tableName": "lambda-apigateway", - "payload": { - "Item": { - "id": "1234ABCD", - "number": 5 - } - } -} -``` +**To create an item in your DynamoDB table** -Save the test input to a file named `create-item.json`\. Run the `test-invoke-method` Amazon API Gateway command to send an HTTP `POST` method request to the resource \(`DynamoDBManager`\) endpoint\. +Your Lambda function can use the `create` operation to create an item in your DynamoDB table\. -``` -aws apigateway test-invoke-method --rest-api-id $API \ ---resource-id $RESOURCE --http-method POST --path-with-query-string "" \ ---body file://create-item.json -``` +1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), choose the name of your REST API \(`DynamoDBOperations`\)\. -Or, you can use the following Curl command: +1. In the **Resources** tree, under `/dynamodbmanager`, choose your `POST` method\. -``` -curl -X POST -d "{\"operation\":\"create\",\"tableName\":\"lambda-apigateway\",\"payload\":{\"Item\":{\"id\":\"1\",\"name\":\"Bob\"}}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager -``` +1. In the **Method Execution** pane, in the **Client** box, choose **Test**\. -To send request for the `echo` operation that your Lambda function supports, you can use the following request payload: +1. In the **Method Test** pane, keep **Query Strings** and **Headers** empty\. For **Request Body**, paste the following JSON: -**Example echo\.json** + ``` + { + "operation": "create", + "tableName": "lambda-apigateway", + "payload": { + "Item": { + "id": "1234ABCD", + "number": 5 + } + } + } + ``` -``` -{ - "operation": "echo", - "payload": { - "somekey1": "somevalue1", - "somekey2": "somevalue2" - } -} -``` +1. Choose **Test**\. -Save the test input to a file named `echo.json`\. Run the `test-invoke-method` Amazon API Gateway CLI command to send an HTTP `POST` method request to the resource \(`DynamoDBManager`\) endpoint using the preceding JSON in the request body\. +The test results should show status `200`, indicating that the `create` operation was successful\. To confirm, you can check that your DynamoDB table now contains an item with `"id": "1234ABCD"` and `"number": "5"`\. -``` -aws apigateway test-invoke-method --rest-api-id $API \ ---resource-id $RESOURCE --http-method POST --path-with-query-string "" \ ---body file://echo.json -``` +**To update the item in your DynamoDB table** -Or, you can use the following Curl command: +You can also update items in the table using the `update` operation\. -``` -curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\",\"somekey2\":\"somevalue2\"}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager -``` +1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), return to your POST method's **Method Test** pane\. + +1. In the **Method Test** pane, keep **Query Strings** and **Headers** empty\. In **Request Body**, paste the following JSON: + + ``` + { + "operation": "update", + "tableName": "lambda-apigateway", + "payload": { + "Key": { + "id": "1234ABCD" + }, + "AttributeUpdates": { + "number": { + "Value": 10 + } + } + } + } + ``` + +1. Choose **Test**\. + +The test results should show status `200`, indicating that the `update` operation was successful\. To confirm, you can check that your DynamoDB table now contains an updated item with `"id": "1234ABCD"` and `"number": "10"`\. ## Clean up your resources @@ -573,7 +512,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index 1b99debe..88435c0b 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -118,7 +118,7 @@ Resources in your API define one or more methods, such as GET or POST\. Methods + [Handling errors with an API Gateway API](#services-apigateway-errors) + [Choosing an API type](#services-apigateway-apitypes) + [Sample applications](#services-apigateway-samples) -+ [Tutorial: Using AWS Lambda with Amazon API Gateway](services-apigateway-tutorial.md) ++ [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) + [Sample function code](services-apigateway-code.md) + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) + [AWS SAM template for an API Gateway application](services-apigateway-template.md) diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md index 74c7e746..62a4d36a 100644 --- a/doc_source/services-cloudwatchevents-expressions.md +++ b/doc_source/services-cloudwatchevents-expressions.md @@ -1,6 +1,6 @@ # Schedule expressions using rate or cron -AWS Lambda supports standard rate and cron expressions for frequencies of up to once per minute\. CloudWatch Events rate expressions have the following format\. +AWS Lambda supports standard rate and cron expressions for frequencies of up to once per minute\. EventBridge \(CloudWatch Events\) rate expressions have the following format\. ``` rate(Value Unit) diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 6459ae67..079c939f 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -1,7 +1,7 @@ # Tutorial: Using AWS Lambda with scheduled events In this tutorial, you do the following: -+ Create a Lambda function using the **lambda\-canary** blueprint\. You configure the Lambda function to run every minute\. Note that if the function returns an error, AWS Lambda logs error metrics to CloudWatch\. ++ Create a Lambda function using the **lambda\-canary** blueprint\. You configure the Lambda function to run every minute\. Note that if the function returns an error, Lambda logs error metrics to Amazon CloudWatch\. + Configure a CloudWatch alarm on the `Errors` metric of your Lambda function to post a message to your Amazon SNS topic when AWS Lambda emits error metrics to CloudWatch\. You subscribe to the Amazon SNS topics to get email notification\. In this tutorial, you do the following to set this up: + Create an Amazon SNS topic\. + Subscribe to the topic so you can get email notifications when a new message is posted to the topic\. @@ -37,7 +37,7 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an 1. Choose **Create function**\. -CloudWatch Events emits an event every minute, based on the schedule expression\. The event triggers the Lambda function, which verifies that the expected string appears in the specified page\. For more information on expressions schedules, see [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md)\. +EventBridge \(CloudWatch Events\) emits an event every minute, based on the schedule expression\. The event triggers the Lambda function, which verifies that the expected string appears in the specified page\. For more information on expressions schedules, see [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md)\. ## Test the Lambda function @@ -49,7 +49,7 @@ Test the function with a sample event provided by the Lambda console\. 1. Choose **Test**\. -1. Create a new event using the **CloudWatch Events** event template\. +1. Create a new event using the **EventBridge \(CloudWatch Events\)** event template\. 1. Choose **Create event**\. @@ -135,7 +135,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index 8c773506..a59998ed 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -1,13 +1,15 @@ -# Using AWS Lambda with Amazon CloudWatch Events +# Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\) **Note** -Amazon EventBridge is the preferred way to manage your events\. CloudWatch Events and EventBridge are the same underlying service and API, but EventBridge provides more features\. Changes you make in either CloudWatch or EventBridge will appear in each console\. For more information, see the [Amazon EventBridge documentation](https://docs.aws.amazon.com/eventbridge/index.html)\. +Amazon EventBridge is the preferred way to manage your events\. CloudWatch Events and EventBridge are the same underlying service and API, but EventBridge provides more features\. Changes you make in either CloudWatch Events or EventBridge will appear in each console\. For more information, see the [Amazon EventBridge documentation](https://docs.aws.amazon.com/eventbridge/index.html)\. -[Amazon CloudWatch events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchEvents.html) help you to respond to state changes in your AWS resources\. When your resources change state, they automatically send events into an event stream\. You can create rules that match selected events in the stream and route them to your AWS Lambda function to take action\. For example, you can automatically invoke an AWS Lambda function to log the state of an [EC2 instance](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogEC2InstanceState.html) or [AutoScaling group](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogASGroupState.html)\. +EventBridge \(CloudWatch Events\) helps you to respond to state changes in your AWS resources\. For more information about EventBridge, see [What is Amazon EventBridge?](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html) in the *Amazon EventBridge User Guide*\. -CloudWatch Events invokes your function asynchronously with an event document that wraps the event from its source\. The following example shows an event that originated from a database snapshot in Amazon Relational Database Service\. +When your resources change state, they automatically send events into an event stream\. With EventBridge \(CloudWatch Events\), you can create rules that match selected events in the stream and route them to your AWS Lambda function to take action\. For example, you can automatically invoke an AWS Lambda function to log the state of an [EC2 instance](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogEC2InstanceState.html) or [AutoScaling group](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogASGroupState.html)\. -**Example CloudWatch Events event** +EventBridge \(CloudWatch Events\) invokes your function asynchronously with an event document that wraps the event from its source\. The following example shows an event that originated from a database snapshot in Amazon Relational Database Service\. + +**Example EventBridge \(CloudWatch Events\) event** ``` { @@ -36,7 +38,7 @@ CloudWatch Events invokes your function asynchronously with an event document th You can also create a Lambda function and direct AWS Lambda to invoke it on a regular schedule\. You can specify a fixed rate \(for example, invoke a Lambda function every hour or 15 minutes\), or you can specify a Cron expression\. -**Example CloudWatch Events message event** +**Example EventBridge \(CloudWatch Events\) message event** ``` { @@ -54,7 +56,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re } ``` -**To configure CloudWatch Events to invoke your function** +**To configure EventBridge \(CloudWatch Events\) to invoke your function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -62,7 +64,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re 1. Under **Function overview**, choose **Add trigger**\. -1. Set the trigger type to **EventBridge\(CloudWatch Events\)**\. +1. Set the trigger type to **EventBridge \(CloudWatch Events\)**\. 1. For **Rule**, choose **Create a new rule**\. @@ -70,9 +72,9 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re For more information on expressions schedules, see [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md)\. -Each AWS account can have up to 100 unique event sources of the **CloudWatch Events\- Schedule** source type\. Each of these can be the event source for up to five Lambda functions\. That is, you can have up to 500 Lambda functions that can be executing on a schedule in your AWS account\. +Each AWS account can have up to 100 unique event sources of the **EventBridge \(CloudWatch Events\)\- Schedule** source type\. Each of these can be the event source for up to five Lambda functions\. That is, you can have up to 500 Lambda functions that can be executing on a schedule in your AWS account\. **Topics** + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) -+ [AWS SAM template for a CloudWatch Events application](with-scheduledevents-example-use-app-spec.md) ++ [AWS SAM template for a EventBridge \(CloudWatch Events\) application](with-scheduledevents-example-use-app-spec.md) + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) \ No newline at end of file diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md index bdce5f13..ee9b970d 100644 --- a/doc_source/services-ec2.md +++ b/doc_source/services-ec2.md @@ -1,8 +1,8 @@ # Using AWS Lambda with Amazon EC2 -You can use AWS Lambda to process lifecycle events from Amazon Elastic Compute Cloud and manage Amazon EC2 resources\. Amazon EC2 sends events to Amazon CloudWatch Events for lifecycle events such as when an instance changes state, when an Amazon Elastic Block Store volume snapshot completes, or when a spot instance is scheduled to be terminated\. You configure CloudWatch Events to forward those events to a Lambda function for processing\. +You can use AWS Lambda to process lifecycle events from Amazon Elastic Compute Cloud and manage Amazon EC2 resources\. Amazon EC2 sends events to Amazon EventBridge \(CloudWatch Events\) for lifecycle events such as when an instance changes state, when an Amazon Elastic Block Store volume snapshot completes, or when a spot instance is scheduled to be terminated\. You configure EventBridge \(CloudWatch Events\) to forward those events to a Lambda function for processing\. -CloudWatch Events invokes your Lambda function asynchronously with the event document from Amazon EC2\. +EventBridge \(CloudWatch Events\) invokes your Lambda function asynchronously with the event document from Amazon EC2\. **Example instance lifecycle event** @@ -25,13 +25,13 @@ CloudWatch Events invokes your Lambda function asynchronously with the event doc } ``` -For details on configuring events in CloudWatch Events, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon CloudWatch Events for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. +For details on configuring events in EventBridge \(CloudWatch Events\), see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon EventBridge \(CloudWatch Events\) for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. You can also use the AWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. ## Permissions -To process lifecycle events from Amazon EC2, CloudWatch Events needs permission to invoke your function\. This permission comes from the function's [resource\-based policy](access-control-resource-based.md)\. If you use the CloudWatch Events console to configure an event trigger, the console updates the resource\-based policy on your behalf\. Otherwise, add a statement like the following: +To process lifecycle events from Amazon EC2, EventBridge \(CloudWatch Events\) needs permission to invoke your function\. This permission comes from the function's [resource\-based policy](access-control-resource-based.md)\. If you use the EventBridge \(CloudWatch Events\) console to configure an event trigger, the console updates the resource\-based policy on your behalf\. Otherwise, add a statement like the following: **Example resource\-based policy statement for Amazon EC2 lifecycle notifications** diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index 048ecc12..785af70b 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -146,7 +146,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index 2af5cd7b..33b28b27 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -181,7 +181,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/services-rds.md b/doc_source/services-rds.md index 7e346dbb..8917eda2 100644 --- a/doc_source/services-rds.md +++ b/doc_source/services-rds.md @@ -38,4 +38,4 @@ You can use AWS Lambda to process event notifications from an Amazon Relational The following section shows additional configurations and topics we recommend as part of this tutorial\. + If too many function instances run concurrently, one or more instances may fail to obtain a database connection\. You can use reserved concurrency to limit the maximum concurrency of the function\. Set the reserved concurrency to be less than the number of database connections\. Reserved concurrency also reserves those instances for this function, which may not be ideal\. If you are invoking the Lambda functions from your application, we recommend you write code that limits the number of concurrent instances\. For more information, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. + For more information on configuring an Amazon RDS database to send notifications, see [Using Amazon RDS event notifications](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html)\. -+ For more information on using Amazon SNS as trigger, see [Using Lambda with Amazon SNS](with-sns.md)\. \ No newline at end of file ++ For more information on using Amazon SNS as trigger, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index a0c24ba6..e7b4e4fd 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -23,7 +23,7 @@ chmod 755 $(find . -type d) **Error:** *An error occurred \(RequestEntityTooLargeException\) when calling the UpdateFunctionCode operation* -When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the [S3Bucket and S3Key](API_UpdateFunctionCode.md#SSS-UpdateFunctionCode-request-S3Bucket) parameters\. +When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the S3Bucket and S3Key parameters\. **Note** When you upload a file directly with the AWS CLI, AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 02d46203..34538767 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -44,13 +44,43 @@ Some libraries don't return promises but can be wrapped in code that does\. For **Issue:** *The AWS SDK included on the runtime updates automatically* Runtimes for scripting languages include the AWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of the AWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: -+ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) -+ [Deploy Python Lambda functions with \.zip file archives](python-package.md) -+ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -+ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) -+ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + +------ +#### [ C\# ] + + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ ## Python: Libraries load incorrectly diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md index 0f426b7a..670f8e91 100644 --- a/doc_source/troubleshooting-images.md +++ b/doc_source/troubleshooting-images.md @@ -1,5 +1,41 @@ # Troubleshoot container image issues in Lambda +## Container: CodeArtifactUserException errors related to the code artifact\. + +**Issue:** *CodeArtifactUserPendingException error message* + +The CodeArtifact is pending optimization\. The function transitions to active state when Lambda completes the optimization\. HTTP response code 500\. + +**Issue:** *CodeArtifactUserDeletedException error message* + +The CodeArtifact is scheduled to be deleted\. HTTP response code 409\. + +**Issue:** *CodeArtifactUserFailedException error message* + +Lambda failed to optimize the code\. You need to correct the code and upload it again\. HTTP response code 409\. + +## Container: ManifestKeyCustomerException errors related to the code manifest key\. + +**Issue:** *KMSAccessDeniedException error message* + +You do not have permissions to access the key to decrypt the manifest\. HTTP response code 502\. + +**Issue:** *TooManyRequestsException error message* + +The client is being throttled\. The current request rate exceeds the KMS subscription rate\. HTTP response code 429\. + +**Issue:** *KMSNotFoundException error message* + +Lambda cannot find the key to decrypt the manifest\. HTTP response code 502\. + +**Issue:** *KMSDisabledException error message* + +The key to decrypt the manifest is disabled\. HTTP response code 502\. + +**Issue:** *KMSInvalidStateException error message* + +The key is in a state \(such as pending deletion or unavailable\) such that Lambda cannot use the key to decrypt the manifest\. HTTP response code 502\. + ## Container: Error occurs on runtime InvalidEntrypoint **Issue:** *You receive a Runtime\.ExitError error message, or an error message with `"errorType": "Runtime.InvalidEntrypoint"`\.* diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index 24b2ad24..68549657 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -268,7 +268,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index bbd900f8..b95e9aa0 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -89,6 +89,7 @@ Configure the `ParallelizationFactor` setting to process one shard of a Kinesis + [Amazon CloudWatch metrics](#events-dynamodb-metrics) + [Time windows](#services-ddb-windows) + [Reporting batch item failures](#services-ddb-batchfailurereporting) ++ [Amazon DynamoDB Streams configuration parameters](#services-ddb-params) + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) + [Sample function code](with-ddb-create-package.md) + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) @@ -152,11 +153,11 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping APIs To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. @@ -601,4 +602,26 @@ def handler(event, context): return {"batchItemFailures":[]} ``` ------- \ No newline at end of file +------ + +## Amazon DynamoDB Streams configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to DynamoDB Streams\. + + +**Event source parameters that apply to DynamoDB Streams** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10000 | +| BisectBatchOnFunctionError | N | false | | +| DestinationConfig | N | | Amazon SQS queue or Amazon SNS topic destination for discarded records | +| Enabled | N | true | | +| EventSourceArn | Y | | ARN of the data stream or a stream consumer | +| FunctionName | Y | | | +| MaximumBatchingWindowInSeconds | N | 0 | | +| MaximumRecordAgeInSeconds | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | +| MaximumRetryAttempts | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | +| ParallelizationFactor | N | 1 | Maximum: 10 | +| StartingPosition | Y | | TRIM\_HORIZON or LATEST | +| TumblingWindowInSeconds | N | | Minimum: 0 Maximum: 900 | \ No newline at end of file diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index fafa324b..47bcaace 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -59,7 +59,7 @@ Lambda sends the batch of messages in the event parameter when it invokes your L + [Auto scaling of the Kafka event source](#services-kafka-scaling) + [Event source API operations](#kafka-hosting-api-operations) + [Event source mapping errors](#services-event-errors) -+ [Event source configuration parameters](#services-kafka-parms) ++ [Self\-managed Apache Kafka configuration parameters](#services-kafka-parms) ## Managing access and permissions @@ -74,11 +74,14 @@ To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda f ### Optional Lambda function permissions -Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed customer master key \(CMK\)](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. +Your Lambda function might need these permissions: ++ Describe your AWS Secrets Manager secret ++ Access your AWS Key Management Service \(AWS KMS\) customer managed key ++ Access your Amazon Virtual Private Cloud \(Amazon VPC\) #### Secrets Manager and AWS KMS permissions -If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed key\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: + [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) + [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) @@ -269,11 +272,11 @@ To monitor the throughput of your Kafka topic, you can view the Apache Kafka con When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS CLI, Lambda uses APIs to process your request\. To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ## Event source mapping errors @@ -296,7 +299,7 @@ The function configuration is not valid\. **Note** If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. -## Event source configuration parameters +## Self\-managed Apache Kafka configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Apache Kafka\. diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index ef3459c1..247b3ac0 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -225,7 +225,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 58861b70..975cb443 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -70,6 +70,7 @@ Configure the `ParallelizationFactor` setting to process one shard of a Kinesis + [Amazon CloudWatch metrics](#events-kinesis-metrics) + [Time windows](#services-kinesis-windows) + [Reporting batch item failures](#services-kinesis-batchfailurereporting) ++ [Amazon Kinesis configuration parameters](#services-kinesis-params) + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) + [Sample function code](with-kinesis-create-package.md) + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) @@ -167,11 +168,11 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping API To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) To create the event source mapping with the AWS CLI, use the `create-event-source-mapping` command\. The following example uses the AWS CLI to map a function named `my-function` to a Kinesis data stream\. The data stream is specified by an Amazon Resource Name \(ARN\), with a batch size of 500, starting from the timestamp in Unix time\. @@ -550,4 +551,27 @@ def handler(event, context): return {"batchItemFailures":[]} ``` ------- \ No newline at end of file +------ + +## Amazon Kinesis configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Kinesis\. + + +**Event source parameters that apply to Kinesis** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10000 | +| BisectBatchOnFunctionError | N | false | | +| DestinationConfig | N | | Amazon SQS queue or Amazon SNS topic destination for discarded records | +| Enabled | N | true | | +| EventSourceArn | Y | | ARN of the data stream or a stream consumer | +| FunctionName | Y | | | +| MaximumBatchingWindowInSeconds | N | 0 | | +| MaximumRecordAgeInSeconds | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | +| MaximumRetryAttempts | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | +| ParallelizationFactor | N | 1 | Maximum: 10 | +| StartingPosition | Y | | AT\_TIMESTAMP, TRIM\_HORIZON, or LATEST | +| StartingPositionTimestamp | N | | Only valid if StartingPosition is set to AT\_TIMESTAMP\. The time from which to start reading, in Unix time seconds | +| TumblingWindowInSeconds | N | | Minimum: 0 Maximum: 900 | \ No newline at end of file diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index b0a3db67..00a045be 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -28,6 +28,7 @@ By default, Amazon MQ has a weekly maintenance window for brokers\. During that + [Configuring a broker as an event source](#services-mq-eventsourcemapping) + [Event source mapping API](#services-mq-api) + [Event source mapping errors](#services-mq-errors) ++ [Amazon MQ and RabbitMQ configuration parameters](#services-mq-params) ## Lambda consumer group @@ -182,11 +183,11 @@ To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in ## Event source mapping API To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) command\. @@ -300,4 +301,19 @@ The function's configuration is not valid\. Records also go unprocessed if Lambda drops them due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a dead\-letter queue \(DLQ\)\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website and [Reliability Guide](https://www.rabbitmq.com/reliability.html) on the RabbitMQ website\. **Note** -Lambda does not support custom redelivery policies\. Instead, Lambda uses a policy with the default values from the [Redelivery Policy](https://activemq.apache.org/redelivery-policy) page on the Apache ActiveMQ website, with `maximumRedeliveries` set to 5\. \ No newline at end of file +Lambda does not support custom redelivery policies\. Instead, Lambda uses a policy with the default values from the [Redelivery Policy](https://activemq.apache.org/redelivery-policy) page on the Apache ActiveMQ website, with `maximumRedeliveries` set to 5\. + +## Amazon MQ and RabbitMQ configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon MQ and RabbitMQ\. + + +**Event source parameters that apply to Amazon MQ and RabbitMQ** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10000 | +| Enabled | N | true | | +| FunctionName | Y | | | +| Queues | N | | The name of the Amazon MQ broker destination queue to consume\. | +| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 9f6c28d6..b49efe60 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -259,7 +259,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index 5464af60..c96428d9 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -658,7 +658,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-scheduledevents-example-use-app-spec.md b/doc_source/with-scheduledevents-example-use-app-spec.md index 5b7a9ce0..4cb7c422 100644 --- a/doc_source/with-scheduledevents-example-use-app-spec.md +++ b/doc_source/with-scheduledevents-example-use-app-spec.md @@ -1,4 +1,4 @@ -# AWS SAM template for a CloudWatch Events application +# AWS SAM template for a EventBridge \(CloudWatch Events\) application You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index 1df57f0d..b005ec46 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -197,7 +197,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md index c9564cb0..3bcc95cb 100644 --- a/doc_source/with-sns.md +++ b/doc_source/with-sns.md @@ -1,4 +1,4 @@ -# Using Lambda with Amazon SNS +# Using AWS Lambda with Amazon SNS You can use a Lambda function to process Amazon Simple Notification Service \(Amazon SNS\) notifications\. Amazon SNS supports Lambda functions as a target for messages sent to a topic\. You can subscribe your function to topics in the same account or in other AWS accounts\. diff --git a/doc_source/with-sqs-cross-account-example.md b/doc_source/with-sqs-cross-account-example.md new file mode 100644 index 00000000..f1112160 --- /dev/null +++ b/doc_source/with-sqs-cross-account-example.md @@ -0,0 +1,234 @@ +# Tutorial: Using a cross\-account Amazon SQS queue as an event source + +In this tutorial, you create a Lambda function that consumes messages from an Amazon Simple Queue Service \(Amazon SQS\) queue in a different AWS account\. This tutorial involves two AWS accounts: **Account A** refers to the account that contains your Lambda function, and **Account B** refers to the account that contains the Amazon SQS queue\. + +## Prerequisites + +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. + +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +aws --version +``` + +You should see the following output: + +``` +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 +``` + +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\. + +## Create the execution role \(Account A\) + +In **Account A**, create an [execution role](lambda-intro-execution-role.md) that gives your function permission to access the required AWS resources\. + +**To create an execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) in the AWS Identity and Access Management \(IAM\) console\. + +1. Choose **Create role**\. + +1. Create a role with the following properties\. + + **Trusted entity** – **AWS Lambda** + + **Permissions** – **AWSLambdaSQSQueueExecutionRole** + + **Role name** – **cross\-account\-lambda\-sqs\-role** + +The **AWSLambdaSQSQueueExecutionRole** policy has the permissions that the function needs to read items from Amazon SQS and to write logs to Amazon CloudWatch Logs\. + +## Create the function \(Account A\) + +In **Account A**, create a Lambda function that processes your Amazon SQS messages\. The following Node\.js 12 code example writes each message to a log in CloudWatch Logs\. + +**Note** +For code examples in other languages, see [Sample Amazon SQS function code](with-sqs-create-package.md)\. + +**Example index\.js** + +``` +exports.handler = async function(event, context) { + event.Records.forEach(record => { + const { body } = record; + console.log(body); + }); + return {}; +} +``` + +**To create the function** +**Note** +Following these steps creates a function in Node\.js 12\. For other languages, the steps are similar, but some details are different\. + +1. Save the code example as a file named `index.js`\. + +1. Create a deployment package\. + + ``` + zip function.zip index.js + ``` + +1. Create the function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. + + ``` + aws lambda create-function --function-name CrossAccountSQSExample \ + --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ + --role arn:aws:iam:::role/cross-account-lambda-sqs-role + ``` + +## Test the function \(Account A\) + +In **Account A**, test your Lambda function manually using the `invoke` AWS CLI command and a sample Amazon SQS event\. + +If the handler returns normally without exceptions, Lambda considers the message to be successfully processed and begins reading new messages in the queue\. After successfully processing a message, Lambda automatically deletes it from the queue\. If the handler throws an exception, Lambda considers the batch of messages not successfully processed, and Lambda invokes the function with the same batch of messages\. + +1. Save the following JSON as a file named `input.txt`\. + + ``` + { + "Records": [ + { + "messageId": "059f36b4-87a3-44ab-83d2-661975830a7d", + "receiptHandle": "AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0a...", + "body": "test", + "attributes": { + "ApproximateReceiveCount": "1", + "SentTimestamp": "1545082649183", + "SenderId": "AIDAIENQZJOLO23YVJ4VO", + "ApproximateFirstReceiveTimestamp": "1545082649185" + }, + "messageAttributes": {}, + "md5OfBody": "098f6bcd4621d373cade4e832627b4f6", + "eventSource": "aws:sqs", + "eventSourceARN": "arn:aws:sqs:us-east-1:123456789012:example-queue", + "awsRegion": "us-east-1" + } + ] + } + ``` + + The preceding JSON simulates an event that Amazon SQS might send to your Lambda function, where `"body"` contains the actual message from the queue\. + +1. Run the following `invoke` AWS CLI command\. + + ``` + aws lambda invoke --function-name CrossAccountSQSExample \ + --payload file://input.txt outputfile.txt + ``` + + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + +1. Verify the output in the file `outputfile.txt`\. + +## Create an Amazon SQS queue \(Account B\) + +In **Account B**, create an Amazon SQS queue that the Lambda function in **Account A** can use as an event source\. + +**To create a queue** + +1. Open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + +1. Choose **Create queue**\. + +1. Create a queue with the following properties\. + + **Type** – **Standard** + + **Name** – **LambdaCrossAccountQueue** + + **Configuration** – Keep the default settings\. + + **Access policy** – Choose **Advanced**\. Paste in the following JSON policy: + + ``` + { + "Version": "2012-10-17", + "Id": "Queue1_Policy_UUID", + "Statement": [{ + "Sid":"Queue1_AllActions", + "Effect": "Allow", + "Principal": { + "AWS": [ + "arn:aws:iam:::role/cross-account-lambda-sqs-role" + ] + }, + "Action": "sqs:*", + "Resource": "arn:aws:sqs:us-east-1::LambdaCrossAccountQueue" + } + ] + } + ``` + + This policy grants the Lambda execution role in **Account A** permissions to consume messages from this Amazon SQS queue\. + +1. After creating the queue, record its Amazon Resource Name \(ARN\)\. You need this in the next step when you associate the queue with your Lambda function\. + +## Configure the event source \(Account A\) + +In **Account A**, create an event source mapping between the Amazon SQS queue in **Account B**and your Lambda function by running the following `create-event-source-mapping` AWS CLI command\. + +``` +aws lambda create-event-source-mapping --function-name CrossAccountSQSExample --batch-size 10 \ +--event-source-arn arn:aws:sqs:us-east-1::LambdaCrossAccountQueue +``` + +To get a list of your event source mappings, run the following command\. + +``` +aws lambda list-event-source-mappings --function-name CrossAccountSQSExample \ +--event-source-arn arn:aws:sqs:us-east-1::LambdaCrossAccountQueue +``` + +## Test the setup + +You can now test the setup as follows: + +1. In **Account B**, open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + +1. Choose **LambdaCrossAccountQueue**, which you created earlier\. + +1. Choose **Send and receive messages**\. + +1. Under **Message body**, enter a test message\. + +1. Choose **Send message**\. + +Your Lambda function in **Account A** should receive the message\. Lambda will continue to poll the queue for updates\. When there is a new message, Lambda invokes your function with this new event data from the queue\. Your function runs and creates logs in Amazon CloudWatch\. You can view the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. + +In **Account A**, clean up your execution role and Lambda function\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, then choose **Delete**\. + +1. Choose **Delete**\. + +In **Account B**, clean up the Amazon SQS queue\. + +**To delete the Amazon SQS queue** + +1. Sign in to the AWS Management Console and open the Amazon SQS console at [https://console\.aws\.amazon\.com/sqs/](https://console.aws.amazon.com/sqs/)\. + +1. Select the queue you created\. + +1. Choose **Delete**\. + +1. Enter **delete** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index c063c40f..1ef0ff70 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -186,7 +186,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 4d89b8bd..1cdf12bf 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -47,6 +47,9 @@ Lambda polls the queue and invokes your Lambda function [synchronously](invocati By default, Lambda polls up to 10 messages in your queue at once and sends that batch to your function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. +**Note** +If you're using a batch window and your SQS queue contains very low traffic, Lambda might wait for up to 20 seconds before invoking your function\. This is true even if you set a batch window lower than 20 seconds\. + For FIFO queues, records contain additional attributes that are related to deduplication and sequencing\. **Example Amazon SQS message event \(FIFO queue\)** @@ -85,7 +88,9 @@ When Lambda reads a batch, the messages stay in the queue but become hidden for + [Execution role permissions](#events-sqs-permissions) + [Configuring a queue as an event source](#events-sqs-eventsource) + [Event source mapping APIs](#services-dynamodb-api) ++ [Amazon SQS configuration parameters](#services-sqs-params) + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) ++ [Tutorial: Using a cross\-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) @@ -101,7 +106,7 @@ Your function can scale in concurrency to the number of active message groups\. [Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. -To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [timeout](configuration-function-common.md) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. +To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [ timeout](https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/timeout.html) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. If a message fails to be processed multiple times, Amazon SQS can send it to a [dead\-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\. When your function returns an error, Lambda leaves it in the queue\. After the visibility timeout occurs, Lambda receives the message again\. To send messages to a second queue after a number of receives, configure a dead\-letter queue on your source queue\. @@ -163,11 +168,11 @@ Configure your function timeout to allow enough time to process an entire batch ## Event source mapping APIs To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) The following example uses the AWS CLI to map a function named `my-function` to an Amazon SQS queue that is specified by its Amazon Resource Name \(ARN\), with a batch size of 5 and a batch window of 60 seconds\. @@ -190,4 +195,19 @@ You should see the following output: "State": "Creating", "StateTransitionReason": "USER_INITIATED" } -``` \ No newline at end of file +``` + +## Amazon SQS configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon SQS\. + + +**Event source parameters that apply to Amazon SQS** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10000 | +| Enabled | N | true | | +| EventSourceArn | Y | | ARN of the data stream or a stream consumer | +| FunctionName | Y | | | +| MaximumBatchingWindowInSeconds | N | 0 | | \ No newline at end of file From eb7312d28e717234abcf6a5935780a8664ef0c13 Mon Sep 17 00:00:00 2001 From: Paul Mowat Date: Fri, 1 Oct 2021 14:07:49 +0100 Subject: [PATCH 76/94] fix: removing duplicate better --- doc_source/foundation-arch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md index 72c0156a..42d7fc33 100644 --- a/doc_source/foundation-arch.md +++ b/doc_source/foundation-arch.md @@ -6,7 +6,7 @@ ## Advantages of using arm64 architecture -Lambda functions that use arm64 architecture \(AWS Graviton2 processor\) can achieve significantly better better price and performance than the equivalent function running on x86\_64 architecture\. Consider using arm64 for compute\-intensive applications such as high\-performance computing, video encoding, and simulation workloads\. +Lambda functions that use arm64 architecture \(AWS Graviton2 processor\) can achieve significantly better price and performance than the equivalent function running on x86\_64 architecture\. Consider using arm64 for compute\-intensive applications such as high\-performance computing, video encoding, and simulation workloads\. The Graviton2 CPU uses the Neoverse N1 core and supports Armv8\.2 \(including CRC and crypto extensions\) plus several other architectural extensions\. From 57ac64264003ae7b0704eb213ddcec591a03194c Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Tue, 19 Oct 2021 07:08:17 -0700 Subject: [PATCH 77/94] Restore the create bucket script. Create bucket script commented out. --- sample-apps/blank-python/1-create-bucket.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sample-apps/blank-python/1-create-bucket.sh b/sample-apps/blank-python/1-create-bucket.sh index 160f00ed..64a5f749 100755 --- a/sample-apps/blank-python/1-create-bucket.sh +++ b/sample-apps/blank-python/1-create-bucket.sh @@ -1,5 +1,5 @@ #!/bin/bash -# BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') -# BUCKET_NAME=lambda-artifacts-$BUCKET_ID -# echo $BUCKET_NAME > bucket-name.txt -# aws s3 mb s3://$BUCKET_NAME +BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') +BUCKET_NAME=lambda-artifacts-$BUCKET_ID +echo $BUCKET_NAME > bucket-name.txt +aws s3 mb s3://$BUCKET_NAME From 29e141060c25a28481e3c3904754d76b8cdbd255 Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Tue, 19 Oct 2021 07:26:21 -0700 Subject: [PATCH 78/94] Change pip to pip3 Python 2.7 has reached end of support. --- sample-apps/blank-python/2-build-layer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/blank-python/2-build-layer.sh b/sample-apps/blank-python/2-build-layer.sh index 58f407b8..8f047d17 100755 --- a/sample-apps/blank-python/2-build-layer.sh +++ b/sample-apps/blank-python/2-build-layer.sh @@ -2,4 +2,4 @@ set -eo pipefail rm -rf package cd function -pip install --target ../package/python -r requirements.txt +pip3 install --target ../package/python -r requirements.txt From d6ab3f74ff30b26a1ac23538ec3e6daaa61dc374 Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Tue, 19 Oct 2021 07:29:00 -0700 Subject: [PATCH 79/94] Updated the list of supported Python versions. --- sample-apps/blank-python/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/blank-python/README.md b/sample-apps/blank-python/README.md index d33f2661..1c6d5710 100644 --- a/sample-apps/blank-python/README.md +++ b/sample-apps/blank-python/README.md @@ -11,7 +11,7 @@ The project source includes function code and supporting resources: Use the following instructions to deploy the sample application. # Requirements -- [Python 3.7](https://www.python.org/downloads/) +- [Python 3.7](https://www.python.org/downloads/). Sample also works with Python 3.8 and 3.9. - The Bash shell. For Linux and macOS, this is included by default. In 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. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. From 8fbf1410c073f6b42ffbecb5a672441e93ef2e47 Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Tue, 19 Oct 2021 09:58:04 -0700 Subject: [PATCH 80/94] fix: use valid json for the active mq example --- doc_source/with-mq.md | 64 +++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 00a045be..0de8fa33 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -45,38 +45,36 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut ``` { - "eventSource": "aws:amq", - "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", - "messages": { - [ - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType": "jms/text-message", - "data": "QUJDOkFBQUE=", - "connectionId": "myJMSCoID", - "redelivered": false, - "destination": { - "physicalname": "testQueue" - }, - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 - }, - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType":"jms/bytes-message", - "data": "3DTOOW7crj51prgVLQaGQ82S48k=", - "connectionId": "myJMSCoID1", - "persistent": false, - "destination": { - "physicalname": "testQueue" - }, - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 - } - ] - } + "eventSource":"aws:amq", + "eventSourceArn":"arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "messages":[ + { + "messageID":"ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType":"jms/text-message", + "data":"QUJDOkFBQUE=", + "connectionId":"myJMSCoID", + "redelivered":false, + "destination":{ + "physicalname":"testQueue" + }, + "timestamp":1598827811958, + "brokerInTime":1598827811958, + "brokerOutTime":1598827811959 + }, + { + "messageID":"ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType":"jms/bytes-message", + "data":"3DTOOW7crj51prgVLQaGQ82S48k=", + "connectionId":"myJMSCoID1", + "persistent":false, + "destination":{ + "physicalname":"testQueue" + }, + "timestamp":1598827811958, + "brokerInTime":1598827811958, + "brokerOutTime":1598827811959 + } + ] } ``` @@ -316,4 +314,4 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Enabled | N | true | | | FunctionName | Y | | | | Queues | N | | The name of the Amazon MQ broker destination queue to consume\. | -| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | \ No newline at end of file +| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | From bc06498ecce1bd2b7079cefa2db98d3981592817 Mon Sep 17 00:00:00 2001 From: Alfie John Date: Tue, 19 Oct 2021 21:57:12 +0000 Subject: [PATCH 81/94] Typo in the subcommand --- doc_source/invocation-layers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md index ec2ca6c8..a7cda28c 100644 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -151,7 +151,7 @@ The following procedure assumes that you have packaged the updated layer code in 1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. ``` - aws lambda get-function-config --function-name my-function --query 'Layers[*].Arn' --output yaml + aws lambda get-function-configuration --function-name my-function --query 'Layers[*].Arn' --output yaml ``` 1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`: @@ -217,4 +217,4 @@ The GitHub repository for this guide provides blank sample applications that dem + **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) + **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) -For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. From 20e3f1a7f209ad067207d36fc645f0ba1119900a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rski?= Date: Wed, 3 Nov 2021 21:42:20 +0100 Subject: [PATCH 82/94] Update info about json serialization --- doc_source/csharp-handler.md | 88 +++++++++++++++--------------------- 1 file changed, 36 insertions(+), 52 deletions(-) diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 7ec210e0..c53803cc 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -50,47 +50,9 @@ All other types, as listed below, require you to specify a serializer\. + For asynchronous invocations the return\-type will be ignored by Lambda\. The return type may be set to void in such cases\. + If you are using \.NET asynchronous programming, the return type can be Task and Task types and use `async` and `await` keywords\. For more information, see [Using async in C\# functions with AWS Lambda](#csharp-handler-async)\. -Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializer that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. +Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializers that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. - To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.Json` in your `.csproj` file\. - -``` - - - netcoreapp3.1 - true - AssemblyName - - - - - - - - - -``` - - The example below illustrates the flexibility you can leverage by specifying the default Json\.NET serializer on one method and another of your choosing on a different method: - -``` -public class ProductService{ - [LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] - public Product DescribeProduct(DescribeProductRequest request) - { - return catalogService.DescribeProduct(request.Id); - } - - [LambdaSerializer(typeof(MyJsonSerializer))] - public Customer DescribeCustomer(DescribeCustomerRequest request) - { - return customerService.DescribeCustomer(request.Id); - } -} -``` - -**Note** -If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. +Instruction how to define serialize you can find in [Serializing Lambda functions](#csharp-handler-serializer)\. ## Handler signatures @@ -128,9 +90,8 @@ If the method specified in your handler string is overloaded, you must provide t ## Serializing Lambda functions For any Lambda functions that use input or output types other than a `Stream` object, you will need to add a serialization library to your application\. You can do this in the following ways: -+ Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses JSON\.NET to handle serialization\. -**Note** -If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. ++ Use the `Amazon.Lambda.Serialization.SystemTextJson` NuGet package\. This library uses native .net core JSON serializer to handle serialization\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`, but please note that there are some limitation documented in the [Microsoft's documentation](https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-core-3-1)\. It is only available for \.net core 3\.1 runtimes or higher\. ++ Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses `Newtonsoft.Json` NuGet package to handle serialization\. + Create your own serialization library by implementing the `ILambdaSerializer` interface, which is available as part of the `Amazon.Lambda.Core` library\. The interface defines two methods: + `T Deserialize(Stream requestStream);` @@ -139,24 +100,47 @@ If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda You implement this method to serialize the result returned from the Lambda function handler into the response payload that is returned by the `Invoke` API\. -You use whichever serializer you wish by adding it as a dependency to your `MyProject.csproj` file\. + +To use serializer you need to add a dependency to your `csproj` file\. ``` -... - - + + + ``` -You then add it to your AssemblyInfo\.cs file\. For example, if you are using the default Json\.NET serializer, this is what you would add: +Next you need to define the serializer. For example you can define it in the AssemblyInfo\.cs file\. If you are using `Amazon.Lambda.Serialization.SystemTextJson`, the serializercan be defined that way: ``` -[assembly:LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] +[assembly: LambdaSerializer(typeof(DefaultLambdaJsonSerializer))] +``` + +Using `Amazon.Lambda.Serialization.Json`, it will be: + +``` +[assembly: LambdaSerializer(typeof(JsonSerializer))] ``` -**Note** -You can define a custom serialization attribute at the method level, which will override the default serializer specified at the assembly level\. For more information, see [Handling standard data types](#csharp-handler-types)\. +You can also define a custom serialization attribute at the method level, which will override the default serializer specified at the assembly level\. + +``` +public class ProductService{ + + [LambdaSerializer(typeof(JsonSerializer))] + public Product DescribeProduct(DescribeProductRequest request) + { + return catalogService.DescribeProduct(request.Id); + } + + [LambdaSerializer(typeof(MyJsonSerializer))] + public Customer DescribeCustomer(DescribeCustomerRequest request) + { + return customerService.DescribeCustomer(request.Id); + } +} +``` ## Lambda function handler restrictions @@ -216,4 +200,4 @@ If you use this pattern, there are some considerations you must take into accoun // Lambda may return before printing all tests since we're only waiting for one to finish. await Task.WhenAny(task1, task2, task3); } - ``` \ No newline at end of file + ``` From fed3290d83b61873ecae443a9cc2b876a6398b1e Mon Sep 17 00:00:00 2001 From: callezenwaka Date: Thu, 11 Nov 2021 11:06:22 +0100 Subject: [PATCH 83/94] Update typos in configuration-tags.md Update typos in configuration-tags.md --- doc_source/configuration-tags.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 1cd6d2af..e543d27a 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -43,7 +43,7 @@ You can filter functions based on the presence or value of a tag with the Lambda The search bar also supports searching for tag keys\. Type `tag` to see just a list of tag keys, or start typing the name of a key to find it in the list\. -With AWS Billing and Cost Management, you can use tags to customize billing reports and create cost\-allocation reports\. For more information, see see [Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. +With AWS Billing and Cost Management, you can use tags to customize billing reports and create cost\-allocation reports\. For more information, see [Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. ## Using Tags with the AWS CLI @@ -77,7 +77,7 @@ If you want to view the tags that are applied to a specific Lambda function, you ``` aws lambda list-tags --resource function arn ``` -+ [GetFunction](API_GetFunction.md) – You supply your Lambda function name to a view a list of the tags associated with this function: ++ [GetFunction](API_GetFunction.md) – You supply your Lambda function name to view a list of the tags associated with this function: ``` aws lambda get-function --function-name my-function @@ -93,4 +93,4 @@ The following requirements apply to tags: + Maximum value length—256 Unicode characters in UTF\-8 + Tag keys and values are case sensitive\. + Do not use the `aws:` prefix in your tag names or values because it is reserved for AWS use\. You can't edit or delete tag names or values with this prefix\. Tags with this prefix do not count against your tags per resource limit\. -+ If your tagging schema will be used across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. \ No newline at end of file ++ If your tagging schema will be used across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. From afca60967a1e1a56c6ee4b6d00131b9c0dbc3f9d Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 12 Nov 2021 23:57:06 +0000 Subject: [PATCH 84/94] periodic content update --- doc_source/API_CreateEventSourceMapping.md | 1 + doc_source/API_CreateFunction.md | 2 +- doc_source/API_Invoke.md | 3 +- doc_source/API_SourceAccessConfiguration.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 1 + doc_source/API_UpdateFunctionCode.md | 2 +- doc_source/configuration-envvars.md | 2 +- doc_source/configuration-filesystem.md | 96 ++++++----- doc_source/configuration-images.md | 51 +++++- doc_source/configuration-tags.md | 65 ++++++-- doc_source/configuration-versions.md | 7 +- doc_source/configuration-vpc.md | 21 ++- doc_source/csharp-image.md | 9 +- doc_source/csharp-package.md | 3 - doc_source/foundation-arch.md | 10 +- doc_source/foundation-networking.md | 106 ++++++++++++ doc_source/functions-states.md | 27 +-- doc_source/gettingstarted-images.md | 2 + doc_source/gettingstarted-limits.md | 5 +- doc_source/go-image.md | 4 +- doc_source/golang-package.md | 35 +++- doc_source/images-create.md | 2 +- doc_source/images-test.md | 4 +- doc_source/index.md | 3 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/invocation-layers.md | 133 +++++++++------ doc_source/java-image.md | 4 +- doc_source/lambda-api-permissions-ref.md | 2 +- doc_source/lambda-foundation.md | 1 + doc_source/lambda-golang.md | 3 + doc_source/lambda-java.md | 2 +- doc_source/lambda-nodejs.md | 6 +- doc_source/lambda-python.md | 8 +- doc_source/lambda-runtimes.md | 19 ++- doc_source/lambda-services.md | 4 +- doc_source/logging-using-cloudtrail.md | 35 ++-- doc_source/monitoring-code-profiler.md | 3 - doc_source/nodejs-image.md | 4 +- doc_source/provisioned-concurrency.md | 62 ++++--- doc_source/python-image.md | 8 +- doc_source/ruby-image.md | 4 +- doc_source/runtime-support-policy.md | 10 +- doc_source/runtimes-context.md | 3 + doc_source/runtimes-logs-api.md | 25 ++- doc_source/services-apigateway.md | 155 ++++++++++-------- .../services-cloudwatchevents-tutorial.md | 2 +- doc_source/services-s3-object-lambda.md | 6 +- doc_source/using-extensions.md | 2 +- doc_source/with-ddb.md | 2 +- doc_source/with-kafka.md | 34 +--- doc_source/with-kinesis.md | 2 +- doc_source/with-mq.md | 64 ++++---- doc_source/with-msk.md | 71 +++++++- doc_source/with-s3-tutorial.md | 2 +- doc_source/with-sqs.md | 2 +- 55 files changed, 760 insertions(+), 383 deletions(-) create mode 100644 doc_source/foundation-networking.md diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 66941c8f..1e63ae7f 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -84,6 +84,7 @@ The maximum number of records in each batch that Lambda pulls from your stream o + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. + **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. ++ **Amazon MQ \(ActiveMQ and RabbitMQ\)** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 0bfba5c1..b2cbf94b 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -86,7 +86,7 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. ** [ Architectures ](#API_CreateFunction_RequestSyntax) ** -The instruction set architecture that the function supports\. Enter a string array with one of the valid values\. The default value is `x86_64`\. +The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 2f449d7b..36f2c5ec 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -65,7 +65,8 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following binary data\. ** [ Payload ](#API_Invoke_RequestSyntax) ** -The JSON that you want to provide to your Lambda function as input\. +The JSON that you want to provide to your Lambda function as input\. +You can enter the JSON directly\. For example, `--payload '{ "key": "value" }'`\. You can also specify a file path\. For example, `--payload file://payload.json`\. ## Response Syntax diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 5b108d1c..88c9fcdb 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -12,7 +12,7 @@ The type of authentication protocol, VPC components, or virtual host for your ev + `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your self\-managed Apache Kafka brokers\. + `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your self\-managed Apache Kafka brokers\. + `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your self\-managed Apache Kafka brokers\. -+ `VIRTUAL_HOST` \- \(Amazon MQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. ++ `VIRTUAL_HOST` \- \(Amazon MQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. This property cannot be specified in an UpdateEventSourceMapping API call\. Type: String Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST` Required: No diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 09a0dcd3..260e96cd 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -78,6 +78,7 @@ The maximum number of records in each batch that Lambda pulls from your stream o + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. + **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. ++ **Amazon MQ \(ActiveMQ and RabbitMQ\)** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 1547566f..4d310a1b 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -47,7 +47,7 @@ Required: Yes The request accepts the following data in JSON format\. ** [ Architectures ](#API_UpdateFunctionCode_RequestSyntax) ** -The instruction set architecture that the function supports\. Enter a string array with one of the valid values\. The default value is `x86_64`\. +The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 9c9bcbff..4de65981 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -217,7 +217,7 @@ Lambda always provides server\-side encryption at rest with an AWS KMS key\. By If you prefer, you can provide an AWS KMS customer managed key instead\. You might do this to have control over rotation of the KMS key or to meet the requirements of your organization for managing KMS keys\. When you use a customer managed key, only users in your account with access to the KMS key can view or manage environment variables on the function\. -Customer managed keys incur standard AWS KMS charges\. For more information, see [AWS Key Management Service pricing](https://aws.amazon.com/kms/pricing/), in the *AWS KMS produt pages*\. +Customer managed keys incur standard AWS KMS charges\. For more information, see [AWS Key Management Service pricing](https://aws.amazon.com/kms/pricing/), in the *AWS KMS product pages*\. **Security in transit** For additional security, you can enable helpers for encryption in transit, which ensures that your environment variables are encrypted client\-side for protection in transit\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 9c510546..dfc08d2d 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -3,39 +3,27 @@ You can configure a function to mount an Amazon Elastic File System \(Amazon EFS\) file system to a local directory\. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency\. **Topics** -+ [Connecting to a file system \(console\)](#configuration-filesystem-config) -+ [Configuring a file system and access point](#configuration-filesystem-setup) + [Execution role and user permissions](#configuration-filesystem-permissions) ++ [Configuring a file system and access point](#configuration-filesystem-setup) ++ [Connecting to a file system \(console\)](#configuration-filesystem-config) + [Configuring file system access with the Lambda API](#configuration-filesystem-api) + [AWS CloudFormation and AWS SAM](#configuration-filesystem-cloudformation) + [Sample applications](#configuration-filesystem-samples) -## Connecting to a file system \(console\) - -A function connects to a file system over the local network in a VPC\. The subnets that your function connects to can be the same subnets that contain mount points for your file system, or subnets in the same Availability Zone that can route NFS traffic \(port 2049\) to the file system\. - -**Note** -If your function is not already connected to a VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. - -**To configure file system access** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. +## Execution role and user permissions -1. Choose **Configuration** and then choose **File systems**\. +Lambda uses your function's permissions to mount file systems\. To connect to a file system, your function's execution role must have the following permissions in addition to the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions): -1. Under **File system**, choose **Add file system**\. +**Execution role permissions** ++ **elasticfilesystem:ClientMount** ++ **elasticfilesystem:ClientWrite \(not required for read\-only connections\)** -1. Configure the following properties: - + **EFS file system** – The access point for a file system in the same VPC\. - + **Local mount path** – The location where the file system is mounted on the Lambda function, starting with `/mnt/`\. +These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. -**Pricing** -Amazon EFS charges for storage and throughput, with rates that vary by storage class\. For details, see [Amazon EFS pricing](https://aws.amazon.com/efs/pricing)\. -Lambda charges for data transfer between VPCs\. This only applies if your function's VPC is peered to another VPC with a file system\. The rates are the same as for Amazon EC2 data transfer between VPCs in the same Region\. For details, see [Lambda pricing](https://aws.amazon.com/lambda/pricing)\. +When you configure a file system, Lambda uses your permissions to verify mount targets\. To configure a function to connect to a file system, your IAM user needs the following permissions: -For more information about Lambda's integration with Amazon EFS, see [Using Amazon EFS with Lambda](services-efs.md)\. +**User permissions** ++ **elasticfilesystem:DescribeMountTargets** ## Configuring a file system and access point @@ -61,20 +49,32 @@ For more information, see the following topics in the *Amazon Elastic File Syste + [Creating resources for Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/creating-using.html) + [Working with users, groups, and permissions](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs-nfs-permissions.html) -## Execution role and user permissions +## Connecting to a file system \(console\) -Lambda uses your function's permissions to mount file systems\. To connect to a file system, your function's execution role must have the following permissions in addition to the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions): +A function connects to a file system over the local network in a VPC\. The subnets that your function connects to can be the same subnets that contain mount points for your file system, or subnets in the same Availability Zone that can route NFS traffic \(port 2049\) to the file system\. -**Execution role permissions** -+ **elasticfilesystem:ClientMount** -+ **elasticfilesystem:ClientWrite \(not required for read\-only connections\)** +**Note** +If your function is not already connected to a VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. -These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. +**To configure file system access** -When you configure a file system, Lambda uses your permissions to verify mount targets\. To configure a function to connect to a file system, your IAM user needs the following permissions: +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -**User permissions** -+ **elasticfilesystem:DescribeMountTargets** +1. Choose a function\. + +1. Choose **Configuration** and then choose **File systems**\. + +1. Under **File system**, choose **Add file system**\. + +1. Configure the following properties: + + **EFS file system** – The access point for a file system in the same VPC\. + + **Local mount path** – The location where the file system is mounted on the Lambda function, starting with `/mnt/`\. + +**Pricing** +Amazon EFS charges for storage and throughput, with rates that vary by storage class\. For details, see [Amazon EFS pricing](https://aws.amazon.com/efs/pricing)\. +Lambda charges for data transfer between VPCs\. This only applies if your function's VPC is peered to another VPC with a file system\. The rates are the same as for Amazon EC2 data transfer between VPCs in the same Region\. For details, see [Lambda pricing](https://aws.amazon.com/lambda/pricing)\. + +For more information about Lambda's integration with Amazon EFS, see [Using Amazon EFS with Lambda](services-efs.md)\. ## Configuring file system access with the Lambda API @@ -130,6 +130,7 @@ You can use AWS CloudFormation and the AWS Serverless Application Model \(AWS SA **Example template\.yml – File system configuration** ``` +Transform: AWS::Serverless-2016-10-31 Resources: VPC: Type: AWS::EC2::VPC @@ -141,20 +142,33 @@ Resources: VpcId: Ref: VPC CidrBlock: 10.0.1.0/24 - AvailabilityZone: "eu-central-1a" + AvailabilityZone: "us-west-2a" EfsSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: VpcId: Ref: VPC GroupDescription: "mnt target sg" - SecurityGroupEgress: + SecurityGroupIngress: - IpProtocol: -1 CidrIp: "0.0.0.0/0" FileSystem: Type: AWS::EFS::FileSystem Properties: PerformanceMode: generalPurpose + AccessPoint: + Type: AWS::EFS::AccessPoint + Properties: + FileSystemId: + Ref: FileSystem + PosixUser: + Uid: "1001" + Gid: "1001" + RootDirectory: + CreationInfo: + OwnerGid: "1001" + OwnerUid: "1001" + Permissions: "755" MountTarget1: Type: AWS::EFS::MountTarget Properties: @@ -167,11 +181,17 @@ Resources: MyFunctionWithEfs: Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: - CodeUri: function/. - Description: Use a file system. + Handler: index.handler + Runtime: python3.9 + VpcConfig: + SecurityGroupIds: + - Ref: EfsSecurityGroup + SubnetIds: + - Ref: Subnet1 FileSystemConfigs: - - Arn: "arn:aws:elasticfilesystem:eu-central-1:123456789101:access-point/fsap-015cxmplb72b405fd" - LocalMountPath: "/mnt/efs0" + - Arn: !GetAtt AccessPoint.Arn + LocalMountPath: "/mnt/efs" + Description: Use a file system. DependsOn: "MountTarget1" ``` diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index e0159494..f5ffb645 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -37,7 +37,7 @@ When you deploy code as a container image to a Lambda function, the image underg ## Amazon ECR permissions -For your function to access the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minimum policy: +For a function in the same account as the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minimum policy: ``` { @@ -59,6 +59,53 @@ If the Amazon ECR repository does not include these permissions, Lambda adds `ec To view or edit your Amazon ECR repository permissions, follow the directions in [Setting a repository policy statement](https://docs.aws.amazon.com/AmazonECR/latest/userguide/set-repository-policy.html) in the *Amazon Elastic Container Registry User Guide*\. +### Amazon ECR cross\-account permissions + +A different account in the same region can create a function that uses a container image owned by your account\. In the following example, your Amazon ECR repository permissions policy needs the following statements to grant access to account number 123456789012\. ++ **CrossAccountPermission** – Allows account 123456789012 to create and update Lambda functions that use images from this ECR repository\. ++ **LambdaECRImageCrossAccountRetrievalPolicy** – Lambda will eventually set a function's state to inactive if it is not invoked for an extended period\. This statement is required so that Lambda can retrieve the container image for optimization and caching on behalf of the function owned by 123456789012\. + +**Example Add cross\-account permission to your repository** + +``` +{"Version": "2012-10-17", + "Statement": [ + { + "Sid": "CrossAccountPermission", + "Effect": "Allow", + "Action": [ + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ], + "Principal": { + "AWS": "arn:aws:iam::123456789012:root" + } + }, + { + "Sid": "LambdaECRImageCrossAccountRetrievalPolicy", + "Effect": "Allow", + "Action": [ + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ], + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Condition": { + "StringLike": { + "aws:sourceARN": + "arn:aws:lambda:us-east-1:123456789012:function:*" + } + } + } + ] +} +``` + +To give access to multiple accounts, you add the account IDs to the Principal list in the `CrossAccountPermission` policy and to the Condition evaluation list in the `LambdaECRImageCrossAccountRetrievalPolicy`\. + +If you are working with multiple accounts in an AWS Organization, we recommend that you enumerate each account ID in the ECR permissions policy\. This approach aligns with the AWS security best practice of setting narrow permissions in IAM policies\. + ## Override the container settings You can use the Lambda console or the Lambda API to override the following container image settings: @@ -163,7 +210,7 @@ To create a function defined as container image, use the `create-function` comma When you create the function, you can specify the instruction set architecture\. The default architecture is `x86-64`\. Make sure that the code in your container image is compatible with the architecture\. - Note that you must create the function from the same account as the container registry in Amazon ECR\. + You can create the function from the same account as the container registry or from a different account in the same region as the container registry in Amazon ECR\. For cross\-account access, adjust the [Amazon ECR permissions](#configuration-images-xaccount-permissions) for the image\. ``` aws lambda create-function --region sa-east-1 --function-name my-function \ diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 1cd6d2af..feec12c4 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -1,16 +1,25 @@ -# Tagging Lambda Functions +# Using tags on AWS Lambda functions You can tag Lambda functions to organize them by owner, project or department\. Tags are freeform key\-value pairs that are supported across AWS services for use in filtering resources and adding detail to billing reports\. **Topics** -+ [Adding tags to a function \(console\)](#configuration-tags-config) -+ [Using tags to filter functions \(console\)](#configuration-tags-filter) -+ [Using Tags with the AWS CLI](#configuration-tags-cli) -+ [Tag Key and Value Requirements](#configuration-tags-restrictions) ++ [Using tags with the Lambda console](#using-tags-with-the-console) ++ [Using tags with the AWS Command Line Interface](#configuration-tags-cli) ++ [Requirements for tags](#configuration-tags-restrictions) -## Adding tags to a function \(console\) +## Using tags with the Lambda console -**To add tags to a function** +You can use the console to add tags to existing functions and to filter functions by the tags that you add\. + +### Adding tags to a function + +**To add tags to a function \(console\)** + +1. Grant appropriate permissions to the IAM identity \(user, group, or role\) for the person working with the function: + + **lambda:ListTags**—When a function has tags, grant this permission to anyone who needs to view the function\. + + **lambda:TagResource**—Grant this permission to anyone who needs to add tags to a function\. + + For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -20,16 +29,24 @@ You can tag Lambda functions to organize them by owner, project or department\. 1. Under **Tags**, choose **Manage tags**\. -1. Enter a key and value\. To add additional tags, choose **Add new tag**\. +1. Enter a key and value\. To add additional tags, choose **Add new tag**\. + + Make sure that any tags you use conform to the [tag requirements](#configuration-tags-restrictions)\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-add.png) 1. Choose **Save**\. -## Using tags to filter functions \(console\) +### Filtering functions by tag + +You can filter functions based on the presence or value of a tag with the Lambda console or with the AWS Resource Groups API\. -You can filter functions based on the presence or value of a tag with the Lambda console or with the AWS Resource Groups API\. Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that is snapshotted when you publish a version\. +Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that is snapshotted when you publish a version\. -**To filter functions with tags** +**To filter functions with tags \(console\)** + +1. Make sure that you have the permissions you need: + + lambda:ListTags grants permission to view functions that have tags\. + + lambda:TagResource grants permission to add tags to a function\. 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -45,7 +62,21 @@ The search bar also supports searching for tag keys\. Type `tag` to see just a l With AWS Billing and Cost Management, you can use tags to customize billing reports and create cost\-allocation reports\. For more information, see see [Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. -## Using Tags with the AWS CLI +## Using tags with the AWS Command Line Interface + +You can use the console to create functions that have tags, add tags to existing functions, and to filter functions by the tags that you add\. + +### Permissions required for working with tags + +Grant appropriate permissions to the IAM identity \(user, group, or role\) for the person working with the function: ++ **lambda:ListTags**—When a function has tags, grant this permission to anyone who needs to call `GetFunction` or `ListTags` on it\. ++ **lambda:TagResource**—Grant this permission to anyone who needs to call `CreateFunction` or `TagResource`\. + +For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. + +### Creating tags when you create a function + +Make sure that any tags you use conform to the [tag requirements](#configuration-tags-restrictions)\. When you create a new Lambda function, you can include tags with the `--tags` option\. @@ -71,6 +102,8 @@ aws lambda untag-resource --resource function arn \ --tag-keys Department ``` +### Viewing tags on a function + If you want to view the tags that are applied to a specific Lambda function, you can use either of the following Lambda API commands: + [ListTags](API_ListTags.md) – You supply your Lambda function ARN \(Amazon Resource Name\) to view a list of the tags associated with this function: @@ -83,9 +116,13 @@ If you want to view the tags that are applied to a specific Lambda function, you aws lambda get-function --function-name my-function ``` -You can also use the AWS Tagging Service’s [GetResources](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) API to filter your resources by tags\. The GetResources API receives up to 10 filters, with each filter containing a tag key and up to 10 tag values\. You provide GetResources with a ‘ResourceType’ to filter by specific resource types\. For more information about the AWS Tagging Service, see [Working with Resource Groups](https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/resource-groups.html)\. +#### Filtering functions by tag + +You can use the AWS Resource Groups Tagging API [GetResources](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) action to filter your resources by tags\. The GetResources API receives up to 10 filters, with each filter containing a tag key and up to 10 tag values\. You provide GetResources with a ‘ResourceType’ to filter by specific resource types\. + +For more information about the AWS Resource Groups service, see [What are resource groups?](https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html) in the *AWS Resource Groups and Tags User Guide*\. -## Tag Key and Value Requirements +## Requirements for tags The following requirements apply to tags: + Maximum number of tags per resource—50 diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index d0890f5a..e8b3b26e 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -2,10 +2,13 @@ You can use versions to manage the deployment of your functions\. For example, you can publish a new version of a function for beta testing without affecting users of the stable production version\. Lambda creates a new version of your function each time that you publish the function\. The new version is a copy of the unpublished version of the function\. +**Note** +Lambda doesn't create a new version if the code in the unpublished version is the same as the previous published version\. You need to deploy code changes in $LATEST before you can create a new version\. + A function version includes the following information: + The function code and all associated dependencies\. + The Lambda runtime that invokes the function\. -+ All of the function settings, including the environment variables\. ++ All the function settings, including the environment variables\. + A unique Amazon Resource Name \(ARN\) to identify the specific version of the function\. **Topics** @@ -16,7 +19,7 @@ A function version includes the following information: ## Creating function versions -You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring Lambda function options](configuration-function-common.md)\. +You can change the function code and settings only on the unpublished version of a function\. When you publish a version, Lambda locks the code and most of the settings to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring Lambda function options](configuration-function-common.md)\. You can create a function version using the Lambda console\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index bb9b45ed..de3d4e65 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -2,17 +2,14 @@ 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 while the function is running\. -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 subnet in your function's VPC configuration\. This process can take several minutes\. +When you connect a function to a VPC, Lambda assigns your function to a Hyperplane ENI \(elastic network interface\) for each subnet in your function's VPC configuration\. Lambda creates a Hyperplane ENI the first time a unique subnet and security group combination is defined for a VPC\-enabled function in an account\. -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 [Lambda function states](functions-states.md)\. - -Multiple functions can share a network interface, if the functions share the same subnet and security group\. Connecting additional functions to the same VPC configuration \(subnet and security group\) 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\. +While Lambda creates a Hyperplane ENI, 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 details about the Hyperplane ENI lifecycle, see [Lambda Hyperplane ENIs](foundation-networking.md#foundation-nw-eni)\. 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/)\. **Topics** ++ [Managing VPC connections](#vpc-managing-eni) + [Execution role and user permissions](#vpc-permissions) + [Configuring VPC access \(console\)](#vpc-configuring) + [Configuring VPC access \(API\)](#vpc-configuring-api) @@ -21,6 +18,18 @@ Lambda functions can't connect directly to a VPC with [ dedicated instance tenan + [VPC tutorials](#vpc-tutorials) + [Sample VPC configurations](#vpc-samples) +## Managing VPC connections + +This section provides a summary of Lambda VPC connections\. For details about VPC networking in Lambda, see [ VPC networking for Lambda](foundation-networking.md)\. + +Multiple functions can share a network interface, if the functions share the same subnet and security group\. Connecting additional functions to the same VPC configuration \(subnet and security group\) that has an existing Lambda\-managed network interface is much quicker than creating a new network interface\. + +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\. + +If you update your function to access a different VPC, it terminates connectivity from the Hyperplane ENI to the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, Lambda connects funtion invocations to the previous VPC\. After the update is complete, new invocations start using the the new VPC and the Lambda function is no longer connected to the older VPC\. + +For short\-lived operations, such as DynamoDB queries, the latency overhead of setting up a TCP connection might be greater than the operation itself\. To ensure connection reuse for short\-lived/infrequently invoked functions, we recommend that you use *TCP keep\-alive* for connections that were created during your function initialization, to avoid creating new connections for subsequent invokes\. For more information on reusing connections using keep\-alive, refer to [Lambda documentation on reusing connections](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)[\.](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html) + ## Execution role and user permissions Lambda uses your function's permissions to create and manage network interfaces\. To connect to a VPC, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 4a8b6105..9ca53129 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -2,21 +2,18 @@ You can deploy your Lambda function code as a [container image](images-create.md)\. -**Note** -Lambda does not support arm64 architecture for \.NET runtimes\. - AWS provides the following resources to help you build a container image for your \.NET function: + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: @@ -39,7 +36,7 @@ AWS provides the following base images for \.NET: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/master/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | +| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet5.0/Dockerfile.dotnet5.0) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | | core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md index b616ac68..cf47126e 100644 --- a/doc_source/csharp-package.md +++ b/doc_source/csharp-package.md @@ -4,9 +4,6 @@ A \.NET Core deployment package \(\.zip file archive\) contains your function's Although it is possible to create the deployment package with the `dotnet publish` command, we recommend that you create the deployment package with either the [\.NET Core CLI](csharp-package-cli.md) or the [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)\. These are tools optimized specifically for Lambda to ensure that the `lambda-project.runtimeconfig.json` file exists and optimizes the package bundle, including the removal of any non\-Linux\-based dependencies\. -**Note** -Lambda does not support arm64 architecture for \.NET runtimes\. - **Topics** + [\.NET Core CLI](csharp-package-cli.md) + [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) \ No newline at end of file diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md index 42d7fc33..5e278770 100644 --- a/doc_source/foundation-arch.md +++ b/doc_source/foundation-arch.md @@ -4,6 +4,13 @@ + arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. + x86\_64 – 64\-bit x86 architecture, for x86\-based processors\. +**Topics** ++ [Advantages of using arm64 architecture](#foundation-arch-adv) ++ [Function migration to arm64 architecture](#foundation-arch-consider) ++ [Function code compatibility with arm64 architecture](#foundation-arch-considerations) ++ [Suggested migration steps](#foundation-arch-steps) ++ [Configuring the instruction set architecture](#foundation-arch-adv) + ## Advantages of using arm64 architecture Lambda functions that use arm64 architecture \(AWS Graviton2 processor\) can achieve significantly better price and performance than the equivalent function running on x86\_64 architecture\. Consider using arm64 for compute\-intensive applications such as high\-performance computing, video encoding, and simulation workloads\. @@ -71,6 +78,7 @@ Lambda provides the following runtimes for the arm64 architecture\. These runtim + Ruby 2\.7 + Custom Runtime on Amazon Linux 2 -Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 instruction set architecture\. You can use the custom runtime \(provided\.al2\) to run Go functions with arm64 architecture\. +**Note** +Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. For example, see [Build a Go function for the provided\.al2 runtime](golang-package.md#golang-package-al2) or [Create a Go image from the provided\.al2 base image](go-image.md#go-image-al2)\. For an example of how to create a function with arm64 architecture, see [ AWS Lambda Functions Powered by AWS Graviton2 Processor](http://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)\. \ No newline at end of file diff --git a/doc_source/foundation-networking.md b/doc_source/foundation-networking.md new file mode 100644 index 00000000..be157636 --- /dev/null +++ b/doc_source/foundation-networking.md @@ -0,0 +1,106 @@ +# VPC networking for Lambda + +Amazon Virtual Private Cloud \(Amazon VPC\) is a virtual network in the AWS cloud, dedicated to your AWS account\. You can use Amazon VPC to create a private network for resources such as databases, cache instances, or internal services\. For more information about Amazon VPC, see [What is Amazon VPC?](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) + +A Lambda function always runs inside a VPC owned by the Lambda service\. Lambda applies network access and security rules to this VPC and Lambda maintains and monitors the VPC automatically\. If your Lambda function needs to access the resources in your account VPC, [ configure the function to access the VPC](configuration-vpc.md)\. Lambda provides managed resources named Hyperplane ENIs, which your Lambda function uses to connect from the Lambda VPC to an ENI \(Elastic network interface\) in your account VPC\. + +There's no additional charge for using a VPC or a Hyperplane ENI\. There are charges for some VPC components, such as NAT gateways\. For more information, see [Amazon VPC Pricing](http://aws.amazon.com/vpc/pricing)\. + +**Topics** ++ [VPC network elements](#foundation-nw-concepts) ++ [Connecting Lambda functions to your VPC](#foundation-nw-connecting) ++ [Lambda Hyperplane ENIs](#foundation-nw-eni) ++ [Connections](#foundation-nw-addressing) ++ [Security](#foundation-nw-security) ++ [Observability](#foundation-nw-obs) + +## VPC network elements + +Amazon VPC networks includes the following network elements: ++ Elastic network interface – [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) is a logical networking component in a VPC that represents a virtual network card\. ++ Subnet – A range of IP addresses in your VPC\. You can add AWS resources to a specified subnet\. Use a public subnet for resources that must connect to the internet, and a private subnet for resources that don't connect to the internet\. ++ Security group – use security groups to control access to the AWS resources in each subnet\. ++ Access control list \(ACL\) – use a network ACL to provide additional security in a subnet\. The default subnet ACL allows all inbound and outbound traffic\. ++ Route table – contains a set of routes that AWS uses to direct the network traffic for your VPC\. You can explicitly associate a subnet with a particular route table\. By default, the subnet is associated with the main route table\. ++ Route – each route in a route table specifies a range of IP addresses and the destination where Lambda sends the traffic for that range\. The route also specifies a target, which is the gateway, network interface, or connection through which to send the traffic\. ++ NAT gateway – An AWS Network Address Translation \(NAT\) service that controls access from a private VPC private subnet to the Internet\. ++ VPC endpoints – You can use an Amazon VPC endpoint to create private connectivity to services hosted in AWS, without requiring access over the internet or through a NAT device, VPN connection, or AWS Direct Connect connection\. For more information, see [AWS PrivateLink and VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-services-overview.html)\. + +For more information about Amazon VPC networking definitions, see [ How Amazon VPC works](https://docs.aws.amazon.com/vpc/latest/userguide/how-it-works.html) in the Amazon VPC Developer Guide and the [Amazon VPC FAQs\.](http://aws.amazon.com/vpc/faqs.html) + +## Connecting Lambda functions to your VPC + +By default, Lambda runs your functions in a secure VPC\. Lambda owns this VPC, which isn't connected to your account's [default VPC](https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html)\. When you connect a function to a VPC in your account, the function can't access the internet unless your VPC provides access\. + +Lambda accesses resources in your VPC using a Hyperplane ENI\. Hyperplane ENIs provide NAT capabilities from the Lambda VPC to your account VPC using VPC\-to\-VPC NAT \(V2N\)\. V2N provides connectivity from the Lambda VPC to your account VPC, but not in the other direction\. + +When you create a Lambda function \(or update its VPC settings\), Lambda allocates a Hyperplane ENI for each subnet in your function's VPC configuration\. Multiple Lambda functions can share a network interface, if the functions share the same subnet and security group\. + +To connect to another AWS service, you can use [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) for private communications between your VPC and supported AWS services\. An alternative approach is to use a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) to route outbound traffic to another AWS service\. + +To give your function access to the internet, route outbound traffic to a NAT gateway in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. + +For information about how to configure Lambda VPC networking, see [Lambda networking](configuration-vpc.md)\. + +## Lambda Hyperplane ENIs + +The Hyperplane ENI is a managed network resource that the Lambda service creates and manages\. Multiple execution environments in the Lambda VPC can use a Hyperplane ENI to securely access resources inside of VPCs in your account\. Hyperplane ENIs provide NAT capabilities from the Lambda VPC to your account VPC\. For more information about Hyperplane ENIs, see [Improved VPC networking for AWS Lambda functions ](http://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/) in the AWS compute blog\. + +Each unique security group and subnet combination in your account requires a different network interface\. Functions in the account that share the same security group and subnet combination use the same network interfaces\. + +Because the functions in your account share the ENI resources, the ENI lifecycle is more complex than other Lambda resources\. The following sections describe the ENI lifecycle\. + +**Topics** ++ [Creating ENIs](#foundation-nw-eni-create) ++ [Managing ENIs](#foundation-nw-eni-man) ++ [Deleting ENIs](#foundation-nw-eni-delete) + +### Creating ENIs + +Lambda may create Hyperplane ENI resources for a newly created VPC\-enabled function or for a VPC configuration change to an existing function\. The function remains in pending state while Lambda creates the required resources\. When the Hyperplane ENI is ready, the function transitions to active state and the ENI becomes available for use\. Lambda can require several minutes to create a Hyperplane ENI\. + +For a newly created VPC\-enabled function, any invocations or other API actions that operate on the function fail until the function state transitions to active\. + +For a VPC configuration change to an existing function, any function invocations continue to use the Hyperplane ENI associated with the old subnet and security group configuration until the function state transitions to active\. + +If a Lambda function remains idle for consecutive weeks, Lambda reclaims the unused Hyperplane ENIs and sets the function state to idle\. The next invocation causes Lambda to reactivate the idle function\. The invocation fails, and the function enters pending state until Lambda completes the creation or allocation of a Hyperplane ENI\. + +For more information about function states, see [Lambda function states](functions-states.md)\. + +### Managing ENIs + +Lambda uses permissions in your function's execution role to create and manage network interfaces\. Lambda creates a Hyperplane ENI when you define a unique subnet plus security group combination for a VPC\-enabled function in an account\. Lambda reuses the Hyperplane ENI for other VPC\-enabled functions in your account that use the same subnet and security group combination\. + +There is no quota on the number of Lambda functions that can use the same Hyperplane ENI\. However, each Hyperplane ENI supports up to 65,000 connections/ports\. If the number of connections exceeds 65,000, Lambda creates a new Hyperplane ENI to provide additional connections\. + +When you update your function configuration to access a different VPC, Lambda terminates connectivity to the Hyperplane ENI in the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, invocations to the function continue to use the previous VPC\. After the update is complete, new invocations start using the Hyperplane ENI in the new VPC\. At this point, the Lambda function is no longer connected to the previous VPC\. + +### Deleting ENIs + +When you update a function to remove its VPC configuration, Lambda requires up to 20 minutes to delete the attached Hyperplane ENI\. Lambda only deletes the ENI if no other function \(or published function version\) is using that Hyperplane ENI\. + +Lambda relies on permissions in the function [ execution role](lambda-intro-execution-role.md) to delete the Hyperplane ENI\. If you delete the execution role before Lambda deletes the Hyperplane ENI, Lambda won't be able to delete the Hyperplane ENI\. You can manually perform the deletion\. + +Lambda doesn't delete network interfaces that are in use by functions or function versions in your account\. You can use the [Lambda ENI Finder](https://github.com/awslabs/aws-support-tools/tree/master/Lambda/FindEniMappings) to identify the functions or function versions that are using a Hyperplane ENI\. For any functions or function versions that you no longer need, you can remove the VPC configuration so that Lambda deletes the Hyperplane ENI\. + +## Connections + +Lambda supports two types of connections: TCP \(Transmission Control Protocol\) and UDP \(User Datagram Protocol\)\. + +When you create a VPC, Lambda automatically creates a set of DHCP options and associates them with the VPC\. You can configure your own DHCP options set for your VPC\. For more details, refer to [Amazon VPC DHCP options](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)\. + +Amazon provides a DNS server \(the Amazon Route 53 resolver\) for your VPC\. For more information, see [DNS support for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html)\. + +## Security + +AWS provides [https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) and [https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html) to increase security in your VPC\. Security groups control inbound and outbound traffic for your instances, and network ACLs control inbound and outbound traffic for your subnets\. Security groups provide enough access control for most subnets\. You can use network ACLs if you want an additional layer of security for your VPC\. For more information, see [Internetwork traffic privacy in Amazon VPC](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Security.html)\. Every subnet that you create is automatically associated with the VPC's default network ACL\. You can change the association, and you can change the contents of the default network ACL\. + +For general security best practices, see [VPC security best practices](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-best-practices.html)\. For details on how you can use IAM to manage access to the Lambda API and resources, see [AWS Lambda permissions](lambda-permissions.md)\. + +You can use Lambda\-specific condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For more information about VPC condition keys, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. + +## Observability + +You can use [VPC Flow Logs](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html) to capture information about the IP traffic going to and from network interfaces in your VPC\. You can publish Flow log data to Amazon CloudWatch Logs or Amazon S3\. After you've created a flow log, you can retrieve and view its data in the chosen destination\. + +Note: when you attach a function to a VPC, the CloudWatch log messages do not use the VPC routes\. Lambda sends them using the regular routing for logs\. \ No newline at end of file diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index a79655f9..aec7996c 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -1,37 +1,24 @@ # Lambda function states -When you create or update a function, AWS Lambda provisions the compute and networking resources that enable it to run\. In most cases your function is ready to be invoked or modified after a few seconds\. However, there are situations where this action can take longer, for example, configuring your function to connect to a virtual private cloud \(VPC\)\. This may lead to situations where invocation of your function fails due to resources not being available\. To indicate when your function is ready to invoke, Lambda includes a state field in the function configuration for all functions\. `State` provides information about the current status of the function, including whether you can successfully invoke the function\. - -Function states do not change the behavior of function invocations or how your function runs the code\. Function states include: +Lambda includes a state field in the function configuration for all functions to indicate when your function is ready to invoke\. `State` provides information about the current status of the function, including whether you can successfully invoke the function\. Function states do not change the behavior of function invocations or how your function runs the code\. Function states include: + `Pending` – After Lambda creates the function, it sets the state to pending\. While in pending state, Lambda attempts to create or configure resources for the function, such as VPC or EFS resources\. Lambda does not invoke a function during pending state\. Any invocations or other API actions that operate on the function will fail\. + `Active` – Your function transitions to active state after Lambda completes resource configuration and provisioning\. Functions can only be successfully invoked while active\. + `Failed` – Indicates that resource configuration or provisioning encountered an error\. + `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -Check a function's state before invocation to verify that it is active\. You can do this using the Lambda API action [GetFunctionConfiguration](API_GetFunctionConfiguration.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. - -To view the function's state with the AWS CLI, use `get-function-configuration`\. +If you are utilzing SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. ``` -aws lambda get-function-configuration --function-name my-function +aws lambda get-function --function-name my-function --query 'Configuration.[State, LastUpdateStatus]' ``` You should see the following output: ``` -{ - "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", - ... -} +[ + "Active", + "Successful" +] ``` Functions have two other attributes, `StateReason` and `StateReasonCode`\. These provide information and context about the function’s state when it is not active for troubleshooting issues\. diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md index fbf47dbd..d185ab0a 100644 --- a/doc_source/gettingstarted-images.md +++ b/doc_source/gettingstarted-images.md @@ -88,6 +88,8 @@ In the following commands, replace `123456789012` with your AWS account ID\. ## Upload the image to the Amazon ECR repository +In the following commands, replace `123456789012` with your AWS account ID\. + 1. Authenticate the Docker CLI to your Amazon ECR registry\. ``` diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index f19a906e..1cf0c322 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -4,11 +4,14 @@ Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per AWS Region and can be increased\. For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*\. +**Note** +New AWS accounts might start out with limits that are lower than these defaults\. Lambda monitors usage and raises your limits automatically based on your usage\. + | Resource | Default quota | Can be increased up to | | --- | --- | --- | | Concurrent executions | 1,000 | Tens of thousands | -| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | +| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. For best practices on managing your code storage, see [Monitoring Lambda code storage](https://docs.aws.amazon.com/lambda/latest/operatorguide/code-storage.html) in the *Lambda Operator Guide*\. | 75 GB | Terabytes | | Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | diff --git a/doc_source/go-image.md b/doc_source/go-image.md index d1cb58d3..28da6942 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -5,13 +5,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index c9ae5298..bca5bf0f 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -10,6 +10,7 @@ This page describes how to create a \.zip file as your deployment package for th + [Sample applications](#golang-package-sample) + [Creating a \.zip file on macOS and Linux](#golang-package-mac-linux) + [Creating a \.zip file on Windows](#golang-package-windows) ++ [Build Go with the provided\.al2 runtime](#golang-package-al2) ## Prerequisites @@ -116,4 +117,36 @@ If you have not already done so, you must install [git](https://git-scm.com/) an ~\Go\Bin\build-lambda-zip.exe -output main.zip main ``` ------- \ No newline at end of file +------ + +## Build Go with the provided\.al2 runtime + +Go is implemented differently than other native runtimes\. Lambda treats Go as a custom runtime, so you can create a Go function on the provided\.al2 runtime\. You can use the AWS SAM build command to build the \.zip file package\. + +**Using AWS SAM to build Go for AL2 function** + +1. Update the AWS SAM template to use the provided\.al2 runtime\. Also set the BuildMethod to makefile\. + + ``` + Resources: + HelloWorldFunction: + Type: AWS::Serverless::Function + Properties: + CodeUri: hello-world/ + Handler: my.bootstrap.file + Runtime: provided.al2 + Architectures: [arm64] + Metadata: + BuildMethod: makefile + ``` + + Remove the `Architectures` property to build the package for the x86\_64 instruction set architecture\. + +1. Add file makefile to the project folder, with the following contents: + + ``` + GOOS=linux go build -o bootstrap + cp ./bootstrap $(ARTIFACTS_DIR)/. + ``` + +For an example application, download [ Go on AL2](https://github.com/aws-samples/sessions-with-aws-sam/tree/master/go-al2)\. The readme file contains the instructions to build and run the application\. You can also view the blog post [ Migrating AWS Lambda functions to Amazon Linux 2](https://github.com/aws-samples/sessions-with-aws-sam/tree/master/go-al2)\. \ No newline at end of file diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 98a267a9..2c5c7ce2 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -1,6 +1,6 @@ # Creating Lambda container images -You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. Note that you must create the Lambda function from the same account as the container registry in Amazon ECR\. +You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. AWS provides a set of open\-source [base images](runtimes-images.md#runtimes-images-lp) that you can use to create your container image\. These base images include a [runtime interface client](runtimes-images.md#runtimes-api-client) to manage the interaction between Lambda and your function code\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 3cf4ccd3..0dad96f2 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -100,8 +100,8 @@ You can build RIE into a base image\. The following steps show how to download t ``` 1. Download the runtime interface emulator for your target architecture from GitHub into your project directory\. Lambda provides an emulator for each of the instruction set architectures\. - + x86\_64 – Download [aws\-lambda\-rie](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/aws-lambda-rie) - + arm64 – Download [aws\-lambda\-rie\-arm64](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/aws-lambda-rie-arm64) + + x86\_64 – Download [aws\-lambda\-rie](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) + + arm64 – Download [aws\-lambda\-rie\-arm64](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64) 1. Copy the script, install the emulator package, and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile\. diff --git a/doc_source/index.md b/doc_source/index.md index b74e136a..8c8ead85 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -24,6 +24,7 @@ Amazon's trademarks and trade dress may not be used in + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) + [Lambda instruction set architectures](foundation-arch.md) + + [VPC networking for Lambda](foundation-networking.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + [Lambda console](foundation-console.md) @@ -50,7 +51,7 @@ Amazon's trademarks and trade dress may not be used in + [Configuring database access for a Lambda function](configuration-database.md) + [Configuring file system access for Lambda functions](configuration-filesystem.md) + [Configuring code signing for AWS Lambda](configuration-codesigning.md) - + [Tagging Lambda Functions](configuration-tags.md) + + [Using tags on AWS Lambda functions](configuration-tags.md) + [Using layers with your Lambda function](invocation-layers.md) + [Invoking AWS Lambda functions](lambda-invocation.md) + [Synchronous invocation](invocation-sync.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index d6bddbb5..854d36dd 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -14,7 +14,7 @@ An event source mapping uses permissions in the function's [execution role](lamb To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md index a7cda28c..fdafb450 100644 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -5,44 +5,79 @@ A Lambda layer is a \.zip file archive that can contain additional code or other You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For a function [defined as a container image](lambda-images.md), you can package your preferred runtime and all code dependencies when you create the container image\. For more information, see [ Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. **Topics** -+ [Configuring a function to use layers](#invocation-layers-using) -+ [Accessing the contents of a layer](#invocation-layers-accessing) ++ [Configuring functions to use layers](#invocation-layers-using) ++ [Accessing layer content from your function](#invocation-layers-accessing) + [Finding layer information](#configuration-layers-finding) -+ [Updating a layer version that your function uses](#invocation-layers-script) + [Adding layer permissions](#invocation-layers-permissions) + [Using AWS SAM to add a layer to a function](#invocation-layers-cloudformation) + [Sample applications](#invocation-layers-samples) -## Configuring a function to use layers +## Configuring functions to use layers -A Lambda function can use up to five layers at a time\. The total unzipped size of the function and all layers cannot exceed the unzipped deployment package size quota of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. +You can add up to five layers to a Lambda function\. The total unzipped size of the function and all layers cannot exceed the unzipped deployment package size quota of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. If your functions consume a layer that a different AWS account publishes, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function that uses a deleted layer version\. **Note** Make sure that the layers that you add to a function are compatible with the runtime and instruction set architecture of the function\. -Console +### Configuring layers with the console -**Configuring a function to use layers \(Console\)** +**Adding a layer to a function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Choose the function to configure\. + 1. Under **Layers**, choose **Add a layer** -1. Under **Add layer**, choose a layer source\. +1. Under **Choose a layer**, choose a layer source\. 1. For the **AWS layers** or **Custom layers** layer source: 1. Choose a layer from the pull\-down menu\. - 1. Choose a layer version from the pull\-down menu\. Each layer version entry lists its compatible runtimes and architectures\. + 1. Under **Version**, choose a layer version from the pull\-down menu\. Each layer version entry lists its compatible runtimes and architectures\. + + 1. Choose **Add**\. + +1. For the **Specify an ARN** layer source: + + 1. Enter an ARN in the text box and choose **Verify**\. + + 1. Choose **Add**\. + +The order in which you add the layers is the order in which Lambda later merges the layer content into the execution environment\. You can change the layer merge order using the console\. + +**Update layer order for your function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to configure\. + +1. Under **Layers**, choose **Edit** + +1. Choose one of the layers\. + +1. Choose **Merge earlier** or **Merge later** to adjust the order of the layers\. + +1. Choose **Save**\. + +Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. You can use the console to update your function's layer versions\. + +**Update layer versions for your function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to configure\. -1. For the **Specify an ARN** layer source:: +1. Under **Layers**, choose **Edit** - 1. Enter an ARN in the text box +1. Under **Layer version**, enter the new layer version\. You can change the version for one or more of the listed layers\. -API +1. Choose **Save**\. + +### Configuring layers with the API To add layers to your function, use the update\-function\-configuration command\. The following example adds two layers: one from the same AWS account as the function, and one from a different account\. @@ -75,7 +110,11 @@ You should see output similar to the following: } ``` -To specify the layer versions to use, you must provide the full Amazon Resource Name \(ARN\) of each layer version\. When you add layers to a function that already has layers, you overwrite the previous list of layers\. Be sure to include all layers every time that you update the layer configuration\. Or, to remove all layers, specify an empty list\. +To specify the layer versions to use, you must provide the full Amazon Resource Name \(ARN\) of each layer version\. When you add layers to a function that already has layers, you overwrite the previous list of layers\. Be sure to include all layers every time that you update the layer configuration\. The order in which you add the layers is the order in which Lambda later extracts the layer content into the execution environment\. + + + +To remove all layers, specify an empty list\. ``` aws lambda update-function-configuration --function-name my-function --layers [] @@ -83,9 +122,38 @@ aws lambda update-function-configuration --function-name my-function --layers [] The creator of a layer can delete a version of the layer\. If you're using that layer version in a function, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. -## Accessing the contents of a layer +Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. You can use the API to update the layer versions that your function uses\. + +**Update layer versions for your function** -When you include a layer in a Lambda function, Lambda extracts the layer's contents into the `/opt` directory in the function execution environment\. Lambda extracts layers in the order that you specified them, merging any folders with the same name\. If the same file appears in multiple layers, the function uses the version in the last extracted layer\. +To update one or more layer versions for your function, use the update\-function\-configuration command\. Use the `--layers` option with this command to include all of the layer versions for the function, even if you are updating one of the layer versions\. If the function already has layers, the new list overwrites the previous list\. + +The following procedure steps assume that you have packaged the updated layer code into a local file named `layer.zip`\. + +1. \(Optional\) If the new layer version is not published yet, publish the new version\. + + ``` + aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ + --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 + ``` + +1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. + + ``` + aws lambda get-function-configuration --function-name my-function --query 'Layers[*].Arn' --output yaml + ``` + +1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`: + + ``` + aws lambda update-function-configuration --function-name my-function \ + --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ + arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 + ``` + +## Accessing layer content from your function + +If your Lambda function includes layers, Lambda extracts the layer contents into the `/opt` directory in the function execution environment\. Lambda extracts the layers in the order \(low to high\) listed by the function\. Lambda merges folders with the same name, so if the same file appears in multiple layers, the function uses the version in the last extracted layer\. Each [Lambda runtime](lambda-runtimes.md) adds specific `/opt` directory folders to the PATH variable\. Your function code can access the layer content without the need to specify the path\. For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. @@ -129,39 +197,6 @@ You can also get the latest version of a layer using the list\-layer\-versions c aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn ``` -## Updating a layer version that your function uses - -Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. - -To add an updated layer version to your function, use the update\-function\-configuration command\. Use the `--layers` option with this command to list all of the layer versions that you want to add\. If the function already has layers, the new list overwrites the previous list\. - -To update only one of the layer versions, you must include the ARNs of the existing layer versions with the `--layers` option\. - -The following procedure assumes that you have packaged the updated layer code into a local file named `layer.zip`\. - -**Add an updated layer version to your function** - -1. \(Optional\) If the new layer version is not published yet, publish the new version\. - - ``` - aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ - --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 - ``` - -1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. - - ``` - aws lambda get-function-configuration --function-name my-function --query 'Layers[*].Arn' --output yaml - ``` - -1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`: - - ``` - aws lambda update-function-configuration --function-name my-function \ - --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ - arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 - ``` - ## Adding layer permissions To use a Lambda function with a layer, you need permission to call the [GetLayerVersion](API_GetLayerVersion.md) API operation on the layer version\. For functions in your AWS account, you can add this permission from your [user policy](access-control-identity-based.md)\. @@ -217,4 +252,4 @@ The GitHub repository for this guide provides blank sample applications that dem + **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) + **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) -For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. +For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 9e9810fa..c0a7aa29 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -5,13 +5,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index ee55ebda..456ac147 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -112,7 +112,7 @@ The following identity\-based policy statement denies access to the `lambda:GetF ``` { - "Version": "2020-07-20", + "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md index 0b30cb7a..44c8728c 100644 --- a/doc_source/lambda-foundation.md +++ b/doc_source/lambda-foundation.md @@ -7,6 +7,7 @@ The Lambda function is the foundational principle of Lambda\. You can configure + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) + [Lambda instruction set architectures](foundation-arch.md) ++ [VPC networking for Lambda](foundation-networking.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + [Lambda console](foundation-console.md) diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index a23df8db..a30f8d0d 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -9,6 +9,9 @@ The following sections explain how common programming patterns and core concepts | --- | --- | --- | --- | | Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | +**Note** +Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. + Lambda provides the following tools and libraries for the Go runtime: **Tools and libraries for Go** diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index a663fb65..f533c6e3 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -11,7 +11,7 @@ Lambda supports the following Java runtimes\. | --- | --- | --- | --- | --- | | Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | | Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | -| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | x86\_64 | +| Java 8 | `java8` | amazon\-corretto\-8 | Amazon Linux | x86\_64 | Lambda provides the following libraries for Java functions: + [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 930c21b6..096ad77c 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,9 +9,9 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | SDK for JavaScript | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64 | +| Node\.js 14 | `nodejs14.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 10 | `nodejs10.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 34dfa0c5..14d40a41 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -12,10 +12,10 @@ End of support for the Python 2\.7 runtime started on July 15, 2021\. For more i | Name | Identifier | AWS SDK for Python | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 3\.9 | `python3.9` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | | Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | **To create a Python function** diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 37de18f6..ad4c92be 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -21,9 +21,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | SDK for JavaScript | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64 | +| Node\.js 14 | `nodejs14.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 10 | `nodejs10.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. @@ -33,10 +33,10 @@ For end of support information about Node\.js 10, see [Runtime support policy](r | Name | Identifier | AWS SDK for Python | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 3\.9 | `python3.9` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | | Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | **Important** @@ -60,7 +60,7 @@ For end of support information about Ruby 2\.5, see [Runtime support policy](run | --- | --- | --- | --- | --- | | Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | | Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | -| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | x86\_64 | +| Java 8 | `java8` | amazon\-corretto\-8 | Amazon Linux | x86\_64 | **Go runtimes** @@ -69,6 +69,9 @@ For end of support information about Ruby 2\.5, see [Runtime support policy](run | --- | --- | --- | --- | | Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | +**Note** +Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. + **\.NET runtimes** diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index d9fe0023..1b101428 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -46,8 +46,8 @@ Entries in this table are alphabetical by service name, excluding the "Amazon" o | [Amazon MQ](with-mq.md) | Lambda polling | | [Amazon Simple Email Service](services-ses.md) | Event\-driven; asynchronous invocation | | [Amazon Simple Notification Service](with-sns.md) | Event\-driven; asynchronous invocation | -| [Amazon Simple Queue Service \(Amazon S3\)](with-sqs.md) | Lambda polling | -| [Amazon Simple Storage Service](with-s3.md) | Event\-driven; asynchronous invocation | +| [Amazon Simple Queue Service](with-sqs.md) | Lambda polling | +| [Amazon Simple Storage Service \(Amazon S3\)](with-s3.md) | Event\-driven; asynchronous invocation | | [Amazon Simple Storage Service Batch](services-s3-batch.md) | Event\-driven; synchronous invocation | | [Secrets Manager](with-secrets-manager.md) | Event\-driven; synchronous invocation | | [AWS X\-Ray](services-xray.md) | Special integration | diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md index e991b198..4a104587 100644 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -6,15 +6,30 @@ To learn more about CloudTrail, including how to configure and enable it, see th ## AWS Lambda information in CloudTrail -CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in AWS Lambda, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)\. +CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in AWS Lambda, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. -For an ongoing record of events in your AWS account, including events for AWS Lambda, you create a trail\. A *trail* enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. For more information, see the following: +For an ongoing record of events in your AWS account, including events for AWS Lambda, you create a trail\. A *trail* enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. + +For more information, see the following topics in the *AWS CloudTrail User Guide*: + [Overview for creating a trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html) + [CloudTrail supported services and integrations](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html#cloudtrail-aws-service-specific-topics-integrations) + [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html) + [Receiving CloudTrail log files from multiple regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail log files from multiple accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html) -AWS Lambda supports logging the following actions as events in CloudTrail log files: +Every log entry contains information about who generated the request\. The user identity information in the log helps you determine whether the request was made with root or IAM user credentials, with temporary security credentials for a role or federated user, or by another AWS service\. For more information, see the **userIdentity** field in the [CloudTrail event reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)\. + +You can store your log files in your bucket for as long as you want, but you can also define Amazon S3 lifecycle rules to archive or delete log files automatically\. By default, your log files are encrypted by using Amazon S3 server\-side encryption \(SSE\)\. + +You can choose to have CloudTrail publish Amazon SNS notifications when new log files are delivered if you want to take quick action upon log file delivery\. For more information, see [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)\. + +You can also aggregate AWS Lambda log files from multiple AWS regions and multiple AWS accounts into a single S3 bucket\. For more information, see [Working with CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html)\. + +### List of supported Lambda API actions + +Lambda supports logging the following actions as events in CloudTrail log files\. + +**Note** +In the CloudTrail log file, the `eventName` might include date and version information, but it is still referring to the same public API\. For example the, `GetFunction` action might appear as `"GetFunction20150331"`\. To see the `eventName` for a particular action, view a log file entry in your event history\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) @@ -37,20 +52,15 @@ AWS Lambda supports logging the following actions as events in CloudTrail log fi \(The `ZipFile` parameter is omitted from the CloudTrail logs for `UpdateFunctionCode`\.\) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -Every log entry contains information about who generated the request\. The user identity information in the log helps you determine whether the request was made with root or IAM user credentials, with temporary security credentials for a role or federated user, or by another AWS service\. For more information, see the **userIdentity** field in the [CloudTrail event reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)\. - -You can store your log files in your bucket for as long as you want, but you can also define Amazon S3 lifecycle rules to archive or delete log files automatically\. By default, your log files are encrypted by using Amazon S3 server\-side encryption \(SSE\)\. - -You can choose to have CloudTrail publish Amazon SNS notifications when new log files are delivered if you want to take quick action upon log file delivery\. For more information, see [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)\. - -You can also aggregate AWS Lambda log files from multiple AWS regions and multiple AWS accounts into a single S3 bucket\. For more information, see [Working with CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html)\. - ## Understanding AWS Lambda log file entries CloudTrail log files contain one or more log entries where each entry is made up of multiple JSON\-formatted events\. A log entry represents a single request from any source and includes information about the requested action, any parameters, the date and time of the action, and so on\. The log entries are not guaranteed to be in any particular order\. That is, they are not an ordered stack trace of the public API calls\. The following example shows CloudTrail log entries for the `GetFunction` and `DeleteFunction` actions\. +**Note** +The `eventName` might include date and version information, such as `"GetFunction20150331"`, but it is still referring to the same public API\. + ``` { "Records": [ @@ -108,9 +118,6 @@ The following example shows CloudTrail log entries for the `GetFunction` and `De } ``` -**Note** -The `eventName` may include date and version information, such as `"GetFunction20150331"`, but it is still referring to the same public API\. For more information, see [ Services supported by CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-supported-services.html#view-cloudtrail-events-supported-apis-lambda) in the *AWS CloudTrail User Guide*\. - ## Using CloudTrail to track function invocations CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [ Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md index d22d8d66..fe2f6951 100644 --- a/doc_source/monitoring-code-profiler.md +++ b/doc_source/monitoring-code-profiler.md @@ -14,9 +14,6 @@ You can activate CodeGuru Profiler from the Lambda console if your function's ru + For Java runtimes, see [ Profiling your Java applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)\. + For Python runtimes, see [ Profiling your Python applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda.html)\. -**Note** -CodeGuru Profiler supports functions that use x86\_64 architecture and arm64 architecture\.????? - ## Activating CodeGuru Profiler from the Lambda console This section describes how to activate CodeGuru Profiler from the Lambda console\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index b72acc36..b5d19e03 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -5,13 +5,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md index 3521229a..280429ed 100644 --- a/doc_source/provisioned-concurrency.md +++ b/doc_source/provisioned-concurrency.md @@ -6,11 +6,12 @@ There are two types of concurrency controls available: This topic details how to manage and configure provisioned concurrency\. If you want to configure reserved concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. -When Lambda allocates an instance of your function, the runtime loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. As your function scales up, this causes the portion of requests that are served by new instances to have higher latency than the rest\. +When Lambda allocates an instance of your function, the runtime loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. When your function has not been used for some time, needs to scale up, or when you update a function, Lambda creates new execution environments\. This causes the portion of requests that are served by new instances to have higher latency than the rest, otherwise known as a cold start\. -By allocating provisioned concurrency before an increase in invocations, you can ensure that all requests are served by initialized instances with low latency\. You can configure provisioned concurrency on a version of a function, or on an alias\. +By allocating provisioned concurrency before an increase in invocations, you can ensure that all requests are served by initialized instances with low latency\. Lambda functions configured with provisioned concurrency run with consistent start\-up latency, making them ideal for building interactive mobile or web backends, latency sensitive microservices, and synchronously invoked APIs\. -Provisioned concurrency counts towards a function's reserved concurrency and Regional quotas\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \($LATEST\), which prevents it from executing\. You can't allocate more provisioned concurrency than reserved concurrency for a function\. +**Note** +Provisioned concurrency counts towards a function's reserved concurrency and [Regional quotas](gettingstarted-limits.md)\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \($LATEST\), which prevents it from executing\. You can't allocate more provisioned concurrency than reserved concurrency for a function\. Lambda also integrates with Application Auto Scaling, allowing you to manage provisioned concurrency on a schedule or based on utilization\. @@ -21,7 +22,14 @@ Lambda also integrates with Application Auto Scaling, allowing you to manage pro ## Configuring provisioned concurrency -To manage provisioned concurrency settings for a version or alias, use the Lambda console\. +To manage provisioned concurrency settings for a version or alias, use the Lambda console\. You can configure provisioned concurrency on a version of a function, or on an alias\. + + Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. + + If you change the version that an alias points to, Lambda deallocates the provisioned concurrency from the old version and allocates it to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. For more information, see [Lambda function aliases](configuration-aliases.md)\. Note that you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. + +**Note** + Provisioned Concurrency is not supported on $LATEST\. Ensure your client application is not pointing to $LATEST before configuring provisioned concurrency\. **To allocate provisioned concurrency for an alias or version** @@ -89,19 +97,15 @@ You should see the following output: You can manage provisioned concurrency for all aliases and versions from the function configuration page\. The list of provisioned concurrency configurations shows the allocation progress of each configuration\. Provisioned concurrency settings are also available on the configuration page for each version and alias\. -Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. - -When you change the version that an alias points to, provisioned concurrency is deallocated from the old version and then allocated to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. However, you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. - Lambda emits the following metrics for provisioned concurrency: **Provisioned concurrency metrics** -+ `ProvisionedConcurrentExecutions` -+ `ProvisionedConcurrencyInvocations` -+ `ProvisionedConcurrencySpilloverInvocations` -+ `ProvisionedConcurrencyUtilization` ++ `ProvisionedConcurrentExecutions` – The number of function instances that are processing events on provisioned concurrency\. For each invocation of an alias or version with provisioned concurrency, Lambda emits the current count\. ++ `ProvisionedConcurrencyInvocations` – The number of times your function code is executed on provisioned concurrency\. ++ `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. ++ `ProvisionedConcurrencyUtilization` – For a version or alias, the value of `ProvisionedConcurrentExecutions` divided by the total amount of provisioned concurrency allocated\. For example, \.5 indicates that 50 percent of allocated provisioned concurrency is in use\. -For details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +For more details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. ## Optimizing latency with provisioned concurrency @@ -123,27 +127,33 @@ If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PR For provisioned concurrency instances, your function's [initialization code](foundation-progmodel.md) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. +For more information on optimizing functions using provisioned concurrency, see the [Lambda Operator Guide\.](https://docs.aws.amazon.com/lambda/latest/operatorguide/execution-environments.html) + ## Managing provisioned concurrency with Application Auto Scaling -Application Auto Scaling allows you to manage provisioned concurrency on a schedule or based on utilization\. Use scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. +Application Auto Scaling allows you to manage provisioned concurrency on a schedule or based on utilization\. Use a target tracking scaling policy if want your function to maintain a specified utilization percentage, and scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. + +### Target tracking -To increase provisioned concurrency automatically as needed, use the `RegisterScalableTarget` and `PutScalingPolicy` [Application Auto Scaling API ](configuration-concurrency.md#configuration-concurrency-api) operations to register a target and create a scaling policy: + With target tracking, Application Auto Scaling creates and manages the CloudWatch alarms that trigger a scaling policy and calculates the scaling adjustment based on a metric and target value that you define\. This is ideal for applications that don’t have a scheduled time of increased traffic, but have certain traffic patterns\. + +To increase provisioned concurrency automatically as needed, use the `RegisterScalableTarget` and `PutScalingPolicy` Application Auto Scaling API operations to register a target and create a scaling policy: 1. Register a function's alias as a scaling target\. The following example registers the BLUE alias of a function named `function`my\-: ``` aws application-autoscaling register-scalable-target --service-namespace lambda \ - --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ - --scalable-dimension lambda:function:ProvisionedConcurrency + --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ + --scalable-dimension lambda:function:ProvisionedConcurrency ``` 1. Apply a scaling policy to the target\. The following example configures Application Auto Scaling to adjust the provisioned concurrency configuration for an alias to keep utilization near 70 percent\. ``` aws application-autoscaling put-scaling-policy --service-namespace lambda \ - --scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ - --policy-name my-policy --policy-type TargetTrackingScaling \ - --target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' + --scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ + --policy-name my-policy --policy-type TargetTrackingScaling \ + --target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' ``` You should see the following output: @@ -174,4 +184,14 @@ In the following example, a function scales between a minimum and maximum amount + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency \ No newline at end of file ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency + + Both of these alarms use the *average* statistic by default\. Functions that have traffic patterns of quick bursts may not trigger your provisioned concurrency to scale up\. For example, if your Lambda function executes quickly \(20–100 ms\) and your traffic pattern comes in quick bursts, this may cause incoming requests to exceed your allocated provisioned concurrency during the burst, but if the burst doesn’t last 3 minutes, auto scaling will not trigger\. Additionally, if CloudWatch doesn’t get three data points that hit the target average, the auto scaling policy will not trigger\. + + If your scaling policy does not trigger and your provisioned concurrency does not scale, check that the alarms were triggered\. If not, deploy your function with a custom CloudWatch alarm set to use the *max* statistic\. + +For more information on target tracking scaling policies, see [Target tracking scaling policies for Application Auto Scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html)\. + +### Scheduled scaling + + Scaling based on a schedule allows you to set your own scaling schedule according to predictable load changes\. For more information and examples, see [Scheduling AWS Lambda Provisioned Concurrency for recurring peak usage](https://aws.amazon.com/blogs/compute/scheduling-aws-lambda-provisioned-concurrency-for-recurring-peak-usage/)\. \ No newline at end of file diff --git a/doc_source/python-image.md b/doc_source/python-image.md index ea83bd21..55bfb071 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -8,13 +8,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: @@ -50,7 +50,9 @@ Amazon ECR repository: gallery\.ecr\.aws/lambda/python ## Create a Python image from an AWS base image -When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. +When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. + +If your function has dependencies, your local Python environment must match the version in the base image that you specify in the Dockerfile\. **To build and deploy a Python function with the `python:3.8` base image\.** diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 07e9023a..b205730c 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -5,13 +5,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index 0ae9240f..7fe3e7f4 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -11,17 +11,17 @@ Lambda does not block invocations of functions that use deprecated runtime versi **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. -The following runtimes have reached or are scheduled for end of support: +In the table below, each of the phases starts at midnight \(Pacific time zone\) on the specified date\. The following runtimes have reached or are scheduled for end of support: **Runtime end of support dates** | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Sept 20, 2021 | Oct 20, 2021 | -| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | -| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Sept 17, 2021 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Oct 26, 2021 | Nov 30, 2021 | +| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Nov 22, 2021 | +| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Nov 30, 2021 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Nov 30, 2021 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index 0b670b5b..75729f85 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -49,6 +49,9 @@ The invoke phase ends after the runtime and all extensions signal that they are If the Lambda function crashes or times out during the `Invoke` phase, Lambda resets the execution environment\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime\. Then Lambda sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If another `Invoke` event results in this execution environment being reused, Lambda initializes the runtime and extensions as part of the next invocation\. +**Note** +The Lambda reset does not clear the `/tmp` directory content prior to the next init phase\. This behavior is consistent with the regular shutdown phase\. + ![\[This is my image.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) ### Shutdown phase diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index e25263ad..7c8d7571 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -79,21 +79,20 @@ The following example shows a request to subscribe to the platform and function ``` PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 -{ - "schemaVersion": "2020-08-15", - "types": [ - "platform", - "function" +{ "schemaVersion": "2020-08-15", + "types": [ + "platform", + "function" ], - "buffering": { - "maxItems": 1000, - "maxBytes": 262144, - "timeoutMs": 100 + "buffering": { + "maxItems": 1000, + "maxBytes": 262144, + "timeoutMs": 100 }, - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox.localdomain:8080/lambda_logs" - } + "destination": { + "protocol": "HTTP", + "URI": "http://sandbox.localdomain:8080/lambda_logs" + } } ``` diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index 88435c0b..3222c7a8 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -2,6 +2,24 @@ You can create a web API with an HTTP endpoint for your Lambda function by using Amazon API Gateway\. API Gateway provides tools for creating and documenting web APIs that route HTTP requests to Lambda functions\. You can secure access to your API with authentication and authorization controls\. Your APIs can serve traffic over the internet or can be accessible only within your VPC\. +Resources in your API define one or more methods, such as GET or POST\. Methods have an integration that routes requests to a Lambda function or another integration type\. You can define each resource and method individually, or use special resource and method types to match all requests that fit a pattern\. A *proxy resource* catches all paths beneath a resource\. The `ANY` method catches all HTTP methods\. + +**Topics** ++ [Adding an endpoint to your Lambda function](#apigateway-add) ++ [Proxy integration](#apigateway-proxy) ++ [Event format](#apigateway-example-event) ++ [Response format](#apigateway-types-transforms) ++ [Permissions](#apigateway-permissions) ++ [Handling errors with an API Gateway API](#services-apigateway-errors) ++ [Choosing an API type](#services-apigateway-apitypes) ++ [Sample applications](#services-apigateway-samples) ++ [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) ++ [Sample function code](services-apigateway-code.md) ++ [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) ++ [AWS SAM template for an API Gateway application](services-apigateway-template.md) + +## Adding an endpoint to your Lambda function + **To add a public endpoint to your Lambda function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -14,10 +32,14 @@ You can create a web API with an HTTP endpoint for your Lambda function by using 1. For **API**, choose **Create an API**\. +1. For **API type**, choose **HTTP API**\. For more information, see [API types](#services-apigateway-apitypes) + 1. For **Security**, choose **Open**\. 1. Choose **Add**\. +## Proxy integration + API Gateway APIs are comprised of stages, resources, methods, and integrations\. The stage and resource determine the path of the endpoint: **API path format** @@ -28,48 +50,50 @@ API Gateway APIs are comprised of stages, resources, methods, and integrations\. A Lambda integration maps a path and HTTP method combination to a Lambda function\. You can configure API Gateway to pass the body of the HTTP request as\-is \(custom integration\), or to encapsulate the request body in a document that includes all of the request information including headers, resource, path, and method\. +## Event format + Amazon API Gateway invokes your function [synchronously](invocation-sync.md) with an event that contains a JSON representation of the HTTP request\. For a custom integration, the event is the body of the request\. For a proxy integration, the event has a defined structure\. The following example shows a proxy event from an API Gateway REST API\. **Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** ``` { - "resource": "/", - "path": "/", - "httpMethod": "GET", - "requestContext": { - "resourcePath": "/", - "httpMethod": "GET", - "path": "/Prod/", - ... - }, - "headers": { - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", - "accept-encoding": "gzip, deflate, br", - "Host": "70ixmpl4fl.execute-api.us-east-2.amazonaws.com", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36", - "X-Amzn-Trace-Id": "Root=1-5e66d96f-7491f09xmpl79d18acf3d050", - ... - }, - "multiValueHeaders": { - "accept": [ - "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" - ], - "accept-encoding": [ - "gzip, deflate, br" - ], - ... - }, - "queryStringParameters": null, - "multiValueQueryStringParameters": null, - "pathParameters": null, - "stageVariables": null, - "body": null, - "isBase64Encoded": false -} + "resource": "/", + "path": "/", + "httpMethod": "GET", + "requestContext": { + "resourcePath": "/", + "httpMethod": "GET", + "path": "/Prod/", + ... + }, + "headers": { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "accept-encoding": "gzip, deflate, br", + "Host": "70ixmpl4fl.execute-api.us-east-2.amazonaws.com", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36", + "X-Amzn-Trace-Id": "Root=1-5e66d96f-7491f09xmpl79d18acf3d050", + ... + }, + "multiValueHeaders": { + "accept": [ + "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" + ], + "accept-encoding": [ + "gzip, deflate, br" + ], + ... + }, + "queryStringParameters": null, + "multiValueQueryStringParameters": null, + "pathParameters": null, + "stageVariables": null, + "body": null, + "isBase64Encoded": false + } ``` -This example shows an event for a GET request to the root path of the Prod stage of a REST API\. Event shape and contents vary by [API type](#services-apigateway-apitypes) and configuration\. +## Response format API Gateway waits for a response from your function and relays the result to the caller\. For a custom integration, you define an integration response and a method response to convert the output from the function to an HTTP response\. For a proxy integration, the function must respond with a representation of the response in a specific format\. @@ -79,16 +103,16 @@ The following example shows a response object from a Node\.js function\. The res ``` var response = { - "statusCode": 200, - "headers": { - "Content-Type": "application/json" - }, - "isBase64Encoded": false, - "multiValueHeaders": { - "X-Custom-Header": ["My value", "My other value"], - }, - "body": "{\n \"TotalCodeSize\": 104330022,\n \"FunctionCount\": 26\n}" - } + "statusCode": 200, + "headers": { + "Content-Type": "application/json" + }, + "isBase64Encoded": false, + "multiValueHeaders": { + "X-Custom-Header": ["My value", "My other value"], + }, + "body": "{\n \"TotalCodeSize\": 104330022,\n \"FunctionCount\": 26\n}" + } ``` The Lambda runtime serializes the response object into JSON and sends it to the API\. The API parses the response and uses it to create an HTTP response, which it then sends to the client that made the original request\. @@ -97,32 +121,20 @@ The Lambda runtime serializes the response object into JSON and sends it to the ``` < HTTP/1.1 200 OK -< Content-Type: application/json -< Content-Length: 55 -< Connection: keep-alive -< x-amzn-RequestId: 32998fea-xmpl-4268-8c72-16138d629356 -< X-Custom-Header: My value -< X-Custom-Header: My other value -< X-Amzn-Trace-Id: Root=1-5e6aa925-ccecxmplbae116148e52f036 -< -{ - "TotalCodeSize": 104330022, - "FunctionCount": 26 -} + < Content-Type: application/json + < Content-Length: 55 + < Connection: keep-alive + < x-amzn-RequestId: 32998fea-xmpl-4268-8c72-16138d629356 + < X-Custom-Header: My value + < X-Custom-Header: My other value + < X-Amzn-Trace-Id: Root=1-5e6aa925-ccecxmplbae116148e52f036 + < + { + "TotalCodeSize": 104330022, + "FunctionCount": 26 + } ``` -Resources in your API define one or more methods, such as GET or POST\. Methods have an integration that routes requests to a Lambda function or another integration type\. You can define each resource and method individually, or use special resource and method types to match all requests that fit a pattern\. A *proxy resource* catches all paths beneath a resource\. The `ANY` method catches all HTTP methods\. - -**Topics** -+ [Permissions](#apigateway-permissions) -+ [Handling errors with an API Gateway API](#services-apigateway-errors) -+ [Choosing an API type](#services-apigateway-apitypes) -+ [Sample applications](#services-apigateway-samples) -+ [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) -+ [Sample function code](services-apigateway-code.md) -+ [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) -+ [AWS SAM template for an API Gateway application](services-apigateway-template.md) - ## Permissions Amazon API Gateway gets permission to invoke your function from the function's [resource\-based policy](access-control-resource-based.md)\. You can grant invoke permission to an entire API, or grant limited access to a stage, resource, or method\. @@ -143,10 +155,13 @@ When you add an API to your function by using the Lambda console, using the API "Service": "apigateway.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:nodejs-apig-function-1G3MXMPLXVXYI", + "Resource": "arn:aws:lambda:us-east-2:111122223333:function:nodejs-apig-function-1G3MXMPLXVXYI", "Condition": { + "StringEquals": { + "aws:SourceAccount": "111122223333" + }, "ArnLike": { - "AWS:SourceArn": "arn:aws:execute-api:us-east-2:123456789012:ktyvxmpls1/*/GET/" + "aws:SourceArn": "arn:aws:execute-api:us-east-2:111122223333:ktyvxmpls1/*/GET/" } } } diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 079c939f..7cbe0277 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -49,7 +49,7 @@ Test the function with a sample event provided by the Lambda console\. 1. Choose **Test**\. -1. Create a new event using the **EventBridge \(CloudWatch Events\)** event template\. +1. Create a new event using the **CloudWatch** event template\. 1. Choose **Create event**\. diff --git a/doc_source/services-s3-object-lambda.md b/doc_source/services-s3-object-lambda.md index 1c80121c..00b5768b 100644 --- a/doc_source/services-s3-object-lambda.md +++ b/doc_source/services-s3-object-lambda.md @@ -2,4 +2,8 @@ With S3 Object Lambda you can add your own code to Amazon S3 GET requests to modify and process data before it is returned to an application\. You can use custom code to modify the data returned by standard S3 GET requests to filter rows, dynamically resize images, redact confidential data, and more\. Powered by AWS Lambda functions, your code runs on infrastructure that is fully managed by AWS, eliminating the need to create and store derivative copies of your data or to run proxies, all with no changes required to applications\. -For more information, see [Transforming objects with S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html)\. \ No newline at end of file +For more information, see [Transforming objects with S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html)\. + +**Tutorials** ++ [Transforming data for your application with Amazon S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/tutorial-s3-object-lambda-uppercase.html) ++ [Detecting and redacting PII data with Amazon S3 Object Lambda and Amazon Comprehend](https://docs.aws.amazon.com/AmazonS3/latest/userguide/tutorial-s3-object-lambda-redact-pii.html) \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index fa3f7d21..845a69f2 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -108,7 +108,7 @@ RUN pip install -r requirements.txt # Add an extension from the local directory into /opt ADD my-extension.zip /opt -CMD python ./index.py +CMD python ./my-function.py ``` ## Next steps diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index b95e9aa0..30a003a7 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -154,7 +154,7 @@ To manage the event source configuration later, choose the trigger in the design To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index 47bcaace..3d26a22c 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -79,7 +79,7 @@ Your Lambda function might need these permissions: + Access your AWS Key Management Service \(AWS KMS\) customer managed key + Access your Amazon Virtual Private Cloud \(Amazon VPC\) -#### Secrets Manager and AWS KMS permissions +#### Secrets Manager and AWS KMS permissions If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed key\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: + [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) @@ -97,31 +97,9 @@ If only users within a VPC can access your self\-managed Apache Kafka cluster, y ### Adding permissions to your execution role -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's [execution role](lambda-intro-execution-role.md)\. +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's execution role\. -By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an [IAM trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#term_trust-policy), and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. - -``` -{ - "Version":"2012-10-17", - "Statement":[ - { - "Effect":"Allow", - "Action":[ - "ec2:CreateNetworkInterface", - "ec2:DescribeNetworkInterfaces", - "ec2:DescribeVpcs", - "ec2:DeleteNetworkInterface", - "ec2:DescribeSubnets", - "ec2:DescribeSecurityGroups" - ], - "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" - } - ] - } -``` - -For information about creating a JSON policy document in the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. +By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md) ### Adding users to an IAM policy @@ -215,7 +193,7 @@ aws lambda create-event-source-mapping --topics AWSKafkaTopic --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` -For more information, see the API reference documentation\. +For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. #### Using a VPC @@ -232,7 +210,7 @@ aws lambda create-event-source-mapping "abc2.xyz.com:9092"]}}' ``` -For more information, see the API reference documentation\. +For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. #### Viewing the status using the AWS CLI @@ -273,7 +251,7 @@ When you add your Kafka cluster as an [event source](invocation-eventsourcemappi To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 975cb443..d60e978d 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -169,7 +169,7 @@ To manage the event source configuration later, choose the trigger in the design To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 0de8fa33..d9414499 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -45,36 +45,36 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut ``` { - "eventSource":"aws:amq", - "eventSourceArn":"arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", - "messages":[ - { - "messageID":"ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType":"jms/text-message", - "data":"QUJDOkFBQUE=", - "connectionId":"myJMSCoID", - "redelivered":false, - "destination":{ - "physicalname":"testQueue" - }, - "timestamp":1598827811958, - "brokerInTime":1598827811958, - "brokerOutTime":1598827811959 - }, - { - "messageID":"ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType":"jms/bytes-message", - "data":"3DTOOW7crj51prgVLQaGQ82S48k=", - "connectionId":"myJMSCoID1", - "persistent":false, - "destination":{ - "physicalname":"testQueue" - }, - "timestamp":1598827811958, - "brokerInTime":1598827811958, - "brokerOutTime":1598827811959 - } - ] + "eventSource": "aws:amq", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "messages": [ + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType": "jms/text-message", + "data": "QUJDOkFBQUE=", + "connectionId": "myJMSCoID", + "redelivered": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + }, + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType": "jms/bytes-message", + "data": "3DTOOW7crj51prgVLQaGQ82S48k=", + "connectionId": "myJMSCoID1", + "persistent": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + } + ] } ``` @@ -182,7 +182,7 @@ To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) @@ -314,4 +314,4 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Enabled | N | true | | | FunctionName | Y | | | | Queues | N | | The name of the Amazon MQ broker destination queue to consume\. | -| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | +| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | \ No newline at end of file diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 01414df9..21cbc233 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -6,9 +6,9 @@ Amazon MSK as an event source operates similarly to using Amazon Simple Queue Se For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. Also, see [ Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs for a complete tutorial\. -Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. +Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function times out or returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. -Lambda allows a function to run for up to 14 minutes before stopping it\. +For Amazon MSK invocations, Lambda allows the function to run for up to 14 minutes\. Set your function timeout value to 14 minutes or less \(the default timeout value is 3 seconds\)\. Lambda sends the batch of messages in the event parameter when it invokes your function\. The event payload contains an array of messages\. Each array item contains details of the Amazon MSK topic and partition identifier, together with a timestamp and a base64\-encoded message\. @@ -57,7 +57,9 @@ Lambda sends the batch of messages in the event parameter when it invokes your f ## Managing access and permissions -For Lambda to poll your Kafka topic and update other cluster resources, your Lambda function—as well as your IAM users and roles—must have the following permissions\. +You can use IAM access control to handle both authentication and authorization for your Amazon MSK cluster\. This eliminates the need to use one mechanism for authentication and a different mechanism for authorization\. For example, when a client tries to write to your cluster, Amazon MSK uses IAM to check whether that client is an authenticated identity and also whether it is authorized to produce to your cluster\. + +As an alternative, you can use SASL/SCRAM to authenticate clients and [Apache Kafka ACLs](https://docs.aws.amazon.com/msk/latest/developerguide/msk-acls.html) to control access\. ### Required Lambda function permissions @@ -74,6 +76,36 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) must hav + [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) + [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) +### Additional function permissions for IAM authorization + +If you plan to use IAM authorization, you need to add the following additional permissions: + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "kafka-cluster:Connect", + "kafka-cluster:DescribeGroup", + "kafka-cluster:AlterGroup", + "kafka-cluster:DescribeTopic", + "kafka-cluster:ReadData", + "kafka-cluster:DescribeClusterDynamicConfiguration" + ], + "Resource": [ + "arn:aws:kafka:::cluster//", + "arn:aws:kafka:::topic///", + "arn:aws:kafka:::group///" + ] + } + ] +} +``` + +You can scope these permissions to a specific cluster, topic and group\. See [Amazon MSK Kafka actions](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html#kafka-actions) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. The group name that Lambda uses is equivalent to the event source mapping’s UUID\. + ### Adding a policy to your execution role Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. @@ -98,6 +130,30 @@ Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Re Note that Amazon MSK does not support SASL/PLAIN authentication\. +### Authentication and authorization Errors + +If any of the required permissions to consume data from the Amazon MSK cluster are missing, Lambda displays an error message in the event source mapping under **LastProcessingResult**\. + +The following error message results from authorization errors\. + +**Example Cluster failed to authorize Lambda** +For SASL/SCRAM, the provided user does not have all of the required Kafka ACL permissions: ++ DescribeConfigs Cluster ++ Describe Group ++ Read Group ++ Describe Topic ++ Read Topic +For IAM access control, the execution role is missing one or more of the permissions required to access the group or topic\. To add the missing permissions to the role, see the example in [Additional function permissions for IAM authorization](#msk-permissions-iam-auth) +When you create either Kafka ACLs or an IAM policy with the required kafka\-cluster permissions listed previously, you must specify the topic and group as resources\. The topic name must match the topic in the event source mapping and the group name must match the event source mapping’s UUID\. +After you add the required permissions to the execution role, there might be a delay of several minutes before the changes take effect\. + +The following error message results from authentication failures\. + +**Example SASL authentication failed** +For SASL/SCRAM, this failure indicates that the provided username and password are invalid\. +For IAM access control, the execution role is missing `kafka-cluster:Connect` permissions for the cluster\. Add this permission to the role and specify the cluster ARN as a resource\. +You might see this error intermittently if the cluster rejects connections because it reached the TCP connection limit set by [Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/limits.html)\. Lambda backs off and retries until a connection is successful\. The last processing result will eventually change to “OK” after Lambda successfully connects to and polls from the cluster\. + ## Network configuration Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Amazon MSK cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. @@ -105,8 +161,9 @@ Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resou Alternatively, ensure that the VPC associated with your Amazon MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. You must configure your Amazon VPC security groups with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. ++ Inbound rules – Allow all traffic on the MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. ++ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. ++ if you are using VPC endpoints instead of NAT Gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. **Note** Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and does not need to be configured during setup using the create\-event\-source\-mapping command\. @@ -147,7 +204,7 @@ Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. - 1. \(Optional\) For **Secret key**, choose the secret key for SASL/SCRAM authentication of the brokers in your Amazon MSK cluster\. + 1. \(Optional\) For **Secret key**, choose the secret key for SASL/SCRAM authentication of the brokers in your Amazon MSK cluster\. If you are using IAM access control, do not choose a secret key\. 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. @@ -169,7 +226,7 @@ aws lambda create-event-source-mapping \ --function-name my-kafka-function ``` -For more information, see the API reference documentation\. +For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. #### Viewing the status using the AWS CLI diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index c96428d9..91b550fc 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -636,7 +636,7 @@ This procedure configures the S3 bucket to invoke your function every time that + **Destination** – **Lambda function** + **Lambda function** – **CreateThumbnail** -For more information on event configuration, see [Enabling and configuring event notifications using the Amazon S3 console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html) in the *Amazon Simple Storage Service Console User Guide*\. +For more information on event configuration, see [Enabling and configuring event notifications using the Amazon S3 console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html) in the *Amazon Simple Storage Service User Guide*\. ## Step 9\. Test using the S3 trigger diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 1cdf12bf..50c5db97 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -169,7 +169,7 @@ Configure your function timeout to allow enough time to process an entire batch To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) From c1e1349f3cf5742e5ee52d977c0003383262d743 Mon Sep 17 00:00:00 2001 From: Olivier Truong Date: Wed, 1 Dec 2021 09:47:06 +0100 Subject: [PATCH 85/94] Typo in functions-states.md --- doc_source/functions-states.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index aec7996c..aad0bb8c 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -6,7 +6,7 @@ Lambda includes a state field in the function configuration for all functions to + `Failed` – Indicates that resource configuration or provisioning encountered an error\. + `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -If you are utilzing SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. +If you are utilizing SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. ``` aws lambda get-function --function-name my-function --query 'Configuration.[State, LastUpdateStatus]' @@ -66,4 +66,4 @@ The following is the result of `get-function-configuration` on a function underg The following operations fail while an asynchronous update is in progress: + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [PublishVersion](API_PublishVersion.md) \ No newline at end of file ++ [PublishVersion](API_PublishVersion.md) From e3582b92e6a2e9c624990ebaffae2f811fc13784 Mon Sep 17 00:00:00 2001 From: Mark Sailes Date: Fri, 10 Dec 2021 15:42:04 +0000 Subject: [PATCH 86/94] Update to the version of log4j2 which isn't effected by CVE-2021-44228 --- doc_source/java-logging.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 6302d70b..7e1fef2a 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -310,10 +310,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } From 806bcc0ba63a12eba477cb20f12856cdb00b441d Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Fri, 10 Dec 2021 21:28:49 -0800 Subject: [PATCH 87/94] update log4j2 --- sample-apps/blank-java/build.gradle | 8 ++++---- sample-apps/blank-java/pom.xml | 10 +++++----- sample-apps/java-basic/build.gradle | 6 +++--- sample-apps/java-basic/pom.xml | 6 +++--- sample-apps/java-events-v1sdk/build.gradle | 8 ++++---- sample-apps/java-events-v1sdk/pom.xml | 10 +++++----- sample-apps/java-events/build.gradle | 6 +++--- sample-apps/java-events/pom.xml | 6 +++--- sample-apps/s3-java/build.gradle | 8 ++++---- sample-apps/s3-java/pom.xml | 10 +++++----- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 710d433f..626717f6 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -17,10 +17,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index b1b40871..a191854c 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.2.0 + 1.3.0 com.google.code.gson @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 software.amazon.awssdk @@ -118,7 +118,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.13.0 + 2.15.0 diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index d32fc80a..91089ad8 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -9,9 +9,9 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.13.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.13.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' + testImplementation 'org.apache.logging.log4j:log4j-api:2.15.0' + testImplementation 'org.apache.logging.log4j:log4j-core:2.15.0' + testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 721a9cf7..ffa65ebe 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -25,19 +25,19 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 test org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 test org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 test diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index bcbb32f5..f9850483 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -17,10 +17,10 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index a5a095b8..aea29069 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.2.0 + 1.3.0 com.google.code.gson @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 com.amazonaws @@ -122,7 +122,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.13.0 + 2.15.0 diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index 0f68f99a..637fcac8 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -10,9 +10,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index 0d13721a..f7353d97 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -30,17 +30,17 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 org.junit.jupiter diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 425f06e1..47f73baa 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -15,10 +15,10 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index b82a458e..5463b5f5 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.1.0 + 1.3.0 com.google.code.gson @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 com.amazonaws @@ -117,7 +117,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.13.0 + 2.15.0 From 34a84a59fb314c5bb784674c987bb6f5a04e2747 Mon Sep 17 00:00:00 2001 From: eriboo Date: Mon, 20 Dec 2021 14:50:49 -0800 Subject: [PATCH 88/94] Updating log4 dependencies. --- doc_source/java-logging.md | 8 ++++---- sample-apps/blank-java/build.gradle | 8 ++++---- sample-apps/blank-java/pom.xml | 8 ++++---- sample-apps/java-basic/build.gradle | 6 +++--- sample-apps/java-basic/pom.xml | 4 ++-- sample-apps/java-events-v1sdk/build.gradle | 8 ++++---- sample-apps/java-events-v1sdk/pom.xml | 8 ++++---- sample-apps/java-events/build.gradle | 6 +++--- sample-apps/java-events/pom.xml | 4 ++-- sample-apps/s3-java/build.gradle | 8 ++++---- sample-apps/s3-java/pom.xml | 8 ++++---- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 7e1fef2a..08319924 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -310,10 +310,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 626717f6..f8853ba6 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -17,10 +17,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index a191854c..7e9a8dbc 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.3.0 + 1.4.0 com.google.code.gson @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 software.amazon.awssdk @@ -118,7 +118,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.15.0 + 2.16.0 diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index 91089ad8..14bdf57a 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -9,9 +9,9 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.15.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.15.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + testImplementation 'org.apache.logging.log4j:log4j-api:2.16.0' + testImplementation 'org.apache.logging.log4j:log4j-core:2.16.0' + testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index ffa65ebe..ecab98f3 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -25,7 +25,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 test @@ -37,7 +37,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 test diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index f9850483..739d8653 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -17,10 +17,10 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index aea29069..49a7678d 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.3.0 + 1.4.0 com.google.code.gson @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 com.amazonaws @@ -122,7 +122,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.15.0 + 2.16.0 diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index 637fcac8..8f82c06a 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -10,9 +10,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index f7353d97..ad471866 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -30,7 +30,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 org.apache.logging.log4j @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 org.junit.jupiter diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 47f73baa..daa1b295 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -15,10 +15,10 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 5463b5f5..e25eb6f0 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.3.0 + 1.4.0 com.google.code.gson @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 com.amazonaws @@ -117,7 +117,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.15.0 + 2.16.0 From f3f0e84281afd426aeff43f2c473dee1ca25ca18 Mon Sep 17 00:00:00 2001 From: eriboo Date: Mon, 20 Dec 2021 15:12:27 -0800 Subject: [PATCH 89/94] Updating to newest version. --- doc_source/java-logging.md | 6 +++--- sample-apps/blank-java/build.gradle | 6 +++--- sample-apps/blank-java/pom.xml | 6 +++--- sample-apps/java-basic/build.gradle | 6 +++--- sample-apps/java-basic/pom.xml | 4 ++-- sample-apps/java-events-v1sdk/build.gradle | 6 +++--- sample-apps/java-events-v1sdk/pom.xml | 6 +++--- sample-apps/java-events/build.gradle | 6 +++--- sample-apps/java-events/pom.xml | 4 ++-- sample-apps/s3-java/build.gradle | 6 +++--- sample-apps/s3-java/pom.xml | 6 +++--- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 08319924..d7724a64 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -310,9 +310,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index f8853ba6..5a7587da 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -17,9 +17,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 7e9a8dbc..2d36e63d 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 software.amazon.awssdk @@ -118,7 +118,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.16.0 + 2.17.0 diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index 14bdf57a..cf3cfba1 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -9,9 +9,9 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.16.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.16.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + testImplementation 'org.apache.logging.log4j:log4j-api:2.17.0' + testImplementation 'org.apache.logging.log4j:log4j-core:2.17.0' + testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index ecab98f3..0f3372cd 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -25,7 +25,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 test @@ -37,7 +37,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 test diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index 739d8653..c5daa3a6 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -17,9 +17,9 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index 49a7678d..62ce5b20 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 com.amazonaws @@ -122,7 +122,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.16.0 + 2.17.0 diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index 8f82c06a..4563c3ae 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -10,9 +10,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index ad471866..f066fd3a 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -30,7 +30,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 org.apache.logging.log4j @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 org.junit.jupiter diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index daa1b295..acde5657 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -15,9 +15,9 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index e25eb6f0..3ad2cbb8 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 com.amazonaws @@ -117,7 +117,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.16.0 + 2.17.0 From f54ddb8a7bdc0167983c79fddbb1e6f3902ec193 Mon Sep 17 00:00:00 2001 From: eriboo Date: Mon, 20 Dec 2021 15:20:10 -0800 Subject: [PATCH 90/94] Missed some outdated log4 versions. --- doc_source/java-package.md | 10 +++++----- sample-apps/blank-java/pom.xml | 2 +- sample-apps/java-basic/pom.xml | 2 +- sample-apps/java-events-v1sdk/pom.xml | 2 +- sample-apps/java-events/pom.xml | 2 +- sample-apps/s3-java/pom.xml | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 4bf6634f..c2af7569 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -112,10 +112,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } @@ -214,7 +214,7 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.13.0 + 2.17.0 diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 2d36e63d..5063e4fd 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 org.apache.logging.log4j diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 0f3372cd..128e931f 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -31,7 +31,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 test diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index 62ce5b20..8e24bf3d 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 org.apache.logging.log4j diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index f066fd3a..09f530e6 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 org.apache.logging.log4j diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 3ad2cbb8..3785d1b7 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 org.apache.logging.log4j From 5640d93efd12cf9d546029f5a099396aed3f8b57 Mon Sep 17 00:00:00 2001 From: eriboo Date: Tue, 21 Dec 2021 11:35:04 -0800 Subject: [PATCH 91/94] Updating aws-lambda-java-log4j2 to 1.5.0 --- doc_source/java-logging.md | 2 +- doc_source/java-package.md | 2 +- sample-apps/blank-java/build.gradle | 2 +- sample-apps/blank-java/pom.xml | 2 +- sample-apps/java-events-v1sdk/build.gradle | 2 +- sample-apps/java-events-v1sdk/pom.xml | 2 +- sample-apps/s3-java/build.gradle | 2 +- sample-apps/s3-java/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index d7724a64..cd0960cf 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -313,7 +313,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/doc_source/java-package.md b/doc_source/java-package.md index c2af7569..d90feb27 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -115,7 +115,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 5a7587da..a52c2d1e 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -20,7 +20,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 5063e4fd..b58c4b7a 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.4.0 + 1.5.0 com.google.code.gson diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index c5daa3a6..8de68744 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -20,7 +20,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index 8e24bf3d..7b618f7b 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.4.0 + 1.5.0 com.google.code.gson diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index acde5657..1b83d37f 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -18,7 +18,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 3785d1b7..0a71ebd2 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.4.0 + 1.5.0 com.google.code.gson From f72c2ddfe0e0d877f37cc0664d9ee8d4a14f999e Mon Sep 17 00:00:00 2001 From: eriboo Date: Mon, 3 Jan 2022 20:20:10 -0800 Subject: [PATCH 92/94] Updating aws-sdk versions. --- sample-apps/blank-nodejs/package.json | 2 +- sample-apps/error-processor/package.json | 2 +- sample-apps/list-manager/processor/package.json | 2 +- sample-apps/nodejs-apig/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sample-apps/blank-nodejs/package.json b/sample-apps/blank-nodejs/package.json index 9fa06adb..b1b429f8 100644 --- a/sample-apps/blank-nodejs/package.json +++ b/sample-apps/blank-nodejs/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "devDependencies": { - "aws-sdk": "2.631.0", + "aws-sdk": "2.814.0", "jest": "25.4.0" }, "dependencies": { diff --git a/sample-apps/error-processor/package.json b/sample-apps/error-processor/package.json index bd2bfa96..700647b0 100644 --- a/sample-apps/error-processor/package.json +++ b/sample-apps/error-processor/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "devDependencies": { - "aws-sdk": "2.631.0" + "aws-sdk": "2.814.0" }, "dependencies": { "aws-xray-sdk-core": "1.1.2", diff --git a/sample-apps/list-manager/processor/package.json b/sample-apps/list-manager/processor/package.json index 1428d7bd..18e2befc 100644 --- a/sample-apps/list-manager/processor/package.json +++ b/sample-apps/list-manager/processor/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": {}, "devDependencies": { - "aws-sdk": "2.488.0", + "aws-sdk": "2.814.0", "aws-xray-sdk-core": "2.4.0", "aws-xray-sdk-mysql": "2.4.0", "md5": "2.2.1", diff --git a/sample-apps/nodejs-apig/package.json b/sample-apps/nodejs-apig/package.json index 271c8428..efb1ca11 100644 --- a/sample-apps/nodejs-apig/package.json +++ b/sample-apps/nodejs-apig/package.json @@ -3,6 +3,6 @@ "version": "1.0.0", "private": true, "devDependencies": { - "aws-sdk": "2.631.0" + "aws-sdk": "2.814.0" } } From 0efbd3a3e7ac9e83f689246b996bcc40a69b3281 Mon Sep 17 00:00:00 2001 From: eriboo Date: Wed, 12 Jan 2022 11:30:26 -0800 Subject: [PATCH 93/94] Updating log4j versions. --- doc_source/java-logging.md | 6 +++--- doc_source/java-package.md | 8 ++++---- sample-apps/blank-java/build.gradle | 6 +++--- sample-apps/blank-java/pom.xml | 8 ++++---- sample-apps/java-basic/build.gradle | 6 +++--- sample-apps/java-basic/pom.xml | 6 +++--- sample-apps/java-events-v1sdk/build.gradle | 6 +++--- sample-apps/java-events-v1sdk/pom.xml | 8 ++++---- sample-apps/java-events/build.gradle | 6 +++--- sample-apps/java-events/pom.xml | 6 +++--- sample-apps/s3-java/build.gradle | 6 +++--- sample-apps/s3-java/pom.xml | 8 ++++---- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index cd0960cf..2297df33 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -310,9 +310,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/doc_source/java-package.md b/doc_source/java-package.md index d90feb27..5c43578a 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -112,9 +112,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' @@ -214,7 +214,7 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.17.0 + [2.17.1,) diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index a52c2d1e..0c2e47ef 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -17,9 +17,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index b58c4b7a..85cc2f58 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) software.amazon.awssdk @@ -118,7 +118,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.17.0 + [2.17.1,) diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index cf3cfba1..2e9e324b 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -9,9 +9,9 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.17.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.17.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + testImplementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + testImplementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 128e931f..9aa99c47 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -25,19 +25,19 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) test org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) test org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) test diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index 8de68744..0a7d3bdc 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -17,9 +17,9 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index 7b618f7b..bb3fe158 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) com.amazonaws @@ -122,7 +122,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.17.0 + [2.17.1,) diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index 4563c3ae..f98131dc 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -10,9 +10,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index 09f530e6..771e1af6 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -30,17 +30,17 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) org.junit.jupiter diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 1b83d37f..0c8eb35a 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -15,9 +15,9 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 0a71ebd2..31a30dcf 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) com.amazonaws @@ -117,7 +117,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.17.0 + [2.17.1,) From 2be81b8fa0e4b7ecb20892909bcd01da2e6cb61c Mon Sep 17 00:00:00 2001 From: eriboo Date: Wed, 23 Feb 2022 15:26:34 -0800 Subject: [PATCH 94/94] Syncing with dev guide. --- doc_source/API_AccountLimit.md | 10 +- doc_source/API_AccountUsage.md | 8 +- doc_source/API_AddLayerVersionPermission.md | 40 +-- doc_source/API_AddPermission.md | 38 +-- doc_source/API_AliasConfiguration.md | 10 +- doc_source/API_AliasRoutingConfiguration.md | 8 +- doc_source/API_AllowedPublishers.md | 8 +- doc_source/API_CodeSigningConfig.md | 12 +- doc_source/API_CodeSigningPolicies.md | 8 +- doc_source/API_Concurrency.md | 8 +- doc_source/API_CreateAlias.md | 44 +-- doc_source/API_CreateCodeSigningConfig.md | 32 +- doc_source/API_CreateEventSourceMapping.md | 135 ++++---- doc_source/API_CreateFunction.md | 166 +++++----- doc_source/API_DeadLetterConfig.md | 8 +- doc_source/API_DeleteAlias.md | 22 +- doc_source/API_DeleteCodeSigningConfig.md | 20 +- doc_source/API_DeleteEventSourceMapping.md | 83 +++-- doc_source/API_DeleteFunction.md | 24 +- .../API_DeleteFunctionCodeSigningConfig.md | 20 +- doc_source/API_DeleteFunctionConcurrency.md | 20 +- .../API_DeleteFunctionEventInvokeConfig.md | 24 +- doc_source/API_DeleteLayerVersion.md | 24 +- .../API_DeleteProvisionedConcurrencyConfig.md | 22 +- doc_source/API_DestinationConfig.md | 12 +- doc_source/API_Environment.md | 8 +- doc_source/API_EnvironmentError.md | 8 +- doc_source/API_EnvironmentResponse.md | 10 +- .../API_EventSourceMappingConfiguration.md | 21 +- doc_source/API_FileSystemConfig.md | 8 +- doc_source/API_Filter.md | 20 ++ doc_source/API_FilterCriteria.md | 18 + doc_source/API_FunctionCode.md | 8 +- doc_source/API_FunctionCodeLocation.md | 8 +- doc_source/API_FunctionConfiguration.md | 22 +- doc_source/API_FunctionEventInvokeConfig.md | 10 +- doc_source/API_GetAccountSettings.md | 26 +- doc_source/API_GetAlias.md | 36 +- doc_source/API_GetCodeSigningConfig.md | 24 +- doc_source/API_GetEventSourceMapping.md | 83 +++-- doc_source/API_GetFunction.md | 36 +- .../API_GetFunctionCodeSigningConfig.md | 24 +- doc_source/API_GetFunctionConcurrency.md | 24 +- doc_source/API_GetFunctionConfiguration.md | 104 +++--- .../API_GetFunctionEventInvokeConfig.md | 36 +- doc_source/API_GetLayerVersion.md | 44 +-- doc_source/API_GetLayerVersionByArn.md | 42 +-- doc_source/API_GetLayerVersionPolicy.md | 28 +- doc_source/API_GetPolicy.md | 26 +- .../API_GetProvisionedConcurrencyConfig.md | 34 +- doc_source/API_ImageConfig.md | 8 +- doc_source/API_ImageConfigError.md | 8 +- doc_source/API_ImageConfigResponse.md | 12 +- doc_source/API_Invoke.md | 40 +-- doc_source/API_InvokeAsync.md | 26 +- doc_source/API_Layer.md | 10 +- doc_source/API_LayerVersionContentInput.md | 10 +- doc_source/API_LayerVersionContentOutput.md | 10 +- doc_source/API_LayerVersionsListItem.md | 10 +- doc_source/API_LayersListItem.md | 12 +- doc_source/API_ListAliases.md | 32 +- doc_source/API_ListCodeSigningConfigs.md | 28 +- doc_source/API_ListEventSourceMappings.md | 39 ++- .../API_ListFunctionEventInvokeConfigs.md | 32 +- doc_source/API_ListFunctions.md | 34 +- .../API_ListFunctionsByCodeSigningConfig.md | 28 +- doc_source/API_ListLayerVersions.md | 36 +- doc_source/API_ListLayers.md | 34 +- .../API_ListProvisionedConcurrencyConfigs.md | 30 +- doc_source/API_ListTags.md | 24 +- doc_source/API_ListVersionsByFunction.md | 30 +- doc_source/API_OnFailure.md | 8 +- doc_source/API_OnSuccess.md | 8 +- doc_source/API_Operations.md | 116 +++---- ...PI_ProvisionedConcurrencyConfigListItem.md | 8 +- doc_source/API_PublishLayerVersion.md | 58 ++-- doc_source/API_PublishVersion.md | 110 +++--- .../API_PutFunctionCodeSigningConfig.md | 26 +- doc_source/API_PutFunctionConcurrency.md | 28 +- .../API_PutFunctionEventInvokeConfig.md | 46 +-- .../API_PutProvisionedConcurrencyConfig.md | 36 +- doc_source/API_Reference.md | 0 .../API_RemoveLayerVersionPermission.md | 28 +- doc_source/API_RemovePermission.md | 28 +- doc_source/API_SelfManagedEventSource.md | 8 +- doc_source/API_SourceAccessConfiguration.md | 12 +- doc_source/API_TagResource.md | 22 +- doc_source/API_TracingConfig.md | 10 +- doc_source/API_TracingConfigResponse.md | 8 +- doc_source/API_Types.md | 74 +++-- doc_source/API_UntagResource.md | 22 +- doc_source/API_UpdateAlias.md | 46 +-- doc_source/API_UpdateCodeSigningConfig.md | 34 +- doc_source/API_UpdateEventSourceMapping.md | 123 ++++--- doc_source/API_UpdateFunctionCode.md | 132 ++++---- doc_source/API_UpdateFunctionConfiguration.md | 148 ++++----- .../API_UpdateFunctionEventInvokeConfig.md | 44 +-- doc_source/API_VpcConfig.md | 8 +- doc_source/API_VpcConfigResponse.md | 8 +- doc_source/access-control-identity-based.md | 0 doc_source/access-control-resource-based.md | 4 +- doc_source/applications-console.md | 0 doc_source/applications-tutorial.md | 0 doc_source/applications-usecases.md | 0 doc_source/best-practices.md | 5 +- doc_source/configuration-aliases.md | 8 +- doc_source/configuration-codesigning.md | 2 +- doc_source/configuration-concurrency.md | 2 +- doc_source/configuration-database.md | 6 +- doc_source/configuration-envvars.md | 6 +- doc_source/configuration-filesystem.md | 6 +- doc_source/configuration-function-common.md | 12 +- doc_source/configuration-function-zip.md | 10 +- doc_source/configuration-images.md | 8 +- doc_source/configuration-layers.md | 4 +- doc_source/configuration-tags.md | 6 +- doc_source/configuration-versions.md | 2 +- doc_source/configuration-vpc-endpoints.md | 0 doc_source/configuration-vpc.md | 4 +- doc_source/csharp-context.md | 0 doc_source/csharp-exceptions.md | 10 +- doc_source/csharp-handler.md | 197 ++++++++--- doc_source/csharp-image.md | 3 +- doc_source/csharp-logging.md | 27 +- doc_source/csharp-package-cli.md | 37 ++- doc_source/csharp-package-toolkit.md | 11 +- doc_source/csharp-package.md | 0 doc_source/csharp-tracing.md | 2 +- doc_source/deploying-lambda-apps.md | 0 doc_source/foundation-arch.md | 2 +- doc_source/foundation-console.md | 0 doc_source/foundation-networking.md | 0 doc_source/foundation-progmodel.md | 0 doc_source/functions-states.md | 4 +- doc_source/getting-started-create-function.md | 8 +- doc_source/getting-started.md | 0 doc_source/gettingstarted-awscli.md | 0 doc_source/gettingstarted-concepts.md | 2 +- doc_source/gettingstarted-features.md | 4 +- doc_source/gettingstarted-images.md | 12 +- doc_source/gettingstarted-limits.md | 4 +- doc_source/gettingstarted-package.md | 0 doc_source/glossary.md | 0 doc_source/go-image.md | 2 +- doc_source/golang-context.md | 0 doc_source/golang-envvars.md | 0 doc_source/golang-exceptions.md | 4 +- doc_source/golang-handler.md | 0 doc_source/golang-logging.md | 2 +- doc_source/golang-package.md | 0 doc_source/golang-tracing.md | 2 +- doc_source/images-create.md | 0 doc_source/images-test.md | 0 doc_source/index.md | 20 +- doc_source/invocation-async.md | 14 +- doc_source/invocation-eventfiltering.md | 312 ++++++++++++++++++ doc_source/invocation-eventsourcemapping.md | 39 ++- doc_source/invocation-images.md | 0 doc_source/invocation-layers.md | 6 +- doc_source/invocation-retries.md | 2 +- doc_source/invocation-scaling.md | 14 +- doc_source/invocation-sync.md | 0 doc_source/java-context.md | 0 doc_source/java-exceptions.md | 4 +- doc_source/java-handler.md | 0 doc_source/java-image.md | 2 +- doc_source/java-logging.md | 17 +- doc_source/java-package-eclipse.md | 0 doc_source/java-package.md | 24 +- doc_source/java-samples.md | 0 doc_source/java-tracing.md | 2 +- doc_source/kinesis-tutorial-spec.md | 2 +- doc_source/lambda-api-permissions-ref.md | 96 ++---- doc_source/lambda-csharp.md | 5 +- doc_source/lambda-edge.md | 0 doc_source/lambda-foundation.md | 0 doc_source/lambda-functions.md | 0 doc_source/lambda-golang.md | 0 doc_source/lambda-images.md | 0 doc_source/lambda-intro-execution-role.md | 33 +- doc_source/lambda-invocation.md | 15 +- doc_source/lambda-java.md | 0 doc_source/lambda-managing.md | 0 doc_source/lambda-monitoring.md | 4 +- doc_source/lambda-nodejs.md | 15 + doc_source/lambda-permissions.md | 0 doc_source/lambda-powershell.md | 1 + doc_source/lambda-python.md | 0 doc_source/lambda-releases.md | 3 +- doc_source/lambda-rolling-deployments.md | 0 doc_source/lambda-ruby.md | 0 doc_source/lambda-runtimes.md | 1 + doc_source/lambda-samples.md | 0 doc_source/lambda-security.md | 0 doc_source/lambda-services.md | 2 +- doc_source/lambda-settingup.md | 0 doc_source/lambda-stepfunctions.md | 0 doc_source/lambda-troubleshooting.md | 0 doc_source/logging-using-cloudtrail.md | 22 +- doc_source/monitoring-cloudwatchlogs.md | 11 +- doc_source/monitoring-code-profiler.md | 4 +- .../monitoring-functions-access-metrics.md | 34 +- doc_source/monitoring-insights.md | 2 +- doc_source/monitoring-metrics.md | 43 +-- doc_source/monitoring-servicemap.md | 4 +- doc_source/nodejs-context.md | 0 doc_source/nodejs-exceptions.md | 4 +- doc_source/nodejs-handler.md | 8 + doc_source/nodejs-image.md | 5 +- doc_source/nodejs-logging.md | 2 +- doc_source/nodejs-package.md | 0 doc_source/nodejs-tracing.md | 2 +- doc_source/permissions-boundary.md | 0 doc_source/powershell-context.md | 0 doc_source/powershell-devenv.md | 0 doc_source/powershell-exceptions.md | 4 +- doc_source/powershell-handler.md | 2 +- doc_source/powershell-logging.md | 2 +- doc_source/powershell-package.md | 0 doc_source/provisioned-concurrency.md | 4 +- doc_source/python-context.md | 0 doc_source/python-exceptions.md | 4 +- doc_source/python-handler.md | 2 +- doc_source/python-image.md | 2 +- doc_source/python-logging.md | 2 +- doc_source/python-package.md | 6 +- doc_source/python-tracing.md | 2 +- doc_source/ruby-context.md | 0 doc_source/ruby-exceptions.md | 4 +- doc_source/ruby-handler.md | 0 doc_source/ruby-image.md | 2 +- doc_source/ruby-logging.md | 2 +- doc_source/ruby-package.md | 0 doc_source/ruby-tracing.md | 2 +- doc_source/runtime-support-policy.md | 8 +- doc_source/runtimes-api.md | 0 doc_source/runtimes-avx2.md | 0 doc_source/runtimes-context.md | 0 doc_source/runtimes-custom.md | 0 doc_source/runtimes-extensions-api.md | 2 +- doc_source/runtimes-images.md | 0 doc_source/runtimes-logs-api.md | 0 doc_source/runtimes-modify.md | 0 doc_source/runtimes-walkthrough.md | 2 +- doc_source/samples-blank.md | 2 +- doc_source/samples-errorprocessor.md | 0 doc_source/samples-listmanager.md | 0 doc_source/security-compliance.md | 0 doc_source/security-configuration.md | 0 doc_source/security-dataprotection.md | 0 doc_source/security-iam.md | 0 doc_source/security-infrastructure.md | 0 doc_source/security-resilience.md | 0 .../security_iam_id-based-policy-examples.md | 0 doc_source/security_iam_service-with-iam.md | 0 doc_source/security_iam_troubleshoot.md | 0 doc_source/services-alb.md | 0 doc_source/services-alexa.md | 0 doc_source/services-apigateway-blueprint.md | 0 doc_source/services-apigateway-code.md | 0 doc_source/services-apigateway-template.md | 0 doc_source/services-apigateway-tutorial.md | 2 +- doc_source/services-apigateway.md | 2 +- doc_source/services-cloudformation.md | 0 .../services-cloudwatchevents-expressions.md | 0 .../services-cloudwatchevents-tutorial.md | 4 +- doc_source/services-cloudwatchevents.md | 3 +- doc_source/services-cloudwatchlogs.md | 0 doc_source/services-codecommit.md | 0 doc_source/services-codepipeline.md | 0 doc_source/services-cognito.md | 0 doc_source/services-config.md | 0 doc_source/services-connect.md | 0 doc_source/services-ec2-tutorial.md | 0 doc_source/services-ec2.md | 0 doc_source/services-efs.md | 0 doc_source/services-elasticache-tutorial.md | 0 doc_source/services-iot.md | 0 doc_source/services-iotevents.md | 0 doc_source/services-kinesisfirehose.md | 0 doc_source/services-lex.md | 0 doc_source/services-rds-tutorial.md | 0 doc_source/services-rds.md | 0 doc_source/services-s3-batch.md | 2 +- doc_source/services-s3-object-lambda.md | 0 doc_source/services-ses.md | 0 doc_source/services-stepfunctions.md | 0 doc_source/services-xray.md | 2 +- doc_source/stepfunctions-lc.md | 0 doc_source/stepfunctions-patterns.md | 0 doc_source/troubleshooting-deployment.md | 0 doc_source/troubleshooting-execution.md | 0 doc_source/troubleshooting-images.md | 0 doc_source/troubleshooting-invocation.md | 0 doc_source/troubleshooting-networking.md | 20 +- doc_source/using-extensions.md | 2 +- doc_source/welcome.md | 2 +- doc_source/with-android-create-package.md | 0 doc_source/with-android-example.md | 2 +- doc_source/with-cloudtrail-create-package.md | 0 doc_source/with-cloudtrail-example.md | 0 doc_source/with-cloudtrail.md | 2 +- doc_source/with-ddb-create-package.md | 0 doc_source/with-ddb-example.md | 6 +- doc_source/with-ddb.md | 34 +- doc_source/with-kafka.md | 288 ++++++++++++---- doc_source/with-kinesis-create-package.md | 0 .../with-kinesis-example-use-app-spec.md | 0 doc_source/with-kinesis-example.md | 2 +- doc_source/with-kinesis.md | 26 +- doc_source/with-mq.md | 16 +- doc_source/with-msk.md | 237 ++++++++++--- doc_source/with-on-demand-custom-android.md | 0 doc_source/with-s3-example-use-app-spec.md | 2 +- doc_source/with-s3-example.md | 6 +- doc_source/with-s3-tutorial.md | 10 +- doc_source/with-s3.md | 2 +- ...th-scheduledevents-example-use-app-spec.md | 52 --- doc_source/with-secrets-manager.md | 0 doc_source/with-sns-create-package.md | 0 doc_source/with-sns-example.md | 54 +-- doc_source/with-sns.md | 0 doc_source/with-sqs-create-package.md | 0 doc_source/with-sqs-cross-account-example.md | 2 +- doc_source/with-sqs-example-use-app-spec.md | 2 +- doc_source/with-sqs-example.md | 2 +- doc_source/with-sqs.md | 140 ++++++-- 327 files changed, 3156 insertions(+), 2220 deletions(-) mode change 100644 => 100755 doc_source/API_AccountLimit.md mode change 100644 => 100755 doc_source/API_AccountUsage.md mode change 100644 => 100755 doc_source/API_AddLayerVersionPermission.md mode change 100644 => 100755 doc_source/API_AddPermission.md mode change 100644 => 100755 doc_source/API_AliasConfiguration.md mode change 100644 => 100755 doc_source/API_AliasRoutingConfiguration.md mode change 100644 => 100755 doc_source/API_AllowedPublishers.md mode change 100644 => 100755 doc_source/API_CodeSigningConfig.md mode change 100644 => 100755 doc_source/API_CodeSigningPolicies.md mode change 100644 => 100755 doc_source/API_Concurrency.md mode change 100644 => 100755 doc_source/API_CreateAlias.md mode change 100644 => 100755 doc_source/API_CreateCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_CreateEventSourceMapping.md mode change 100644 => 100755 doc_source/API_CreateFunction.md mode change 100644 => 100755 doc_source/API_DeadLetterConfig.md mode change 100644 => 100755 doc_source/API_DeleteAlias.md mode change 100644 => 100755 doc_source/API_DeleteCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_DeleteEventSourceMapping.md mode change 100644 => 100755 doc_source/API_DeleteFunction.md mode change 100644 => 100755 doc_source/API_DeleteFunctionCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_DeleteFunctionConcurrency.md mode change 100644 => 100755 doc_source/API_DeleteFunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_DeleteLayerVersion.md mode change 100644 => 100755 doc_source/API_DeleteProvisionedConcurrencyConfig.md mode change 100644 => 100755 doc_source/API_DestinationConfig.md mode change 100644 => 100755 doc_source/API_Environment.md mode change 100644 => 100755 doc_source/API_EnvironmentError.md mode change 100644 => 100755 doc_source/API_EnvironmentResponse.md mode change 100644 => 100755 doc_source/API_EventSourceMappingConfiguration.md mode change 100644 => 100755 doc_source/API_FileSystemConfig.md create mode 100755 doc_source/API_Filter.md create mode 100755 doc_source/API_FilterCriteria.md mode change 100644 => 100755 doc_source/API_FunctionCode.md mode change 100644 => 100755 doc_source/API_FunctionCodeLocation.md mode change 100644 => 100755 doc_source/API_FunctionConfiguration.md mode change 100644 => 100755 doc_source/API_FunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_GetAccountSettings.md mode change 100644 => 100755 doc_source/API_GetAlias.md mode change 100644 => 100755 doc_source/API_GetCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_GetEventSourceMapping.md mode change 100644 => 100755 doc_source/API_GetFunction.md mode change 100644 => 100755 doc_source/API_GetFunctionCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_GetFunctionConcurrency.md mode change 100644 => 100755 doc_source/API_GetFunctionConfiguration.md mode change 100644 => 100755 doc_source/API_GetFunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_GetLayerVersion.md mode change 100644 => 100755 doc_source/API_GetLayerVersionByArn.md mode change 100644 => 100755 doc_source/API_GetLayerVersionPolicy.md mode change 100644 => 100755 doc_source/API_GetPolicy.md mode change 100644 => 100755 doc_source/API_GetProvisionedConcurrencyConfig.md mode change 100644 => 100755 doc_source/API_ImageConfig.md mode change 100644 => 100755 doc_source/API_ImageConfigError.md mode change 100644 => 100755 doc_source/API_ImageConfigResponse.md mode change 100644 => 100755 doc_source/API_Invoke.md mode change 100644 => 100755 doc_source/API_InvokeAsync.md mode change 100644 => 100755 doc_source/API_Layer.md mode change 100644 => 100755 doc_source/API_LayerVersionContentInput.md mode change 100644 => 100755 doc_source/API_LayerVersionContentOutput.md mode change 100644 => 100755 doc_source/API_LayerVersionsListItem.md mode change 100644 => 100755 doc_source/API_LayersListItem.md mode change 100644 => 100755 doc_source/API_ListAliases.md mode change 100644 => 100755 doc_source/API_ListCodeSigningConfigs.md mode change 100644 => 100755 doc_source/API_ListEventSourceMappings.md mode change 100644 => 100755 doc_source/API_ListFunctionEventInvokeConfigs.md mode change 100644 => 100755 doc_source/API_ListFunctions.md mode change 100644 => 100755 doc_source/API_ListFunctionsByCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_ListLayerVersions.md mode change 100644 => 100755 doc_source/API_ListLayers.md mode change 100644 => 100755 doc_source/API_ListProvisionedConcurrencyConfigs.md mode change 100644 => 100755 doc_source/API_ListTags.md mode change 100644 => 100755 doc_source/API_ListVersionsByFunction.md mode change 100644 => 100755 doc_source/API_OnFailure.md mode change 100644 => 100755 doc_source/API_OnSuccess.md mode change 100644 => 100755 doc_source/API_Operations.md mode change 100644 => 100755 doc_source/API_ProvisionedConcurrencyConfigListItem.md mode change 100644 => 100755 doc_source/API_PublishLayerVersion.md mode change 100644 => 100755 doc_source/API_PublishVersion.md mode change 100644 => 100755 doc_source/API_PutFunctionCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_PutFunctionConcurrency.md mode change 100644 => 100755 doc_source/API_PutFunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_PutProvisionedConcurrencyConfig.md mode change 100644 => 100755 doc_source/API_Reference.md mode change 100644 => 100755 doc_source/API_RemoveLayerVersionPermission.md mode change 100644 => 100755 doc_source/API_RemovePermission.md mode change 100644 => 100755 doc_source/API_SelfManagedEventSource.md mode change 100644 => 100755 doc_source/API_SourceAccessConfiguration.md mode change 100644 => 100755 doc_source/API_TagResource.md mode change 100644 => 100755 doc_source/API_TracingConfig.md mode change 100644 => 100755 doc_source/API_TracingConfigResponse.md mode change 100644 => 100755 doc_source/API_Types.md mode change 100644 => 100755 doc_source/API_UntagResource.md mode change 100644 => 100755 doc_source/API_UpdateAlias.md mode change 100644 => 100755 doc_source/API_UpdateCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_UpdateEventSourceMapping.md mode change 100644 => 100755 doc_source/API_UpdateFunctionCode.md mode change 100644 => 100755 doc_source/API_UpdateFunctionConfiguration.md mode change 100644 => 100755 doc_source/API_UpdateFunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_VpcConfig.md mode change 100644 => 100755 doc_source/API_VpcConfigResponse.md mode change 100644 => 100755 doc_source/access-control-identity-based.md mode change 100644 => 100755 doc_source/access-control-resource-based.md mode change 100644 => 100755 doc_source/applications-console.md mode change 100644 => 100755 doc_source/applications-tutorial.md mode change 100644 => 100755 doc_source/applications-usecases.md mode change 100644 => 100755 doc_source/best-practices.md mode change 100644 => 100755 doc_source/configuration-aliases.md mode change 100644 => 100755 doc_source/configuration-codesigning.md mode change 100644 => 100755 doc_source/configuration-concurrency.md mode change 100644 => 100755 doc_source/configuration-database.md mode change 100644 => 100755 doc_source/configuration-envvars.md mode change 100644 => 100755 doc_source/configuration-filesystem.md mode change 100644 => 100755 doc_source/configuration-function-common.md mode change 100644 => 100755 doc_source/configuration-function-zip.md mode change 100644 => 100755 doc_source/configuration-images.md mode change 100644 => 100755 doc_source/configuration-layers.md mode change 100644 => 100755 doc_source/configuration-tags.md mode change 100644 => 100755 doc_source/configuration-versions.md mode change 100644 => 100755 doc_source/configuration-vpc-endpoints.md mode change 100644 => 100755 doc_source/configuration-vpc.md mode change 100644 => 100755 doc_source/csharp-context.md mode change 100644 => 100755 doc_source/csharp-exceptions.md mode change 100644 => 100755 doc_source/csharp-handler.md mode change 100644 => 100755 doc_source/csharp-image.md mode change 100644 => 100755 doc_source/csharp-logging.md mode change 100644 => 100755 doc_source/csharp-package-cli.md mode change 100644 => 100755 doc_source/csharp-package-toolkit.md mode change 100644 => 100755 doc_source/csharp-package.md mode change 100644 => 100755 doc_source/csharp-tracing.md mode change 100644 => 100755 doc_source/deploying-lambda-apps.md mode change 100644 => 100755 doc_source/foundation-arch.md mode change 100644 => 100755 doc_source/foundation-console.md mode change 100644 => 100755 doc_source/foundation-networking.md mode change 100644 => 100755 doc_source/foundation-progmodel.md mode change 100644 => 100755 doc_source/functions-states.md mode change 100644 => 100755 doc_source/getting-started-create-function.md mode change 100644 => 100755 doc_source/getting-started.md mode change 100644 => 100755 doc_source/gettingstarted-awscli.md mode change 100644 => 100755 doc_source/gettingstarted-concepts.md mode change 100644 => 100755 doc_source/gettingstarted-features.md mode change 100644 => 100755 doc_source/gettingstarted-images.md mode change 100644 => 100755 doc_source/gettingstarted-limits.md mode change 100644 => 100755 doc_source/gettingstarted-package.md mode change 100644 => 100755 doc_source/glossary.md mode change 100644 => 100755 doc_source/go-image.md mode change 100644 => 100755 doc_source/golang-context.md mode change 100644 => 100755 doc_source/golang-envvars.md mode change 100644 => 100755 doc_source/golang-exceptions.md mode change 100644 => 100755 doc_source/golang-handler.md mode change 100644 => 100755 doc_source/golang-logging.md mode change 100644 => 100755 doc_source/golang-package.md mode change 100644 => 100755 doc_source/golang-tracing.md mode change 100644 => 100755 doc_source/images-create.md mode change 100644 => 100755 doc_source/images-test.md mode change 100644 => 100755 doc_source/index.md mode change 100644 => 100755 doc_source/invocation-async.md create mode 100755 doc_source/invocation-eventfiltering.md mode change 100644 => 100755 doc_source/invocation-eventsourcemapping.md mode change 100644 => 100755 doc_source/invocation-images.md mode change 100644 => 100755 doc_source/invocation-layers.md mode change 100644 => 100755 doc_source/invocation-retries.md mode change 100644 => 100755 doc_source/invocation-scaling.md mode change 100644 => 100755 doc_source/invocation-sync.md mode change 100644 => 100755 doc_source/java-context.md mode change 100644 => 100755 doc_source/java-exceptions.md mode change 100644 => 100755 doc_source/java-handler.md mode change 100644 => 100755 doc_source/java-image.md mode change 100644 => 100755 doc_source/java-logging.md mode change 100644 => 100755 doc_source/java-package-eclipse.md mode change 100644 => 100755 doc_source/java-package.md mode change 100644 => 100755 doc_source/java-samples.md mode change 100644 => 100755 doc_source/java-tracing.md mode change 100644 => 100755 doc_source/kinesis-tutorial-spec.md mode change 100644 => 100755 doc_source/lambda-api-permissions-ref.md mode change 100644 => 100755 doc_source/lambda-csharp.md mode change 100644 => 100755 doc_source/lambda-edge.md mode change 100644 => 100755 doc_source/lambda-foundation.md mode change 100644 => 100755 doc_source/lambda-functions.md mode change 100644 => 100755 doc_source/lambda-golang.md mode change 100644 => 100755 doc_source/lambda-images.md mode change 100644 => 100755 doc_source/lambda-intro-execution-role.md mode change 100644 => 100755 doc_source/lambda-invocation.md mode change 100644 => 100755 doc_source/lambda-java.md mode change 100644 => 100755 doc_source/lambda-managing.md mode change 100644 => 100755 doc_source/lambda-monitoring.md mode change 100644 => 100755 doc_source/lambda-nodejs.md mode change 100644 => 100755 doc_source/lambda-permissions.md mode change 100644 => 100755 doc_source/lambda-powershell.md mode change 100644 => 100755 doc_source/lambda-python.md mode change 100644 => 100755 doc_source/lambda-releases.md mode change 100644 => 100755 doc_source/lambda-rolling-deployments.md mode change 100644 => 100755 doc_source/lambda-ruby.md mode change 100644 => 100755 doc_source/lambda-runtimes.md mode change 100644 => 100755 doc_source/lambda-samples.md mode change 100644 => 100755 doc_source/lambda-security.md mode change 100644 => 100755 doc_source/lambda-services.md mode change 100644 => 100755 doc_source/lambda-settingup.md mode change 100644 => 100755 doc_source/lambda-stepfunctions.md mode change 100644 => 100755 doc_source/lambda-troubleshooting.md mode change 100644 => 100755 doc_source/logging-using-cloudtrail.md mode change 100644 => 100755 doc_source/monitoring-cloudwatchlogs.md mode change 100644 => 100755 doc_source/monitoring-code-profiler.md mode change 100644 => 100755 doc_source/monitoring-functions-access-metrics.md mode change 100644 => 100755 doc_source/monitoring-insights.md mode change 100644 => 100755 doc_source/monitoring-metrics.md mode change 100644 => 100755 doc_source/monitoring-servicemap.md mode change 100644 => 100755 doc_source/nodejs-context.md mode change 100644 => 100755 doc_source/nodejs-exceptions.md mode change 100644 => 100755 doc_source/nodejs-handler.md mode change 100644 => 100755 doc_source/nodejs-image.md mode change 100644 => 100755 doc_source/nodejs-logging.md mode change 100644 => 100755 doc_source/nodejs-package.md mode change 100644 => 100755 doc_source/nodejs-tracing.md mode change 100644 => 100755 doc_source/permissions-boundary.md mode change 100644 => 100755 doc_source/powershell-context.md mode change 100644 => 100755 doc_source/powershell-devenv.md mode change 100644 => 100755 doc_source/powershell-exceptions.md mode change 100644 => 100755 doc_source/powershell-handler.md mode change 100644 => 100755 doc_source/powershell-logging.md mode change 100644 => 100755 doc_source/powershell-package.md mode change 100644 => 100755 doc_source/provisioned-concurrency.md mode change 100644 => 100755 doc_source/python-context.md mode change 100644 => 100755 doc_source/python-exceptions.md mode change 100644 => 100755 doc_source/python-handler.md mode change 100644 => 100755 doc_source/python-image.md mode change 100644 => 100755 doc_source/python-logging.md mode change 100644 => 100755 doc_source/python-package.md mode change 100644 => 100755 doc_source/python-tracing.md mode change 100644 => 100755 doc_source/ruby-context.md mode change 100644 => 100755 doc_source/ruby-exceptions.md mode change 100644 => 100755 doc_source/ruby-handler.md mode change 100644 => 100755 doc_source/ruby-image.md mode change 100644 => 100755 doc_source/ruby-logging.md mode change 100644 => 100755 doc_source/ruby-package.md mode change 100644 => 100755 doc_source/ruby-tracing.md mode change 100644 => 100755 doc_source/runtime-support-policy.md mode change 100644 => 100755 doc_source/runtimes-api.md mode change 100644 => 100755 doc_source/runtimes-avx2.md mode change 100644 => 100755 doc_source/runtimes-context.md mode change 100644 => 100755 doc_source/runtimes-custom.md mode change 100644 => 100755 doc_source/runtimes-extensions-api.md mode change 100644 => 100755 doc_source/runtimes-images.md mode change 100644 => 100755 doc_source/runtimes-logs-api.md mode change 100644 => 100755 doc_source/runtimes-modify.md mode change 100644 => 100755 doc_source/runtimes-walkthrough.md mode change 100644 => 100755 doc_source/samples-blank.md mode change 100644 => 100755 doc_source/samples-errorprocessor.md mode change 100644 => 100755 doc_source/samples-listmanager.md mode change 100644 => 100755 doc_source/security-compliance.md mode change 100644 => 100755 doc_source/security-configuration.md mode change 100644 => 100755 doc_source/security-dataprotection.md mode change 100644 => 100755 doc_source/security-iam.md mode change 100644 => 100755 doc_source/security-infrastructure.md mode change 100644 => 100755 doc_source/security-resilience.md mode change 100644 => 100755 doc_source/security_iam_id-based-policy-examples.md mode change 100644 => 100755 doc_source/security_iam_service-with-iam.md mode change 100644 => 100755 doc_source/security_iam_troubleshoot.md mode change 100644 => 100755 doc_source/services-alb.md mode change 100644 => 100755 doc_source/services-alexa.md mode change 100644 => 100755 doc_source/services-apigateway-blueprint.md mode change 100644 => 100755 doc_source/services-apigateway-code.md mode change 100644 => 100755 doc_source/services-apigateway-template.md mode change 100644 => 100755 doc_source/services-apigateway-tutorial.md mode change 100644 => 100755 doc_source/services-apigateway.md mode change 100644 => 100755 doc_source/services-cloudformation.md mode change 100644 => 100755 doc_source/services-cloudwatchevents-expressions.md mode change 100644 => 100755 doc_source/services-cloudwatchevents-tutorial.md mode change 100644 => 100755 doc_source/services-cloudwatchevents.md mode change 100644 => 100755 doc_source/services-cloudwatchlogs.md mode change 100644 => 100755 doc_source/services-codecommit.md mode change 100644 => 100755 doc_source/services-codepipeline.md mode change 100644 => 100755 doc_source/services-cognito.md mode change 100644 => 100755 doc_source/services-config.md mode change 100644 => 100755 doc_source/services-connect.md mode change 100644 => 100755 doc_source/services-ec2-tutorial.md mode change 100644 => 100755 doc_source/services-ec2.md mode change 100644 => 100755 doc_source/services-efs.md mode change 100644 => 100755 doc_source/services-elasticache-tutorial.md mode change 100644 => 100755 doc_source/services-iot.md mode change 100644 => 100755 doc_source/services-iotevents.md mode change 100644 => 100755 doc_source/services-kinesisfirehose.md mode change 100644 => 100755 doc_source/services-lex.md mode change 100644 => 100755 doc_source/services-rds-tutorial.md mode change 100644 => 100755 doc_source/services-rds.md mode change 100644 => 100755 doc_source/services-s3-batch.md mode change 100644 => 100755 doc_source/services-s3-object-lambda.md mode change 100644 => 100755 doc_source/services-ses.md mode change 100644 => 100755 doc_source/services-stepfunctions.md mode change 100644 => 100755 doc_source/services-xray.md mode change 100644 => 100755 doc_source/stepfunctions-lc.md mode change 100644 => 100755 doc_source/stepfunctions-patterns.md mode change 100644 => 100755 doc_source/troubleshooting-deployment.md mode change 100644 => 100755 doc_source/troubleshooting-execution.md mode change 100644 => 100755 doc_source/troubleshooting-images.md mode change 100644 => 100755 doc_source/troubleshooting-invocation.md mode change 100644 => 100755 doc_source/troubleshooting-networking.md mode change 100644 => 100755 doc_source/using-extensions.md mode change 100644 => 100755 doc_source/welcome.md mode change 100644 => 100755 doc_source/with-android-create-package.md mode change 100644 => 100755 doc_source/with-android-example.md mode change 100644 => 100755 doc_source/with-cloudtrail-create-package.md mode change 100644 => 100755 doc_source/with-cloudtrail-example.md mode change 100644 => 100755 doc_source/with-cloudtrail.md mode change 100644 => 100755 doc_source/with-ddb-create-package.md mode change 100644 => 100755 doc_source/with-ddb-example.md mode change 100644 => 100755 doc_source/with-ddb.md mode change 100644 => 100755 doc_source/with-kafka.md mode change 100644 => 100755 doc_source/with-kinesis-create-package.md mode change 100644 => 100755 doc_source/with-kinesis-example-use-app-spec.md mode change 100644 => 100755 doc_source/with-kinesis-example.md mode change 100644 => 100755 doc_source/with-kinesis.md mode change 100644 => 100755 doc_source/with-mq.md mode change 100644 => 100755 doc_source/with-msk.md mode change 100644 => 100755 doc_source/with-on-demand-custom-android.md mode change 100644 => 100755 doc_source/with-s3-example-use-app-spec.md mode change 100644 => 100755 doc_source/with-s3-example.md mode change 100644 => 100755 doc_source/with-s3-tutorial.md mode change 100644 => 100755 doc_source/with-s3.md delete mode 100644 doc_source/with-scheduledevents-example-use-app-spec.md mode change 100644 => 100755 doc_source/with-secrets-manager.md mode change 100644 => 100755 doc_source/with-sns-create-package.md mode change 100644 => 100755 doc_source/with-sns-example.md mode change 100644 => 100755 doc_source/with-sns.md mode change 100644 => 100755 doc_source/with-sqs-create-package.md mode change 100644 => 100755 doc_source/with-sqs-cross-account-example.md mode change 100644 => 100755 doc_source/with-sqs-example-use-app-spec.md mode change 100644 => 100755 doc_source/with-sqs-example.md mode change 100644 => 100755 doc_source/with-sqs.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md old mode 100644 new mode 100755 index 8f1ca0c8..24a89f4d --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -25,7 +25,7 @@ Type: Long Required: No ** UnreservedConcurrentExecutions ** -The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. +The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. Type: Integer Valid Range: Minimum value of 0\. Required: No @@ -33,7 +33,7 @@ Required: No ## See Also 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/AccountLimit) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountLimit) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md old mode 100644 new mode 100755 index d316b7b8..5717c170 --- a/doc_source/API_AccountUsage.md +++ b/doc_source/API_AccountUsage.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/AccountUsage) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountUsage) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md old mode 100644 new mode 100755 index f06b3e02..1ee2de37 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -1,8 +1,8 @@ # AddLayerVersionPermission -Adds permissions to the resource\-based policy of a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. +Adds permissions to the resource\-based policy of a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. -To revoke permission, call [ RemoveLayerVersionPermission ](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. +To revoke permission, call [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. ## Request Syntax @@ -22,16 +22,16 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ LayerName ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [LayerName](#API_AddLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ RevisionId ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [RevisionId](#API_AddLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [ VersionNumber ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [VersionNumber](#API_AddLayerVersionPermission_RequestSyntax) ** The version number\. Required: Yes @@ -39,27 +39,27 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Action ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [Action](#API_AddLayerVersionPermission_RequestSyntax) ** The API action that grants access to the layer\. For example, `lambda:GetLayerVersion`\. Type: String Length Constraints: Maximum length of 22\. Pattern: `lambda:GetLayerVersion` Required: Yes - ** [ OrganizationId ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [OrganizationId](#API_AddLayerVersionPermission_RequestSyntax) ** With the principal set to `*`, grant permission to all accounts in the specified organization\. Type: String Length Constraints: Maximum length of 34\. Pattern: `o-[a-z0-9]{10,32}` Required: No - ** [ Principal ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [Principal](#API_AddLayerVersionPermission_RequestSyntax) ** An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts \(if `organizationId` is not specified\)\. For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer\. Type: String Pattern: `\d{12}|\*|arn:(aws[a-zA-Z-]*):iam::\d{12}:root` Required: Yes - ** [ StatementId ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [StatementId](#API_AddLayerVersionPermission_RequestSyntax) ** An identifier that distinguishes the policy from others on the same layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 100\. @@ -84,11 +84,11 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ RevisionId ](#API_AddLayerVersionPermission_ResponseSyntax) ** + ** [RevisionId](#API_AddLayerVersionPermission_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String - ** [ Statement ](#API_AddLayerVersionPermission_ResponseSyntax) ** + ** [Statement](#API_AddLayerVersionPermission_ResponseSyntax) ** The permission statement\. Type: String @@ -125,12 +125,12 @@ HTTP Status Code: 429 ## See Also 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/AddLayerVersionPermission) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddLayerVersionPermission) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md old mode 100644 new mode 100755 index 4889c9d4..17759770 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -27,7 +27,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_AddPermission_RequestSyntax) ** + ** [FunctionName](#API_AddPermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -39,7 +39,7 @@ 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 - ** [ Qualifier ](#API_AddPermission_RequestSyntax) ** + ** [Qualifier](#API_AddPermission_RequestSyntax) ** Specify a version or alias to add permissions to a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -48,45 +48,45 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [ Action ](#API_AddPermission_RequestSyntax) ** + ** [Action](#API_AddPermission_RequestSyntax) ** The action that the principal can use on the function\. For example, `lambda:InvokeFunction` or `lambda:GetFunction`\. Type: String Pattern: `(lambda:[*]|lambda:[a-zA-Z]+|[*])` Required: Yes - ** [ EventSourceToken ](#API_AddPermission_RequestSyntax) ** + ** [EventSourceToken](#API_AddPermission_RequestSyntax) ** For Alexa Smart Home functions, a token that must be supplied by the invoker\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Pattern: `[a-zA-Z0-9._\-]+` Required: No - ** [ Principal ](#API_AddPermission_RequestSyntax) ** + ** [Principal](#API_AddPermission_RequestSyntax) ** The AWS service or account that invokes the function\. If you specify a service, use `SourceArn` or `SourceAccount` to limit who can invoke the function through that service\. Type: String Pattern: `[^\s]+` Required: Yes - ** [ RevisionId ](#API_AddPermission_RequestSyntax) ** + ** [RevisionId](#API_AddPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. Type: String Required: No - ** [ SourceAccount ](#API_AddPermission_RequestSyntax) ** + ** [SourceAccount](#API_AddPermission_RequestSyntax) ** For Amazon S3, the ID of the account that owns the resource\. Use this together with `SourceArn` to ensure that the resource is owned by the specified account\. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account\. Type: String Length Constraints: Maximum length of 12\. Pattern: `\d{12}` Required: No - ** [ SourceArn ](#API_AddPermission_RequestSyntax) ** + ** [SourceArn](#API_AddPermission_RequestSyntax) ** For AWS services, the ARN of the AWS resource that invokes the function\. For example, an Amazon S3 bucket or Amazon SNS topic\. Note that Lambda configures the comparison using the `StringLike` operator\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - ** [ StatementId ](#API_AddPermission_RequestSyntax) ** + ** [StatementId](#API_AddPermission_RequestSyntax) ** A statement identifier that differentiates the statement from others in the same policy\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 100\. @@ -110,7 +110,7 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ Statement ](#API_AddPermission_ResponseSyntax) ** + ** [Statement](#API_AddPermission_ResponseSyntax) ** The permission statement that's added to the function policy\. Type: String @@ -147,12 +147,12 @@ HTTP Status Code: 429 ## See Also 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/AddPermission) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddPermission) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddPermission) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddPermission) \ No newline at end of file diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md old mode 100644 new mode 100755 index 13d6487b..b6aa0d1b --- a/doc_source/API_AliasConfiguration.md +++ b/doc_source/API_AliasConfiguration.md @@ -37,13 +37,13 @@ Required: No ** RoutingConfig ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object Required: No ## See Also 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/AliasConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md old mode 100644 new mode 100755 index 8eab8c2a..c2c4021b --- a/doc_source/API_AliasRoutingConfiguration.md +++ b/doc_source/API_AliasRoutingConfiguration.md @@ -15,7 +15,7 @@ Required: No ## See Also 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/AliasRoutingConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasRoutingConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md old mode 100644 new mode 100755 index 1060d3b2..498de6b5 --- a/doc_source/API_AllowedPublishers.md +++ b/doc_source/API_AllowedPublishers.md @@ -14,7 +14,7 @@ Required: Yes ## See Also 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/AllowedPublishers) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md old mode 100644 new mode 100755 index 10c2381f..99a1c44d --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -6,7 +6,7 @@ Details about a [Code signing configuration](https://docs.aws.amazon.com/lambda/ ** AllowedPublishers ** List of allowed publishers\. -Type: [ AllowedPublishers ](API_AllowedPublishers.md) object +Type: [AllowedPublishers](API_AllowedPublishers.md) object Required: Yes ** CodeSigningConfigArn ** @@ -24,7 +24,7 @@ Required: Yes ** CodeSigningPolicies ** The code signing policy controls the validation failure action for signature mismatch or expiry\. -Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object +Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object Required: Yes ** Description ** @@ -41,7 +41,7 @@ Required: Yes ## See Also 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/CodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md old mode 100644 new mode 100755 index fdeb3b45..6ce8eb1a --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -14,7 +14,7 @@ Required: No ## See Also 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/CodeSigningPolicies) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md old mode 100644 new mode 100755 index b9c53c9d..f555752a --- a/doc_source/API_Concurrency.md +++ b/doc_source/API_Concurrency.md @@ -11,7 +11,7 @@ Required: No ## See Also 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/Concurrency) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Concurrency) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md old mode 100644 new mode 100755 index 710f21c9..328a580c --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -26,7 +26,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_CreateAlias_RequestSyntax) ** + ** [FunctionName](#API_CreateAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -42,29 +42,29 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Description ](#API_CreateAlias_RequestSyntax) ** + ** [Description](#API_CreateAlias_RequestSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ FunctionVersion ](#API_CreateAlias_RequestSyntax) ** + ** [FunctionVersion](#API_CreateAlias_RequestSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: Yes - ** [ Name ](#API_CreateAlias_RequestSyntax) ** + ** [Name](#API_CreateAlias_RequestSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` Required: Yes - ** [ RoutingConfig ](#API_CreateAlias_RequestSyntax) ** + ** [RoutingConfig](#API_CreateAlias_RequestSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object Required: No ## Response Syntax @@ -93,35 +93,35 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ AliasArn ](#API_CreateAlias_ResponseSyntax) ** + ** [AliasArn](#API_CreateAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. 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-_]+))?` - ** [ Description ](#API_CreateAlias_ResponseSyntax) ** + ** [Description](#API_CreateAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ FunctionVersion ](#API_CreateAlias_ResponseSyntax) ** + ** [FunctionVersion](#API_CreateAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ Name ](#API_CreateAlias_ResponseSyntax) ** + ** [Name](#API_CreateAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [ RevisionId ](#API_CreateAlias_ResponseSyntax) ** + ** [RevisionId](#API_CreateAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [ RoutingConfig ](#API_CreateAlias_ResponseSyntax) ** + ** [RoutingConfig](#API_CreateAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object ## Errors @@ -148,12 +148,12 @@ HTTP Status Code: 429 ## See Also 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/CreateAlias) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateAlias) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateAlias) \ No newline at end of file diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md old mode 100644 new mode 100755 index eaa6639a..399ed29b --- a/doc_source/API_CreateCodeSigningConfig.md +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -27,17 +27,17 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [ AllowedPublishers ](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [AllowedPublishers](#API_CreateCodeSigningConfig_RequestSyntax) ** Signing profiles for this code signing configuration\. -Type: [ AllowedPublishers ](API_AllowedPublishers.md) object +Type: [AllowedPublishers](API_AllowedPublishers.md) object Required: Yes - ** [ CodeSigningPolicies ](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningPolicies](#API_CreateCodeSigningConfig_RequestSyntax) ** The code signing policies define the actions to take if the validation checks fail\. -Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object +Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object Required: No - ** [ Description ](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [Description](#API_CreateCodeSigningConfig_RequestSyntax) ** Descriptive name for this code signing configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. @@ -71,9 +71,9 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfig ](#API_CreateCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfig](#API_CreateCodeSigningConfig_ResponseSyntax) ** The code signing configuration\. -Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object +Type: [CodeSigningConfig](API_CodeSigningConfig.md) object ## Errors @@ -88,12 +88,12 @@ HTTP Status Code: 500 ## See Also 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/CreateCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md old mode 100644 new mode 100755 index 1e63ae7f..e24d8261 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -44,6 +44,13 @@ Content-type: application/json }, "Enabled": boolean, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionName": "string", "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, @@ -77,7 +84,7 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [ BatchSize ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [BatchSize](#API_CreateEventSourceMapping_RequestSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. @@ -89,23 +96,23 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - ** [ BisectBatchOnFunctionError ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No - ** [ DestinationConfig ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [DestinationConfig](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No - ** [ Enabled ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [Enabled](#API_CreateEventSourceMapping_RequestSyntax) ** When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. Default: True Type: Boolean Required: No - ** [ EventSourceArn ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [EventSourceArn](#API_CreateEventSourceMapping_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. @@ -115,7 +122,12 @@ Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - ** [ FunctionName ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [FilterCriteria](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object +Required: No + + ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -129,14 +141,14 @@ 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 - ** [ FunctionResponseTypes ](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams only\) A list of current response type enums applied to the event source mapping\. + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - ** [ MaximumBatchingWindowInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. @@ -144,25 +156,25 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - ** [ MaximumRecordAgeInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - ** [ MaximumRetryAttempts ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - ** [ ParallelizationFactor ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ParallelizationFactor](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - ** [ Queues ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [Queues](#API_CreateEventSourceMapping_RequestSyntax) ** \(MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -170,29 +182,29 @@ Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` Required: No - ** [ SelfManagedEventSource ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** The Self\-Managed Apache Kafka cluster to send records\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No - ** [ SourceAccessConfigurations ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - ** [ StartingPosition ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No - ** [ StartingPositionTimestamp ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_RequestSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp Required: No - ** [ Topics ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -200,7 +212,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No - ** [ TumblingWindowInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. @@ -224,6 +236,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -260,113 +279,117 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [ BatchSize ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [BatchSize](#API_CreateEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [ BisectBatchOnFunctionError ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [ DestinationConfig ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [DestinationConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ EventSourceArn ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [EventSourceArn](#API_CreateEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionArn ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [FilterCriteria](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object + + ** [FunctionArn](#API_CreateEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda 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-_]+))?` - ** [ FunctionResponseTypes ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [ LastModified ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [ LastProcessingResult ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [LastProcessingResult](#API_CreateEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [ MaximumBatchingWindowInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [ MaximumRecordAgeInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [ MaximumRetryAttempts ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ ParallelizationFactor ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [ Queues ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [Queues](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [ SelfManagedEventSource ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [ SourceAccessConfigurations ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [ StartingPosition ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [ StartingPositionTimestamp ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [ State ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [ StateTransitionReason ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [StateTransitionReason](#API_CreateEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [ Topics ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [ TumblingWindowInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [ UUID ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -395,12 +418,12 @@ HTTP Status Code: 429 ## See Also 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/CreateEventSourceMapping) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateEventSourceMapping) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md old mode 100644 new mode 100755 index b2cbf94b..ac3dcc1f --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -6,17 +6,17 @@ You set the package type to `Image` if the deployment package is a [container im You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. The code in the deployment package must be compatible with the target instruction set architecture of the function \(`x86-64` or `arm64`\)\. If you do not specify the architecture, the default value is `x86-64`\. -When you create 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 or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. +When you create 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 or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. A function has an unpublished version, and can have published versions and aliases\. The unpublished version changes when you update your function's code and configuration\. A published version is a snapshot of your function code and configuration that can't be changed\. An alias is a named resource that maps to a version, and can be changed to map to a different version\. Use the `Publish` parameter to create version `1` of your function from its initial configuration\. -The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([ TagResource ](API_TagResource.md)\) and per\-function concurrency limits \([ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\)\. +The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. -You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [ UpdateFunctionCode ](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. +You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. -If another account or an AWS service invokes your function, use [ AddPermission ](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. +If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. -To invoke your function directly, use [ Invoke ](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([ CreateEventSourceMapping ](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. +To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. ## Request Syntax @@ -85,48 +85,48 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [ Architectures ](#API_CreateFunction_RequestSyntax) ** + ** [Architectures](#API_CreateFunction_RequestSyntax) ** The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` Required: No - ** [ Code ](#API_CreateFunction_RequestSyntax) ** + ** [Code](#API_CreateFunction_RequestSyntax) ** The code for the function\. -Type: [ FunctionCode ](API_FunctionCode.md) object +Type: [FunctionCode](API_FunctionCode.md) object Required: Yes - ** [ CodeSigningConfigArn ](#API_CreateFunction_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: No - ** [ DeadLetterConfig ](#API_CreateFunction_RequestSyntax) ** + ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** 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 +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object Required: No - ** [ Description ](#API_CreateFunction_RequestSyntax) ** + ** [Description](#API_CreateFunction_RequestSyntax) ** A description of the function\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ Environment ](#API_CreateFunction_RequestSyntax) ** + ** [Environment](#API_CreateFunction_RequestSyntax) ** Environment variables that are accessible from function code during execution\. -Type: [ Environment ](API_Environment.md) object +Type: [Environment](API_Environment.md) object Required: No - ** [ FileSystemConfigs ](#API_CreateFunction_RequestSyntax) ** + ** [FileSystemConfigs](#API_CreateFunction_RequestSyntax) ** Connection settings for an Amazon EFS file system\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - ** [ FunctionName ](#API_CreateFunction_RequestSyntax) ** + ** [FunctionName](#API_CreateFunction_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -139,79 +139,79 @@ 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 - ** [ Handler ](#API_CreateFunction_RequestSyntax) ** -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)\. + ** [Handler](#API_CreateFunction_RequestSyntax) ** +The name of the method within your code that Lambda calls to execute your function\. Handler is required if the deployment package is a \.zip file archive\. 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 - ** [ ImageConfig ](#API_CreateFunction_RequestSyntax) ** + ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** Container image [configuration values](https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-settings) that override the values in the container image Dockerfile\. -Type: [ ImageConfig ](API_ImageConfig.md) object +Type: [ImageConfig](API_ImageConfig.md) object Required: No - ** [ KMSKeyArn ](#API_CreateFunction_RequestSyntax) ** + ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** 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_CreateFunction_RequestSyntax) ** + ** [Layers](#API_CreateFunction_RequestSyntax) ** 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\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` Required: No - ** [ MemorySize ](#API_CreateFunction_RequestSyntax) ** + ** [MemorySize](#API_CreateFunction_RequestSyntax) ** The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - ** [ PackageType ](#API_CreateFunction_RequestSyntax) ** + ** [PackageType](#API_CreateFunction_RequestSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. Type: String Valid Values:` Zip | Image` Required: No - ** [ Publish ](#API_CreateFunction_RequestSyntax) ** + ** [Publish](#API_CreateFunction_RequestSyntax) ** Set to true to publish the first version of the function during creation\. Type: Boolean Required: No - ** [ Role ](#API_CreateFunction_RequestSyntax) ** + ** [Role](#API_CreateFunction_RequestSyntax) ** 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: Yes - ** [ Runtime ](#API_CreateFunction_RequestSyntax) ** -The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. + ** [Runtime](#API_CreateFunction_RequestSyntax) ** +The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Runtime is required if the deployment package is a \.zip file archive\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [ Tags ](#API_CreateFunction_RequestSyntax) ** + ** [Tags](#API_CreateFunction_RequestSyntax) ** A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. Type: String to string map Required: No - ** [ Timeout ](#API_CreateFunction_RequestSyntax) ** + ** [Timeout](#API_CreateFunction_RequestSyntax) ** The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No - ** [ TracingConfig ](#API_CreateFunction_RequestSyntax) ** + ** [TracingConfig](#API_CreateFunction_RequestSyntax) ** Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [ TracingConfig ](API_TracingConfig.md) object +Type: [TracingConfig](API_TracingConfig.md) object Required: No - ** [ VpcConfig ](#API_CreateFunction_RequestSyntax) ** + ** [VpcConfig](#API_CreateFunction_RequestSyntax) ** 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 +Type: [VpcConfig](API_VpcConfig.md) object Required: No ## Response Syntax @@ -300,157 +300,157 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_CreateFunction_ResponseSyntax) ** + ** [Architectures](#API_CreateFunction_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_CreateFunction_ResponseSyntax) ** + ** [CodeSha256](#API_CreateFunction_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_CreateFunction_ResponseSyntax) ** + ** [CodeSize](#API_CreateFunction_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_CreateFunction_ResponseSyntax) ** + ** [DeadLetterConfig](#API_CreateFunction_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_CreateFunction_ResponseSyntax) ** + ** [Description](#API_CreateFunction_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_CreateFunction_ResponseSyntax) ** + ** [Environment](#API_CreateFunction_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_CreateFunction_ResponseSyntax) ** + ** [FileSystemConfigs](#API_CreateFunction_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_CreateFunction_ResponseSyntax) ** + ** [FunctionArn](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [FunctionName](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [Handler](#API_CreateFunction_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_CreateFunction_ResponseSyntax) ** + ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_CreateFunction_ResponseSyntax) ** + ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_CreateFunction_ResponseSyntax) ** + ** [LastModified](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [LastUpdateStatus](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [LastUpdateStatusReason](#API_CreateFunction_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_CreateFunction_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_CreateFunction_ResponseSyntax) ** + ** [Layers](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_CreateFunction_ResponseSyntax) ** + ** [MasterArn](#API_CreateFunction_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main 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_CreateFunction_ResponseSyntax) ** + ** [MemorySize](#API_CreateFunction_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_CreateFunction_ResponseSyntax) ** + ** [PackageType](#API_CreateFunction_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_CreateFunction_ResponseSyntax) ** + ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_CreateFunction_ResponseSyntax) ** + ** [Role](#API_CreateFunction_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [ Runtime ](#API_CreateFunction_ResponseSyntax) ** + ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_CreateFunction_ResponseSyntax) ** + ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_CreateFunction_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_CreateFunction_ResponseSyntax) ** + ** [State](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [StateReason](#API_CreateFunction_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_CreateFunction_ResponseSyntax) ** + ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_CreateFunction_ResponseSyntax) ** + ** [Timeout](#API_CreateFunction_ResponseSyntax) ** 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_CreateFunction_ResponseSyntax) ** + ** [TracingConfig](#API_CreateFunction_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_CreateFunction_ResponseSyntax) ** + ** [Version](#API_CreateFunction_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ VpcConfig ](#API_CreateFunction_ResponseSyntax) ** + ** [VpcConfig](#API_CreateFunction_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -493,12 +493,12 @@ HTTP Status Code: 429 ## See Also 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/CreateFunction) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunction) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunction) \ No newline at end of file diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md old mode 100644 new mode 100755 index 472781c8..66c1b753 --- a/doc_source/API_DeadLetterConfig.md +++ b/doc_source/API_DeadLetterConfig.md @@ -13,7 +13,7 @@ Required: No ## See Also 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/DeadLetterConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeadLetterConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md old mode 100644 new mode 100755 index a2009314..e2c9e069 --- a/doc_source/API_DeleteAlias.md +++ b/doc_source/API_DeleteAlias.md @@ -12,7 +12,7 @@ DELETE /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteAlias_RequestSyntax) ** + ** [FunctionName](#API_DeleteAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ 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 - ** [ Name ](#API_DeleteAlias_RequestSyntax) ** + ** [Name](#API_DeleteAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -65,12 +65,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteAlias) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteAlias) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteAlias) \ No newline at end of file diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md old mode 100644 new mode 100755 index 4736a717..871eeff3 --- a/doc_source/API_DeleteCodeSigningConfig.md +++ b/doc_source/API_DeleteCodeSigningConfig.md @@ -12,7 +12,7 @@ DELETE /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 The request uses the following URI parameters\. - ** [ CodeSigningConfigArn ](#API_DeleteCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_DeleteCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -53,12 +53,12 @@ HTTP Status Code: 500 ## See Also 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/DeleteCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md old mode 100644 new mode 100755 index 614c5471..ff0a29db --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -1,6 +1,6 @@ # DeleteEventSourceMapping -Deletes an [event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html)\. You can get the identifier of a mapping from the output of [ ListEventSourceMappings ](API_ListEventSourceMappings.md)\. +Deletes an [event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html)\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. When you delete an event source mapping, it enters a `Deleting` state and might not be completely deleted for several seconds\. @@ -14,7 +14,7 @@ DELETE /2015-03-31/event-source-mappings/UUID HTTP/1.1 The request uses the following URI parameters\. - ** [ UUID ](#API_DeleteEventSourceMapping_RequestSyntax) ** + ** [UUID](#API_DeleteEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -40,6 +40,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -76,113 +83,117 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [ BatchSize ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [BatchSize](#API_DeleteEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [ BisectBatchOnFunctionError ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [BisectBatchOnFunctionError](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [ DestinationConfig ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [DestinationConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ EventSourceArn ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [EventSourceArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionArn ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [FilterCriteria](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object + + ** [FunctionArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda 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-_]+))?` - ** [ FunctionResponseTypes ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [ LastModified ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [ LastProcessingResult ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [LastProcessingResult](#API_DeleteEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [ MaximumBatchingWindowInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [ MaximumRecordAgeInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [ MaximumRetryAttempts ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ ParallelizationFactor ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [ Queues ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [Queues](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [ SelfManagedEventSource ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [ SourceAccessConfigurations ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [ StartingPosition ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [ StartingPositionTimestamp ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [ State ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [ StateTransitionReason ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [StateTransitionReason](#API_DeleteEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [ Topics ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [ TumblingWindowInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [ UUID ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -211,12 +222,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteEventSourceMapping) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteEventSourceMapping) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md old mode 100644 new mode 100755 index 2b753d6f..a6c75339 --- a/doc_source/API_DeleteFunction.md +++ b/doc_source/API_DeleteFunction.md @@ -2,7 +2,7 @@ Deletes a Lambda function\. To delete a specific function version, use the `Qualifier` parameter\. Otherwise, all versions and aliases are deleted\. -To delete Lambda event source mappings that invoke a function, use [ DeleteEventSourceMapping ](API_DeleteEventSourceMapping.md)\. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it\. +To delete Lambda event source mappings that invoke a function, use [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md)\. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it\. ## Request Syntax @@ -14,7 +14,7 @@ DELETE /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteFunction_RequestSyntax) ** + ** [FunctionName](#API_DeleteFunction_RequestSyntax) ** The name of the Lambda function or version\. **Name formats** @@ -26,7 +26,7 @@ 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 - ** [ Qualifier ](#API_DeleteFunction_RequestSyntax) ** + ** [Qualifier](#API_DeleteFunction_RequestSyntax) ** Specify a version to delete\. You can't delete a version that's referenced by an alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteFunction) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunction) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunction) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md old mode 100644 new mode 100755 index 140631dd..e75f7f19 --- a/doc_source/API_DeleteFunctionCodeSigningConfig.md +++ b/doc_source/API_DeleteFunctionCodeSigningConfig.md @@ -12,7 +12,7 @@ DELETE /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** + ** [FunctionName](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -67,12 +67,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md old mode 100644 new mode 100755 index a5d54266..2021e7f2 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ b/doc_source/API_DeleteFunctionConcurrency.md @@ -12,7 +12,7 @@ DELETE /2017-10-31/functions/FunctionName/concurrency HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteFunctionConcurrency_RequestSyntax) ** + ** [FunctionName](#API_DeleteFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -63,12 +63,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteFunctionConcurrency) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionConcurrency) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 8ae03cdb..97c1014e --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Deletes the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ DELETE /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifie The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** + ** [FunctionName](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ 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 - ** [ Qualifier ](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** + ** [Qualifier](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md old mode 100644 new mode 100755 index 7b64f0e2..4c05bfd8 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -1,6 +1,6 @@ # DeleteLayerVersion -Deletes a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Deleted versions can no longer be viewed or added to functions\. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it\. +Deletes a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Deleted versions can no longer be viewed or added to functions\. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it\. ## Request Syntax @@ -12,13 +12,13 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 The request uses the following URI parameters\. - ** [ LayerName ](#API_DeleteLayerVersion_RequestSyntax) ** + ** [LayerName](#API_DeleteLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ VersionNumber ](#API_DeleteLayerVersion_RequestSyntax) ** + ** [VersionNumber](#API_DeleteLayerVersion_RequestSyntax) ** The version number\. Required: Yes @@ -49,12 +49,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteLayerVersion) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteLayerVersion) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteLayerVersion) \ No newline at end of file diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md old mode 100644 new mode 100755 index 3bbd703f..8791b35c --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ b/doc_source/API_DeleteProvisionedConcurrencyConfig.md @@ -12,7 +12,7 @@ DELETE /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qual The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** + ** [FunctionName](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ 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 - ** [ Qualifier ](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** + ** [Qualifier](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -69,12 +69,12 @@ HTTP Status Code: 429 ## See Also 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/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md old mode 100644 new mode 100755 index a0fb8fc5..9d70476f --- a/doc_source/API_DestinationConfig.md +++ b/doc_source/API_DestinationConfig.md @@ -6,18 +6,18 @@ A configuration object that specifies the destination of an event after Lambda p ** OnFailure ** The destination configuration for failed invocations\. -Type: [ OnFailure ](API_OnFailure.md) object +Type: [OnFailure](API_OnFailure.md) object Required: No ** OnSuccess ** The destination configuration for successful invocations\. -Type: [ OnSuccess ](API_OnSuccess.md) object +Type: [OnSuccess](API_OnSuccess.md) object Required: No ## See Also 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/DestinationConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DestinationConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md old mode 100644 new mode 100755 index 0c18270f..f6431eea --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -13,7 +13,7 @@ Required: No ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file ++ [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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md old mode 100644 new mode 100755 index 1532e16f..2ddf454e --- a/doc_source/API_EnvironmentError.md +++ b/doc_source/API_EnvironmentError.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/EnvironmentError) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentError) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md old mode 100644 new mode 100755 index f1dadee3..d3e1bb12 --- a/doc_source/API_EnvironmentResponse.md +++ b/doc_source/API_EnvironmentResponse.md @@ -6,7 +6,7 @@ The results of an operation to update or read environment variables\. If the ope ** Error ** Error messages for environment variables that couldn't be applied\. -Type: [ EnvironmentError ](API_EnvironmentError.md) object +Type: [EnvironmentError](API_EnvironmentError.md) object Required: No ** Variables ** @@ -18,7 +18,7 @@ Required: No ## See Also 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/EnvironmentResponse) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentResponse) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md old mode 100644 new mode 100755 index 6303741e..4cccf1a0 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -1,6 +1,6 @@ # EventSourceMappingConfiguration -A mapping between an AWS resource and a Lambda function\. For details, see [ CreateEventSourceMapping ](API_CreateEventSourceMapping.md)\. +A mapping between an AWS resource and a Lambda function\. For details, see [CreateEventSourceMapping](API_CreateEventSourceMapping.md)\. ## Contents @@ -19,13 +19,18 @@ Required: No ** DestinationConfig ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No ** EventSourceArn ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: No + + ** FilterCriteria ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object Required: No ** FunctionArn ** @@ -87,12 +92,12 @@ Required: No ** SelfManagedEventSource ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No ** SourceAccessConfigurations ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No @@ -139,7 +144,7 @@ Required: No ## See Also 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/EventSourceMappingConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md old mode 100644 new mode 100755 index 9c5257df..36843cd4 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -21,7 +21,7 @@ Required: Yes ## See Also 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/FileSystemConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file diff --git a/doc_source/API_Filter.md b/doc_source/API_Filter.md new file mode 100755 index 00000000..ab0a6041 --- /dev/null +++ b/doc_source/API_Filter.md @@ -0,0 +1,20 @@ +# Filter + + A structure within a `FilterCriteria` object that defines an event filtering pattern\. + +## Contents + + ** Pattern ** + A filter pattern\. For more information on the syntax of a filter pattern, see [ Filter rule syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax)\. +Type: String +Length Constraints: Minimum length of 0\. Maximum length of 4096\. +Pattern: `.*` +Required: No + +## See Also + +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/Filter) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Filter) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Filter) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Filter) \ No newline at end of file diff --git a/doc_source/API_FilterCriteria.md b/doc_source/API_FilterCriteria.md new file mode 100755 index 00000000..06d99095 --- /dev/null +++ b/doc_source/API_FilterCriteria.md @@ -0,0 +1,18 @@ +# FilterCriteria + + An object that contains the filters for an event source\. + +## Contents + + ** Filters ** + A list of filters\. +Type: Array of [Filter](API_Filter.md) objects +Required: No + +## See Also + +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/FilterCriteria) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FilterCriteria) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FilterCriteria) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FilterCriteria) \ No newline at end of file diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md old mode 100644 new mode 100755 index 0a3dfa0f..1289dcdb --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -36,7 +36,7 @@ Required: No ## See Also 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/FunctionCode) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCode) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md old mode 100644 new mode 100755 index d21a8936..0a9aff6c --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -27,7 +27,7 @@ Required: No ## See Also 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/FunctionCodeLocation) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCodeLocation) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md old mode 100644 new mode 100755 index 2896643e..4590062b --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -23,7 +23,7 @@ Required: No ** DeadLetterConfig ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object Required: No ** Description ** @@ -34,12 +34,12 @@ Required: No ** Environment ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object Required: No ** FileSystemConfigs ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No @@ -65,7 +65,7 @@ Required: No ** ImageConfigResponse ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object Required: No ** KMSKeyArn ** @@ -98,7 +98,7 @@ Required: No ** Layers ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects Required: No ** MasterArn ** @@ -173,7 +173,7 @@ Required: No ** TracingConfig ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object Required: No ** Version ** @@ -185,13 +185,13 @@ Required: No ** VpcConfig ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object Required: No ## See Also 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/FunctionConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 1ea75549..d5e27544 --- a/doc_source/API_FunctionEventInvokeConfig.md +++ b/doc_source/API_FunctionEventInvokeConfig.md @@ -10,7 +10,7 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No ** FunctionArn ** @@ -39,7 +39,7 @@ Required: No ## See Also 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/FunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md old mode 100644 new mode 100755 index f18742f2..dd4292cf --- a/doc_source/API_GetAccountSettings.md +++ b/doc_source/API_GetAccountSettings.md @@ -43,13 +43,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ AccountLimit ](#API_GetAccountSettings_ResponseSyntax) ** + ** [AccountLimit](#API_GetAccountSettings_ResponseSyntax) ** Limits that are related to concurrency and code storage\. -Type: [ AccountLimit ](API_AccountLimit.md) object +Type: [AccountLimit](API_AccountLimit.md) object - ** [ AccountUsage ](#API_GetAccountSettings_ResponseSyntax) ** + ** [AccountUsage](#API_GetAccountSettings_ResponseSyntax) ** The number of functions and amount of storage in use\. -Type: [ AccountUsage ](API_AccountUsage.md) object +Type: [AccountUsage](API_AccountUsage.md) object ## Errors @@ -64,12 +64,12 @@ HTTP Status Code: 429 ## See Also 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/GetAccountSettings) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAccountSettings) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAccountSettings) \ No newline at end of file diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md old mode 100644 new mode 100755 index 9c1f7756..fdb3ced6 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetAlias_RequestSyntax) ** + ** [FunctionName](#API_GetAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ 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 - ** [ Name ](#API_GetAlias_RequestSyntax) ** + ** [Name](#API_GetAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -60,35 +60,35 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ AliasArn ](#API_GetAlias_ResponseSyntax) ** + ** [AliasArn](#API_GetAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. 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-_]+))?` - ** [ Description ](#API_GetAlias_ResponseSyntax) ** + ** [Description](#API_GetAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ FunctionVersion ](#API_GetAlias_ResponseSyntax) ** + ** [FunctionVersion](#API_GetAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ Name ](#API_GetAlias_ResponseSyntax) ** + ** [Name](#API_GetAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [ RevisionId ](#API_GetAlias_ResponseSyntax) ** + ** [RevisionId](#API_GetAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [ RoutingConfig ](#API_GetAlias_ResponseSyntax) ** + ** [RoutingConfig](#API_GetAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object ## Errors @@ -111,12 +111,12 @@ HTTP Status Code: 429 ## See Also 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/GetAlias) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAlias) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAlias) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAlias) \ No newline at end of file diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md old mode 100644 new mode 100755 index 7c2d839d..544fa093 --- a/doc_source/API_GetCodeSigningConfig.md +++ b/doc_source/API_GetCodeSigningConfig.md @@ -12,7 +12,7 @@ GET /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 The request uses the following URI parameters\. - ** [ CodeSigningConfigArn ](#API_GetCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_GetCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -50,9 +50,9 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfig ](#API_GetCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfig](#API_GetCodeSigningConfig_ResponseSyntax) ** The code signing configuration -Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object +Type: [CodeSigningConfig](API_CodeSigningConfig.md) object ## Errors @@ -71,12 +71,12 @@ HTTP Status Code: 500 ## See Also 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/GetCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md old mode 100644 new mode 100755 index cb995038..3a417bb2 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -1,6 +1,6 @@ # GetEventSourceMapping -Returns details about an event source mapping\. You can get the identifier of a mapping from the output of [ ListEventSourceMappings ](API_ListEventSourceMappings.md)\. +Returns details about an event source mapping\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2015-03-31/event-source-mappings/UUID HTTP/1.1 The request uses the following URI parameters\. - ** [ UUID ](#API_GetEventSourceMapping_RequestSyntax) ** + ** [UUID](#API_GetEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -38,6 +38,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -74,113 +81,117 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ BatchSize ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [BatchSize](#API_GetEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [ BisectBatchOnFunctionError ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [BisectBatchOnFunctionError](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [ DestinationConfig ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [DestinationConfig](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ EventSourceArn ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [EventSourceArn](#API_GetEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionArn ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [FilterCriteria](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object + + ** [FunctionArn](#API_GetEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda 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-_]+))?` - ** [ FunctionResponseTypes ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [ LastModified ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [ LastProcessingResult ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [LastProcessingResult](#API_GetEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [ MaximumBatchingWindowInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [ MaximumRecordAgeInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [ MaximumRetryAttempts ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ ParallelizationFactor ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [ Queues ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [Queues](#API_GetEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [ SelfManagedEventSource ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [ SourceAccessConfigurations ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [ StartingPosition ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [ StartingPositionTimestamp ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [ State ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [ StateTransitionReason ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [StateTransitionReason](#API_GetEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [ Topics ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [ TumblingWindowInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [ UUID ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -205,12 +216,12 @@ HTTP Status Code: 429 ## See Also 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/GetEventSourceMapping) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetEventSourceMapping) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md old mode 100644 new mode 100755 index 5e0c4c28..9c4083a3 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunction_RequestSyntax) ** + ** [FunctionName](#API_GetFunction_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,7 +24,7 @@ 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-_]+))?` Required: Yes - ** [ Qualifier ](#API_GetFunction_RequestSyntax) ** + ** [Qualifier](#API_GetFunction_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -133,19 +133,19 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Code ](#API_GetFunction_ResponseSyntax) ** + ** [Code](#API_GetFunction_ResponseSyntax) ** The deployment package of the function or version\. -Type: [ FunctionCodeLocation ](API_FunctionCodeLocation.md) object +Type: [FunctionCodeLocation](API_FunctionCodeLocation.md) object - ** [ Concurrency ](#API_GetFunction_ResponseSyntax) ** + ** [Concurrency](#API_GetFunction_ResponseSyntax) ** The function's [reserved concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. -Type: [ Concurrency ](API_Concurrency.md) object +Type: [Concurrency](API_Concurrency.md) object - ** [ Configuration ](#API_GetFunction_ResponseSyntax) ** + ** [Configuration](#API_GetFunction_ResponseSyntax) ** The configuration of the function or version\. -Type: [ FunctionConfiguration ](API_FunctionConfiguration.md) object +Type: [FunctionConfiguration](API_FunctionConfiguration.md) object - ** [ Tags ](#API_GetFunction_ResponseSyntax) ** + ** [Tags](#API_GetFunction_ResponseSyntax) ** The function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. Type: String to string map @@ -170,12 +170,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunction) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunction) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunction) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunction) \ No newline at end of file diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md old mode 100644 new mode 100755 index ebfabc08..be6ec7ca --- a/doc_source/API_GetFunctionCodeSigningConfig.md +++ b/doc_source/API_GetFunctionCodeSigningConfig.md @@ -12,7 +12,7 @@ GET /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** + ** [FunctionName](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -46,13 +46,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfigArn ](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfigArn](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - ** [ FunctionName ](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** + ** [FunctionName](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** The name of the Lambda function\. **Name formats** @@ -85,12 +85,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunctionCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md old mode 100644 new mode 100755 index 017f6474..c6757228 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -1,6 +1,6 @@ # GetFunctionConcurrency -Returns details about the reserved concurrency configuration for a function\. To set a concurrency limit for a function, use [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. +Returns details about the reserved concurrency configuration for a function\. To set a concurrency limit for a function, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/concurrency HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunctionConcurrency_RequestSyntax) ** + ** [FunctionName](#API_GetFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -45,7 +45,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ ReservedConcurrentExecutions ](#API_GetFunctionConcurrency_ResponseSyntax) ** + ** [ReservedConcurrentExecutions](#API_GetFunctionConcurrency_ResponseSyntax) ** The number of simultaneous executions that are reserved for the function\. Type: Integer Valid Range: Minimum value of 0\. @@ -71,12 +71,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunctionConcurrency) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConcurrency) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md old mode 100644 new mode 100755 index e6d676ba..05ae9974 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -1,8 +1,8 @@ # GetFunctionConfiguration -Returns the version\-specific settings of a Lambda function or version\. The output includes only options that can vary between versions of a function\. To modify these settings, use [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. +Returns the version\-specific settings of a Lambda function or version\. The output includes only options that can vary between versions of a function\. To modify these settings, use [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. -To get all of a function's details, including function\-level settings, use [ GetFunction ](API_GetFunction.md)\. +To get all of a function's details, including function\-level settings, use [GetFunction](API_GetFunction.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2015-03-31/functions/FunctionName/configuration?Qualifier=Qualifier HTTP/1. The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunctionConfiguration_RequestSyntax) ** + ** [FunctionName](#API_GetFunctionConfiguration_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ 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-_]+))?` Required: Yes - ** [ Qualifier ](#API_GetFunctionConfiguration_RequestSyntax) ** + ** [Qualifier](#API_GetFunctionConfiguration_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -121,157 +121,157 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Architectures](#API_GetFunctionConfiguration_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [CodeSha256](#API_GetFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [CodeSize](#API_GetFunctionConfiguration_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [DeadLetterConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Description](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Environment](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [FileSystemConfigs](#API_GetFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [FunctionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [FunctionName](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [Handler](#API_GetFunctionConfiguration_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [LastModified](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatus](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatusReason](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [MasterArn](#API_GetFunctionConfiguration_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [MemorySize](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Role](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [ Runtime ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [StateReason](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** 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_GetFunctionConfiguration_ResponseSyntax) ** + ** [TracingConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Version](#API_GetFunctionConfiguration_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ VpcConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [VpcConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -294,12 +294,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunctionConfiguration) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConfiguration) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 4f593364..8c634b3e --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Retrieves the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier H The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** + ** [FunctionName](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ 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 - ** [ Qualifier ](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** + ** [Qualifier](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -63,7 +63,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ DestinationConfig ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [DestinationConfig](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -71,23 +71,23 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ FunctionArn ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [FunctionArn](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the 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-_]+))?` - ** [ LastModified ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [LastModified](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [ MaximumEventAgeInSeconds ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumEventAgeInSeconds](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [ MaximumRetryAttempts ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -113,12 +113,12 @@ HTTP Status Code: 429 ## See Also 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/GetFunctionEventInvokeConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md old mode 100644 new mode 100755 index 16ddd063..072c87e2 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -1,6 +1,6 @@ # GetLayerVersion -Returns information about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. +Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. ## Request Syntax @@ -12,13 +12,13 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 The request uses the following URI parameters\. - ** [ LayerName ](#API_GetLayerVersion_RequestSyntax) ** + ** [LayerName](#API_GetLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ VersionNumber ](#API_GetLayerVersion_RequestSyntax) ** + ** [VersionNumber](#API_GetLayerVersion_RequestSyntax) ** The version number\. Required: Yes @@ -57,49 +57,49 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CompatibleArchitectures ](#API_GetLayerVersion_ResponseSyntax) ** + ** [CompatibleArchitectures](#API_GetLayerVersion_ResponseSyntax) ** A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Type: Array of strings Array Members: Maximum number of 2 items\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntimes ](#API_GetLayerVersion_ResponseSyntax) ** + ** [CompatibleRuntimes](#API_GetLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ Content ](#API_GetLayerVersion_ResponseSyntax) ** + ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. -Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object +Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object - ** [ CreatedDate ](#API_GetLayerVersion_ResponseSyntax) ** + ** [CreatedDate](#API_GetLayerVersion_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ Description ](#API_GetLayerVersion_ResponseSyntax) ** + ** [Description](#API_GetLayerVersion_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ LayerArn ](#API_GetLayerVersion_ResponseSyntax) ** + ** [LayerArn](#API_GetLayerVersion_ResponseSyntax) ** The ARN of the layer\. Type: String 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-_]+` - ** [ LayerVersionArn ](#API_GetLayerVersion_ResponseSyntax) ** + ** [LayerVersionArn](#API_GetLayerVersion_ResponseSyntax) ** The ARN of the layer version\. Type: String 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]+` - ** [ LicenseInfo ](#API_GetLayerVersion_ResponseSyntax) ** + ** [LicenseInfo](#API_GetLayerVersion_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [ Version ](#API_GetLayerVersion_ResponseSyntax) ** + ** [Version](#API_GetLayerVersion_ResponseSyntax) ** The version number\. Type: Long @@ -124,12 +124,12 @@ HTTP Status Code: 429 ## See Also 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/GetLayerVersion) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersion) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersion) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md old mode 100644 new mode 100755 index 8bb8a9d9..459cc51f --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -1,6 +1,6 @@ # GetLayerVersionByArn -Returns information about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. +Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2018-10-31/layers?find=LayerVersion&Arn=Arn HTTP/1.1 The request uses the following URI parameters\. - ** [ Arn ](#API_GetLayerVersionByArn_RequestSyntax) ** + ** [Arn](#API_GetLayerVersionByArn_RequestSyntax) ** The ARN of the layer version\. 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]+` @@ -53,49 +53,49 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CompatibleArchitectures ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [CompatibleArchitectures](#API_GetLayerVersionByArn_ResponseSyntax) ** A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Type: Array of strings Array Members: Maximum number of 2 items\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntimes ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [CompatibleRuntimes](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ Content ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. -Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object +Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object - ** [ CreatedDate ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [CreatedDate](#API_GetLayerVersionByArn_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ Description ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [Description](#API_GetLayerVersionByArn_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ LayerArn ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [LayerArn](#API_GetLayerVersionByArn_ResponseSyntax) ** The ARN of the layer\. Type: String 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-_]+` - ** [ LayerVersionArn ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [LayerVersionArn](#API_GetLayerVersionByArn_ResponseSyntax) ** The ARN of the layer version\. Type: String 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]+` - ** [ LicenseInfo ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [LicenseInfo](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [ Version ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [Version](#API_GetLayerVersionByArn_ResponseSyntax) ** The version number\. Type: Long @@ -120,12 +120,12 @@ HTTP Status Code: 429 ## See Also 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/GetLayerVersionByArn) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionByArn) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionByArn) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md old mode 100644 new mode 100755 index 4fe6a68b..ad5f3319 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -1,6 +1,6 @@ # GetLayerVersionPolicy -Returns the permission policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md)\. +Returns the permission policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. ## Request Syntax @@ -12,13 +12,13 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber/policy HTTP/1.1 The request uses the following URI parameters\. - ** [ LayerName ](#API_GetLayerVersionPolicy_RequestSyntax) ** + ** [LayerName](#API_GetLayerVersionPolicy_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ VersionNumber ](#API_GetLayerVersionPolicy_RequestSyntax) ** + ** [VersionNumber](#API_GetLayerVersionPolicy_RequestSyntax) ** The version number\. Required: Yes @@ -44,11 +44,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Policy ](#API_GetLayerVersionPolicy_ResponseSyntax) ** + ** [Policy](#API_GetLayerVersionPolicy_ResponseSyntax) ** The policy document\. Type: String - ** [ RevisionId ](#API_GetLayerVersionPolicy_ResponseSyntax) ** + ** [RevisionId](#API_GetLayerVersionPolicy_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String @@ -73,12 +73,12 @@ HTTP Status Code: 429 ## See Also 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/GetLayerVersionPolicy) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionPolicy) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionPolicy) \ No newline at end of file diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md old mode 100644 new mode 100755 index c8bac1f3..68add8e0 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/policy?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetPolicy_RequestSyntax) ** + ** [FunctionName](#API_GetPolicy_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,7 +24,7 @@ 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-_]+))?` Required: Yes - ** [ Qualifier ](#API_GetPolicy_RequestSyntax) ** + ** [Qualifier](#API_GetPolicy_RequestSyntax) ** Specify a version or alias to get the policy for that resource\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -51,11 +51,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Policy ](#API_GetPolicy_ResponseSyntax) ** + ** [Policy](#API_GetPolicy_ResponseSyntax) ** The resource\-based policy\. Type: String - ** [ RevisionId ](#API_GetPolicy_ResponseSyntax) ** + ** [RevisionId](#API_GetPolicy_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String @@ -80,12 +80,12 @@ HTTP Status Code: 429 ## See Also 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/GetPolicy) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetPolicy) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetPolicy) \ No newline at end of file diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md old mode 100644 new mode 100755 index 16674dc4..b8da47c5 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifi The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** + ** [FunctionName](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ 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 - ** [ Qualifier ](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** + ** [Qualifier](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -56,31 +56,31 @@ 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) ** + ** [AllocatedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. - ** [ AvailableProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [AvailableProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. - ** [ LastModified ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [LastModified](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** 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 - ** [ RequestedProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [RequestedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. - ** [ Status ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [Status](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` - ** [ StatusReason ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [StatusReason](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String @@ -109,12 +109,12 @@ HTTP Status Code: 429 ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ 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) \ No newline at end of file ++ [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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [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) \ No newline at end of file diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md old mode 100644 new mode 100755 index 151d0ad7..a50ee895 --- a/doc_source/API_ImageConfig.md +++ b/doc_source/API_ImageConfig.md @@ -25,7 +25,7 @@ Required: No ## See Also 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/ImageConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md old mode 100644 new mode 100755 index f64556b5..9a1372b5 --- a/doc_source/API_ImageConfigError.md +++ b/doc_source/API_ImageConfigError.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/ImageConfigError) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md old mode 100644 new mode 100755 index 3337f9ed..fdba6bfb --- a/doc_source/API_ImageConfigResponse.md +++ b/doc_source/API_ImageConfigResponse.md @@ -6,18 +6,18 @@ Response to GetFunctionConfiguration request\. ** Error ** Error response to GetFunctionConfiguration\. -Type: [ ImageConfigError ](API_ImageConfigError.md) object +Type: [ImageConfigError](API_ImageConfigError.md) object Required: No ** ImageConfig ** Configuration values that override the container image Dockerfile\. -Type: [ ImageConfig ](API_ImageConfig.md) object +Type: [ImageConfig](API_ImageConfig.md) object Required: No ## See Also 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/ImageConfigResponse) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md old mode 100644 new mode 100755 index 36f2c5ec..fbbf3396 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -29,10 +29,10 @@ Payload The request uses the following URI parameters\. - ** [ ClientContext ](#API_Invoke_RequestSyntax) ** + ** [ClientContext](#API_Invoke_RequestSyntax) ** Up to 3583 bytes of base64\-encoded data about the invoking client to pass to the function in the context object\. - ** [ FunctionName ](#API_Invoke_RequestSyntax) ** + ** [FunctionName](#API_Invoke_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -44,18 +44,18 @@ 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-_]+))?` Required: Yes - ** [ InvocationType ](#API_Invoke_RequestSyntax) ** + ** [InvocationType](#API_Invoke_RequestSyntax) ** Choose from the following options\. + `RequestResponse` \(default\) \- Invoke the function synchronously\. Keep the connection open until the function returns a response or times out\. The API response includes the function response and additional data\. + `Event` \- Invoke the function asynchronously\. Send events that fail multiple times to the function's dead\-letter queue \(if it's configured\)\. The API response only includes a status code\. + `DryRun` \- Validate parameter values and verify that the user or role has permission to invoke the function\. Valid Values:` Event | RequestResponse | DryRun` - ** [ LogType ](#API_Invoke_RequestSyntax) ** + ** [LogType](#API_Invoke_RequestSyntax) ** Set to `Tail` to include the execution log in the response\. Applies to synchronously invoked functions only\. Valid Values:` None | Tail` - ** [ Qualifier ](#API_Invoke_RequestSyntax) ** + ** [Qualifier](#API_Invoke_RequestSyntax) ** Specify a version or alias to invoke a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -64,7 +64,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following binary data\. - ** [ Payload ](#API_Invoke_RequestSyntax) ** + ** [Payload](#API_Invoke_RequestSyntax) ** The JSON that you want to provide to your Lambda function as input\. You can enter the JSON directly\. For example, `--payload '{ "key": "value" }'`\. You can also specify a file path\. For example, `--payload file://payload.json`\. @@ -83,25 +83,25 @@ Payload If the action is successful, the service sends back the following HTTP response\. - ** [ StatusCode ](#API_Invoke_ResponseSyntax) ** + ** [StatusCode](#API_Invoke_ResponseSyntax) ** The HTTP status code is in the 200 range for a successful request\. For the `RequestResponse` invocation type, this status code is 200\. For the `Event` invocation type, this status code is 202\. For the `DryRun` invocation type, the status code is 204\. The response returns the following HTTP headers\. - ** [ ExecutedVersion ](#API_Invoke_ResponseSyntax) ** + ** [ExecutedVersion](#API_Invoke_ResponseSyntax) ** The version of the function that executed\. When you invoke a function with an alias, this indicates which version the alias resolved to\. Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ FunctionError ](#API_Invoke_ResponseSyntax) ** + ** [FunctionError](#API_Invoke_ResponseSyntax) ** If present, indicates that an error occurred during function execution\. Details about the error are included in the response payload\. - ** [ LogResult ](#API_Invoke_ResponseSyntax) ** + ** [LogResult](#API_Invoke_ResponseSyntax) ** The last 4 KB of the execution log, which is base64 encoded\. The response returns the following as the HTTP body\. - ** [ Payload ](#API_Invoke_ResponseSyntax) ** + ** [Payload](#API_Invoke_ResponseSyntax) ** The response from the function, or an error object\. ## Errors @@ -213,12 +213,12 @@ HTTP Status Code: 415 ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) -+ [ 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) \ No newline at end of file ++ [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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) ++ [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) \ No newline at end of file diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md old mode 100644 new mode 100755 index 0ed67594..8a6281c5 --- a/doc_source/API_InvokeAsync.md +++ b/doc_source/API_InvokeAsync.md @@ -3,7 +3,7 @@ *This action has been deprecated\.* **Important** -For asynchronous function invocation, use [ Invoke ](API_Invoke.md)\. +For asynchronous function invocation, use [Invoke](API_Invoke.md)\. Invokes a function asynchronously\. @@ -19,7 +19,7 @@ InvokeArgs The request uses the following URI parameters\. - ** [ FunctionName ](#API_InvokeAsync_RequestSyntax) ** + ** [FunctionName](#API_InvokeAsync_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -35,7 +35,7 @@ Required: Yes The request accepts the following binary data\. - ** [ InvokeArgs ](#API_InvokeAsync_RequestSyntax) ** + ** [InvokeArgs](#API_InvokeAsync_RequestSyntax) ** The JSON that you want to provide to your Lambda function as input\. Required: Yes @@ -49,7 +49,7 @@ HTTP/1.1 Status If the action is successful, the service sends back the following HTTP response\. - ** [ Status ](#API_InvokeAsync_ResponseSyntax) ** + ** [Status](#API_InvokeAsync_ResponseSyntax) ** The status code\. ## Errors @@ -77,12 +77,12 @@ HTTP Status Code: 500 ## See Also 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/InvokeAsync) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/InvokeAsync) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/InvokeAsync) \ No newline at end of file diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md old mode 100644 new mode 100755 index 8c2f129a..89f0c7a8 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -1,6 +1,6 @@ # Layer -An [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +An [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents @@ -31,7 +31,7 @@ Required: No ## See Also 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/Layer) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Layer) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md old mode 100644 new mode 100755 index 461e603b..3a7d97d3 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -1,6 +1,6 @@ # LayerVersionContentInput -A ZIP archive that contains the contents of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. You can specify either an Amazon S3 location, or upload a layer archive directly\. +A ZIP archive that contains the contents of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. You can specify either an Amazon S3 location, or upload a layer archive directly\. ## Contents @@ -31,7 +31,7 @@ Required: No ## See Also 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/LayerVersionContentInput) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentInput) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md old mode 100644 new mode 100755 index a56a36b3..68c14788 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -1,6 +1,6 @@ # LayerVersionContentOutput -Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents @@ -32,7 +32,7 @@ Required: No ## See Also 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/LayerVersionContentOutput) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentOutput) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md old mode 100644 new mode 100755 index 06495845..a1128be9 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -1,6 +1,6 @@ # LayerVersionsListItem -Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents @@ -50,7 +50,7 @@ Required: No ## See Also 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/LayerVersionsListItem) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionsListItem) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md old mode 100644 new mode 100755 index 4064a303..76e34d54 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -1,12 +1,12 @@ # LayersListItem -Details about an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents ** LatestMatchingVersion ** The newest version of the layer\. -Type: [ LayerVersionsListItem ](API_LayerVersionsListItem.md) object +Type: [LayerVersionsListItem](API_LayerVersionsListItem.md) object Required: No ** LayerArn ** @@ -26,7 +26,7 @@ Required: No ## See Also 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/LayersListItem) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayersListItem) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md old mode 100644 new mode 100755 index 96a8f132..e785f1fb --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/aliases?FunctionVersion=FunctionVersion&M The request uses the following URI parameters\. - ** [ FunctionName ](#API_ListAliases_RequestSyntax) ** + ** [FunctionName](#API_ListAliases_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,15 +24,15 @@ 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 - ** [ FunctionVersion ](#API_ListAliases_RequestSyntax) ** + ** [FunctionVersion](#API_ListAliases_RequestSyntax) ** Specify a function version to only list aliases that invoke that version\. Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ Marker ](#API_ListAliases_RequestSyntax) ** + ** [Marker](#API_ListAliases_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListAliases_RequestSyntax) ** + ** [MaxItems](#API_ListAliases_RequestSyntax) ** Limit the number of aliases returned\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -71,11 +71,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Aliases ](#API_ListAliases_ResponseSyntax) ** + ** [Aliases](#API_ListAliases_ResponseSyntax) ** A list of aliases\. -Type: Array of [ AliasConfiguration ](API_AliasConfiguration.md) objects +Type: Array of [AliasConfiguration](API_AliasConfiguration.md) objects - ** [ NextMarker ](#API_ListAliases_ResponseSyntax) ** + ** [NextMarker](#API_ListAliases_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -100,12 +100,12 @@ HTTP Status Code: 429 ## See Also 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/ListAliases) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListAliases) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListAliases) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListAliases) \ No newline at end of file diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md old mode 100644 new mode 100755 index e5fcdff9..7e951ff5 --- a/doc_source/API_ListCodeSigningConfigs.md +++ b/doc_source/API_ListCodeSigningConfigs.md @@ -12,10 +12,10 @@ GET /2020-04-22/code-signing-configs/?Marker=Marker&MaxItems=MaxItems HTTP/1.1 The request uses the following URI parameters\. - ** [ Marker ](#API_ListCodeSigningConfigs_RequestSyntax) ** + ** [Marker](#API_ListCodeSigningConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListCodeSigningConfigs_RequestSyntax) ** + ** [MaxItems](#API_ListCodeSigningConfigs_RequestSyntax) ** Maximum number of items to return\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -54,11 +54,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfigs ](#API_ListCodeSigningConfigs_ResponseSyntax) ** + ** [CodeSigningConfigs](#API_ListCodeSigningConfigs_ResponseSyntax) ** The code signing configurations -Type: Array of [ CodeSigningConfig ](API_CodeSigningConfig.md) objects +Type: Array of [CodeSigningConfig](API_CodeSigningConfig.md) objects - ** [ NextMarker ](#API_ListCodeSigningConfigs_ResponseSyntax) ** + ** [NextMarker](#API_ListCodeSigningConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -75,12 +75,12 @@ HTTP Status Code: 500 ## See Also 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/ListCodeSigningConfigs) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md old mode 100644 new mode 100755 index 05fffac7..4c9b3cc4 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -12,7 +12,7 @@ GET /2015-03-31/event-source-mappings/?EventSourceArn=EventSourceArn&FunctionNam The request uses the following URI parameters\. - ** [ EventSourceArn ](#API_ListEventSourceMappings_RequestSyntax) ** + ** [EventSourceArn](#API_ListEventSourceMappings_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. @@ -20,7 +20,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionName ](#API_ListEventSourceMappings_RequestSyntax) ** + ** [FunctionName](#API_ListEventSourceMappings_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -32,10 +32,10 @@ The length constraint applies only to the full ARN\. If you specify only the fun 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-_]+))?` - ** [ Marker ](#API_ListEventSourceMappings_RequestSyntax) ** + ** [Marker](#API_ListEventSourceMappings_RequestSyntax) ** A pagination token returned by a previous call\. - ** [ MaxItems ](#API_ListEventSourceMappings_RequestSyntax) ** + ** [MaxItems](#API_ListEventSourceMappings_RequestSyntax) ** The maximum number of event source mappings to return\. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -63,6 +63,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -102,11 +109,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ EventSourceMappings ](#API_ListEventSourceMappings_ResponseSyntax) ** + ** [EventSourceMappings](#API_ListEventSourceMappings_ResponseSyntax) ** A list of event source mappings\. -Type: Array of [ EventSourceMappingConfiguration ](API_EventSourceMappingConfiguration.md) objects +Type: Array of [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) objects - ** [ NextMarker ](#API_ListEventSourceMappings_ResponseSyntax) ** + ** [NextMarker](#API_ListEventSourceMappings_ResponseSyntax) ** A pagination token that's returned when the response doesn't contain all event source mappings\. Type: String @@ -131,12 +138,12 @@ HTTP Status Code: 429 ## See Also 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/ListEventSourceMappings) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListEventSourceMappings) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListEventSourceMappings) \ No newline at end of file diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md old mode 100644 new mode 100755 index 86f29bc5..56f281a8 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -2,7 +2,7 @@ Retrieves a list of configurations for asynchronous invocation for a function\. -To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config/list?Marker=Marker&Ma The request uses the following URI parameters\. - ** [ FunctionName ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [FunctionName](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -26,10 +26,10 @@ 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 - ** [ Marker ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [Marker](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [MaxItems](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** The maximum number of configurations to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -70,11 +70,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ FunctionEventInvokeConfigs ](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** + ** [FunctionEventInvokeConfigs](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** A list of configurations\. -Type: Array of [ FunctionEventInvokeConfig ](API_FunctionEventInvokeConfig.md) objects +Type: Array of [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) objects - ** [ NextMarker ](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** + ** [NextMarker](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -99,12 +99,12 @@ HTTP Status Code: 429 ## See Also 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/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) \ No newline at end of file diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md old mode 100644 new mode 100755 index 06195eff..507ab5ef --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -5,7 +5,7 @@ Returns a list of Lambda functions, with the version\-specific configuration of Set `FunctionVersion` to `ALL` to include all published versions of each function in addition to the unpublished version\. **Note** -The `ListFunctions` action returns a subset of the [ FunctionConfiguration ](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [ GetFunction ](API_GetFunction.md)\. +The `ListFunctions` action returns a subset of the [FunctionConfiguration](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [GetFunction](API_GetFunction.md)\. ## Request Syntax @@ -17,18 +17,18 @@ GET /2015-03-31/functions/?FunctionVersion=FunctionVersion&Marker=Marker&MasterR The request uses the following URI parameters\. - ** [ FunctionVersion ](#API_ListFunctions_RequestSyntax) ** + ** [FunctionVersion](#API_ListFunctions_RequestSyntax) ** Set to `ALL` to include entries for all published versions of each function\. Valid Values:` ALL` - ** [ Marker ](#API_ListFunctions_RequestSyntax) ** + ** [Marker](#API_ListFunctions_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MasterRegion ](#API_ListFunctions_RequestSyntax) ** + ** [MasterRegion](#API_ListFunctions_RequestSyntax) ** For Lambda@Edge functions, the AWS Region of the master function\. For example, `us-east-1` filters the list of functions to only include Lambda@Edge functions replicated from a master function in US East \(N\. Virginia\)\. If specified, you must set `FunctionVersion` to `ALL`\. Pattern: `ALL|[a-z]{2}(-gov)?-[a-z]+-\d{1}` - ** [ MaxItems ](#API_ListFunctions_RequestSyntax) ** + ** [MaxItems](#API_ListFunctions_RequestSyntax) ** The maximum number of functions to return in the response\. Note that `ListFunctions` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -127,11 +127,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Functions ](#API_ListFunctions_ResponseSyntax) ** + ** [Functions](#API_ListFunctions_ResponseSyntax) ** A list of Lambda functions\. -Type: Array of [ FunctionConfiguration ](API_FunctionConfiguration.md) objects +Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects - ** [ NextMarker ](#API_ListFunctions_ResponseSyntax) ** + ** [NextMarker](#API_ListFunctions_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -152,12 +152,12 @@ HTTP Status Code: 429 ## See Also 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/ListFunctions) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctions) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctions) \ No newline at end of file diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md old mode 100644 new mode 100755 index 04be90ec..60377544 --- a/doc_source/API_ListFunctionsByCodeSigningConfig.md +++ b/doc_source/API_ListFunctionsByCodeSigningConfig.md @@ -12,16 +12,16 @@ GET /2020-04-22/code-signing-configs/CodeSigningConfigArn/functions?Marker=Marke The request uses the following URI parameters\. - ** [ CodeSigningConfigArn ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: Yes - ** [ Marker ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [Marker](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [MaxItems](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** Maximum number of items to return\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -47,12 +47,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ FunctionArns ](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** + ** [FunctionArns](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** The function ARNs\. Type: Array of strings 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-_]+))?` - ** [ NextMarker ](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** + ** [NextMarker](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -73,12 +73,12 @@ HTTP Status Code: 500 ## See Also 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/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md old mode 100644 new mode 100755 index 76259787..c5d0bf21 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -1,6 +1,6 @@ # ListLayerVersions -Lists the versions of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layer versions that are compatible with that architecture\. +Lists the versions of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layer versions that are compatible with that architecture\. ## Request Syntax @@ -12,24 +12,24 @@ GET /2018-10-31/layers/LayerName/versions?CompatibleArchitecture=CompatibleArchi The request uses the following URI parameters\. - ** [ CompatibleArchitecture ](#API_ListLayerVersions_RequestSyntax) ** + ** [CompatibleArchitecture](#API_ListLayerVersions_RequestSyntax) ** The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntime ](#API_ListLayerVersions_RequestSyntax) ** + ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ LayerName ](#API_ListLayerVersions_RequestSyntax) ** + ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ Marker ](#API_ListLayerVersions_RequestSyntax) ** + ** [Marker](#API_ListLayerVersions_RequestSyntax) ** A pagination token returned by a previous call\. - ** [ MaxItems ](#API_ListLayerVersions_RequestSyntax) ** + ** [MaxItems](#API_ListLayerVersions_RequestSyntax) ** The maximum number of versions to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -65,11 +65,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ LayerVersions ](#API_ListLayerVersions_ResponseSyntax) ** + ** [LayerVersions](#API_ListLayerVersions_ResponseSyntax) ** A list of versions\. -Type: Array of [ LayerVersionsListItem ](API_LayerVersionsListItem.md) objects +Type: Array of [LayerVersionsListItem](API_LayerVersionsListItem.md) objects - ** [ NextMarker ](#API_ListLayerVersions_ResponseSyntax) ** + ** [NextMarker](#API_ListLayerVersions_ResponseSyntax) ** A pagination token returned when the response doesn't contain all versions\. Type: String @@ -94,12 +94,12 @@ HTTP Status Code: 429 ## See Also 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/ListLayerVersions) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayerVersions) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayerVersions) \ No newline at end of file diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md old mode 100644 new mode 100755 index a95db624..a8379dd6 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -1,6 +1,6 @@ # ListLayers -Lists [ AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layers that are compatible with that [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Lists [AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layers that are compatible with that [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. ## Request Syntax @@ -12,18 +12,18 @@ GET /2018-10-31/layers?CompatibleArchitecture=CompatibleArchitecture&CompatibleR The request uses the following URI parameters\. - ** [ CompatibleArchitecture ](#API_ListLayers_RequestSyntax) ** + ** [CompatibleArchitecture](#API_ListLayers_RequestSyntax) ** The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntime ](#API_ListLayers_RequestSyntax) ** + ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ Marker ](#API_ListLayers_RequestSyntax) ** + ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. - ** [ MaxItems ](#API_ListLayers_RequestSyntax) ** + ** [MaxItems](#API_ListLayers_RequestSyntax) ** The maximum number of layers to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -63,11 +63,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Layers ](#API_ListLayers_ResponseSyntax) ** + ** [Layers](#API_ListLayers_ResponseSyntax) ** A list of function layers\. -Type: Array of [ LayersListItem ](API_LayersListItem.md) objects +Type: Array of [LayersListItem](API_LayersListItem.md) objects - ** [ NextMarker ](#API_ListLayers_ResponseSyntax) ** + ** [NextMarker](#API_ListLayers_ResponseSyntax) ** A pagination token returned when the response doesn't contain all layers\. Type: String @@ -88,12 +88,12 @@ HTTP Status Code: 429 ## See Also 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/ListLayers) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayers) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) \ No newline at end of file diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md old mode 100644 new mode 100755 index bd1e9916..e05f6c95 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?List=ALL&Marker=M The request uses the following URI parameters\. - ** [ FunctionName ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [FunctionName](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,10 +24,10 @@ 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 - ** [ Marker ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [Marker](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [MaxItems](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** Specify a number to limit the number of configurations returned\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -63,13 +63,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ NextMarker ](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** + ** [NextMarker](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String - ** [ ProvisionedConcurrencyConfigs ](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** + ** [ProvisionedConcurrencyConfigs](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** A list of provisioned concurrency configurations\. -Type: Array of [ ProvisionedConcurrencyConfigListItem ](API_ProvisionedConcurrencyConfigListItem.md) objects +Type: Array of [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) objects ## Errors @@ -92,12 +92,12 @@ HTTP Status Code: 429 ## See Also 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/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) \ No newline at end of file diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md old mode 100644 new mode 100755 index 394361bc..bf96edde --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -1,6 +1,6 @@ # ListTags -Returns a function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. You can also view tags with [ GetFunction ](API_GetFunction.md)\. +Returns a function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. You can also view tags with [GetFunction](API_GetFunction.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2017-03-31/tags/ARN HTTP/1.1 The request uses the following URI parameters\. - ** [ ARN ](#API_ListTags_RequestSyntax) ** + ** [ARN](#API_ListTags_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. Note: Lambda does not support adding tags to aliases or versions\. 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 @@ -40,7 +40,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Tags ](#API_ListTags_ResponseSyntax) ** + ** [Tags](#API_ListTags_ResponseSyntax) ** The function's tags\. Type: String to string map @@ -65,12 +65,12 @@ HTTP Status Code: 429 ## See Also 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/ListTags) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListTags) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListTags) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListTags) \ No newline at end of file diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md old mode 100644 new mode 100755 index ad35ed08..fe5215a2 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/versions?Marker=Marker&MaxItems=MaxItems The request uses the following URI parameters\. - ** [ FunctionName ](#API_ListVersionsByFunction_RequestSyntax) ** + ** [FunctionName](#API_ListVersionsByFunction_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,10 +24,10 @@ 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-_]+))?` Required: Yes - ** [ Marker ](#API_ListVersionsByFunction_RequestSyntax) ** + ** [Marker](#API_ListVersionsByFunction_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListVersionsByFunction_RequestSyntax) ** + ** [MaxItems](#API_ListVersionsByFunction_RequestSyntax) ** The maximum number of versions to return\. Note that `ListVersionsByFunction` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -126,13 +126,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ NextMarker ](#API_ListVersionsByFunction_ResponseSyntax) ** + ** [NextMarker](#API_ListVersionsByFunction_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String - ** [ Versions ](#API_ListVersionsByFunction_ResponseSyntax) ** + ** [Versions](#API_ListVersionsByFunction_ResponseSyntax) ** A list of Lambda function versions\. -Type: Array of [ FunctionConfiguration ](API_FunctionConfiguration.md) objects +Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects ## Errors @@ -155,12 +155,12 @@ HTTP Status Code: 429 ## See Also 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/ListVersionsByFunction) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListVersionsByFunction) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListVersionsByFunction) \ No newline at end of file diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md old mode 100644 new mode 100755 index e85b7838..6bb084a9 --- a/doc_source/API_OnFailure.md +++ b/doc_source/API_OnFailure.md @@ -14,7 +14,7 @@ Required: No ## See Also 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/OnFailure) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnFailure) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md old mode 100644 new mode 100755 index 5447b3fa..7dd22ba6 --- a/doc_source/API_OnSuccess.md +++ b/doc_source/API_OnSuccess.md @@ -14,7 +14,7 @@ Required: No ## See Also 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/OnSuccess) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnSuccess) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md old mode 100644 new mode 100755 index 8c67257d..70a90b0c --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -1,61 +1,61 @@ # Actions The following actions are supported: -+ [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md) -+ [ AddPermission ](API_AddPermission.md) -+ [ CreateAlias ](API_CreateAlias.md) -+ [ CreateCodeSigningConfig ](API_CreateCodeSigningConfig.md) -+ [ CreateEventSourceMapping ](API_CreateEventSourceMapping.md) -+ [ CreateFunction ](API_CreateFunction.md) -+ [ DeleteAlias ](API_DeleteAlias.md) -+ [ DeleteCodeSigningConfig ](API_DeleteCodeSigningConfig.md) -+ [ DeleteEventSourceMapping ](API_DeleteEventSourceMapping.md) -+ [ DeleteFunction ](API_DeleteFunction.md) -+ [ DeleteFunctionCodeSigningConfig ](API_DeleteFunctionCodeSigningConfig.md) -+ [ DeleteFunctionConcurrency ](API_DeleteFunctionConcurrency.md) -+ [ DeleteFunctionEventInvokeConfig ](API_DeleteFunctionEventInvokeConfig.md) -+ [ DeleteLayerVersion ](API_DeleteLayerVersion.md) -+ [ DeleteProvisionedConcurrencyConfig ](API_DeleteProvisionedConcurrencyConfig.md) -+ [ GetAccountSettings ](API_GetAccountSettings.md) -+ [ GetAlias ](API_GetAlias.md) -+ [ GetCodeSigningConfig ](API_GetCodeSigningConfig.md) -+ [ GetEventSourceMapping ](API_GetEventSourceMapping.md) -+ [ GetFunction ](API_GetFunction.md) -+ [ GetFunctionCodeSigningConfig ](API_GetFunctionCodeSigningConfig.md) -+ [ GetFunctionConcurrency ](API_GetFunctionConcurrency.md) -+ [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) -+ [ GetFunctionEventInvokeConfig ](API_GetFunctionEventInvokeConfig.md) -+ [ GetLayerVersion ](API_GetLayerVersion.md) -+ [ GetLayerVersionByArn ](API_GetLayerVersionByArn.md) -+ [ GetLayerVersionPolicy ](API_GetLayerVersionPolicy.md) -+ [ GetPolicy ](API_GetPolicy.md) -+ [ GetProvisionedConcurrencyConfig ](API_GetProvisionedConcurrencyConfig.md) -+ [ Invoke ](API_Invoke.md) -+ [ InvokeAsync ](API_InvokeAsync.md) -+ [ ListAliases ](API_ListAliases.md) -+ [ ListCodeSigningConfigs ](API_ListCodeSigningConfigs.md) -+ [ ListEventSourceMappings ](API_ListEventSourceMappings.md) -+ [ ListFunctionEventInvokeConfigs ](API_ListFunctionEventInvokeConfigs.md) -+ [ ListFunctions ](API_ListFunctions.md) -+ [ ListFunctionsByCodeSigningConfig ](API_ListFunctionsByCodeSigningConfig.md) -+ [ ListLayers ](API_ListLayers.md) -+ [ ListLayerVersions ](API_ListLayerVersions.md) -+ [ ListProvisionedConcurrencyConfigs ](API_ListProvisionedConcurrencyConfigs.md) -+ [ ListTags ](API_ListTags.md) -+ [ ListVersionsByFunction ](API_ListVersionsByFunction.md) -+ [ PublishLayerVersion ](API_PublishLayerVersion.md) -+ [ PublishVersion ](API_PublishVersion.md) -+ [ PutFunctionCodeSigningConfig ](API_PutFunctionCodeSigningConfig.md) -+ [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md) -+ [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md) -+ [ PutProvisionedConcurrencyConfig ](API_PutProvisionedConcurrencyConfig.md) -+ [ RemoveLayerVersionPermission ](API_RemoveLayerVersionPermission.md) -+ [ RemovePermission ](API_RemovePermission.md) -+ [ TagResource ](API_TagResource.md) -+ [ UntagResource ](API_UntagResource.md) -+ [ UpdateAlias ](API_UpdateAlias.md) -+ [ UpdateCodeSigningConfig ](API_UpdateCodeSigningConfig.md) -+ [ UpdateEventSourceMapping ](API_UpdateEventSourceMapping.md) -+ [ UpdateFunctionCode ](API_UpdateFunctionCode.md) -+ [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md) -+ [ UpdateFunctionEventInvokeConfig ](API_UpdateFunctionEventInvokeConfig.md) \ No newline at end of file ++ [AddLayerVersionPermission](API_AddLayerVersionPermission.md) ++ [AddPermission](API_AddPermission.md) ++ [CreateAlias](API_CreateAlias.md) ++ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateFunction](API_CreateFunction.md) ++ [DeleteAlias](API_DeleteAlias.md) ++ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [DeleteFunction](API_DeleteFunction.md) ++ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) ++ [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) ++ [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) ++ [DeleteLayerVersion](API_DeleteLayerVersion.md) ++ [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) ++ [GetAccountSettings](API_GetAccountSettings.md) ++ [GetAlias](API_GetAlias.md) ++ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [GetFunction](API_GetFunction.md) ++ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) ++ [GetFunctionConcurrency](API_GetFunctionConcurrency.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) ++ [GetLayerVersion](API_GetLayerVersion.md) ++ [GetLayerVersionByArn](API_GetLayerVersionByArn.md) ++ [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) ++ [GetPolicy](API_GetPolicy.md) ++ [GetProvisionedConcurrencyConfig](API_GetProvisionedConcurrencyConfig.md) ++ [Invoke](API_Invoke.md) ++ [InvokeAsync](API_InvokeAsync.md) ++ [ListAliases](API_ListAliases.md) ++ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) ++ [ListFunctions](API_ListFunctions.md) ++ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) ++ [ListLayers](API_ListLayers.md) ++ [ListLayerVersions](API_ListLayerVersions.md) ++ [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) ++ [ListTags](API_ListTags.md) ++ [ListVersionsByFunction](API_ListVersionsByFunction.md) ++ [PublishLayerVersion](API_PublishLayerVersion.md) ++ [PublishVersion](API_PublishVersion.md) ++ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) ++ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) ++ [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) ++ [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) ++ [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) ++ [RemovePermission](API_RemovePermission.md) ++ [TagResource](API_TagResource.md) ++ [UntagResource](API_UntagResource.md) ++ [UpdateAlias](API_UpdateAlias.md) ++ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [UpdateFunctionCode](API_UpdateFunctionCode.md) ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md) \ No newline at end of file diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md old mode 100644 new mode 100755 index 4f1830eb..71a88d0f --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ b/doc_source/API_ProvisionedConcurrencyConfigListItem.md @@ -47,7 +47,7 @@ Required: No ## See Also 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/ProvisionedConcurrencyConfigListItem) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md old mode 100644 new mode 100755 index 2c9adb46..90016955 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -1,8 +1,8 @@ # PublishLayerVersion -Creates an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. +Creates an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. -Add layers to your function with [ CreateFunction ](API_CreateFunction.md) or [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. +Add layers to your function with [CreateFunction](API_CreateFunction.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. ## Request Syntax @@ -28,7 +28,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ LayerName ](#API_PublishLayerVersion_RequestSyntax) ** + ** [LayerName](#API_PublishLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` @@ -38,32 +38,32 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ CompatibleArchitectures ](#API_PublishLayerVersion_RequestSyntax) ** + ** [CompatibleArchitectures](#API_PublishLayerVersion_RequestSyntax) ** A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Type: Array of strings Array Members: Maximum number of 2 items\. Valid Values:` x86_64 | arm64` Required: No - ** [ CompatibleRuntimes ](#API_PublishLayerVersion_RequestSyntax) ** -A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ ListLayers ](API_ListLayers.md) and [ ListLayerVersions ](API_ListLayerVersions.md)\. + ** [CompatibleRuntimes](#API_PublishLayerVersion_RequestSyntax) ** +A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [ Content ](#API_PublishLayerVersion_RequestSyntax) ** + ** [Content](#API_PublishLayerVersion_RequestSyntax) ** The function layer archive\. -Type: [ LayerVersionContentInput ](API_LayerVersionContentInput.md) object +Type: [LayerVersionContentInput](API_LayerVersionContentInput.md) object Required: Yes - ** [ Description ](#API_PublishLayerVersion_RequestSyntax) ** + ** [Description](#API_PublishLayerVersion_RequestSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ LicenseInfo ](#API_PublishLayerVersion_RequestSyntax) ** + ** [LicenseInfo](#API_PublishLayerVersion_RequestSyntax) ** The layer's software license\. It can be any of the following: + An [SPDX license identifier](https://spdx.org/licenses/)\. For example, `MIT`\. + The URL of a license hosted on the internet\. For example, `https://opensource.org/licenses/MIT`\. @@ -103,49 +103,49 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ CompatibleArchitectures ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [CompatibleArchitectures](#API_PublishLayerVersion_ResponseSyntax) ** A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Type: Array of strings Array Members: Maximum number of 2 items\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntimes ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [CompatibleRuntimes](#API_PublishLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ Content ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. -Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object +Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object - ** [ CreatedDate ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [CreatedDate](#API_PublishLayerVersion_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ Description ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [Description](#API_PublishLayerVersion_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ LayerArn ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [LayerArn](#API_PublishLayerVersion_ResponseSyntax) ** The ARN of the layer\. Type: String 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-_]+` - ** [ LayerVersionArn ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [LayerVersionArn](#API_PublishLayerVersion_ResponseSyntax) ** The ARN of the layer version\. Type: String 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]+` - ** [ LicenseInfo ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [LicenseInfo](#API_PublishLayerVersion_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [ Version ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [Version](#API_PublishLayerVersion_ResponseSyntax) ** The version number\. Type: Long @@ -174,12 +174,12 @@ HTTP Status Code: 429 ## See Also 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/PublishLayerVersion) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishLayerVersion) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishLayerVersion) \ No newline at end of file diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md old mode 100644 new mode 100755 index 12c42030..b7ef43ae --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -2,9 +2,9 @@ Creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) from the current code and configuration of a function\. Use versions to create a snapshot of your function code and configuration that doesn't change\. - AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [ UpdateFunctionCode ](API_UpdateFunctionCode.md) or [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. + AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [UpdateFunctionCode](API_UpdateFunctionCode.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. -Clients can invoke versions directly or with an alias\. To create an alias, use [ CreateAlias ](API_CreateAlias.md)\. +Clients can invoke versions directly or with an alias\. To create an alias, use [CreateAlias](API_CreateAlias.md)\. ## Request Syntax @@ -23,7 +23,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PublishVersion_RequestSyntax) ** + ** [FunctionName](#API_PublishVersion_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -39,18 +39,18 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ CodeSha256 ](#API_PublishVersion_RequestSyntax) ** -Only publish a version if the hash value matches the value that's specified\. Use this option to avoid publishing a version if the function code has changed since you last updated it\. You can get the hash for the version that you uploaded from the output of [ UpdateFunctionCode ](API_UpdateFunctionCode.md)\. + ** [CodeSha256](#API_PublishVersion_RequestSyntax) ** +Only publish a version if the hash value matches the value that's specified\. Use this option to avoid publishing a version if the function code has changed since you last updated it\. You can get the hash for the version that you uploaded from the output of [UpdateFunctionCode](API_UpdateFunctionCode.md)\. Type: String Required: No - ** [ Description ](#API_PublishVersion_RequestSyntax) ** + ** [Description](#API_PublishVersion_RequestSyntax) ** A description for the version to override the description in the function configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ RevisionId ](#API_PublishVersion_RequestSyntax) ** + ** [RevisionId](#API_PublishVersion_RequestSyntax) ** Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid publishing a version if the function configuration has changed since you last updated it\. Type: String Required: No @@ -141,157 +141,157 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_PublishVersion_ResponseSyntax) ** + ** [Architectures](#API_PublishVersion_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_PublishVersion_ResponseSyntax) ** + ** [CodeSha256](#API_PublishVersion_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_PublishVersion_ResponseSyntax) ** + ** [CodeSize](#API_PublishVersion_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_PublishVersion_ResponseSyntax) ** + ** [DeadLetterConfig](#API_PublishVersion_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_PublishVersion_ResponseSyntax) ** + ** [Description](#API_PublishVersion_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_PublishVersion_ResponseSyntax) ** + ** [Environment](#API_PublishVersion_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_PublishVersion_ResponseSyntax) ** + ** [FileSystemConfigs](#API_PublishVersion_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_PublishVersion_ResponseSyntax) ** + ** [FunctionArn](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [FunctionName](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [Handler](#API_PublishVersion_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_PublishVersion_ResponseSyntax) ** + ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_PublishVersion_ResponseSyntax) ** + ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_PublishVersion_ResponseSyntax) ** + ** [LastModified](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [LastUpdateStatus](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [LastUpdateStatusReason](#API_PublishVersion_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_PublishVersion_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_PublishVersion_ResponseSyntax) ** + ** [Layers](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_PublishVersion_ResponseSyntax) ** + ** [MasterArn](#API_PublishVersion_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main 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_PublishVersion_ResponseSyntax) ** + ** [MemorySize](#API_PublishVersion_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_PublishVersion_ResponseSyntax) ** + ** [PackageType](#API_PublishVersion_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_PublishVersion_ResponseSyntax) ** + ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_PublishVersion_ResponseSyntax) ** + ** [Role](#API_PublishVersion_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [ Runtime ](#API_PublishVersion_ResponseSyntax) ** + ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_PublishVersion_ResponseSyntax) ** + ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_PublishVersion_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_PublishVersion_ResponseSyntax) ** + ** [State](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [StateReason](#API_PublishVersion_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_PublishVersion_ResponseSyntax) ** + ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_PublishVersion_ResponseSyntax) ** + ** [Timeout](#API_PublishVersion_ResponseSyntax) ** 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_PublishVersion_ResponseSyntax) ** + ** [TracingConfig](#API_PublishVersion_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_PublishVersion_ResponseSyntax) ** + ** [Version](#API_PublishVersion_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ VpcConfig ](#API_PublishVersion_ResponseSyntax) ** + ** [VpcConfig](#API_PublishVersion_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -326,12 +326,12 @@ HTTP Status Code: 429 ## See Also 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/PublishVersion) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishVersion) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishVersion) \ No newline at end of file diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md old mode 100644 new mode 100755 index f8d5b31e..c2cf8b73 --- a/doc_source/API_PutFunctionCodeSigningConfig.md +++ b/doc_source/API_PutFunctionCodeSigningConfig.md @@ -17,7 +17,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** + ** [FunctionName](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -33,7 +33,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ CodeSigningConfigArn ](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. @@ -58,13 +58,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfigArn ](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - ** [ FunctionName ](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** + ** [FunctionName](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** The name of the Lambda function\. **Name formats** @@ -105,12 +105,12 @@ HTTP Status Code: 429 ## See Also 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/PutFunctionCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md old mode 100644 new mode 100755 index 20dac787..22521e8a --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -2,9 +2,9 @@ Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level\. -Concurrency settings apply to the function as a whole, including all published versions and the unpublished version\. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level\. Use [ GetFunction ](API_GetFunction.md) to see the current setting for a function\. +Concurrency settings apply to the function as a whole, including all published versions and the unpublished version\. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level\. Use [GetFunction](API_GetFunction.md) to see the current setting for a function\. -Use [ GetAccountSettings ](API_GetAccountSettings.md) to see your Regional concurrency limit\. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per\-function limit\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. +Use [GetAccountSettings](API_GetAccountSettings.md) to see your Regional concurrency limit\. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per\-function limit\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. ## Request Syntax @@ -21,7 +21,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PutFunctionConcurrency_RequestSyntax) ** + ** [FunctionName](#API_PutFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -37,7 +37,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ ReservedConcurrentExecutions ](#API_PutFunctionConcurrency_RequestSyntax) ** + ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_RequestSyntax) ** The number of simultaneous executions to reserve for the function\. Type: Integer Valid Range: Minimum value of 0\. @@ -60,7 +60,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ ReservedConcurrentExecutions ](#API_PutFunctionConcurrency_ResponseSyntax) ** + ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_ResponseSyntax) ** The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. Type: Integer Valid Range: Minimum value of 0\. @@ -90,12 +90,12 @@ HTTP Status Code: 429 ## See Also 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/PutFunctionConcurrency) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionConcurrency) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 306e9aaf..48345d0c --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -1,8 +1,8 @@ # PutFunctionEventInvokeConfig -Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [ UpdateFunctionEventInvokeConfig ](API_UpdateFunctionEventInvokeConfig.md)\. +Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md)\. -By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. +By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. To send an invocation record to a queue, topic, function, or event bus, specify a [destination](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations)\. You can configure separate destinations for successful invocations \(on\-success\) and events that fail all processing attempts \(on\-failure\)\. You can configure destinations in addition to or instead of a dead\-letter queue\. @@ -30,7 +30,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [FunctionName](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -42,7 +42,7 @@ 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 - ** [ Qualifier ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [Qualifier](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -51,7 +51,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [ DestinationConfig ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -59,16 +59,16 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No - ** [ MaximumEventAgeInSeconds ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - ** [ MaximumRetryAttempts ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -102,7 +102,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ DestinationConfig ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -110,23 +110,23 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ FunctionArn ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [FunctionArn](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the 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-_]+))?` - ** [ LastModified ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [LastModified](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [ MaximumEventAgeInSeconds ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [ MaximumRetryAttempts ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -156,12 +156,12 @@ HTTP Status Code: 429 ## See Also 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/PutFunctionEventInvokeConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md old mode 100644 new mode 100755 index 7dca3a23..bcea56b2 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -17,7 +17,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [FunctionName](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -29,7 +29,7 @@ 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 - ** [ Qualifier ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [Qualifier](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -39,7 +39,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ ProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The amount of provisioned concurrency to allocate for the version or alias\. Type: Integer Valid Range: Minimum value of 1\. @@ -67,31 +67,31 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [ AllocatedProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [AllocatedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. - ** [ AvailableProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [AvailableProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. - ** [ LastModified ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [LastModified](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** 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 - ** [ RequestedProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [RequestedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. - ** [ Status ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [Status](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` - ** [ StatusReason ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [StatusReason](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String @@ -120,12 +120,12 @@ HTTP Status Code: 429 ## See Also 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/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_Reference.md b/doc_source/API_Reference.md old mode 100644 new mode 100755 diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md old mode 100644 new mode 100755 index c9d5478d..8c1673de --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -1,6 +1,6 @@ # RemoveLayerVersionPermission -Removes a statement from the permissions policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md)\. +Removes a statement from the permissions policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. ## Request Syntax @@ -12,22 +12,22 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber/policy/StatementId?Re The request uses the following URI parameters\. - ** [ LayerName ](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [LayerName](#API_RemoveLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. 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-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ RevisionId ](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [RevisionId](#API_RemoveLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [ StatementId ](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [StatementId](#API_RemoveLayerVersionPermission_RequestSyntax) ** The identifier that was specified when the statement was added\. Length Constraints: Minimum length of 1\. Maximum length of 100\. Pattern: `([a-zA-Z0-9-_]+)` Required: Yes - ** [ VersionNumber ](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [VersionNumber](#API_RemoveLayerVersionPermission_RequestSyntax) ** The version number\. Required: Yes @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also 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/RemoveLayerVersionPermission) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemoveLayerVersionPermission) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemoveLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md old mode 100644 new mode 100755 index bc601ef3..58c33758 --- a/doc_source/API_RemovePermission.md +++ b/doc_source/API_RemovePermission.md @@ -1,6 +1,6 @@ # RemovePermission -Revokes function\-use permission from an AWS service or another account\. You can get the ID of the statement from the output of [ GetPolicy ](API_GetPolicy.md)\. +Revokes function\-use permission from an AWS service or another account\. You can get the ID of the statement from the output of [GetPolicy](API_GetPolicy.md)\. ## Request Syntax @@ -12,7 +12,7 @@ DELETE /2015-03-31/functions/FunctionName/policy/StatementId?Qualifier=Qualifier The request uses the following URI parameters\. - ** [ FunctionName ](#API_RemovePermission_RequestSyntax) ** + ** [FunctionName](#API_RemovePermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,15 +24,15 @@ 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 - ** [ Qualifier ](#API_RemovePermission_RequestSyntax) ** + ** [Qualifier](#API_RemovePermission_RequestSyntax) ** Specify a version or alias to remove permissions from a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` - ** [ RevisionId ](#API_RemovePermission_RequestSyntax) ** + ** [RevisionId](#API_RemovePermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [ StatementId ](#API_RemovePermission_RequestSyntax) ** + ** [StatementId](#API_RemovePermission_RequestSyntax) ** Statement ID of the permission to remove\. Length Constraints: Minimum length of 1\. Maximum length of 100\. Pattern: `([a-zA-Z0-9-_.]+)` @@ -77,12 +77,12 @@ HTTP Status Code: 429 ## See Also 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/RemovePermission) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemovePermission) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemovePermission) \ No newline at end of file diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md old mode 100644 new mode 100755 index 26ec3da5..04777747 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -17,7 +17,7 @@ Required: No ## See Also 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/SelfManagedEventSource) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md old mode 100644 new mode 100755 index 88c9fcdb..12faeaad --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -13,8 +13,10 @@ The type of authentication protocol, VPC components, or virtual host for your ev + `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your self\-managed Apache Kafka brokers\. + `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your self\-managed Apache Kafka brokers\. + `VIRTUAL_HOST` \- \(Amazon MQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. This property cannot be specified in an UpdateEventSourceMapping API call\. ++ `CLIENT_CERTIFICATE_TLS_AUTH` \- \(Amazon MSK, Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key containing the certificate chain \(X\.509 PEM\), private key \(PKCS\#8 PEM\), and private key password \(optional\) used for mutual TLS authentication of your MSK/Apache Kafka brokers\. ++ `SERVER_ROOT_CA_CERTIFICATE` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key containing the root CA certificate \(X\.509 PEM\) used for TLS encryption of your Apache Kafka brokers\. Type: String -Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST` +Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST | CLIENT_CERTIFICATE_TLS_AUTH | SERVER_ROOT_CA_CERTIFICATE` Required: No ** URI ** @@ -27,7 +29,7 @@ Required: No ## See Also 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/SourceAccessConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md old mode 100644 new mode 100755 index 45444747..0104ba08 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -19,7 +19,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ ARN ](#API_TagResource_RequestSyntax) ** + ** [ARN](#API_TagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. 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 @@ -28,7 +28,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Tags ](#API_TagResource_RequestSyntax) ** + ** [Tags](#API_TagResource_RequestSyntax) ** A list of tags to apply to the function\. Type: String to string map Required: Yes @@ -68,12 +68,12 @@ HTTP Status Code: 429 ## See Also 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/TagResource) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TagResource) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/TagResource) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TagResource) \ No newline at end of file diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md old mode 100644 new mode 100755 index a4348db1..4833a916 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -1,6 +1,6 @@ # TracingConfig -The function's [ AWS X\-Ray ](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. +The function's [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. ## Contents @@ -13,7 +13,7 @@ Required: No ## See Also 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/TracingConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md old mode 100644 new mode 100755 index 9d666f16..d5bf88f8 --- a/doc_source/API_TracingConfigResponse.md +++ b/doc_source/API_TracingConfigResponse.md @@ -13,7 +13,7 @@ Required: No ## See Also 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/TracingConfigResponse) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfigResponse) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md old mode 100644 new mode 100755 index f6188166..9d81625a --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -1,39 +1,41 @@ # Data Types The following data types are supported: -+ [ AccountLimit ](API_AccountLimit.md) -+ [ AccountUsage ](API_AccountUsage.md) -+ [ AliasConfiguration ](API_AliasConfiguration.md) -+ [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) -+ [ AllowedPublishers ](API_AllowedPublishers.md) -+ [ CodeSigningConfig ](API_CodeSigningConfig.md) -+ [ CodeSigningPolicies ](API_CodeSigningPolicies.md) -+ [ Concurrency ](API_Concurrency.md) -+ [ DeadLetterConfig ](API_DeadLetterConfig.md) -+ [ DestinationConfig ](API_DestinationConfig.md) -+ [ Environment ](API_Environment.md) -+ [ EnvironmentError ](API_EnvironmentError.md) -+ [ EnvironmentResponse ](API_EnvironmentResponse.md) -+ [ EventSourceMappingConfiguration ](API_EventSourceMappingConfiguration.md) -+ [ FileSystemConfig ](API_FileSystemConfig.md) -+ [ FunctionCode ](API_FunctionCode.md) -+ [ FunctionCodeLocation ](API_FunctionCodeLocation.md) -+ [ FunctionConfiguration ](API_FunctionConfiguration.md) -+ [ FunctionEventInvokeConfig ](API_FunctionEventInvokeConfig.md) -+ [ ImageConfig ](API_ImageConfig.md) -+ [ ImageConfigError ](API_ImageConfigError.md) -+ [ ImageConfigResponse ](API_ImageConfigResponse.md) -+ [ Layer ](API_Layer.md) -+ [ LayersListItem ](API_LayersListItem.md) -+ [ LayerVersionContentInput ](API_LayerVersionContentInput.md) -+ [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) -+ [ LayerVersionsListItem ](API_LayerVersionsListItem.md) -+ [ OnFailure ](API_OnFailure.md) -+ [ OnSuccess ](API_OnSuccess.md) -+ [ ProvisionedConcurrencyConfigListItem ](API_ProvisionedConcurrencyConfigListItem.md) -+ [ SelfManagedEventSource ](API_SelfManagedEventSource.md) -+ [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) -+ [ TracingConfig ](API_TracingConfig.md) -+ [ TracingConfigResponse ](API_TracingConfigResponse.md) -+ [ VpcConfig ](API_VpcConfig.md) -+ [ VpcConfigResponse ](API_VpcConfigResponse.md) \ No newline at end of file ++ [AccountLimit](API_AccountLimit.md) ++ [AccountUsage](API_AccountUsage.md) ++ [AliasConfiguration](API_AliasConfiguration.md) ++ [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) ++ [AllowedPublishers](API_AllowedPublishers.md) ++ [CodeSigningConfig](API_CodeSigningConfig.md) ++ [CodeSigningPolicies](API_CodeSigningPolicies.md) ++ [Concurrency](API_Concurrency.md) ++ [DeadLetterConfig](API_DeadLetterConfig.md) ++ [DestinationConfig](API_DestinationConfig.md) ++ [Environment](API_Environment.md) ++ [EnvironmentError](API_EnvironmentError.md) ++ [EnvironmentResponse](API_EnvironmentResponse.md) ++ [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) ++ [FileSystemConfig](API_FileSystemConfig.md) ++ [Filter](API_Filter.md) ++ [FilterCriteria](API_FilterCriteria.md) ++ [FunctionCode](API_FunctionCode.md) ++ [FunctionCodeLocation](API_FunctionCodeLocation.md) ++ [FunctionConfiguration](API_FunctionConfiguration.md) ++ [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) ++ [ImageConfig](API_ImageConfig.md) ++ [ImageConfigError](API_ImageConfigError.md) ++ [ImageConfigResponse](API_ImageConfigResponse.md) ++ [Layer](API_Layer.md) ++ [LayersListItem](API_LayersListItem.md) ++ [LayerVersionContentInput](API_LayerVersionContentInput.md) ++ [LayerVersionContentOutput](API_LayerVersionContentOutput.md) ++ [LayerVersionsListItem](API_LayerVersionsListItem.md) ++ [OnFailure](API_OnFailure.md) ++ [OnSuccess](API_OnSuccess.md) ++ [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) ++ [SelfManagedEventSource](API_SelfManagedEventSource.md) ++ [SourceAccessConfiguration](API_SourceAccessConfiguration.md) ++ [TracingConfig](API_TracingConfig.md) ++ [TracingConfigResponse](API_TracingConfigResponse.md) ++ [VpcConfig](API_VpcConfig.md) ++ [VpcConfigResponse](API_VpcConfigResponse.md) \ No newline at end of file diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md old mode 100644 new mode 100755 index 88cfb1be..8abf4139 --- a/doc_source/API_UntagResource.md +++ b/doc_source/API_UntagResource.md @@ -12,12 +12,12 @@ DELETE /2017-03-31/tags/ARN?tagKeys=TagKeys HTTP/1.1 The request uses the following URI parameters\. - ** [ ARN ](#API_UntagResource_RequestSyntax) ** + ** [ARN](#API_UntagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. 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 - ** [ TagKeys ](#API_UntagResource_RequestSyntax) ** + ** [TagKeys](#API_UntagResource_RequestSyntax) ** A list of tag keys to remove from the function\. Required: Yes @@ -60,12 +60,12 @@ HTTP Status Code: 429 ## See Also 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/UntagResource) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UntagResource) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UntagResource) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UntagResource) \ No newline at end of file diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md old mode 100644 new mode 100755 index 98f85781..c1ffe2e9 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -24,7 +24,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_UpdateAlias_RequestSyntax) ** + ** [FunctionName](#API_UpdateAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -36,7 +36,7 @@ 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 - ** [ Name ](#API_UpdateAlias_RequestSyntax) ** + ** [Name](#API_UpdateAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -46,27 +46,27 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Description ](#API_UpdateAlias_RequestSyntax) ** + ** [Description](#API_UpdateAlias_RequestSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ FunctionVersion ](#API_UpdateAlias_RequestSyntax) ** + ** [FunctionVersion](#API_UpdateAlias_RequestSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: No - ** [ RevisionId ](#API_UpdateAlias_RequestSyntax) ** + ** [RevisionId](#API_UpdateAlias_RequestSyntax) ** Only update the alias if the revision ID matches the ID that's specified\. Use this option to avoid modifying an alias that has changed since you last read it\. Type: String Required: No - ** [ RoutingConfig ](#API_UpdateAlias_RequestSyntax) ** + ** [RoutingConfig](#API_UpdateAlias_RequestSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object Required: No ## Response Syntax @@ -95,35 +95,35 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ AliasArn ](#API_UpdateAlias_ResponseSyntax) ** + ** [AliasArn](#API_UpdateAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. 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-_]+))?` - ** [ Description ](#API_UpdateAlias_ResponseSyntax) ** + ** [Description](#API_UpdateAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ FunctionVersion ](#API_UpdateAlias_ResponseSyntax) ** + ** [FunctionVersion](#API_UpdateAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ Name ](#API_UpdateAlias_ResponseSyntax) ** + ** [Name](#API_UpdateAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [ RevisionId ](#API_UpdateAlias_ResponseSyntax) ** + ** [RevisionId](#API_UpdateAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [ RoutingConfig ](#API_UpdateAlias_ResponseSyntax) ** + ** [RoutingConfig](#API_UpdateAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object ## Errors @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also 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/UpdateAlias) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateAlias) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateAlias) \ No newline at end of file diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md old mode 100644 new mode 100755 index 181a153a..5ea4611b --- a/doc_source/API_UpdateCodeSigningConfig.md +++ b/doc_source/API_UpdateCodeSigningConfig.md @@ -23,7 +23,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ CodeSigningConfigArn ](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_UpdateCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -33,17 +33,17 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ AllowedPublishers ](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [AllowedPublishers](#API_UpdateCodeSigningConfig_RequestSyntax) ** Signing profiles for this code signing configuration\. -Type: [ AllowedPublishers ](API_AllowedPublishers.md) object +Type: [AllowedPublishers](API_AllowedPublishers.md) object Required: No - ** [ CodeSigningPolicies ](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningPolicies](#API_UpdateCodeSigningConfig_RequestSyntax) ** The code signing policy\. -Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object +Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object Required: No - ** [ Description ](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [Description](#API_UpdateCodeSigningConfig_RequestSyntax) ** Descriptive name for this code signing configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. @@ -77,9 +77,9 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfig ](#API_UpdateCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfig](#API_UpdateCodeSigningConfig_ResponseSyntax) ** The code signing configuration -Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object +Type: [CodeSigningConfig](API_CodeSigningConfig.md) object ## Errors @@ -98,12 +98,12 @@ HTTP Status Code: 500 ## See Also 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/UpdateCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md old mode 100644 new mode 100755 index 260e96cd..eb06196f --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -43,6 +43,13 @@ Content-type: application/json } }, "Enabled": boolean, + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionName": "string", "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, @@ -63,7 +70,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ UUID ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [UUID](#API_UpdateEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -71,7 +78,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ BatchSize ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [BatchSize](#API_UpdateEventSourceMapping_RequestSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. @@ -83,23 +90,28 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - ** [ BisectBatchOnFunctionError ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No - ** [ DestinationConfig ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [DestinationConfig](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No - ** [ Enabled ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [Enabled](#API_UpdateEventSourceMapping_RequestSyntax) ** When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. Default: True Type: Boolean Required: No - ** [ FunctionName ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [FilterCriteria](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object +Required: No + + ** [FunctionName](#API_UpdateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -113,14 +125,14 @@ 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: No - ** [ FunctionResponseTypes ](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams only\) A list of current response type enums applied to the event source mapping\. + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - ** [ MaximumBatchingWindowInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. @@ -128,31 +140,31 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - ** [ MaximumRecordAgeInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - ** [ MaximumRetryAttempts ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - ** [ ParallelizationFactor ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ParallelizationFactor](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - ** [ SourceAccessConfigurations ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - ** [ TumblingWindowInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. @@ -176,6 +188,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -212,113 +231,117 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [ BatchSize ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [BatchSize](#API_UpdateEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [ BisectBatchOnFunctionError ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [ DestinationConfig ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [DestinationConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ EventSourceArn ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [EventSourceArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionArn ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [FilterCriteria](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object + + ** [FunctionArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda 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-_]+))?` - ** [ FunctionResponseTypes ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [ LastModified ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [ LastProcessingResult ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [LastProcessingResult](#API_UpdateEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [ MaximumBatchingWindowInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [ MaximumRecordAgeInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [ MaximumRetryAttempts ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ ParallelizationFactor ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [ Queues ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [Queues](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [ SelfManagedEventSource ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [ SourceAccessConfigurations ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [ StartingPosition ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [ StartingPositionTimestamp ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [ State ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [ StateTransitionReason ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [StateTransitionReason](#API_UpdateEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [ Topics ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [ TumblingWindowInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [ UUID ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -351,12 +374,12 @@ HTTP Status Code: 429 ## See Also 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/UpdateEventSourceMapping) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateEventSourceMapping) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md old mode 100644 new mode 100755 index 4d310a1b..1af1d49a --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -2,6 +2,12 @@ Updates a Lambda function's code\. If code signing is enabled for the function, the code package must be signed by a trusted publisher\. For more information, see [Configuring code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html)\. +If the function's package type is `Image`, you must specify the code package in `ImageUri` as the URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry\. + +If the function's package type is `Zip`, you must specify the deployment package as a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. Enter the Amazon S3 bucket and key of the code \.zip file location\. You can also provide the function code inline using the `ZipFile` field\. + +The code in the deployment package must be compatible with the target instruction set architecture of the function \(`x86-64` or `arm64`\)\. + 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\. **Note** @@ -30,7 +36,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_UpdateFunctionCode_RequestSyntax) ** + ** [FunctionName](#API_UpdateFunctionCode_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -46,54 +52,54 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Architectures ](#API_UpdateFunctionCode_RequestSyntax) ** + ** [Architectures](#API_UpdateFunctionCode_RequestSyntax) ** The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` Required: No - ** [ DryRun ](#API_UpdateFunctionCode_RequestSyntax) ** + ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean Required: No - ** [ ImageUri ](#API_UpdateFunctionCode_RequestSyntax) ** -URI of a container image in the Amazon ECR registry\. + ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** +URI of a container image in the Amazon ECR registry\. Do not use for a function defined with a \.zip file archive\. Type: String Required: No - ** [ Publish ](#API_UpdateFunctionCode_RequestSyntax) ** -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\. + ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** +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) ** + ** [RevisionId](#API_UpdateFunctionCode_RequestSyntax) ** 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) ** -An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. + ** [S3Bucket](#API_UpdateFunctionCode_RequestSyntax) ** +An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Use only with a function defined with a \.zip file archive deployment package\. Type: String Length Constraints: Minimum length of 3\. Maximum length of 63\. Pattern: `^[0-9A-Za-z\.\-_]*(? -The Amazon S3 key of the deployment package\. + ** [S3Key](#API_UpdateFunctionCode_RequestSyntax) ** +The Amazon S3 key of the deployment package\. Use only with a function defined with a \.zip file archive deployment package\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - ** [ S3ObjectVersion ](#API_UpdateFunctionCode_RequestSyntax) ** + ** [S3ObjectVersion](#API_UpdateFunctionCode_RequestSyntax) ** 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) ** -The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\. + ** [ZipFile](#API_UpdateFunctionCode_RequestSyntax) ** +The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\. Use only with a function defined with a \.zip file archive deployment package\. Type: Base64\-encoded binary data object Required: No @@ -183,157 +189,157 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Architectures](#API_UpdateFunctionCode_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [CodeSha256](#API_UpdateFunctionCode_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [CodeSize](#API_UpdateFunctionCode_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [DeadLetterConfig](#API_UpdateFunctionCode_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Description](#API_UpdateFunctionCode_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Environment](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [FunctionArn](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [FunctionName](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [Handler](#API_UpdateFunctionCode_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [LastModified](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [LastUpdateStatus](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [LastUpdateStatusReason](#API_UpdateFunctionCode_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [MasterArn](#API_UpdateFunctionCode_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main 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) ** + ** [MemorySize](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Role](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [StateReason](#API_UpdateFunctionCode_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [TracingConfig](#API_UpdateFunctionCode_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Version](#API_UpdateFunctionCode_ResponseSyntax) ** 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) ** + ** [VpcConfig](#API_UpdateFunctionCode_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -380,12 +386,12 @@ HTTP Status Code: 429 ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) -+ [ 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) \ No newline at end of file ++ [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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/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) ++ [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) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md old mode 100644 new mode 100755 index a32e845b..94358f2a --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -2,11 +2,11 @@ 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)\. +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)\. +To configure function concurrency, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. To grant invoke permissions to an account or AWS service, use [AddPermission](API_AddPermission.md)\. ## Request Syntax @@ -57,7 +57,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [FunctionName](#API_UpdateFunctionConfiguration_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -73,90 +73,90 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ DeadLetterConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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 +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object Required: No - ** [ Description ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [Description](#API_UpdateFunctionConfiguration_RequestSyntax) ** A description of the function\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ Environment ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [Environment](#API_UpdateFunctionConfiguration_RequestSyntax) ** Environment variables that are accessible from function code during execution\. -Type: [ Environment ](API_Environment.md) object +Type: [Environment](API_Environment.md) object Required: No - ** [ FileSystemConfigs ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_RequestSyntax) ** Connection settings for an Amazon EFS file system\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - ** [ Handler ](#API_UpdateFunctionConfiguration_RequestSyntax) ** -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)\. + ** [Handler](#API_UpdateFunctionConfiguration_RequestSyntax) ** +The name of the method within your code that Lambda calls to execute your function\. Handler is required if the deployment package is a \.zip file archive\. 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 - ** [ ImageConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Docker file\. -Type: [ ImageConfig ](API_ImageConfig.md) object +Type: [ImageConfig](API_ImageConfig.md) object Required: No - ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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) ** + ** [Layers](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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\. 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) ** + ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - ** [ RevisionId ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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) ** + ** [Role](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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) ** -The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. + ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** +The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Runtime is required if the deployment package is a \.zip file archive\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [ Timeout ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No - ** [ TracingConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [ TracingConfig ](API_TracingConfig.md) object +Type: [TracingConfig](API_TracingConfig.md) object Required: No - ** [ VpcConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [VpcConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** 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 +Type: [VpcConfig](API_VpcConfig.md) object Required: No ## Response Syntax @@ -245,157 +245,157 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Architectures](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [CodeSha256](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [CodeSize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Description](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [FunctionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [FunctionName](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [Handler](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [LastModified](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [LastUpdateStatus](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [LastUpdateStatusReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [MasterArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main 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) ** + ** [MemorySize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Role](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [StateReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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 | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [TracingConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Version](#API_UpdateFunctionConfiguration_ResponseSyntax) ** 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) ** + ** [VpcConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -438,12 +438,12 @@ HTTP Status Code: 429 ## See Also 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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ 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) \ No newline at end of file ++ [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 V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [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) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 35d1ba27..cd8ae575 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Updates the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -28,7 +28,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [FunctionName](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -40,7 +40,7 @@ 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 - ** [ Qualifier ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [Qualifier](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -49,7 +49,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [ DestinationConfig ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -57,16 +57,16 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No - ** [ MaximumEventAgeInSeconds ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - ** [ MaximumRetryAttempts ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -100,7 +100,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ DestinationConfig ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -108,23 +108,23 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ FunctionArn ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [FunctionArn](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the 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-_]+))?` - ** [ LastModified ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [LastModified](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [ MaximumEventAgeInSeconds ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [ MaximumRetryAttempts ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also 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/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md old mode 100644 new mode 100755 index 5cf2d276..00a22693 --- a/doc_source/API_VpcConfig.md +++ b/doc_source/API_VpcConfig.md @@ -19,7 +19,7 @@ Required: No ## See Also 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/VpcConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md old mode 100644 new mode 100755 index af0b36fd..24c5badc --- a/doc_source/API_VpcConfigResponse.md +++ b/doc_source/API_VpcConfigResponse.md @@ -24,7 +24,7 @@ Required: No ## See Also 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/VpcConfigResponse) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfigResponse) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md old mode 100644 new mode 100755 diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md old mode 100644 new mode 100755 index f1bb64c7..32620b0f --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -6,7 +6,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc **To view a function's resource\-based policy** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function:*", + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" diff --git a/doc_source/applications-console.md b/doc_source/applications-console.md old mode 100644 new mode 100755 diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md old mode 100644 new mode 100755 diff --git a/doc_source/applications-usecases.md b/doc_source/applications-usecases.md old mode 100644 new mode 100755 diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md old mode 100644 new mode 100755 index 0cc90bf8..a8793dde --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -36,6 +36,7 @@ For more information about best practices for Lambda applications, see [Applicat + **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) for instructions\. + **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. ++ **Do not use non\-documented, non\-public APIs** in your Lambda function code\. For AWS Lambda managed runtimes, Lambda periodically applies security and functional updates to Lambda's internal APIs\. These internal API updates may be backwards\-incompatible, leading to unintended consequences such as invocation failures if your function has a dependency on these non\-public APIs\. See [the API reference](API_Operations.md) for a list of publicly available APIs\. ## Function configuration + **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: @@ -58,12 +59,12 @@ For more information about best practices for Lambda applications, see [Applicat + In the case of **UpdateFunctionConfiguration**, it could result in duplicate invocations of the function\. ## Metrics and alarms -+ **Use [Working with AWS Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function invocation in order to address any bottlenecks or latencies attributable to your function code\. ++ **Use [Working with Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function invocation in order to address any bottlenecks or latencies attributable to your function code\. + **Leverage your logging library and [AWS Lambda Metrics and Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/lam-metricscollected.html)** to catch app errors \(e\.g\. ERR, ERROR, WARNING, etc\.\) ## Working with streams + **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. The [CreateEventSourceMapping](API_CreateEventSourceMapping.md) BatchSize parameter controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. - By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. + By default, Lambda invokes your function as soon as records are available\. If the batch that Lambda reads from the event source has only one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batching window*\. Before invoking the function, Lambda continues to read records from the event source until it has gathered a full batch, the batching window expires, or the batch reaches the payload limit of 6 MB\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. + **Increase Kinesis stream processing throughput by adding shards\.** A Kinesis stream is composed of one or more shards\. Lambda will poll each shard with at most one concurrent invocation\. For example, if your stream has 100 active shards, there will be at most 100 Lambda function invocations running concurrently\. Increasing the number of shards will directly increase the number of maximum concurrent Lambda function invocations and can increase your Kinesis stream processing throughput\. If you are increasing the number of shards in a Kinesis stream, make sure you have picked a good partition key \(see [Partition Keys](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key)\) for your data, so that related records end up on the same shards and your data is well distributed\. + **Use [Amazon CloudWatch](https://docs.aws.amazon.com/streams/latest/dev/monitoring-with-cloudwatch.html)** on IteratorAge to determine if your Kinesis stream is being processed\. For example, configure a CloudWatch alarm with a maximum setting to 30000 \(30 seconds\)\. \ No newline at end of file diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md old mode 100644 new mode 100755 index 1b3f53ba..ba8e9806 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -15,7 +15,7 @@ You can create a function alias using the Lambda console\. **To create an alias** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -62,7 +62,7 @@ aws lambda delete-alias --function-name my-function --name alias-name Each alias has a unique ARN\. An alias can point only to a function version, not to another alias\. You can update an alias to point to a new version of the function\. -Event sources such as Amazon Simple Storage Service \(Amazon S3\) invoke your Lambda function\. These event sources maintain a mapping that identifies the function to invoke when events occur\. If you specify a Lambda function alias in the mapping configuration, you don't need to update the mapping when the function version changes\. For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md)\. +Event sources such as Amazon Simple Storage Service \(Amazon S3\) invoke your Lambda function\. These event sources maintain a mapping that identifies the function to invoke when events occur\. If you specify a Lambda function alias in the mapping configuration, you don't need to update the mapping when the function version changes\. For more information, see [Lambda event source mappings](invocation-eventsourcemapping.md)\. In a resource policy, you can grant permissions for event sources to use your Lambda function\. If you specify an alias ARN in the policy, you don't need to update the policy when the function version changes\. @@ -97,7 +97,7 @@ You can point an alias to a maximum of two Lambda function versions\. The versio **Note** Verify that the function has at least two published versions\. To create additional versions, follow the instructions in [Lambda function versions](configuration-versions.md)\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -155,7 +155,7 @@ When you configure traffic weights between two function versions, there are two `19:44:37 START RequestId: request id Version: $version ` - For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. + For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. + **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. \ No newline at end of file diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md old mode 100644 new mode 100755 index f61f5d92..49be75a6 --- a/doc_source/configuration-codesigning.md +++ b/doc_source/configuration-codesigning.md @@ -119,7 +119,7 @@ To enable code signing for a function, you associate a code signing configuratio **To associate a code signing configuration with a function \(console\)** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function for which you want to enable code signing\. diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md old mode 100644 new mode 100755 index eece79db..bbfbefac --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -20,7 +20,7 @@ To manage reserved concurrency settings for a function, use the Lambda console\. **To reserve concurrency for a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md old mode 100644 new mode 100755 index b7a76747..04478967 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -13,7 +13,7 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy\. **To create a database proxy** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -85,9 +85,9 @@ For more information, see [IAM database authentication](https://docs.aws.amazon. Sample applications that demonstrate the use of Lambda with an Amazon RDS database are available in this guide's GitHub repository\. There are two applications: + [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. - [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) + [https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) + [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. - [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) + [https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md old mode 100644 new mode 100755 index 4de65981..ff33dc53 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -24,7 +24,7 @@ You create an environment variable for your function by defining a key and a val **To set environment variables in the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -228,7 +228,7 @@ For additional security, you can enable helpers for encryption in transit, which 1. Using the Lambda console, navigate to the **Edit environment variables** page\. - 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -242,7 +242,7 @@ For additional security, you can enable helpers for encryption in transit, which 1. Under **Encryption in transit**, choose **Enable helpers for encryption in transit**\. - 1. For each environment variable that you want to enable console encryption helpers for, choose **Encrypt** next ot the environment variable\. + 1. For each environment variable that you want to enable console encryption helpers for, choose **Encrypt** next to the environment variable\. 1. Under AWS KMS key to encrypt in transit, choose a customer managed key that you created at the beginning of this procedure\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md old mode 100644 new mode 100755 index dfc08d2d..93ea99d0 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -12,13 +12,13 @@ You can configure a function to mount an Amazon Elastic File System \(Amazon EFS ## Execution role and user permissions -Lambda uses your function's permissions to mount file systems\. To connect to a file system, your function's execution role must have the following permissions in addition to the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions): +If the file system doesn't have a user\-configured IAM policy, EFS uses a default policy that grants full access to any client that can connect to the file system using a file system mount target\. If the file system has a user\-configured IAM policy, your function's execution role must have the correct `elasticfilesystem` permissions\. **Execution role permissions** + **elasticfilesystem:ClientMount** + **elasticfilesystem:ClientWrite \(not required for read\-only connections\)** -These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. +These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. Additionally, your execution role must have the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions)\. When you configure a file system, Lambda uses your permissions to verify mount targets\. To configure a function to connect to a file system, your IAM user needs the following permissions: @@ -58,7 +58,7 @@ If your function is not already connected to a VPC, see [Configuring a Lambda fu **To configure file system access** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md old mode 100644 new mode 100755 index 1c963dc4..840bb9ad --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -30,7 +30,7 @@ The **Function overview** shows a visualization of your function and its upstrea ## Configuring functions \(console\) -For the following function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **configuration** tab provides the following sections: +For the following function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **Configuration** tab provides the following sections: + **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function timeout and the execution role\. + **Permissions** – Configure the execution role and other [permissions](lambda-permissions.md)\. + **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. @@ -81,7 +81,7 @@ You can configure the memory of your function in the Lambda console\. **To update the memory of a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -102,7 +102,7 @@ When you've opted in and your [Lambda function meets Compute Optimizer requireme **To accept a function memory recommendation** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -120,7 +120,7 @@ For details about how services trigger Lambda functions, see [Using AWS Lambda w **To add a trigger to your function\.** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update\. @@ -136,7 +136,7 @@ You can create test events for your function from the **Test** tab\. **To create a test event** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -152,7 +152,7 @@ Saved test events are also available from the **Code** tab, under the **Test** m **To test the function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. diff --git a/doc_source/configuration-function-zip.md b/doc_source/configuration-function-zip.md old mode 100644 new mode 100755 index 5e4ed1d7..dead45ae --- a/doc_source/configuration-function-zip.md +++ b/doc_source/configuration-function-zip.md @@ -22,7 +22,7 @@ When you create a function defined with a \.zip file archive, you choose a code **To create the function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -30,7 +30,7 @@ When you create a function defined with a \.zip file archive, you choose a code 1. Under **Basic information**, do the following: - 1. For **Function name**, enter the function name\. + 1. For **Function name**, enter the function name\. Function names are limited to 64 characters in length\. 1. For **Runtime**, choose the language version to use for your function\. @@ -59,7 +59,7 @@ For scripting languages \(Node\.js, Python, and Ruby\), you can edit your functi **To upload function code as a \.zip archive** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update and choose the **Code** tab\. @@ -116,7 +116,7 @@ If you update the function configuration to use a new runtime version, you may n **To change the runtime or runtime version** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update and choose the **Code** tab\. @@ -177,7 +177,7 @@ However, if you provide your function code using a \.zip file archive deployment **To change the instruction set architecture** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update and choose the **Code** tab\. diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md old mode 100644 new mode 100755 index f5ffb645..0d8ff94c --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -122,7 +122,7 @@ To create a function defined as a container image, you must first [create the im **To create the function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -130,7 +130,7 @@ To create a function defined as a container image, you must first [create the im 1. Under **Basic information**, do the following: - 1. For **Function name**, enter the function name\. + 1. For **Function name**, enter the function name\. Function names are limited to 64 characters in length\. 1. For **Container image URI**, provide a container image that is compatible with the instruction set architecture that you want for your function code\. @@ -169,7 +169,7 @@ After you deploy a container image to a function, the image is read\-only\. To u **To configure the function to use an updated container image** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update\. @@ -187,7 +187,7 @@ You can use the Lambda console to override the configuration values in the conta **To override the configuration values in the container image** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update\. diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md old mode 100644 new mode 100755 index bdff631f..63b41caa --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -1,6 +1,8 @@ # Creating and sharing Lambda layers -A Lambda layer is a \.zip file archive that can contain additional code or data\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. +Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) provide a convenient way to package libraries and other dependencies that you can use with your Lambda functions\. Using layers reduces the size of uploaded deployment archives and makes it faster to deploy your code\. + +A layer is a \.zip file archive that can contain additional code or data\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For functions [defined as a container image](lambda-images.md), you package your preferred runtime and all code dependencies when you create the container image\. For more information, see [Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md old mode 100644 new mode 100755 index 8e85efb3..3c3cc12e --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -21,7 +21,7 @@ You can use the console to add tags to existing functions and to filter function For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -48,7 +48,7 @@ Tags apply at the function level, not to versions or aliases\. Tags are not part + lambda:ListTags grants permission to view functions that have tags\. + lambda:TagResource grants permission to add tags to a function\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Click within the search bar to see a list of function attributes and tag keys\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-key.png) @@ -130,4 +130,4 @@ The following requirements apply to tags: + Maximum value length—256 Unicode characters in UTF\-8 + Tag keys and values are case sensitive\. + Do not use the `aws:` prefix in your tag names or values because it is reserved for AWS use\. You can't edit or delete tag names or values with this prefix\. Tags with this prefix do not count against your tags per resource limit\. -+ If your tagging schema will be used across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. ++ If your tagging schema will be used across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. \ No newline at end of file diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md old mode 100644 new mode 100755 index e8b3b26e..da0fcc7c --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -25,7 +25,7 @@ You can create a function version using the Lambda console\. **To create a new function version** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function and then choose **Versions**\. diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md old mode 100644 new mode 100755 diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md old mode 100644 new mode 100755 index de3d4e65..8ac162f6 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -54,7 +54,7 @@ If your [IAM permissions](#vpc-conditions) allow you only to create Lambda funct **To configure a VPC when you create a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -72,7 +72,7 @@ To access private resources, connect your function to private subnets\. If your **To configure a VPC for an existing function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/csharp-context.md b/doc_source/csharp-context.md old mode 100644 new mode 100755 diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md old mode 100644 new mode 100755 index 767bfdc4..dc25eefe --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -14,7 +14,7 @@ This page describes how to view Lambda function invocation errors for the C\# ru ## Syntax -In the initialization phase, exceptions can be thrown for invalid handler strings, a rule\-breaking type or method \(see [Lambda function handler restrictions ](csharp-handler.md#csharp-handler-restrictions)\), or any other validation method \(such as forgetting the serializer attribute and having a POCO as your input or output type\)\. These exceptions are of type `LambdaException`\. For example: +In the initialization phase, exceptions can be thrown for invalid handler strings, a rule\-breaking type or method \(see [Lambda function handler restrictions](csharp-handler.md#csharp-handler-restrictions)\), or any other validation method \(such as forgetting the serializer attribute and having a POCO as your input or output type\)\. These exceptions are of type `LambdaException`\. For example: ``` { @@ -151,7 +151,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -184,7 +184,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: @@ -204,7 +204,7 @@ cat output.txt You should see the invocation response in your command prompt\. -Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in C\#](csharp-logging.md)\. +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [Lambda function logging in C\#](csharp-logging.md)\. ## Error handling in other AWS services @@ -219,4 +219,4 @@ We recommend using AWS X\-Ray to determine the source of an error and its cause\ For more information, see [Instrumenting C\# code in AWS Lambda](csharp-tracing.md)\. ## What's next? -+ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in C\#](csharp-logging.md) page\. \ No newline at end of file ++ Learn how to show logging events for your Lambda function on the [Lambda function logging in C\#](csharp-logging.md) page\. \ No newline at end of file diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md old mode 100644 new mode 100755 index c53803cc..f2423e9b --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -1,8 +1,8 @@ -# AWS Lambda function handler in C\# +# Lambda function handler in C\# The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. -You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current invocation, such as the name of the current function, the memory limit, execution time remaining, and logging\. +You define a Lambda function handler as an instance or static method in a class\. For access to the Lambda context object, you can define a method parameter of type *ILambdaContext*\. You can use this to access information about the current invocation, such as the name of the function, memory limit, remaining execution time, and logging\. ``` returnType handler-name(inputType input, ILambdaContext context) { @@ -11,17 +11,17 @@ returnType handler-name(inputType input, ILambdaContext context) { ``` In the syntax, note the following: -+ *inputType* – The first handler parameter is the input to the handler, which can be event data \(published by an event source\) or custom input that you provide such as a string or any custom data object\. -+ *returnType* – If you plan to invoke the Lambda function synchronously \(using the `RequestResponse` invocation type\), you can return the output of your function using any of the supported data types\. For example, if you use a Lambda function as a mobile application backend, you are invoking it synchronously\. Your output data type will be serialized into JSON\. ++ *inputType* – The first handler parameter is the input to the handler\. This can be event data \(that an event source publishes\) or custom input that you provide, such as a string or any custom data object\. ++ *returnType* – If you plan to invoke the Lambda function synchronously \(using the `RequestResponse` invocation type\), you can return the output of your function using any of the supported data types\. For example, if you use a Lambda function as a mobile application backend, you are invoking it synchronously\. Your output data type is serialized into JSON\. - If you plan to invoke the Lambda function asynchronously \(using the `Event` invocation type\), the `returnType` should be `void`\. For example, if you use AWS Lambda with event sources such as Amazon S3 or Amazon SNS, these event sources invoke the Lambda function using the `Event` invocation type\. -+ `ILambdaContext context` – The second argument in the handler signature is optional\. It provides access to the [context object](csharp-context.md) which has information about the function and request\. + If you plan to invoke the Lambda function asynchronously \(using the `Event` invocation type\), the `returnType` should be `void`\. For example, if you use Lambda with event sources such as Amazon Simple Storage Service \(Amazon S3\) or Amazon Simple Notification Service \(Amazon SNS\), these event sources invoke the Lambda function using the `Event` invocation type\. ++ `ILambdaContext context` – The second argument in the handler signature is optional\. It provides access to the [context object](csharp-context.md), which has information about the function and request\. ## Handling streams -Only the `System.IO.Stream` type is supported as an input parameter by default\. +By default, Lambda supports only the `System.IO.Stream` type as an input parameter\. -For example, consider the following C\# example code\. +For example, consider the following C\# example code\. ``` using System.IO; @@ -38,34 +38,130 @@ namespace Example } ``` -In the example C\# code, the first handler parameter is the input to the handler \(MyHandler\), which can be event data \(published by an event source such as Amazon S3\) or custom input you provide such as a `Stream` \(as in this example\) or any custom data object\. The output is of type `Stream`\. +In the example C\# code, the first handler parameter is the input to the handler \(MyHandler\)\. This can be event data \(published by an event source such as Amazon S3\) or custom input that you provide, such as a `Stream` \(as in this example\) or any custom data object\. The output is of type `Stream`\. ## Handling standard data types -All other types, as listed below, require you to specify a serializer\. -+ Primitive \.NET types \(such as string or int\)\. -+ Collections and maps \- IList, IEnumerable, IList, Array, IDictionary, IDictionary +All the following other types require you to specify a serializer: ++ Primitive \.NET types \(such as string or int\) ++ Collections and maps – IList, IEnumerable, IList, Array, IDictionary, IDictionary + POCO types \(Plain old CLR objects\) + Predefined AWS event types -+ For asynchronous invocations the return\-type will be ignored by Lambda\. The return type may be set to void in such cases\. -+ If you are using \.NET asynchronous programming, the return type can be Task and Task types and use `async` and `await` keywords\. For more information, see [Using async in C\# functions with AWS Lambda](#csharp-handler-async)\. ++ For asynchronous invocations, Lambda ignores the return type\. In such cases, the return type may be set to void\. ++ If you are using \.NET asynchronous programming, the return type can be Task and Task types and use `async` and `await` keywords\. For more information, see [Using async in C\# functions with Lambda](#csharp-handler-async)\. -Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializers that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. +Unless your function input and output parameters are of type `System.IO.Stream`, you must serialize them\. Lambda provides default serializers that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. -Instruction how to define serialize you can find in [Serializing Lambda functions](#csharp-handler-serializer)\. + To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.SystemTextJson` in your `.csproj` file\. + +``` + + + + net6.0 + enable + enable + true + Lambda + + true + + true + + + + + + + + +``` + +The example below illustrates the flexibility you can leverage by specifying the default System\.Text\.Json serializer on one method and another of your choosing on a different method: + +``` +public class ProductService + { + [LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] + public Product DescribeProduct(DescribeProductRequest request) + { + return catalogService.DescribeProduct(request.Id); + } + + [LambdaSerializer(typeof(MyJsonSerializer))] + public Customer DescribeCustomer(DescribeCustomerRequest request) + { + return customerService.DescribeCustomer(request.Id); + } +} +``` + +### Source generation for JSON serialization + +C\# 9 provides source generators that allow code generation during compilation\. Starting with \.NET 6, the native JSON library `System.Text.Json` can use source generators, allowing JSON parsing without the need for reflection APIs\. This can help improve cold start performance\. + +**To use the source generator** + +1. In your project, define an empty, partial class that derives from `System.Text.Json.Serialization.JsonSerializerContext`\. + +1. Add the `JsonSerializable` attribute for each \.NET type that the source generator must generate serialization code for\. + +**Example API Gateway integration leveraging source generation** + +``` +using System.Collections.Generic; +using System.Net; +using System.Text.Json.Serialization; + +using Amazon.Lambda.Core; +using Amazon.Lambda.APIGatewayEvents; +using Amazon.Lambda.Serialization.SystemTextJson; + +[assembly: +LambdaSerializer(typeof(SourceGeneratorLambdaJsonSerializer))] + +namespace SourceGeneratorExample; + +[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyRequest))] +[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyResponse))] +public partial class HttpApiJsonSerializerContext : JsonSerializerContext +{ +} + +public class Functions +{ + public APIGatewayProxyResponse Get(APIGatewayHttpApiV2ProxyRequest +request, ILambdaContext context) + { + context.Logger.LogInformation("Get Request"); + var response = new APIGatewayHttpApiV2ProxyResponse + { + StatusCode = (int)HttpStatusCode.OK, + Body = "Hello AWS Serverless", + Headers = new Dictionary { { "Content-Type", +"text/plain" } } + }; + + return response; + } +} +``` + +When you invoke your function, Lambda uses the source\-generated JSON serialization code to handle the serialization of Lambda events and responses\. ## Handler signatures -When creating Lambda functions, you have to provide a handler string that tells AWS Lambda where to look for the code to invoke\. In C\#, the format is: +When creating Lambda functions, you have to provide a handler string that tells Lambda where to look for the code to invoke\. In C\#, the format is: *ASSEMBLY::TYPE::METHOD* where: -+ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in \.csproj, the *ASSEMBLY* name will be the \.csproj file name\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the \.csproj file is `HelloWorldApp.csproj`\. ++ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in the \.csproj file, the *ASSEMBLY* name is the \.csproj file name\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume that the \.csproj file is `HelloWorldApp.csproj`\. + *TYPE* is the full name of the handler type, which consists of the *Namespace* and the *ClassName*\. In this case `Example.Hello`\. + *METHOD* is name of the function handler, in this case `MyHandler`\. -Ultimately, the signature will be of this format: *Assembly::Namespace\.ClassName::MethodName* +Ultimately, the signature is of this format: *Assembly::Namespace\.ClassName::MethodName* -Again, consider the following example: +Consider the following example: ``` using System.IO; @@ -85,25 +181,44 @@ namespace Example The handler string would be: `HelloWorldApp::Example.Hello::MyHandler` **Important** -If the method specified in your handler string is overloaded, you must provide the exact signature of the method Lambda should invoke\. AWS Lambda will reject an otherwise valid signature if the resolution would require selecting among multiple \(overloaded\) signatures\. +If the method specified in your handler string is overloaded, you must provide the exact signature of the method that Lambda should invoke\. If the resolution would require selecting among multiple \(overloaded\) signatures, Lambda will reject an otherwise valid signature\. + +## Using top\-level statements + +Starting with \.NET 6, you can write functions using *top\-level statements*\. Top\-level statements remove some of the boilerplate code required for \.NET projects, reducing the number of lines of code that you write\. For example, you can rewrite the previous example using top\-level statements: + +``` +using Amazon.Lambda.RuntimeSupport; + +var handler = (Stream stream) => +{ + //function logic +}; + +await LambdaBootstrapBuilder.Create(handler).Build().RunAsync(); +``` + + When using top\-level statements, you only include the `ASSEMBLY` name when providing the handler signature\. Continuing from the previous example, the handler string would be `HelloWorldApp`\. + + By setting the handler to the assembly name Lambda will treat the assembly as an executable and execute it at startup\. You must add the NuGet package `Amazon.Lambda.RuntimeSupport` to the project so that the executable that runs at startup starts the Lambda runtime client\. ## Serializing Lambda functions -For any Lambda functions that use input or output types other than a `Stream` object, you will need to add a serialization library to your application\. You can do this in the following ways: -+ Use the `Amazon.Lambda.Serialization.SystemTextJson` NuGet package\. This library uses native .net core JSON serializer to handle serialization\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`, but please note that there are some limitation documented in the [Microsoft's documentation](https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-core-3-1)\. It is only available for \.net core 3\.1 runtimes or higher\. -+ Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses `Newtonsoft.Json` NuGet package to handle serialization\. +For any Lambda functions that use input or output types other than a `Stream` object, you must add a serialization library to your application\. You can do this in the following ways: ++ Use the `Amazon.Lambda.Serialization.SystemTextJson` NuGet package\. This library uses the native \.NET Core JSON serializer to handle serialization\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`, but note the limitations described in the [ Microsoft documentation](https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-core-3-1)\. This library is available for \.NET Core 3\.1 and later runtimes\. ++ Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses JSON\.NET to handle serialization\. + Create your own serialization library by implementing the `ILambdaSerializer` interface, which is available as part of the `Amazon.Lambda.Core` library\. The interface defines two methods: + `T Deserialize(Stream requestStream);` You implement this method to deserialize the request payload from the `Invoke` API into the object that is passed to the Lambda function handler\. + `T Serialize(T response, Stream responseStream);`\. - You implement this method to serialize the result returned from the Lambda function handler into the response payload that is returned by the `Invoke` API\. - + You implement this method to serialize the result returned from the Lambda function handler into the response payload that the `Invoke` API operation returns\. -To use serializer you need to add a dependency to your `csproj` file\. +To use the serializer, you must add a dependency to your `MyProject.csproj` file\. ``` +... @@ -111,19 +226,19 @@ To use serializer you need to add a dependency to your `csproj` file\. ``` -Next you need to define the serializer. For example you can define it in the AssemblyInfo\.cs file\. If you are using `Amazon.Lambda.Serialization.SystemTextJson`, the serializercan be defined that way: +Next, you must define the serializer\. The following example defines the ` Amazon.Lambda.Serialization.SystemTextJson` serializer in the AssemblyInfo\.cs file\. ``` [assembly: LambdaSerializer(typeof(DefaultLambdaJsonSerializer))] ``` - -Using `Amazon.Lambda.Serialization.Json`, it will be: + +The following example defines the `Amazon.Lambda.Serialization.Json` serializer in the AssemblyInfo\.cs file\. ``` [assembly: LambdaSerializer(typeof(JsonSerializer))] ``` -You can also define a custom serialization attribute at the method level, which will override the default serializer specified at the assembly level\. +You can define a custom serialization attribute at the method level, which overrides the default serializer specified at the assembly level\. ``` public class ProductService{ @@ -145,14 +260,14 @@ public class ProductService{ ## Lambda function handler restrictions Note that there are some restrictions on the handler signature\. -+ It may not be `unsafe` and use pointer types in the handler signature, though `unsafe` context can be used inside the handler method and its dependencies\. For more information, see [unsafe \(C\# reference\)](https://msdn.microsoft.com/en-us/library/chfa2zb8.aspx)\. -+ It may not pass a variable number of parameters using the `params` keyword, or use `ArgIterator` as an input or return parameter which is used to support variable number of parameters\. -+ The handler may not be a generic method \(e\.g\. IList Sort\(IList input\)\)\. ++ It may not be `unsafe` and use pointer types in the handler signature, though you can use `unsafe` context inside the handler method and its dependencies\. For more information, see [unsafe \(C\# Reference\)](https://msdn.microsoft.com/en-us/library/chfa2zb8.aspx) on the Microsoft Docs website\. ++ It may not pass a variable number of parameters using the `params` keyword, or use `ArgIterator` as an input or a return parameter, which is used to support a variable number of parameters\. ++ The handler may not be a generic method, for example, IList Sort\(IList input\)\. + Async handlers with signature `async void` are not supported\. -## Using async in C\# functions with AWS Lambda +## Using async in C\# functions with Lambda -If you know your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to time out\. +If you know that your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from Amazon DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to time out\. ``` public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) @@ -162,8 +277,8 @@ public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) } ``` -If you use this pattern, there are some considerations you must take into account: -+ AWS Lambda does not support `async void` methods\. +If you use this pattern, consider the following: ++ Lambda does not support `async void` methods\. + If you create an async Lambda function without implementing the `await` operator, \.NET will issue a compiler warning and you will observe unexpected behavior\. For example, some async actions will run while others won't\. Or some async actions won't complete before the function invocation completes\. ``` @@ -172,7 +287,7 @@ If you use this pattern, there are some considerations you must take into accoun client.DoAsyncWork(input); } ``` -+ Your Lambda function can include multiple async calls, which can be invoked in parallel\. You can use the `Task.WhenAll` and `Task.WhenAny` methods to work with multiple tasks\. To use the `Task.WhenAll` method, you pass a list of the operations as an array to the method\. Note that in the example below, if you neglect to include any operation to the array, that call may return before its operation completes\. ++ Your Lambda function can include multiple async calls, which can be invoked in parallel\. You can use the `Task.WhenAll` and `Task.WhenAny` methods to work with multiple tasks\. To use the `Task.WhenAll` method, you pass a list of the operations as an array to the method\. Note that in the following example, if you neglect to include any operation to the array, that call may return before its operation completes\. ``` public async Task DoesNotWaitForAllTasks1() @@ -197,7 +312,7 @@ If you use this pattern, there are some considerations you must take into accoun var task2 = Task.Run(() => Console.WriteLine("Test2")); var task3 = Task.Run(() => Console.WriteLine("Test3")); - // Lambda may return before printing all tests since we're only waiting for one to finish. + // Lambda may return before printing all tests since we're waiting for only one to finish. await Task.WhenAny(task1, task2, task3); } - ``` + ``` \ No newline at end of file diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md old mode 100644 new mode 100755 index 9ca53129..14631ea0 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -7,7 +7,7 @@ AWS provides the following resources to help you build a container image for you These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -36,6 +36,7 @@ AWS provides the following base images for \.NET: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | +| 6 | \.NET 6\.0 | Amazon Linux 2 | [Dockerfile for \.NET 6\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/tree/master/LambdaRuntimeDockerfiles/Images/net6) | | 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet5.0/Dockerfile.dotnet5.0) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | | core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md old mode 100644 new mode 100755 index 02a49dc3..9acc742d --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -1,4 +1,4 @@ -# AWS Lambda function logging in C\# +# Lambda function logging in C\# AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. @@ -6,6 +6,7 @@ This page describes how to produce log output from your Lambda function's code, **Topics** + [Creating a function that returns logs](#csharp-logging-output) ++ [Using log levels](#log-levels) + [Using the Lambda console](#csharp-logging-console) + [Using the CloudWatch console](#csharp-logging-cwconsole) + [Using the AWS Command Line Interface \(AWS CLI\)](#csharp-logging-cli) @@ -13,7 +14,7 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs - To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. +To output logs from your function code, you can use methods on the [Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. **Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** @@ -37,7 +38,7 @@ public async Task FunctionHandler(SQSEvent invocationEvent, ILambd } ``` -**Example Log format** +**Example log format** ``` START RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d Version: $LATEST @@ -87,6 +88,24 @@ The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocatio + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. +## Using log levels + +Starting with \.NET 6, you can use log levels for additional logging from Lambda functions\. Log levels provide filtering and categorization for the logs that your function writes to Amazon EventBridge \(CloudWatch Events\)\. + +The log levels available are: ++ `LogCritical` ++ `LogError` ++ `LogWarning` ++ `LogInformation` ++ `LogDebug` ++ `LogTrace` + + By default, Lambda writes `LogInformation` level logs and above to CloudWatch\. You can adjust the level of logs that Lambda writes using the `AWS_LAMBDA_HANDLER_LOG_LEVEL` environment variable\. Set the value of the environment variable to the string enum value for the level desired, as outlined in the [LogLevel enum](https://github.com/aws/aws-lambda-dotnet/blob/master/Libraries/src/Amazon.Lambda.Core/ILambdaLogger.cs#L7)\. For example, if you set `AWS_LAMBDA_HANDLER_LOG_LEVEL` to `Error`, Lambda writes `LogError` and `LogCritical` messages to CloudWatch\. + + Lambda writes `Console.WriteLine` calls as info level messages, and `Console.Error.WriteLine` calls as error level messages\. + + If you prefer the previous style of logging in \.NET, set `AWS_LAMBDA_HANDLER_LOG_FORMAT` to `Unformatted`\. + ## Using the Lambda console You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. @@ -151,7 +170,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md old mode 100644 new mode 100755 index 4e984227..9f0c3583 --- a/doc_source/csharp-package-cli.md +++ b/doc_source/csharp-package-cli.md @@ -2,7 +2,7 @@ The \.NET Core CLI offers a cross\-platform way for you to create \.NET\-based Lambda applications\. This section assumes that you have installed the \.NET Core CLI\. If you haven't, see [Download \.NET](https://dotnet.microsoft.com/download) on the Microsoft website\. -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: +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, navigate to where you installed the \.NET Core runtime, and then run the following command: ``` dotnet new -all @@ -21,7 +21,7 @@ Examples: dotnet new --help ``` -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: +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 @@ -53,8 +53,7 @@ Under the `src/myfunction` directory, examine the following files: "profile" : "default", "region" : "us-east-2", "configuration" : "Release", - "framework" : "netcoreapp2.1", - "function-runtime":"dotnetcore3.1", + "function-runtime":"dotnet6", "function-memory-size" : 256, "function-timeout" : 30, "function-handler" : "MyFunction::MyFunction.Function::FunctionHandler" @@ -70,16 +69,16 @@ Under the `src/myfunction` directory, examine the following files: 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))] + [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] namespace MyFunction { public class Function { - public string FunctionHandler1(string input, ILambdaContext context) + public string FunctionHandler(string input, ILambdaContext context) { - return input?.ToUpper(); + return input.ToUpper(); } } } @@ -90,12 +89,20 @@ Under the `src/myfunction` directory, examine the following files: - netcoreapp2.1 + net6.0 + enable + enable + true + Lambda + + true + + true - - + + @@ -103,13 +110,13 @@ Under the `src/myfunction` directory, examine the following files: + **Readme**: Use this file to document your Lambda function\. Under the `myfunction/test` directory, examine the following files: -+ **myFunction\.Tests\.csproj**: As noted previously, 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 seamlessly integrate any Lambda templates required to test your function\. ++ **myFunction\.Tests\.csproj**: As noted previously, 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, so you can seamlessly integrate any Lambda templates required to test your function\. ``` ... - + ... ``` + **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\. @@ -167,16 +174,14 @@ dotnet lambda deploy-function MyFunction --function-role role After deployment, you can re\-test it in a production environment using the following command, and pass in a different value to your Lambda function handler: -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. - ``` -dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" +dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" ``` If everything is successful, you see the following: ``` -dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" +dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" Payload: "JUST CHECKING IF EVERYTHING IS OK" diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md old mode 100644 new mode 100755 index 316b45f8..88473f87 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -1,6 +1,6 @@ # AWS Toolkit for Visual Studio -You can build \.NET\-based Lambda applications using the Lambda plugin to the [AWS Toolkit for Visual Studio](http://aws.amazon.com/visualstudio/)\. The toolkit is available as a [Visual Studio extension](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.AWSToolkitforVisualStudio2017)\. +You can build \.NET\-based Lambda applications using the Lambda plugin for the [AWS Toolkit for Visual Studio](http://aws.amazon.com/visualstudio/)\. The toolkit is available as a [Visual Studio extension](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.AWSToolkitforVisualStudio2017)\. 1. Launch Microsoft Visual Studio and choose **New project**\. @@ -8,21 +8,20 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A 1. In the **New Project** window, choose **Lambda Project \(\.NET Core\)**, and then choose **OK**\. - 1. In the **Select Blueprint** window, you can select from a list of sample applications that provide you with sample code to get started with creating a \.NET\-based Lambda application\. + 1. In the **Select Blueprint** window, select from the list of sample applications with sample code to help you get started with creating a \.NET\-based Lambda application\. 1. To create a Lambda application from scratch, choose **Empty Function**, and then choose **Finish**\. 1. Review the `aws-lambda-tools-defaults.json` file, which is created as part of your project\. You can set the options in this file, which the Lambda tooling reads by default\. The project templates created in Visual Studio set many of these fields with default values\. Note the following fields: + **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) - + **function\-handler** – This is where the `function handler` is specified, which is why you don't have to set it in the wizard\. However, whenever you rename the *Assembly*, *Namespace*, *Class*, or *Function* in your function code, you must update the corresponding fields in the `aws-lambda-tools-defaults.json` file\. + + **function\-handler** – The field where you specify the `function handler`\. \(This is why you don't have to set it in the wizard\.\) However, whenever you rename the *Assembly*, *Namespace*, *Class*, or *Function* in your function code, you must update the corresponding fields in the `aws-lambda-tools-defaults.json` file\. ``` { "profile":"default", "region" : "us-east-2", "configuration" : "Release", - "framework" : "netcoreapp2.1", - "function-runtime":"dotnetcore3.1", + "function-runtime":"dotnet6", "function-memory-size" : 256, "function-timeout" : 30, "function-handler" : "Assembly::Namespace.Class::Function" @@ -31,7 +30,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A 1. Open the **Function\.cs** file\. You are provided with a template to implement your Lambda function handler code\. -1. Once you have written the code that represents your Lambda function, upload it by opening the context \(right\-click\) menu for the **Project** node in your application and then choosing **Publish to AWS Lambda**\. +1. After writing the code that represents your Lambda function, upload it by opening the context \(right\-click\) menu for the **Project** node in your application and then choosing **Publish to AWS Lambda**\. 1. In the **Upload Lambda Function** window, enter a name for the function, or select a previously published function to republish\. Then choose **Next**\. diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md old mode 100644 new mode 100755 diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md old mode 100644 new mode 100755 index 21a62e9f..f468b4d5 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md old mode 100644 new mode 100755 diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md old mode 100644 new mode 100755 index 5e278770..579df015 --- a/doc_source/foundation-arch.md +++ b/doc_source/foundation-arch.md @@ -81,4 +81,4 @@ Lambda provides the following runtimes for the arm64 architecture\. These runtim **Note** Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. For example, see [Build a Go function for the provided\.al2 runtime](golang-package.md#golang-package-al2) or [Create a Go image from the provided\.al2 base image](go-image.md#go-image-al2)\. -For an example of how to create a function with arm64 architecture, see [ AWS Lambda Functions Powered by AWS Graviton2 Processor](http://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)\. \ No newline at end of file +For an example of how to create a function with arm64 architecture, see [AWS Lambda Functions Powered by AWS Graviton2 Processor](http://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)\. \ No newline at end of file diff --git a/doc_source/foundation-console.md b/doc_source/foundation-console.md old mode 100644 new mode 100755 diff --git a/doc_source/foundation-networking.md b/doc_source/foundation-networking.md old mode 100644 new mode 100755 diff --git a/doc_source/foundation-progmodel.md b/doc_source/foundation-progmodel.md old mode 100644 new mode 100755 diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md old mode 100644 new mode 100755 index aad0bb8c..b4747281 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -6,7 +6,7 @@ Lambda includes a state field in the function configuration for all functions to + `Failed` – Indicates that resource configuration or provisioning encountered an error\. + `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -If you are utilizing SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. +If you are using SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. ``` aws lambda get-function --function-name my-function --query 'Configuration.[State, LastUpdateStatus]' @@ -66,4 +66,4 @@ The following is the result of `get-function-configuration` on a function underg The following operations fail while an asynchronous update is in progress: + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [PublishVersion](API_PublishVersion.md) ++ [PublishVersion](API_PublishVersion.md) \ No newline at end of file diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md old mode 100644 new mode 100755 index 90bea1d8..f24cab66 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -1,6 +1,6 @@ # Create a Lambda function with the console -In this getting started exercise, you create a Lambda function using the console\.The function uses the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. +In this getting started exercise, you create a Lambda function using the console\. The function uses the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. For compiled languages, you must create a [\.zip archive deployment package](gettingstarted-package.md#gettingstarted-package-zip) to upload your Lambda function code\. **Topics** + [Create the function](#gettingstarted-zip-function) @@ -13,7 +13,7 @@ You create a Node\.js Lambda function using the Lambda console\. Lambda automati **To create a Lambda function with the console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -59,7 +59,7 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. + For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. ## Clean up @@ -67,7 +67,7 @@ If you are done working with the example function, delete it\. You can also dele **To delete a Lambda function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md old mode 100644 new mode 100755 diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md old mode 100644 new mode 100755 diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md old mode 100644 new mode 100755 index f910270b..2389af5e --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -24,7 +24,7 @@ For more information, see [Configuring AWS Lambda functions](lambda-functions.md ## Trigger -A *trigger* is a resource or configuration that invokes a Lambda function\. Triggers include AWS services that you can configure to invoke a function and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. +A *trigger* is a resource or configuration that invokes a Lambda function\. Triggers include AWS services that you can configure to invoke a function and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. ## Event diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md old mode 100644 new mode 100755 index 47b34567..302d59af --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -14,7 +14,7 @@ Lambda provides a management console and API for managing and invoking functions ## Scaling -Lambda manages the infrastructure that runs your code, and scales automatically in response to incoming requests\. When your function is invoked more quickly than a single instance of your function can process events, Lambda scales up by running additional instances\. When traffic subsides, inactive instances are frozen or stopped\. You only pay for the time that your function is initializing or processing events\. +Lambda manages the infrastructure that runs your code, and scales automatically in response to incoming requests\. When your function is invoked more quickly than a single instance of your function can process events, Lambda scales up by running additional instances\. When traffic subsides, inactive instances are frozen or stopped\. You pay only for the time that your function is initializing or processing events\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling.png) @@ -50,7 +50,7 @@ To process items from a stream or queue, you can create an *event source mapping Event source mappings maintain a local queue of unprocessed items and handle retries if the function returns an error or is throttled\. You can configure an event source mapping to customize batching behavior and error handling, or to send a record of items that fail processing to a destination\. -For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md)\. +For more information, see [Lambda event source mappings](invocation-eventsourcemapping.md)\. ## Destinations diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md old mode 100644 new mode 100755 index d185ab0a..100149e1 --- a/doc_source/gettingstarted-images.md +++ b/doc_source/gettingstarted-images.md @@ -33,7 +33,7 @@ This exercise uses Docker CLI commands to create the container image\. To instal ## Create the container image -AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [ AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. +AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. In the following commands, replace `123456789012` with your AWS account ID\. @@ -88,7 +88,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. ## Upload the image to the Amazon ECR repository -In the following commands, replace `123456789012` with your AWS account ID\. +In the following commands, replace `123456789012` with your AWS account ID and set the region value to the region where you want to create the ECR repository\. 1. Authenticate the Docker CLI to your Amazon ECR registry\. @@ -99,7 +99,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. 1. Create a repository in Amazon ECR using the `create-repository` command\. ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + aws ecr create-repository --region us-east-1 --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE ``` 1. Tag your image to match your repository name using the `docker tag` command\. @@ -140,7 +140,7 @@ Use the Lambda console to create a function defined as a container image\. **To create the function with the console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -188,7 +188,7 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. + For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. ## Clean up @@ -198,7 +198,7 @@ If you are done working with your function, delete it\. You can also delete the **To delete a Lambda function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md old mode 100644 new mode 100755 index 1cf0c322..ac8debc9 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -5,7 +5,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per AWS Region and can be increased\. For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*\. **Note** -New AWS accounts might start out with limits that are lower than these defaults\. Lambda monitors usage and raises your limits automatically based on your usage\. +A few new AWS accounts might start out with limits that are lower than these defaults\. AWS monitors usage and raises your limits automatically based on your usage\. | Resource | Default quota | Can be increased up to | @@ -28,7 +28,7 @@ The Lambda documentation, log messages, and console use the abbreviation MB \(ra | Resource | Quota | | --- | --- | | Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | -| Function [ timeout](https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/timeout.html) | 900 seconds \(15 minutes\) | +| Function timeout | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | five layers | diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md old mode 100644 new mode 100755 diff --git a/doc_source/glossary.md b/doc_source/glossary.md old mode 100644 new mode 100755 diff --git a/doc_source/go-image.md b/doc_source/go-image.md old mode 100644 new mode 100755 index 28da6942..5e2efbb7 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -5,7 +5,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. diff --git a/doc_source/golang-context.md b/doc_source/golang-context.md old mode 100644 new mode 100755 diff --git a/doc_source/golang-envvars.md b/doc_source/golang-envvars.md old mode 100644 new mode 100755 diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md old mode 100644 new mode 100755 index b3d6032e..1c8300a9 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -69,7 +69,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -102,7 +102,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md old mode 100644 new mode 100755 diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md old mode 100644 new mode 100755 index a6dac31c..ba85177c --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -136,7 +136,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md old mode 100644 new mode 100755 diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md old mode 100644 new mode 100755 index c7564059..1c22aaf7 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/images-create.md b/doc_source/images-create.md old mode 100644 new mode 100755 diff --git a/doc_source/images-test.md b/doc_source/images-test.md old mode 100644 new mode 100755 diff --git a/doc_source/index.md b/doc_source/index.md old mode 100644 new mode 100755 index 8c8ead85..3c817e0b --- a/doc_source/index.md +++ b/doc_source/index.md @@ -53,10 +53,11 @@ Amazon's trademarks and trade dress may not be used in + [Configuring code signing for AWS Lambda](configuration-codesigning.md) + [Using tags on AWS Lambda functions](configuration-tags.md) + [Using layers with your Lambda function](invocation-layers.md) -+ [Invoking AWS Lambda functions](lambda-invocation.md) ++ [Invoking Lambda functions](lambda-invocation.md) + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) - + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) + + [Lambda event source mappings](invocation-eventsourcemapping.md) + + [Lambda event filtering](invocation-eventfiltering.md) + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) @@ -119,13 +120,13 @@ Amazon's trademarks and trade dress may not be used in + [Instrumenting Go code in AWS Lambda](golang-tracing.md) + [Using environment variables](golang-envvars.md) + [Building Lambda functions with C#](lambda-csharp.md) - + [AWS Lambda function handler in C#](csharp-handler.md) + + [Lambda function handler in C#](csharp-handler.md) + [Deploy C# Lambda functions with .zip file archives](csharp-package.md) + [.NET Core CLI](csharp-package-cli.md) + [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) + [Deploy .NET Lambda functions with container images](csharp-image.md) + [AWS Lambda context object in C#](csharp-context.md) - + [AWS Lambda function logging in C#](csharp-logging.md) + + [Lambda function logging in C#](csharp-logging.md) + [AWS Lambda function errors in C#](csharp-exceptions.md) + [Instrumenting C# code in AWS Lambda](csharp-tracing.md) + [Building Lambda functions with PowerShell](lambda-powershell.md) @@ -144,12 +145,11 @@ Amazon's trademarks and trade dress may not be used in + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) + [AWS SAM template for an API Gateway application](services-apigateway-template.md) + [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md) - + [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) + + [Logging Lambda API calls with CloudTrail](logging-using-cloudtrail.md) + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + [Sample function code](with-cloudtrail-create-package.md) + [Using AWS Lambda with Amazon EventBridge (CloudWatch Events)](services-cloudwatchevents.md) + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) - + [AWS SAM template for a EventBridge (CloudWatch Events) application](with-scheduledevents-example-use-app-spec.md) + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) + [Using Lambda with CloudWatch Logs](services-cloudwatchlogs.md) + [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md) @@ -192,16 +192,16 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with Amazon SNS](with-sns.md) + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) + [Sample function code](with-sns-create-package.md) - + [Using AWS Lambda with Amazon SQS](with-sqs.md) + + [Using Lambda with Amazon SQS](with-sqs.md) + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + [Tutorial: Using a cross-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + [Using AWS Lambda with AWS X-Ray](services-xray.md) + [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md) - + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + + [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) - + [Working with AWS Lambda function metrics](monitoring-metrics.md) + + [Working with Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) + [Example workflows using other AWS services](monitoring-servicemap.md) @@ -315,6 +315,8 @@ Amazon's trademarks and trade dress may not be used in + [EnvironmentResponse](API_EnvironmentResponse.md) + [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) + [FileSystemConfig](API_FileSystemConfig.md) + + [Filter](API_Filter.md) + + [FilterCriteria](API_FilterCriteria.md) + [FunctionCode](API_FunctionCode.md) + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md old mode 100644 new mode 100755 index abac18f4..6ded61d8 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -25,7 +25,7 @@ aws lambda invoke \ --payload '{ "key": "value" }' response.json ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` { @@ -52,7 +52,7 @@ You can also configure Lambda to send an invocation record to another service\. The invocation record contains details about the request and response in JSON format\. You can configure separate destinations for events that are processed successfully, and events that fail all processing attempts\. Alternatively, you can configure an Amazon SQS queue or Amazon SNS topic as a [dead\-letter queue](#invocation-dlq) for discarded events\. For dead\-letter queues, Lambda only sends the content of the event, without details about the response\. **Note** -To prevent a function from triggering, you can set the function's reserved concurrency to zero\. When you set reserved concurrency to zero for an asynchronously\-invoked function, Lambda immediately sends all events to the configured [dead\-letter queue](#invocation-dlq) or the on\-failure [event destination](#invocation-async-destinations), without any retries\. To process events that were sent while reserved concurrency was set to zero, you need to consume the events from the dead\-letter queue or the on\-failure event destination\. +To prevent a function from triggering, you can set the function's reserved concurrency to zero\. When you set reserved concurrency to zero for an asynchronously\-invoked function, Lambda begins sending new events to the configured [dead\-letter queue](#invocation-dlq) or the on\-failure [event destination](#invocation-async-destinations), without any retries\. To process events that were sent while reserved concurrency was set to zero, you need to consume the events from the dead\-letter queue or the on\-failure event destination\. ## Configuring error handling for asynchronous invocation @@ -60,7 +60,7 @@ Use the Lambda console to configure error handling settings on a function, a ver **To configure error handling** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -94,7 +94,7 @@ Add destinations to your function in the Lambda console's function visualization **To configure a destination for asynchronous invocation records** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -208,7 +208,7 @@ As an alternative to an [on\-failure destination](#invocation-async-destinations To reprocess events in a dead\-letter queue, you can set it as an event source for your Lambda function\. Alternatively, you can manually retrieve the events\. You can choose an Amazon SQS queue or Amazon SNS topic for your dead\-letter queue\. If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. -+ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ++ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using Lambda with Amazon SQS](with-sqs.md)\. Create a queue in the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. @@ -225,7 +225,7 @@ After creating the target and updating your function's execution role, add the d **To configure a dead\-letter queue** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -257,4 +257,4 @@ Lambda sends the event to the dead\-letter queue as\-is, with additional informa If Lambda can't send a message to the dead\-letter queue, it deletes the event and emits the [DeadLetterErrors](monitoring-metrics.md) metric\. This can happen because of lack of permissions, or if the total size of the message exceeds the limit for the target queue or topic\. For example, if an Amazon SNS notification with a body close to 256 KB triggers a function that results in an error, the additional event data added by Amazon SNS, combined with the attributes added by Lambda, can cause the message to exceed the maximum size allowed in the dead\-letter queue\. -If you're using Amazon SQS as an event source, configure a dead\-letter queue on the Amazon SQS queue itself and not on the Lambda function\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. \ No newline at end of file +If you're using Amazon SQS as an event source, configure a dead\-letter queue on the Amazon SQS queue itself and not on the Lambda function\. For more information, see [Using Lambda with Amazon SQS](with-sqs.md)\. \ No newline at end of file diff --git a/doc_source/invocation-eventfiltering.md b/doc_source/invocation-eventfiltering.md new file mode 100755 index 00000000..cf9d458f --- /dev/null +++ b/doc_source/invocation-eventfiltering.md @@ -0,0 +1,312 @@ +# Lambda event filtering + +For Amazon Kinesis, Amazon DynamoDB, and Amazon Simple Queue Service \(Amazon SQS\) event sources, you can use event filtering to control which events Lambda sends to your function for processing\. For example, you can define filter criteria so that you process only the records from a Kinesis stream that have the status code `ERROR`\. + +You can define up to five different filters for a single event source\. If an event satisfies any one of these five filters, Lambda sends the event to your function\. Otherwise, Lambda discards the event\. An event either satisfies the filter criteria or it doesn't\. If you're using batching windows, Lambda applies your filter criteria to each new event to determine whether to add it to the current batch\. + +**Topics** ++ [Event filtering basics](#filtering-basics) ++ [Filter rule syntax](#filtering-syntax) ++ [Filtering examples](#filtering-examples) ++ [Attaching filter criteria to an event source mapping \(console\)](#filtering-console) ++ [Attaching filter criteria to an event source mapping \(AWS CLI\)](#filtering-cli) ++ [Properly filtering Amazon SQS messages](#filtering-sqs) ++ [Properly filtering Kinesis and DynamoDB messages](#filtering-streams) + +## Event filtering basics + +A filter criteria \(`FilterCriteria`\) object is a structure that consists of a list of filters \(`Filters`\)\. Each filter \(`Filter`\) is a structure that defines an event filtering pattern \(`Pattern`\)\. A `Pattern` is a string representation of a JSON filter rule\. A `FilterCriteria` object looks like the following example: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"Metadata1\": [ rule1 ], \"data\": { \"Data1\": [ rule2 ] }}" + } + ] +} +``` + +For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON: + +``` +{ + "Metadata1": [ pattern1 ], + "data": { + "Data1": [ pattern2 ] + } +} +``` + +There are three main parts to a `FilterCriteria` object: metadata properties, data properties, and filter patterns\. For example, suppose you receive a Kinesis event from your event source that looks like the following: + +``` +"kinesis": { + "partitionKey": "1", + "sequenceNumber": "49590338271490256608559692538361571095921575989136588898", + "data": { + "City": "Seattle", + "State": "WA", + "Temperature": "46", + "Month": "December" + }, + "approximateArrivalTimestamp": 1545084650.987 +} +``` ++ **Metadata properties** are the fields of the event object\. In the example `FilterCriteria`, `Metadata1` refers to a metadata property\. In the Kinesis event example, `Metadata1` could refer to a field such as `partitionKey`\. ++ **Data properties** are the fields of the event body\. In the example `FilterCriteria`, `Data1` refers to a data property\. In the Kinesis event example, `Data1` could refer to fields such as `City` and `Temperature`\. +**Note** +To filter on data properties, make sure to contain them in `FilterCriteria` within the proper key\. This key depends on the event source\. For Kinesis event sources, the data key is `data`\. For Amazon SQS event sources, the data key is `body`\. For DynamoDB event sources, the data key is `dynamodb`\. ++ **Filter rules** define the filter that you want to apply to a specific property\. In the example `FilterCriteria`, `rule1` applies to `Metadata1`, and `rule2` applies to `Data1`\. The syntax of your filter rule depends on the comparison operator that you use\. For more information, see [Filter rule syntaxFiltering examples](#filtering-syntax)\. + +When you create a `FilterCriteria` object, specify only the metadata properties and data properties that you want the filter to match on\. For Lambda to consider the event a match, the event must contain all the field names included in a filter\. Lambda ignores the fields that aren't included in a filter\. + +## Filter rule syntax + +For filter rules, Lambda supports the same set of syntax and rules as Amazon EventBridge\. For more information, see [Amazon EventBridge event patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html) in the *Amazon EventBridge User Guide*\. + +The following is a summary of all the comparison operators available for Lambda event filtering\. + + +| Comparison operator | Example | Rule syntax | +| --- | --- | --- | +| Null | UserID is null | "UserID": \[ null \] | +| Empty | LastName is empty | "LastName": \[""\] | +| Equals | Name is "Alice" | "Name": \[ "Alice" \] | +| And | Location is "New York" and Day is "Monday" | "Location": \[ "New York" \], "Day": \["Monday"\] | +| Or | PaymentType is "Credit" or "Debit" | "PaymentType": \[ "Credit", "Debit"\] | +| Not | Weather is anything but "Raining" | "Weather": \[ \{ "anything\-but": \[ "Raining" \] \} \] | +| Numeric \(equals\) | Price is 100 | "Price": \[ \{ "numeric": \[ "=", 100 \] \} \] | +| Numeric \(range\) | Price is more than 10, and less than or equal to 20 | "Price": \[ \{ "numeric": \[ ">", 10, "<=", 20 \] \} \] | +| Exists | ProductName exists | "ProductName": \[ \{ "exists": true \} \] | +| Does not exist | ProductName does not exist | "ProductName": \[ \{ "exists": false \} \] | +| Begins with | Region is in the US | "Region": \[ \{"prefix": "us\-" \} \] | + +**Note** +Like EventBridge, for strings, Lambda uses exact character\-by\-character matching without case\-folding or any other string normalization\. For numbers, Lambda also uses string representation\. For example, 300, 300\.0, and 3\.0e2 are not considered equal\. + +## Filtering examples + +Suppose you have a Kinesis event source, and you want your function to handle only events with a specific `partitionKey` \(a metadata property\)\. In addition, you want to process only events with the `Location` field \(a data property\) equal to "Los Angeles"\. In this case, your `FilterCriteria` object would look like this: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"partitionKey\": [ \"1\" ], \"data\": { \"Location\": [ \"Los Angeles\" ] }}" + } + ] +} +``` + +For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON\. + +``` +{ + "partitionKey": [ "1" ], + "data": { + "Location": [ "Los Angeles" ] + } +} +``` + +The previous example uses the **Equals** comparison operator for both `partitionKey` and `Location`\. + +As another example, suppose that you want to handle only events where the `Temperature` data property is greater than 50 but less than or equal to 60\. In this case, your `FilterCriteria` object would look like this: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"data\": { \"Temperature\": [ {\"numeric\": [ \">\", 50, \"<=\", 60 ] }]}" + } + ] +} +``` + +For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON\. + +``` +{ + "data": { + "Temperature": [ {"numeric": [ ">", 50, "<=", 60 ] } ] + } +} +``` + +The previous example uses the **Numeric \(range\)** comparison operator for `Temperature`\. + +### Multi\-level filtering + +You can also use event filtering to handle multi\-level JSON filtering\. For example, suppose you receive a DynamoDB stream event with a data object that looks like the following: + +``` +"dynamodb": { + "Keys": { + "Id": { + "N": "101" + } + }, + "NewImage": { + "Message": { + "S": "New item!" + }, + "Id": { + "N": "101" + } + }, + "SequenceNumber": "111", + "SizeBytes": 26, + "StreamViewType": "NEW_AND_OLD_IMAGES" +} +``` + +Suppose you only wanted to handle events where the Key ID value, `N`, is 101\. In this case, your `FilterCriteria` object would look like this: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"dynamodb\": { \"Keys\": { \"Id\": { \"N\": [ "101" ] } } } }" + } + ] +} +``` + +For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON\. + +``` +{ + "dynamodb": { + "Keys": { + "Id": { + "N": [ "101" ] + } + } + } +} +``` + +The previous example uses the **Equals** comparison operator for `N`, which is nested multiple layers within the `dynamodb` data field\. + +## Attaching filter criteria to an event source mapping \(console\) + +Follow these steps to create a new event source mapping with filter criteria using the Lambda console\. + +**To create a new event source mapping with filter criteria \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of a function to create an event source mapping for\. + +1. Under **Function overview**, choose **Add trigger**\. + +1. For **Trigger configuration**, choose a trigger type that supports event filtering\. These include **SQS**, **DynamoDB**, and **Kinesis**\. + +1. Expand **Additional settings**\. + +1. Under **Filter criteria**, define and enter your filters\. For example, you can enter the following: + + ``` + { "a" : [ 1, 2 ] } + ``` + + This instructs Lambda to process only the records where field `a` is equal to 1 or 2\. + +1. Choose **Add**\. + +When you enter filter criteria using the console, you provide only the filter pattern\. In step 6 of the preceding instructions, `{ "a" : [ 1, 2 ] }` corresponds to the following `FilterCriteria`: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"a\" : [ 1, 2 ] }" + } + ] +} +``` + +After creating your event source mapping in the console, you can see the formatted `FilterCriteria` in the trigger details\. Note that when entering filters using the console, you don't need to provide the `Pattern` key or escape quotes\. + +**Note** +By default, you can have five different filters per event source\. You can [request a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) for up to 10 filters per event source\. The Lambda console lets you add up to 10 filters depending on the current quota for your account\. If you attempt to add more filters than your current quota allows, Lambda throws an error when you try to create the event source\. + +## Attaching filter criteria to an event source mapping \(AWS CLI\) + +Suppose you want an event source mapping to have the following `FilterCriteria`: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"a\" : [ 1, 2 ] }" + } + ] +} +``` + +To create a new event source mapping with these filter criteria using the AWS Command Line Interface \(AWS CLI\), run the following command: + +``` +aws lambda create-event-source-mapping \ + --function-name my-function \ + --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue \ + --filter-criteria "{\"Filters\": [{\"Pattern\": \"{ \"a\" : [ 1, 2 ]}\"}]}" +``` + +This [CreateEventSourceMapping](API_CreateEventSourceMapping.md) command creates a new Amazon SQS event source mapping for function `my-function` with the specified `FilterCriteria`\. + +To add these filter criteria to an existing event source mapping, run the following command: + +``` +aws lambda update-event-source-mapping \ + --uuid "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" \ + --filter-criteria "{\"Filters\": [{\"Pattern\": \"{ \"a\" : [ 1, 2 ]}\"}]}" +``` + +Note that to update an event source mapping, you need its UUID\. You can get the UUID from a [ListEventSourceMappings](API_ListEventSourceMappings.md) call\. Lambda also returns the UUID in the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API response\. + +To remove filter criteria from an event source, you can run the following [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) command with an empty `FilterCriteria` object: + +``` +aws lambda update-event-source-mapping \ + --uuid "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" \ + --filter-criteria "{}" +``` + +## Properly filtering Amazon SQS messages + +If an Amazon SQS message doesn't satisfy your filter criteria, Lambda automatically removes the message from the queue\. You don't have to manually delete these messages in Amazon SQS\. + +For Amazon SQS, the message `body` can be any string\. However, this can be problematic if your `FilterCriteria` expects `body` to be in a valid JSON format\. The reverse scenario is also true—if the incoming message `body` is in a valid JSON format, this can lead to unintended behavior if your filter criteria expects `body` to be a plain string\. + +To avoid this issue, ensure that the format of `body` in your `FilterCriteria` matches the expected format of `body` in messages that you receive from your queue\. Before filtering your messages, Lambda automatically evaluates the format of the incoming message `body` and of your filter pattern for `body`\. If there is a mismatch, Lambda drops the message\. The following table summarizes this evaluation: + + +| Incoming message `body` format | Filter pattern `body` format | Resulting action | +| --- | --- | --- | +| Plain string | Plain string | Lambda filters based on your filter criteria\. | +| Plain string | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Plain string | Valid JSON | Lambda drops the message\. | +| Valid JSON | Plain string | Lambda drops the message\. | +| Valid JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Valid JSON | Valid JSON | Lambda filters based on your filter criteria\. | + +If you don't include `body` as part of your `FilterCriteria`, Lambda skips this check\. + +## Properly filtering Kinesis and DynamoDB messages + +Once your filter criteria processes an Kinesis or DynamoDB record, the streams iterator advances past this record\. If the record doesn't satisfy your filter criteria, you don't have to manually delete the record from your event source\. After the retention period, Kinesis and DynamoDB automatically delete these old records\. If you want records to be deleted sooner, see [Changing the Data Retention Period](https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-extended-retention.html)\. + +To properly filter events from stream event sources, both the data field and your filter criteria for the data field must be in valid JSON format\. \(For Kinesis, the data field is `data`\. For DynamoDB, the data field is `dynamodb`\.\) If either field isn't in a valid JSON format, Lambda drops the message or throws an exception\. The following table summarizes the specific behavior: + + +| Incoming data format \(`data` or `dynamodb`\) | Filter pattern format for data properties | Resulting action | +| --- | --- | --- | +| Valid JSON | Valid JSON | Lambda filters based on your filter criteria\. | +| Valid JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Valid JSON | Non\-JSON | Lambda throws an exception at the time of the event source mapping creation or update\. The filter pattern for data properties must be in a valid JSON format\. | +| Non\-JSON | Valid JSON | Lambda drops the record\. | +| Non\-JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Non\-JSON | Non\-JSON | Lambda throws an exception at the time of the event source mapping creation or update\. The filter pattern for data properties must be in a valid JSON format\. | \ No newline at end of file diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md old mode 100644 new mode 100755 index 854d36dd..60882025 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -1,25 +1,25 @@ -# AWS Lambda event source mappings +# Lambda event source mappings -An event source mapping is an AWS Lambda resource that reads from an event source and invokes a Lambda function\. You can use event source mappings to process items from a stream or queue in services that don't invoke Lambda functions directly\. Lambda provides event source mappings for the following services\. +An event source mapping is a Lambda resource that reads from an event source and invokes a Lambda function\. You can use event source mappings to process items from a stream or queue in services that don't invoke Lambda functions directly\. Lambda provides event source mappings for the following services\. **Services that Lambda reads events from** + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) -+ [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md) -+ [Amazon Simple Queue Service](with-sqs.md) ++ [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](with-msk.md) ++ [Self\-managed Apache Kafka](with-kafka.md) ++ [Amazon Simple Queue Service \(Amazon SQS\)](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. +The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that its Amazon Resource Name \(ARN\) specifies, with a batch size of 500\. ``` aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ @@ -47,17 +47,30 @@ You should see the following output: } ``` -Event source mappings read items from a stream or queue in batches\. They include multiple items in the event that your function receives\. You can configure the size of the batch that the event source mapping sends to your function, up to a maximum that varies by service\. The number of items in the event can be smaller than the batch size if there aren't enough items available, or if the batch is too large to send in one event and has to be split up\. +## Batching behavior + +Event source mappings read items from a target event source\. By default, an event source mapping batches records together into a single payload that Lambda sends to your function\. To fine\-tune batching behavior, you can configure a batching window \(`MaximumBatchingWindowInSeconds`\) and a batch size \(`BatchSize`\)\. A batching window is the maximum amount of time to gather records into a single payload\. A batch size is the maximum number of records in a single batch\. Lambda invokes your function when one of the following three criteria is met: ++ **The batching window reaches its maximum value\.** Batching window behavior varies depending on the specific event source\. + + **For Kinesis, DynamoDB, and Amazon SQS event sources:** The default batching window is 0 seconds\. This means that Lambda sends batches to your function as quickly as possible\. If you configure a `MaximumBatchingWindowInSeconds`, the next batching window begins as soon as the previous function invocation completes\. + + **For Amazon MSK, self\-managed Apache Kafka, and Amazon MQ event sources:** The default batching window is 500 ms\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. A batching window begins as soon as the first record arrives\. +**Note** +Because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. ++ **The batch size is met\.** The minimum batch size is 1\. The default and maximum batch size depend on the event source\. For details about these values, see the [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize) specification for the `CreateEventSourceMapping` API operation\. ++ **The payload size reaches [6 MB](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)\.** You cannot modify this limit\. + +The following diagram illustrates these three conditions\. Suppose a batching window begins at `t = 7` seconds\. In the first scenario, the batching window reaches its 40 second maximum at `t = 47` seconds after accumulating 5 records\. In the second scenario, the batch size reaches 10 before the batching window expires, so the batching window ends early\. In the third scenario, the maximum payload size is reached before the batching window expires, so the batching window ends early\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/batching-window.png) The following example shows an event source mapping that reads from a Kinesis stream\. If a batch of events fails all processing attempts, the event source mapping sends details about the batch to an SQS queue\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-eventsourcemapping.png) -The event batch is the event that Lambda sends to the function\. It is a batch of records or messages compiled from the items that the event source mapping reads from a stream or queue\. Batch size and other settings only apply to the event batch\. +The event batch is the event that Lambda sends to the function\. It is a batch of records or messages compiled from the items that the event source mapping reads up until the current batching window expires\. -For streams, an event source mapping creates an iterator for each shard in the stream and processes items in each shard in order\. You can configure the event source mapping to read only new items that appear in the stream, or to start with older items\. Processed items aren't removed from the stream and can be processed by other functions or consumers\. +For streams, an event source mapping creates an iterator for each shard in the stream and processes items in each shard in order\. You can configure the event source mapping to read only new items that appear in the stream, or to start with older items\. Processed items aren't removed from the stream, and other functions or consumers can process them\. -By default, if your function returns an error, the entire batch is reprocessed until the function succeeds, or the items in the batch expire\. To ensure in\-order processing, processing for the affected shard is paused until the error is resolved\. You can configure the event source mapping to discard old events, restrict the number of retries, or process multiple batches in parallel\. If you process multiple batches in parallel, in\-order processing is still guaranteed for each partition key, but multiple partition keys in the same shard are processed simultaneously\. +By default, if your function returns an error, the event source mapping reprocesses the entire batch until the function succeeds, or the items in the batch expire\. To ensure in\-order processing, the event source mapping pauses processing for the affected shard until the error is resolved\. You can configure the event source mapping to discard old events, restrict the number of retries, or process multiple batches in parallel\. If you process multiple batches in parallel, in\-order processing is still guaranteed for each partition key, but the event source mapping simultaneously processes multiple partition keys in the same shard\. You can also configure the event source mapping to send an invocation record to another service when it discards an event batch\. Lambda supports the following [destinations](invocation-async.md#invocation-async-destinations) for event source mappings\. + **Amazon SQS** – An SQS queue\. @@ -67,7 +80,7 @@ The invocation record contains details about the failed event batch in JSON form The following example shows an invocation record for a Kinesis stream\. -**Example invocation Record** +**Example invocation record** ``` { @@ -96,6 +109,6 @@ The following example shows an invocation record for a Kinesis stream\. } ``` -Lambda also supports in\-order processing for [FIFO \(first\-in, first\-out\) queues](with-sqs.md), scaling up to the number of active message groups\. For standard queues, items aren't necessarily processed in order\. Lambda scales up to process a standard queue as quickly as possible\. When an error occurs, batches are returned to the queue as individual items and might be processed in a different grouping than the original batch\. Occasionally, the event source mapping might receive the same item from the queue twice, even if no function error occurred\. Lambda deletes items from the queue after they're processed successfully\. You can configure the source queue to send items to a dead\-letter queue if they can't be processed\. +Lambda also supports in\-order processing for [FIFO \(first\-in, first\-out\) queues](with-sqs.md), scaling up to the number of active message groups\. For standard queues, items aren't necessarily processed in order\. Lambda scales up to process a standard queue as quickly as possible\. When an error occurs, Lambda returns batches to the queue as individual items and might process them in a different grouping than the original batch\. Occasionally, the event source mapping might receive the same item from the queue twice, even if no function error occurred\. Lambda deletes items from the queue after they're processed successfully\. You can configure the source queue to send items to a dead\-letter queue if Lambda can't process them\. For information about services that invoke Lambda functions directly, see [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md old mode 100644 new mode 100755 diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md old mode 100644 new mode 100755 index fdafb450..4dd05457 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -25,7 +25,7 @@ Make sure that the layers that you add to a function are compatible with the run **Adding a layer to a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to configure\. @@ -51,7 +51,7 @@ The order in which you add the layers is the order in which Lambda later merges **Update layer order for your function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to configure\. @@ -67,7 +67,7 @@ Layers are versioned, and the content of each layer version is immutable\. The l **Update layer versions for your function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to configure\. diff --git a/doc_source/invocation-retries.md b/doc_source/invocation-retries.md old mode 100644 new mode 100755 index 649fd7ad..116a32b1 --- a/doc_source/invocation-retries.md +++ b/doc_source/invocation-retries.md @@ -32,7 +32,7 @@ When you invoke a function indirectly, you need to be aware of the retry behavio + **Asynchronous invocation** – Lambda retries function errors twice\. If the function doesn't have enough capacity to handle all incoming requests, events might wait in the queue for hours or days to be sent to the function\. You can configure a dead\-letter queue on the function to capture events that weren't successfully processed\. For more information, see [Asynchronous invocation](invocation-async.md)\. + **Event source mappings** – Event source mappings that read from streams retry the entire batch of items\. Repeated errors block processing of the affected shard until the error is resolved or the items expire\. To detect stalled shards, you can monitor the [Iterator Age](monitoring-metrics.md) metric\. - For event source mappings that read from a queue, you determine the length of time between retries and destination for failed events by configuring the visibility timeout and redrive policy on the source queue\. For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md) and the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md)\. + For event source mappings that read from a queue, you determine the length of time between retries and destination for failed events by configuring the visibility timeout and redrive policy on the source queue\. For more information, see [Lambda event source mappings](invocation-eventsourcemapping.md) and the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md)\. + **AWS services** – AWS services can invoke your function [synchronously](invocation-sync.md) or asynchronously\. For synchronous invocation, the service decides whether to retry\. For example, Amazon S3 batch operations retries the operation if the Lambda function returns a `TemporaryFailure` response code\. Services that proxy requests from an upstream user or client may have a retry strategy or may relay the error response back to the requestor\. For example, API Gateway always relays the error response back to the requestor\. For asynchronous invocation, the behavior is the same as when you invoke the function synchronously\. For more information, see the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md) and the invoking service's documentation\. diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md old mode 100644 new mode 100755 index 28d91bcf..ccec4642 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -2,9 +2,9 @@ The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event\. When the function returns a response, it stays active and waits to process additional events\. If you invoke the function again while the first event is being processed, Lambda initializes another instance, and the function processes the two events concurrently\. As more events come in, Lambda routes them to available instances and creates new instances as needed\. When the number of requests decreases, Lambda stops unused instances to free up scaling capacity for other functions\. -The default regional concurrency limit starts at 1,000\. For more information, or to request an increase on this limit, see [Lambda quotas](gettingstarted-limits.md)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. +The default regional concurrency quota starts at 1,000 instances\. For more information, or to request an increase on this quota, see [Lambda quotas](gettingstarted-limits.md)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. - Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. Note that the burst concurrency quota is not per\-function; it applies to all of your functions in the Region\. +Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. Note that the burst concurrency quota is not per\-function; it applies to all your functions in the Region\. **Burst concurrency quotas** + **3000** – US West \(Oregon\), US East \(N\. Virginia\), Europe \(Ireland\) @@ -24,7 +24,7 @@ The following example shows a function processing a spike in traffic\. As invoca The function continues to scale until the account's concurrency limit for the function's Region is reached\. The function catches up to demand, requests subside, and unused instances of the function are stopped after being idle for some time\. Unused instances are frozen while they're waiting for requests and don't incur any charges\. -When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](foundation-progmodel.md) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](configuration-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. +When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](foundation-progmodel.md) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](provisioned-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) @@ -34,7 +34,9 @@ When your function scales up, the first request served by each instance is impac + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency -When you allocate provisioned concurrency, your function is ready to serve a burst of incoming requests with very low latency\. When all provisioned concurrency is in use, the function scales up normally to handle any additional requests\. +When you configure a number for provisioned concurrency, Lambda initializes that number of execution environments\. Your function is ready to serve a burst of incoming requests with very low latency\. Note that configuring [provisioned concurrency](provisioned-concurrency.md) incurs charges to your AWS account\. + + When all provisioned concurrency is in use, the function scales up normally to handle any additional requests\. Application Auto Scaling takes this a step further by providing autoscaling for provisioned concurrency\. With Application Auto Scaling, you can create a target tracking scaling policy that adjusts provisioned concurrency levels automatically, based on the utilization metric that Lambda emits\. [Use the Application Auto Scaling API](configuration-concurrency.md#configuration-concurrency-api) to register an alias as a scalable target and create a scaling policy\. @@ -50,7 +52,7 @@ In the following example, a function scales between a minimum and maximum amount When you invoke your function asynchronously, by using an event source mapping or another AWS service, scaling behavior varies\. For example, event source mappings that read from a stream are limited by the number of shards in the stream\. Scaling capacity that is unused by an event source is available for use by other clients and event sources\. For more information, see the following topics\. + [Asynchronous invocation](invocation-async.md) -+ [AWS Lambda event source mappings](invocation-eventsourcemapping.md) ++ [Lambda event source mappings](invocation-eventsourcemapping.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using AWS Lambda with other services](lambda-services.md) @@ -64,4 +66,4 @@ You can monitor concurrency levels in your account by using the following metric + `ProvisionedConcurrencySpilloverInvocations` + `ProvisionedConcurrencyUtilization` -For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. \ No newline at end of file +For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. \ No newline at end of file diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md old mode 100644 new mode 100755 diff --git a/doc_source/java-context.md b/doc_source/java-context.md old mode 100644 new mode 100755 diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md old mode 100644 new mode 100755 index 0c6a36c8..58fb0f89 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -131,7 +131,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -164,7 +164,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md old mode 100644 new mode 100755 diff --git a/doc_source/java-image.md b/doc_source/java-image.md old mode 100644 new mode 100755 index c0a7aa29..0e5bc56e --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -5,7 +5,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md old mode 100644 new mode 100755 index 2297df33..e9ebaa81 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -150,7 +150,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash @@ -219,6 +219,11 @@ Log groups aren't deleted automatically when you delete a function\. To avoid st ## Advanced logging with Log4j 2 and SLF4J +**Note** + AWS Lambda does not include Log4j2 in its managed runtimes or base container images\. These are therefore not affected by the issues described in CVE\-2021\-44228, CVE\-2021\-45046, and CVE\-2021\-45105\. + For cases where a customer function includes an impacted Log4j2 version, we have applied a change to the Lambda Java [managed runtimes](lambda-runtimes.md) and [base container images](java-image.md) that helps to mitigate the issues in CVE\-2021\-44228, CVE\-2021\-45046, and CVE\-2021\-45105\. As a result of this change, customers using Log4J2 may see an additional log entry, similar to "`Transforming org/apache/logging/log4j/core/lookup/JndiLookup (java.net.URLClassLoader@...)`"\. Any log strings that reference the jndi mapper in the Log4J2 output will be replaced with "`Patched JndiLookup::lookup()`"\. + Independent of this change, we strongly encourage all customers whose functions include Log4j2 to update to the latest version\. Specifically, customers using the aws\-lambda\-java\-log4j2 library in their functions should update to version 1\.5\.0 \(or later\), and redeploy their functions\. This version updates the underlying Log4j2 utility dependencies to version 2\.17\.0 \(or later\)\. The updated aws\-lambda\-java\-log4j2 binary is available at the [Maven repository](https://repo1.maven.org/maven2/com/amazonaws/aws-lambda-java-log4j2/) and its source code is available in [Github](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2)\. + To customize log output, support logging during unit tests, and log AWS SDK calls, use Apache Log4j 2 with SLF4J\. Log4j is a logging library for Java programs that enables you to configure log levels and use appender libraries\. SLF4J is a facade library that lets you change which library you use without changing your function code\. To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. @@ -308,12 +313,12 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' + implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md old mode 100644 new mode 100755 diff --git a/doc_source/java-package.md b/doc_source/java-package.md old mode 100644 new mode 100755 index 5c43578a..7f3c20f0 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -30,8 +30,8 @@ These libraries are available through [Maven Central Repository](https://search. ``` dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' } ``` @@ -48,12 +48,12 @@ dependencies { com.amazonaws aws-lambda-java-events - 3.1.0 + 3.11.0 com.amazonaws aws-lambda-java-log4j2 - 1.2.0 + 1.5.1 ``` @@ -69,7 +69,7 @@ You can upload your deployment package by using the Lambda console, the Lambda A **To upload a deployment package with the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -110,12 +110,12 @@ dependencies { implementation platform('software.amazon.awssdk:bom:2.10.73') implementation 'software.amazon.awssdk:lambda' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' + implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' + implementation 'org.apache.logging.log4j:log4j-api:2.13.0' + implementation 'org.apache.logging.log4j:log4j-core:2.13.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } @@ -169,7 +169,7 @@ To build the deployment package, use the `mvn package` command\. [INFO] [INFO] --- maven-shade-plugin:3.2.2:shade (default) @ java-maven --- [INFO] Including com.amazonaws:aws-lambda-java-core:jar:1.2.1 in the shaded jar. -[INFO] Including com.amazonaws:aws-lambda-java-events:jar:3.1.0 in the shaded jar. +[INFO] Including com.amazonaws:aws-lambda-java-events:jar:3.11.0 in the shaded jar. [INFO] Including joda-time:joda-time:jar:2.6 in the shaded jar. [INFO] Including com.google.code.gson:gson:jar:2.8.6 in the shaded jar. [INFO] Replacing original artifact with shaded artifact. @@ -214,7 +214,7 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - [2.17.1,) + 2.13.0 diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md old mode 100644 new mode 100755 diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md old mode 100644 new mode 100755 index db2726ad..1087a16c --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/kinesis-tutorial-spec.md b/doc_source/kinesis-tutorial-spec.md old mode 100644 new mode 100755 index 7c16045e..250afe05 --- a/doc_source/kinesis-tutorial-spec.md +++ b/doc_source/kinesis-tutorial-spec.md @@ -1,6 +1,6 @@ # AWS SAM template for a DynamoDB application -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. +You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. Below is a sample AWS SAM template for the [tutorial application](with-ddb-example.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md old mode 100644 new mode 100755 index 456ac147..5b7f022f --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -76,108 +76,72 @@ For more information on resources and conditions for Lambda and other AWS servic ## Function resource names -You reference a Lambda function in a policy statement using an Amazon Resource Names \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function, a function [version](configuration-versions.md), or an [alias](configuration-aliases.md)\. +You reference a Lambda function in a policy statement using an Amazon Resource Name \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function \(unqualified\) or a function [version](configuration-versions.md) or [alias](configuration-aliases.md) \(qualified\)\. -When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [GetFunction](API_GetFunction.md) `FunctionName` parameter, or by setting a value in the [GetFunction](API_GetFunction.md) `Qualifier` parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with the `FunctionName` passed in the API calls\. +When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [GetFunction](API_GetFunction.md) `FunctionName` parameter, or by setting a value in the [GetFunction](API_GetFunction.md) `Qualifier` parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with both the `FunctionName` and `Qualifier` passed in API calls\. If there is a misamtch, Lambda denies the request\. -You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. +Whether you are allowing or denying an action on your function, you must use the correct function ARN types in your policy statement to achieve the results that you expect\. For example, if your policy references the unqualified ARN, Lambda accepts requests that reference the unqualified ARN but denies requests that reference a qualified ARN\. - - -### Best practices for using Deny statements with functions - -The following table summarizes the resources to use in Deny effects\. In the **Resource** column, `MyFunction` is the name of the function, `:1` refers to version 1 of the function, and `MyAlias` is the name of a function alias\. - - -**Resource best practices** - -| Policy objective | Resource | -| --- | --- | -| Deny access to all versions of a function | `MyFunction*` | -| Deny access to a specific alias | `MyFunction:MyAlias` and `MyFunction` | -| Deny access to a specific version of a function | `MyFunction:1` and `MyFunction` | - -The following sections provide example policy statements for each of the policy objectives\. - -**Note** -You can use only identity\-based policies to deny specific function resources\. Currently, Lambda does not support the `Deny` effect in resource\-based policies\. - -For the action list in a policy statement, you can add any of the [ actions defined by Lambda](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) that act on a function resource\. - -#### Deny access to all function versions - -The following identity\-based policy statement denies access to the `lambda:GetFunctionConfiguration` action for all versions of the `my-function` function\. The wildcard character at the end of the function ARN ensures that this policy applies to all version and alias ARNs\. - -**Example identity\-based policy** +**Example allowing invocation of an unqualified arn** ``` { "Version": "2012-10-17", "Statement": [ { - "Effect": "Deny", - "Action": [ - "lambda:GetFunctionConfiguration" - ], - "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function*" - } + "Effect": "Allow", + "Action": "lambda:InvokeFunction", + "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction" ] } ``` -#### Deny access to a specific function alias - -To deny access to a specific alias, you must specify both the alias ARN and the unqualified function ARN in the policy\. This prevents users from accessing the specific alias by passing the unqualified ARN as the `FunctionName` and the alias as the `Qualifier`\. - -**Note** -If you create this type of policy, API calls need to refer to the unpublished version of the function by specifying a qualified ARN with the $LATEST suffix in the `FunctionName` parameter\. +If your policy references a specific qualified ARN, Lambda accepts requests that reference that ARN but denies requests that reference the unqualified ARN or a different qualified ARN, for example, `myFunction:2`\. -The following identity\-based policy statement denies access to the `lambda:InvokeFunction` action in the `my-alias` alias of the `my-function` function\. - -**Example identity\-based policy** +**Example allowing invocation of a specific qualified arn** ``` { "Version": "2012-10-17", "Statement": [ { - "Sid": "DenySpecificAlias", - "Effect": "Deny", + "Effect": "Allow", "Action": "lambda:InvokeFunction", - "Resource": [ - "arn:aws:lambda:us-west-2:123456789012:function:my-function:my-alias", - "arn:aws:lambda:us-west-2:123456789012:function:my-function" - ] + "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction:1" } ] } ``` -#### Deny access to a specific function version +If your policy references any qualified ARN using `:*`, Lambda accepts any qualified ARN but denies requests that reference the unqualified ARN\. -To deny access to a specific version, you must specify both the qualified ARN and the unqualified ARN in the policy\. This prevents users from accessing the specific version by passing the unqualified ARN as the `FunctionName` and the version as the `Qualifier`\. +**Example allowing invocation of any qualified arn** -**Note** -If you create this type of policy, API calls need to refer to the unpublished version of the function by specifying a qualified ARN with the $LATEST suffix in the `FunctionName` parameter\. +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": "lambda:InvokeFunction", + "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction:*" + } + ] +} +``` -The following identity\-based policy statement denies access to the invoke action in version 1 of the `my-function` function\. +If your policy references any ARN using `*`, Lambda accepts any qualified or unqualified ARN\. -**Example identity\-based policy** +**Example allowing invocation of any qualified or unqualified arn** ``` { "Version": "2012-10-17", "Statement": [ { - "Sid": "DenySpecificFunctionVersion", - "Effect": "Deny", - "Action": [ - "lambda:InvokeFunction" - ], - "Resource": [ - "arn:aws:lambda:us-west-2:123456789012:function:my-function:1", - "arn:aws:lambda:us-west-2:123456789012:function:my-function" - ] + "Effect": "Allow", + "Action": "lambda:InvokeFunction", + "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction*" } ] } diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md old mode 100644 new mode 100755 index 3bbe3c5b..fae83b69 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -23,6 +23,7 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ | Name | Identifier | Operating system | Architectures | | --- | --- | --- | --- | +| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | @@ -36,10 +37,10 @@ To get started with application development in your local environment, deploy on + [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. **Topics** -+ [AWS Lambda function handler in C\#](csharp-handler.md) ++ [Lambda function handler in C\#](csharp-handler.md) + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + [Deploy \.NET Lambda functions with container images](csharp-image.md) + [AWS Lambda context object in C\#](csharp-context.md) -+ [AWS Lambda function logging in C\#](csharp-logging.md) ++ [Lambda function logging in C\#](csharp-logging.md) + [AWS Lambda function errors in C\#](csharp-exceptions.md) + [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) \ No newline at end of file diff --git a/doc_source/lambda-edge.md b/doc_source/lambda-edge.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-images.md b/doc_source/lambda-images.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md old mode 100644 new mode 100755 index 81eac920..6871fb4d --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -4,7 +4,7 @@ A Lambda function's execution role is an AWS Identity and Access Management \(IA **To view a function's execution role** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -125,17 +125,20 @@ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:p ## AWS managed policies for Lambda features -The following AWS managed policies provide permissions that are required to use Lambda features: -+ **AWSLambdaBasicExecutionRole** – Permission to upload logs to CloudWatch\. -+ **AWSLambdaDynamoDBExecutionRole** – Permission to read records from an Amazon DynamoDB stream\. -+ **AWSLambdaKinesisExecutionRole** – Permission to read events from an Amazon Kinesis data stream or consumer\. -+ **AWSLambdaMQExecutionRole** – Permission to read records from an Amazon MQ broker\. -+ **AWSLambdaMSKExecutionRole** – Permission to read records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster\. -+ **AWSLambdaSQSQueueExecutionRole** – Permission to read a message from an Amazon Simple Queue Service \(Amazon SQS\) queue\. -+ **AWSLambdaVPCAccessExecutionRole** – Permission to manage elastic network interfaces to connect your function to a virtual private cloud \(VPC\)\. -+ **AWSXRayDaemonWriteAccess** – Permission to upload trace data to X\-Ray\. -+ **CloudWatchLambdaInsightsExecutionRolePolicy** – Permission to write runtime metrics to CloudWatch Lambda Insights\. -+ **AmazonS3ObjectLambdaExecutionRolePolicy** – Permission to interact with Amazon S3 Object Lambda\. +The following AWS managed policies provide permissions that are required to use Lambda features\. + + +| Change | Description | Date | +| --- | --- | --- | +| **[ AWSLambdaBasicExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaBasicExecutionRole` grants permissions to upload logs to CloudWatch\. | February 14, 2022 | +| **[ AWSLambdaDynamoDBExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaDynamoDBExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaDynamoDBExecutionRole` grants permissions to read records from an Amazon DynamoDB stream and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSLambdaKinesisExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaKinesisExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaKinesisExecutionRole` grants permissions to read events from an Amazon Kinesis data stream and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSLambdaMSKExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaMSKExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaMSKExecutionRole` grants permissions to read and access records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster, manage elastic network interfaces \(ENIs\), and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSLambdaSQSQueueExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaSQSQueueExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaSQSQueueExecutionRole` grants permissions to read a message from an Amazon Simple Queue Service \(Amazon SQS\) queue and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSLambdaVPCAccessExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaVPCAccessExecutionRole` grants permissions to manage ENIs within an Amazon VPC and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess)** – Lambda started tracking changes to this policy\. | `AWSXRayDaemonWriteAccess` grants permissions to upload trace data to X\-Ray\. | February 14, 2022 | +| **[ CloudWatchLambdaInsightsExecutionRolePolicy](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy)** – Lambda started tracking changes to this policy\. | `CloudWatchLambdaInsightsExecutionRolePolicy` grants permissions to write runtime metrics to CloudWatch Lambda Insights\. | February 14, 2022 | +| **[ AmazonS3ObjectLambdaExecutionRolePolicy](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AmazonS3ObjectLambdaExecutionRolePolicy)** – Lambda started tracking changes to this policy\. | `AmazonS3ObjectLambdaExecutionRolePolicy` grants permissions to interact with Amazon S3 Object Lambda and write to CloudWatch Logs\. | February 14, 2022 | For some features, the Lambda console attempts to add missing permissions to your execution role in a customer managed policy\. These policies can become numerous\. To avoid creating extra policies, add the relevant AWS managed policies to your execution role before enabling features\. @@ -145,8 +148,8 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) -+ [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md) -+ [Amazon Simple Queue Service](with-sqs.md) ++ [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](with-msk.md) ++ [Self\-managed Apache Kafka](with-kafka.md) ++ [Amazon Simple Queue Service \(Amazon SQS\)](with-sqs.md) In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md old mode 100644 new mode 100755 index 9ec12a32..d545ac54 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -1,21 +1,22 @@ -# Invoking AWS Lambda functions +# Invoking Lambda functions -You can invoke Lambda functions directly [with the Lambda console](getting-started-create-function.md#get-started-invoke-manually), the Lambda API, the AWS SDK, the AWS CLI, and AWS toolkits\. You can also configure other AWS services to invoke your function, or you can configure Lambda to read from a stream or queue and invoke your function\. +You can invoke Lambda functions directly [using the Lambda console](getting-started-create-function.md#get-started-invoke-manually), the Lambda API, an AWS SDK, the AWS Command Line Interface \(AWS CLI\), and AWS toolkits\. You can also configure other AWS services to invoke your function, or you can configure Lambda to read from a stream or queue and invoke your function\. When you invoke a function, you can choose to invoke it synchronously or asynchronously\. With [synchronous invocation](invocation-sync.md), you wait for the function to process the event and return a response\. With [asynchronous](invocation-async.md) invocation, Lambda queues the event for processing and returns a response immediately\. For asynchronous invocation, Lambda handles retries and can send invocation records to a [destination](invocation-async.md#invocation-async-destinations)\. -To use your function to process data automatically, add one or more triggers\. A trigger is a Lambda resource or a resource in another service that you configure to invoke your function in response to lifecycle events, external requests, or on a schedule\. Your function can have multiple triggers\. Each trigger acts as a client invoking your function independently\. Each event that Lambda passes to your function only has data from one client or trigger\. +To use your function to process data automatically, add one or more triggers\. A trigger is a Lambda resource or a resource in another service that you configure to invoke your function in response to lifecycle events, external requests, or on a schedule\. Your function can have multiple triggers\. Each trigger acts as a client invoking your function independently\. Each event that Lambda passes to your function has data from only one client or trigger\. -To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon SQS queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. +To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon Simple Queue Service \(Amazon SQS\) queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. -Other AWS services and resources invoke your function directly\. For example, you can configure EventBridge \(CloudWatch Events\) to invoke your function on a timer, or you can configure Amazon S3 to invoke your function when an object is created\. Each service varies in the method it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. +Other AWS services and resources invoke your function directly\. For example, you can configure Amazon EventBridge \(CloudWatch Events\) to invoke your function on a timer, or you can configure Amazon Simple Storage Service \(Amazon S3\) to invoke your function when an object is created\. Each service varies in the method that it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. -Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. +Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For more information, see [Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. **Topics** + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) -+ [AWS Lambda event source mappings](invocation-eventsourcemapping.md) ++ [Lambda event source mappings](invocation-eventsourcemapping.md) ++ [Lambda event filtering](invocation-eventfiltering.md) + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-managing.md b/doc_source/lambda-managing.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md old mode 100644 new mode 100755 index e2f9ba06..94bdeada --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -7,9 +7,9 @@ You can use other AWS services to troubleshoot your Lambda functions\. This sect For more information about monitoring Lambda applications, see [Monitoring and observability](https://docs.aws.amazon.com/lambda/latest/operatorguide/monitoring-observability.html) in the *Lambda operator guide*\. **Topics** -+ [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) ++ [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) -+ [Working with AWS Lambda function metrics](monitoring-metrics.md) ++ [Working with Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) + [Example workflows using other AWS services](monitoring-servicemap.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md old mode 100644 new mode 100755 index 096ad77c..2c167189 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -77,7 +77,22 @@ The function runtime passes a context object to the handler, in addition to the Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](nodejs-logging.md) during invocation\. If your function [returns an error](nodejs-exceptions.md), Lambda formats the error and returns it to the invoker\. +## Node\.js initialization + +Node\.js has a unique event loop model that causes its initialization behavior to be different from other runtimes\. Specifically, Node\.js uses a non\-blocking I/O model that supports asynchronous operations\. This model allows Node\.js to perform efficiently for most workloads\. For example, if a Node\.js function makes a network call, that request may be designated as an asynchronous operation and placed into a callback queue\. The function may continue to process other operations within the main call stack without getting blocked by waiting for the network call to return\. Once the network call is returned, its callback is executed and then removed from the callback queue\. + + Some initialization tasks may run asynchronously\. These asynchronous tasks are not guaranteed to complete execution prior to an invocation\. For example, code that makes a network call to fetch a parameter from AWS Parameter Store may not be complete by the time Lambda executes the handler function\. As a result, the variable may be null during an invocation\. To avoid this, ensure that variables and other asynchronous code are fully initialized before continuing with the rest of the function’s core business logic\. + +### Designating a function handler as an ES module + +Starting with Node 14, you can guarantee completion of asynchronous initialization code prior to handler invocations by designating your code as an ES module, and using top\-level await\. Packages are designated as CommonJS modules by default, meaning you must first designate your function code as an ES module to use top\-level await\. You can do this in two ways: specifying the `type` as `module` in the function's `package.json` file, or by using the \.mjs file name extension\. + +In the first scenario, your function code treats all \.js files as ES modules, while in the second scenario, only the file you specify with \.mjs is an ES module\. You can mix ES modules and CommonJS modules by naming them \.mjs and \.cjs respectively, as \.mjs files are always ES modules and \.cjs files are always CommonJS modules\. + +For more information and an example, see [Using Node\.js ES Modules and Top\-Level Await in AWS Lambda](https://aws.amazon.com/blogs/compute/using-node-js-es-modules-and-top-level-await-in-aws-lambda)\. + **Topics** ++ [Node\.js initialization](#nodejs-initialization) + [AWS Lambda function handler in Node\.js](nodejs-handler.md) + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Node\.js Lambda functions with container images](nodejs-image.md) diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md old mode 100644 new mode 100755 index 9ac3d29e..eee3dc93 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -7,6 +7,7 @@ The following sections explain how common programming patterns and core concepts | Name | Identifier | Operating system | Architectures | | --- | --- | --- | --- | +| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md old mode 100644 new mode 100755 index 7e9f089a..de0e7e9c --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [mTLS authentication for Amazon MSK and self\-managed Apache Kafka event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports mTLS authentication for Amazon MSK and self\-managed Apache Kafka event sources\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | November 19, 2021 | | [Lambda on Graviton2](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss) | Lambda now supports Graviton2 for functions using arm64 architecture\. For details, see [Lambda instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss)\. | September 29, 2021 | | [Python 3\.9 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Python 3\.9\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 16, 2021 | | [New runtime versions for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtime versions are available for Node\.js, Python, and Java\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | July 21, 2021 | @@ -56,7 +57,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | | [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. | November 12, 2018 | -| [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | +| [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | | [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | | [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | | [Support for PowerShell Core language in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md old mode 100644 new mode 100755 index ad4c92be..2b7980e6 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -77,6 +77,7 @@ Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not sup | Name | Identifier | Operating system | Architectures | | --- | --- | --- | --- | +| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-security.md b/doc_source/lambda-security.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md old mode 100644 new mode 100755 index 1b101428..a69e0a4b --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -3,7 +3,7 @@ AWS Lambda integrates with other AWS services to invoke functions or take other actions\. These are some common use cases: + Invoke a function in response to resource lifecycle events, such as with Amazon Simple Storage Service \(Amazon S3\)\. For more information, see [Using AWS Lambda with Amazon S3](with-s3.md)\. + Respond to incoming HTTP requests\. For more information, see [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md)\. -+ Consume events from a queue\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ++ Consume events from a queue\. For more information, see [Using Lambda with Amazon SQS](with-sqs.md)\. + Run a function on a schedule\. For more information, see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. Depending on which service you're using with Lambda, the invocation generally works in one of two ways\. An event drives the invocation or Lambda polls a queue or data stream and invokes the function in response to activity in the queue or data stream\. Lambda integrates with Amazon Elastic File System and AWS X\-Ray in a way that doesn't involve invoking functions\. diff --git a/doc_source/lambda-settingup.md b/doc_source/lambda-settingup.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-stepfunctions.md b/doc_source/lambda-stepfunctions.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-troubleshooting.md b/doc_source/lambda-troubleshooting.md old mode 100644 new mode 100755 diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md old mode 100644 new mode 100755 index 4a104587..526ce6c7 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -1,14 +1,14 @@ -# Logging AWS Lambda API calls with AWS CloudTrail +# Logging Lambda API calls with CloudTrail -AWS Lambda is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in AWS Lambda\. CloudTrail captures API calls for AWS Lambda as events\. The calls captured include calls from the AWS Lambda console and code calls to the AWS Lambda API operations\. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for AWS Lambda\. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in **Event history**\. Using the information collected by CloudTrail, you can determine the request that was made to AWS Lambda, the IP address from which the request was made, who made the request, when it was made, and additional details\. +Lambda is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in Lambda\. CloudTrail captures API calls for Lambda as events\. The calls captured include calls from the Lambda console and code calls to the Lambda API operations\. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon Simple Storage Service \(Amazon S3\) bucket, including events for Lambda\. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in **Event history**\. Using the information collected by CloudTrail, you can determine the request that was made to Lambda, the IP address from which the request was made, who made the request, when it was made, and additional details\. -To learn more about CloudTrail, including how to configure and enable it, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)\. +For more information about CloudTrail, including how to configure and enable it, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)\. -## AWS Lambda information in CloudTrail +## Lambda information in CloudTrail -CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in AWS Lambda, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. +CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in Lambda, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. -For an ongoing record of events in your AWS account, including events for AWS Lambda, you create a trail\. A *trail* enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. +For an ongoing record of events in your AWS account, including events for Lambda, you create a *trail*\. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. For more information, see the following topics in the *AWS CloudTrail User Guide*: + [Overview for creating a trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html) @@ -16,13 +16,13 @@ For more information, see the following topics in the *AWS CloudTrail User Guide + [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html) + [Receiving CloudTrail log files from multiple regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail log files from multiple accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html) -Every log entry contains information about who generated the request\. The user identity information in the log helps you determine whether the request was made with root or IAM user credentials, with temporary security credentials for a role or federated user, or by another AWS service\. For more information, see the **userIdentity** field in the [CloudTrail event reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)\. +Every log entry contains information about who generated the request\. The user identity information in the log helps you determine whether the request was made with root or AWS Identity and Access Management \(IAM\) user credentials, with temporary security credentials for a role or federated user, or by another AWS service\. For more information, see the **userIdentity** field in the [CloudTrail event reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)\. You can store your log files in your bucket for as long as you want, but you can also define Amazon S3 lifecycle rules to archive or delete log files automatically\. By default, your log files are encrypted by using Amazon S3 server\-side encryption \(SSE\)\. -You can choose to have CloudTrail publish Amazon SNS notifications when new log files are delivered if you want to take quick action upon log file delivery\. For more information, see [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)\. +You can choose to have CloudTrail publish Amazon Simple Notification Service \(Amazon SNS\) notifications when new log files are delivered if you want to take quick action upon log file delivery\. For more information, see [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)\. -You can also aggregate AWS Lambda log files from multiple AWS regions and multiple AWS accounts into a single S3 bucket\. For more information, see [Working with CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html)\. +You can also aggregate Lambda log files from multiple Regions and multiple AWS accounts into a single S3 bucket\. For more information, see [Working with CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html)\. ### List of supported Lambda API actions @@ -52,7 +52,7 @@ In the CloudTrail log file, the `eventName` might include date and version infor \(The `ZipFile` parameter is omitted from the CloudTrail logs for `UpdateFunctionCode`\.\) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -## Understanding AWS Lambda log file entries +## Understanding Lambda log file entries CloudTrail log files contain one or more log entries where each entry is made up of multiple JSON\-formatted events\. A log entry represents a single request from any source and includes information about the requested action, any parameters, the date and time of the action, and so on\. The log entries are not guaranteed to be in any particular order\. That is, they are not an ordered stack trace of the public API calls\. @@ -120,7 +120,7 @@ The `eventName` might include date and version information, such as `"GetFunctio ## Using CloudTrail to track function invocations -CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [ Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. +CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. **Note** CloudTrail logs only authenticated and authorized requests\. CloudTrail does not log requests that fail authentication \(credentials are missing or the provided credentials are not valid\) or requests with credentials that are not authorized to invoke the function\. diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md old mode 100644 new mode 100755 index 7134c54a..df53ca0f --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -32,18 +32,13 @@ There is no additional charge for using Lambda logs; however, standard CloudWatc ## Using the Lambda console -The following section describes how to view logs for your function on the Lambda console\. - **To view logs using the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Monitor**\. -![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png)![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/)![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/) - - A graphical representation of the metrics for the Lambda function are shown\. +1. Choose **Monitor**\. 1. Choose **View logs in CloudWatch**\. @@ -55,7 +50,7 @@ To debug and validate that your code is working as expected, you can output logs + [AWS Lambda function logging in Ruby](ruby-logging.md) + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function logging in Go](golang-logging.md) -+ [AWS Lambda function logging in C\#](csharp-logging.md) ++ [Lambda function logging in C\#](csharp-logging.md) + [AWS Lambda function logging in PowerShell](powershell-logging.md) ## What's next? diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md old mode 100644 new mode 100755 index fe2f6951..e0409175 --- a/doc_source/monitoring-code-profiler.md +++ b/doc_source/monitoring-code-profiler.md @@ -10,7 +10,7 @@ You can use Amazon CodeGuru Profiler to gain insights into runtime performance o ## Supported runtimes -You can activate CodeGuru Profiler from the Lambda console if your function's runtime is Python 3\.8, Java 8 with Amazon Linux 2, or Java 11\. For additional runtime versions, you can activate CodeGuru Profiler manually\. +You can activate CodeGuru Profiler from the Lambda console if your function's runtime is Python3\.8, Python3\.9, Java 8 with Amazon Linux 2, or Java 11\. For additional runtime versions, you can activate CodeGuru Profiler manually\. + For Java runtimes, see [ Profiling your Java applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)\. + For Python runtimes, see [ Profiling your Python applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda.html)\. @@ -20,7 +20,7 @@ This section describes how to activate CodeGuru Profiler from the Lambda console **To activate CodeGuru Profiler from the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose your function\. diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md old mode 100644 new mode 100755 index 015532fb..69ecea60 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -1,6 +1,6 @@ -# Monitoring functions in the AWS Lambda console +# Monitoring functions on the Lambda console -AWS Lambda monitors functions on your behalf and sends metrics to Amazon CloudWatch\. The Lambda console creates monitoring graphs for these metrics and shows them on the **Monitoring** page for each Lambda function\. +Lambda monitors functions on your behalf and sends metrics to Amazon CloudWatch\. The Lambda console creates monitoring graphs for these metrics and shows them on the **Monitoring** page for each Lambda function\. This page describes the basics of using the Lambda console to view function metrics, including total requests, duration, and error rates\. @@ -10,15 +10,15 @@ CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatc ## Using the Lambda console -You can use the Lambda console's monitoring dashboard to monitor your Lambda functions and applications\. +You can monitor your Lambda functions and applications on the Lambda console\. **To monitor a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Monitoring**\. +1. Choose the **Monitor** tab\. ## Types of monitoring graphs @@ -26,9 +26,9 @@ The following section describes the monitoring graphs on the Lambda console\. **Lambda monitoring graphs** + **Invocations** – The number of times that the function was invoked\. -+ **Duration** – The average, minimum, and maximum execution times\. -+ **Error count and success rate \(%\)** – The number of errors and the percentage of executions that completed without error\. -+ **Throttles** – The number of times that execution failed due to concurrency limits\. ++ **Duration** – The average, minimum, and maximum amount of time your function code spends processing an event\. ++ **Error count and success rate \(%\)** – The number of errors and the percentage of invocations that completed without error\. ++ **Throttles** – The number of times that an invocation failed due to concurrency limits\. + **IteratorAge** – For stream event sources, the age of the last item in the batch when Lambda received it and invoked the function\. + **Async delivery failures** – The number of errors that occurred when Lambda attempted to write to a destination or dead\-letter queue\. + **Concurrent executions** – The number of function instances that are processing events\. @@ -39,29 +39,29 @@ The following section describes how to view CloudWatch monitoring graphs on the **To view monitoring graphs for a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Monitoring**\. +1. Choose the **Monitor** tab\. -1. Choose from the predefined time ranges, or choose a custom time range\. +1. On the **Metrics**, **Logs**, or **Traces** tab, choose from the predefined time ranges, or choose a custom time range\. -1. To see the definition of a graph in CloudWatch, choose the three vertical dots, and then choose **View in metrics** to open the **Metrics** dashboard in CloudWatch\. +1. To see the definition of a graph in CloudWatch, choose the three vertical dots \(**Widget actions**\), and then choose **View in metrics** to open the **Metrics** dashboard on the CloudWatch console\. ![\[An example monitoring definition on the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-definition.png) -## Viewing queries in the CloudWatch Logs console +## Viewing queries on the CloudWatch Logs console The following section describes how to view and add reports from CloudWatch Logs Insights to a custom dashboard on the CloudWatch Logs console\. **To view reports for a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Monitoring**\. +1. Choose the **Monitor** tab\. 1. Choose **View logs in CloudWatch**\. @@ -76,5 +76,5 @@ The following section describes how to view and add reports from CloudWatch Logs ![\[The CloudWatch Logs Insights reports on the CloudWatch dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) ## What's next? -+ Learn about the metrics that Lambda records and sends to CloudWatch in [Working with AWS Lambda function metrics](monitoring-metrics.md)\. -+ Learn how to use Lambda Insights to collect and aggregate Lambda function runtime performance metrics and logs in [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md)\. \ No newline at end of file ++ Learn about the metrics that Lambda records and sends to CloudWatch in [Working with Lambda function metrics](monitoring-metrics.md)\. ++ Learn how to use CloudWatch Lambda Insights to collect and aggregate Lambda function runtime performance metrics and logs in [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md)\. \ No newline at end of file diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md old mode 100644 new mode 100755 index 250d5255..ee06278c --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -35,7 +35,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu **To enable Lambda Insights in the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose your function\. diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md old mode 100644 new mode 100755 index d0d94b1a..9a953755 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -1,20 +1,20 @@ -# Working with AWS Lambda function metrics +# Working with Lambda function metrics -When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. Lambda sends metric data to CloudWatch in 1\-minute intervals\. +When your Lambda function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics on the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. Lambda sends metric data to CloudWatch in 1\-minute intervals\. This page describes the Lambda function invocation, performance, and concurrency metrics available on the CloudWatch console\. **Topics** -+ [Viewing metrics in the CloudWatch console](#monitoring-metrics-console) ++ [Viewing metrics on the CloudWatch console](#monitoring-metrics-console) + [Types of metrics](#monitoring-metrics-types) -## Viewing metrics in the CloudWatch console +## Viewing metrics on the CloudWatch console You can use the CloudWatch console to filter and sort function metrics by function name, alias, or version\. -**To view metrics in the CloudWatch console** +**To view metrics on the CloudWatch console** -1. Open the [Metrics page](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=~();namespace=~'AWS*2fLambda) \(`AWS/Lambda` namespace\) on the CloudWatch console\. +1. Open the [Metrics page](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=~();namespace=~'AWS*2fLambda) \(`AWS/Lambda` namespace\) of the CloudWatch console\. 1. Choose a dimension\. + **By Function Name** \(`FunctionName`\) – View aggregate metrics for all versions and aliases of a function\. @@ -27,28 +27,28 @@ You can use the CloudWatch console to filter and sort function metrics by functi By default, graphs use the `Sum` statistic for all metrics\. To choose a different statistic and customize the graph, use the options on the **Graphed metrics** tab\. **Note** -The timestamp on a metric reflects when the function was invoked\. Depending on the duration of the execution, this can be several minutes before the metric is emitted\. If, for example, your function has a 10\-minute timeout, look more than 10 minutes in the past for accurate metrics\. +The timestamp on a metric reflects when the function was invoked\. Depending on the duration of the invocation, this can be several minutes before the metric is emitted\. For example, if your function has a 10\-minute timeout, look more than 10 minutes in the past for accurate metrics\. For more information about CloudWatch, see the [https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/)\. ## Types of metrics -The following section describes the type of metrics available on the CloudWatch console\. +The following section describes the types of metrics available on the CloudWatch console\. ### Using invocation metrics -Invocation metrics are binary indicators of the outcome of an invocation\. For example, if the function returns an error, Lambda sends the `Errors` metric with a value of 1\. To get a count of the number of function errors that occurred each minute, view the `Sum` of the `Errors` metric with a period of one minute\. +Invocation metrics are binary indicators of the outcome of an invocation\. For example, if the function returns an error, Lambda sends the `Errors` metric with a value of 1\. To get a count of the number of function errors that occurred each minute, view the `Sum` of the `Errors` metric with a period of 1 minute\. -You should view the following metrics with the `Sum` statistic\. +View the following metrics with the `Sum` statistic\. **Invocation metrics** -+ `Invocations` – The number of times your function code is executed, including successful executions and executions that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise resulted in an invocation error\. This equals the number of requests billed\. -+ `Errors` – The number of invocations that result in a function error\. Function errors include exceptions thrown by your code and exceptions thrown by the Lambda runtime\. The runtime returns errors for issues such as timeouts and configuration errors\. To calculate the error rate, divide the value of `Errors` by the value of `Invocations`\. Note that the timestamp on an error metric reflects when the function was invoked, not when the error occurred\. -+ `DeadLetterErrors` – For [asynchronous invocation](invocation-async.md), the number of times Lambda attempts to send an event to a dead\-letter queue but fails\. Dead\-letter errors can occur due to permissions errors, misconfigured resources, or size limits\. -+ `DestinationDeliveryFailures` – For asynchronous invocation, the number of times Lambda attempts to send an event to a [destination](gettingstarted-features.md#gettingstarted-features-destinations) but fails\. Delivery errors can occur due to permissions errors, misconfigured resources, or size limits\. -+ `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with `TooManyRequestsException`\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. -+ `ProvisionedConcurrencyInvocations` – The number of times your function code is executed on [provisioned concurrency](configuration-concurrency.md)\. -+ `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. ++ `Invocations` – The number of times that your function code is invoked, including successful invocations and invocations that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise results in an invocation error\. This equals the number of requests billed\. ++ `Errors` – The number of invocations that result in a function error\. Function errors include exceptions that your code throws and exceptions that the Lambda runtime throws\. The runtime returns errors for issues such as timeouts and configuration errors\. To calculate the error rate, divide the value of `Errors` by the value of `Invocations`\. Note that the timestamp on an error metric reflects when the function was invoked, not when the error occurred\. ++ `DeadLetterErrors` – For [asynchronous invocation](invocation-async.md), the number of times that Lambda attempts to send an event to a dead\-letter queue but fails\. Dead\-letter errors can occur due to permissions errors, misconfigured resources, or size limits\. ++ `DestinationDeliveryFailures` – For asynchronous invocation, the number of times that Lambda attempts to send an event to a [destination](gettingstarted-features.md#gettingstarted-features-destinations) but fails\. Delivery errors can occur due to permissions errors, misconfigured resources, or size limits\. ++ `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with a `TooManyRequestsException` error\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. ++ `ProvisionedConcurrencyInvocations` – The number of times that your function code is invoked on [provisioned concurrency](configuration-concurrency.md)\. ++ `ProvisionedConcurrencySpilloverInvocations` – The number of times that your function code is invoked on standard concurrency when all provisioned concurrency is in use\. ### Using performance metrics @@ -57,16 +57,17 @@ Performance metrics provide performance details about a single invocation\. For **Performance metrics** + `Duration` – The amount of time that your function code spends processing an event\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. + `PostRuntimeExtensionsDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. -+ `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when the stream receives the record and when the event source mapping sends the event to the function\. ++ `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when a stream receives the record and when the event source mapping sends the event to the function\. ++ `OffsetLag` – For self\-managed Apache Kafka and Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event sources, the difference in offset between the last record written to a topic and the last record that your Lambda function processed\. Though a Kafka topic can have multiple partitions, this metric measures the offset lag at the topic level\. -`Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the P95 statistic shows the maximum duration of 95 percent of executions, excluding the slowest 5 percent\. +`Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the p95 statistic shows the maximum duration of 95 percent of invocations, excluding the slowest 5 percent\. ### Using concurrency metrics Lambda reports concurrency metrics as an aggregate count of the number of instances processing events across a function, version, alias, or AWS Region\. To see how close you are to hitting concurrency limits, view these metrics with the `Max` statistic\. **Concurrency metrics** -+ `ConcurrentExecutions` – The number of function instances that are processing events\. If this number reaches your [concurrent executions quota](gettingstarted-limits.md) for the Region, or the [reserved concurrency limit](configuration-concurrency.md) that you configured on the function, additional invocation requests are throttled\. ++ `ConcurrentExecutions` – The number of function instances that are processing events\. If this number reaches your [concurrent executions quota](gettingstarted-limits.md) for the Region, or the [reserved concurrency limit](configuration-concurrency.md) that you configured on the function, Lambda throttles additional invocation requests\. + `ProvisionedConcurrentExecutions` – The number of function instances that are processing events on [provisioned concurrency](configuration-concurrency.md)\. For each invocation of an alias or version with provisioned concurrency, Lambda emits the current count\. + `ProvisionedConcurrencyUtilization` – For a version or alias, the value of `ProvisionedConcurrentExecutions` divided by the total amount of provisioned concurrency allocated\. For example, `.5` indicates that 50 percent of allocated provisioned concurrency is in use\. -+ `UnreservedConcurrentExecutions` – For an AWS Region, the number of events that are being processed by functions that don't have reserved concurrency\. \ No newline at end of file ++ `UnreservedConcurrentExecutions` – For a Region, the number of events that functions without reserved concurrency are processing\. \ No newline at end of file diff --git a/doc_source/monitoring-servicemap.md b/doc_source/monitoring-servicemap.md old mode 100644 new mode 100755 index efa356d5..a757edae --- a/doc_source/monitoring-servicemap.md +++ b/doc_source/monitoring-servicemap.md @@ -20,7 +20,7 @@ AWS X\-Ray needs to be enabled on the Lambda console to complete the AWS X\-Ray **To enable AWS X\-Ray on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose your function\. @@ -52,7 +52,7 @@ You can choose a node to see detailed insights about the correlated metrics, log **To view service map and traces using the CloudWatch console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/nodejs-context.md b/doc_source/nodejs-context.md old mode 100644 new mode 100755 diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md old mode 100644 new mode 100755 index 3a33a915..e1545e48 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -64,7 +64,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -97,7 +97,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md old mode 100644 new mode 100755 index 541044fd..24bba014 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -62,6 +62,14 @@ exports.handler = async function(event) { } ``` +### Using Node\.js modules and top\-level await + +You can designate your function code as an ES module, allowing you to use `await` at the top level of the file, outside the scope of your function handler\. This guarantees completion of asynchronous initialization code prior to handler invocations, maximizing the effectiveness of [provisioned concurrency](provisioned-concurrency.md) in reducing cold start latency\. You can do this in two ways: specifying the `type` as `module` in the function's `package.json` file, or by using the \.mjs file name extension\. + +In the first scenario, your function code treats all \.js files as ES modules, while in the second scenario, only the file you specify with \.mjs is an ES module\. You can mix ES modules and CommonJS modules by naming them \.mjs and \.cjs respectively, as \.mjs files are always ES modules and \.cjs files are always CommonJS modules\. + +For more information and an example, see [Using Node\.js ES Modules and Top\-Level Await in AWS Lambda](https://aws.amazon.com/blogs/compute/using-node-js-es-modules-and-top-level-await-in-aws-lambda)\. + ## Non\-async handlers The following example function checks a URL and returns the status code to the invoker\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md old mode 100644 new mode 100755 index f6ed4c67..48ce65af --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -5,7 +5,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -36,6 +36,7 @@ AWS provides the following base images for Node\.js: | --- | --- | --- | --- | | 14 | NodeJS 14\.x | Amazon Linux 2 | [Dockerfile for Node\.js 14\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | | 12 | NodeJS 12\.x | Amazon Linux 2 | [Dockerfile for Node\.js 12\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | +| 10 | NodeJS 10\.x | Amazon Linux 2 | [Dockerfile for Node\.js 10\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs10.x/Dockerfile.nodejs10.x) | Docker Hub repository: amazon/aws\-lambda\-nodejs @@ -61,4 +62,4 @@ You can also download the [Node\.js runtime interface client](https://github.com ## Deploy the container image -For a new function, you deploy the Node\.js image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. +For a new function, you deploy the Node\.js image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md old mode 100644 new mode 100755 index d3e16881..41bb4637 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -129,7 +129,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md old mode 100644 new mode 100755 diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md old mode 100644 new mode 100755 index 5ee8eef0..65896465 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/permissions-boundary.md b/doc_source/permissions-boundary.md old mode 100644 new mode 100755 diff --git a/doc_source/powershell-context.md b/doc_source/powershell-context.md old mode 100644 new mode 100755 diff --git a/doc_source/powershell-devenv.md b/doc_source/powershell-devenv.md old mode 100644 new mode 100755 diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md old mode 100644 new mode 100755 index 09ee08eb..00fb56d4 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -88,7 +88,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -121,7 +121,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md old mode 100644 new mode 100755 index 8b640b5a..819a900c --- a/doc_source/powershell-handler.md +++ b/doc_source/powershell-handler.md @@ -17,7 +17,7 @@ This script returns the FunctionName property that's obtained from the $LambdaCo **Note** You're required to use the `#Requires` statement within your PowerShell scripts to indicate the modules that your scripts depend on\. This statement performs two important tasks\. 1\) It communicates to other developers which modules the script uses, and 2\) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment\. For more information about the `#Requires` statement in PowerShell, see [ About requires](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-6)\. For more information about PowerShell deployment packages, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. -When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](http://aws.amazon.com/powershell/?track=sdk)\. +When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [AWS Tools for PowerShell](http://aws.amazon.com/powershell/?track=sdk)\. ## Returning data diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md old mode 100644 new mode 100755 index 9043989d..f2bb52f6 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -139,7 +139,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/powershell-package.md b/doc_source/powershell-package.md old mode 100644 new mode 100755 diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md old mode 100644 new mode 100755 index 280429ed..da53abaf --- a/doc_source/provisioned-concurrency.md +++ b/doc_source/provisioned-concurrency.md @@ -33,7 +33,7 @@ To manage provisioned concurrency settings for a version or alias, use the Lambd **To allocate provisioned concurrency for an alias or version** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -105,7 +105,7 @@ Lambda emits the following metrics for provisioned concurrency: + `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. + `ProvisionedConcurrencyUtilization` – For a version or alias, the value of `ProvisionedConcurrentExecutions` divided by the total amount of provisioned concurrency allocated\. For example, \.5 indicates that 50 percent of allocated provisioned concurrency is in use\. -For more details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +For more details, see [Working with Lambda function metrics](monitoring-metrics.md)\. ## Optimizing latency with provisioned concurrency diff --git a/doc_source/python-context.md b/doc_source/python-context.md old mode 100644 new mode 100755 diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md old mode 100644 new mode 100755 index 883eff54..7793b3eb --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -43,7 +43,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -76,7 +76,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md old mode 100644 new mode 100755 index f566411b..a8a3bc70 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -114,7 +114,7 @@ The function in this example depends on a successful response \(in `200`\) from ### Returning a calculation -The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. +The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): diff --git a/doc_source/python-image.md b/doc_source/python-image.md old mode 100644 new mode 100755 index 55bfb071..6709b05d --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -8,7 +8,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md old mode 100644 new mode 100755 index fdf6f8c0..5fba3a46 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -121,7 +121,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/python-package.md b/doc_source/python-package.md old mode 100644 new mode 100755 index 513209a5..cd9c70dd --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -60,7 +60,7 @@ Create the \.zip file for your deployment package\. cd my-math-function ``` -1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: +1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: ``` my-math-function$ @@ -101,12 +101,10 @@ Create the \.zip file for your deployment package\. ``` import requests - def main(event, context): + def lambda_handler(event, context): response = requests.get("https://www.test.com/") print(response.text) return response.text - if __name__ == "__main__": - main('', '') ``` Your directory structure should look like this: diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md old mode 100644 new mode 100755 index d83fb5a0..7b1a6c85 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -13,7 +13,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/ruby-context.md b/doc_source/ruby-context.md old mode 100644 new mode 100755 diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md old mode 100644 new mode 100755 index b17df846..345344ea --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -65,7 +65,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -98,7 +98,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md old mode 100644 new mode 100755 diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md old mode 100644 new mode 100755 index b205730c..d42ca1e3 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -5,7 +5,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md old mode 100644 new mode 100755 index 9a31503b..9a57855a --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -151,7 +151,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md old mode 100644 new mode 100755 diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md old mode 100644 new mode 100755 index e1da11a2..0ea13d40 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md old mode 100644 new mode 100755 index 7fe3e7f4..201e3cf2 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -18,10 +18,10 @@ In the table below, each of the phases starts at midnight \(Pacific time zone\) | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Oct 26, 2021 | Nov 30, 2021 | -| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Nov 22, 2021 | -| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Nov 30, 2021 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Nov 30, 2021 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Jan 5, 2022 | Feb 14, 2022 | +| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Feb 14, 2022 | +| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Feb 14, 2022 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Feb 14, 2022 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | diff --git a/doc_source/runtimes-api.md b/doc_source/runtimes-api.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md old mode 100644 new mode 100755 index 21057e3d..94d26b24 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -110,7 +110,7 @@ Here is an example payload: **Note** Lambda allocates CPU power in proportion to the function's memory setting\. You might see increased execution and initialization duration at lower memory settings because the function and extension processes are competing for the same CPU resources\. To reduce the execution and initialization duration, try increasing the memory setting\. -To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExtensionsDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExtensionsDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with Lambda function metrics](monitoring-metrics.md)\. Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md old mode 100644 new mode 100755 index c49f6e76..843fb4fc --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -218,7 +218,7 @@ runtime-tutorial$ aws lambda update-function-code --function-name bash-runtime - Invoke the function to verify that it works with the runtime layer\. ``` -runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt +runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt --cli-binary-format raw-in-base64-out { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md old mode 100644 new mode 100755 index 792a6905..62588858 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -64,7 +64,7 @@ var serialize = function(object) { The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. -The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. +The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using Lambda with Amazon SQS](with-sqs.md)\. ## Deployment automation with AWS CloudFormation and the AWS CLI diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md old mode 100644 new mode 100755 diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md old mode 100644 new mode 100755 diff --git a/doc_source/security-compliance.md b/doc_source/security-compliance.md old mode 100644 new mode 100755 diff --git a/doc_source/security-configuration.md b/doc_source/security-configuration.md old mode 100644 new mode 100755 diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md old mode 100644 new mode 100755 diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md old mode 100644 new mode 100755 diff --git a/doc_source/security-infrastructure.md b/doc_source/security-infrastructure.md old mode 100644 new mode 100755 diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md old mode 100644 new mode 100755 diff --git a/doc_source/security_iam_id-based-policy-examples.md b/doc_source/security_iam_id-based-policy-examples.md old mode 100644 new mode 100755 diff --git a/doc_source/security_iam_service-with-iam.md b/doc_source/security_iam_service-with-iam.md old mode 100644 new mode 100755 diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md old mode 100644 new mode 100755 diff --git a/doc_source/services-alb.md b/doc_source/services-alb.md old mode 100644 new mode 100755 diff --git a/doc_source/services-alexa.md b/doc_source/services-alexa.md old mode 100644 new mode 100755 diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md old mode 100644 new mode 100755 diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md old mode 100644 new mode 100755 diff --git a/doc_source/services-apigateway-template.md b/doc_source/services-apigateway-template.md old mode 100644 new mode 100755 diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md old mode 100644 new mode 100755 index 6a4cf921..feb395a0 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -348,7 +348,7 @@ Test the Lambda function manually using the following sample event data\. You ca --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify the output in the file `outputfile.txt`\. diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md old mode 100644 new mode 100755 index 3222c7a8..df218f34 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -22,7 +22,7 @@ Resources in your API define one or more methods, such as GET or POST\. Methods **To add a public endpoint to your Lambda function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md old mode 100644 new mode 100755 diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md old mode 100644 new mode 100755 diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md old mode 100644 new mode 100755 index 7cbe0277..27d178da --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -43,7 +43,7 @@ EventBridge \(CloudWatch Events\) emits an event every minute, based on the sche Test the function with a sample event provided by the Lambda console\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the **lambda\-canary** function\. @@ -113,7 +113,7 @@ Update the function configuration to cause the function to return an error, whic **To trigger an alarm** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the **lambda\-canary** function\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md old mode 100644 new mode 100755 index a59998ed..85e0862f --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -58,7 +58,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re **To configure EventBridge \(CloudWatch Events\) to invoke your function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function @@ -76,5 +76,4 @@ Each AWS account can have up to 100 unique event sources of the **EventBridge \( **Topics** + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) -+ [AWS SAM template for a EventBridge \(CloudWatch Events\) application](with-scheduledevents-example-use-app-spec.md) + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) \ No newline at end of file diff --git a/doc_source/services-cloudwatchlogs.md b/doc_source/services-cloudwatchlogs.md old mode 100644 new mode 100755 diff --git a/doc_source/services-codecommit.md b/doc_source/services-codecommit.md old mode 100644 new mode 100755 diff --git a/doc_source/services-codepipeline.md b/doc_source/services-codepipeline.md old mode 100644 new mode 100755 diff --git a/doc_source/services-cognito.md b/doc_source/services-cognito.md old mode 100644 new mode 100755 diff --git a/doc_source/services-config.md b/doc_source/services-config.md old mode 100644 new mode 100755 diff --git a/doc_source/services-connect.md b/doc_source/services-connect.md old mode 100644 new mode 100755 diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md old mode 100644 new mode 100755 diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md old mode 100644 new mode 100755 diff --git a/doc_source/services-efs.md b/doc_source/services-efs.md old mode 100644 new mode 100755 diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md old mode 100644 new mode 100755 diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md old mode 100644 new mode 100755 diff --git a/doc_source/services-iotevents.md b/doc_source/services-iotevents.md old mode 100644 new mode 100755 diff --git a/doc_source/services-kinesisfirehose.md b/doc_source/services-kinesisfirehose.md old mode 100644 new mode 100755 diff --git a/doc_source/services-lex.md b/doc_source/services-lex.md old mode 100644 new mode 100755 diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md old mode 100644 new mode 100755 diff --git a/doc_source/services-rds.md b/doc_source/services-rds.md old mode 100644 new mode 100755 diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md old mode 100644 new mode 100755 index 848b668a..c579ed57 --- a/doc_source/services-s3-batch.md +++ b/doc_source/services-s3-batch.md @@ -55,7 +55,7 @@ Note that you can't reuse an existing Amazon S3 event\-based function for batch In the [resource\-based policy](access-control-resource-based.md) that you create for the Amazon S3 batch job, ensure that you set permission for the job to invoke your Lambda function\. -In the [execution role](lambda-intro-execution-role.md) for the function, set a trust policy for Amazon S3 to assume the role when it runs your function\. +In the execution role for the function, set a [trust policy for Amazon S3 to assume the role when it runs your function](https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops-iam-role-policies.html)\. If your function uses the AWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. diff --git a/doc_source/services-s3-object-lambda.md b/doc_source/services-s3-object-lambda.md old mode 100644 new mode 100755 diff --git a/doc_source/services-ses.md b/doc_source/services-ses.md old mode 100644 new mode 100755 diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md old mode 100644 new mode 100755 diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md old mode 100644 new mode 100755 index 210cff81..71fe5a4a --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -8,7 +8,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/stepfunctions-lc.md b/doc_source/stepfunctions-lc.md old mode 100644 new mode 100755 diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-networking.md b/doc_source/troubleshooting-networking.md old mode 100644 new mode 100755 index b5bf14db..8ae59be7 --- a/doc_source/troubleshooting-networking.md +++ b/doc_source/troubleshooting-networking.md @@ -1,27 +1,31 @@ # Troubleshoot networking issues in Lambda -By default, Lambda runs your functions in an internal virtual private cloud \(VPC\) with connectivity to AWS services and the internet\. To access local network resources, you can [configure your function to connect to a VPC in your account](configuration-vpc.md)\. When you use this feature, you manage the function's internet access and network connectivity with VPC resources\. +By default, Lambda runs your functions in an internal virtual private cloud \(VPC\) with connectivity to AWS services and the internet\. To access local network resources, you can [configure your function to connect to a VPC in your account](configuration-vpc.md)\. When you use this feature, you manage the function's internet access and network connectivity with Amazon Virtual Private Cloud \(Amazon VPC\) resources\. -Network connectivity errors can result from issues in routing configuration, security group rules, role permissions, network address translation, or the availability of resources such as IP addresses or network interfaces\. They may result in a specific error or, if a request can't reach its destination, a timeout\. +Network connectivity errors can result from issues with your VPC's routing configuration, security group rules, AWS Identity and Access Management \(IAM\) role permissions, or network address translation \(NAT\), or from the availability of resources such as IP addresses or network interfaces\. Depending on the issue, you might see a specific error or timeout if a request can't reach its destination\. ## VPC: Function loses internet access or times out -**Issue:** *Function loses internet access after connecting to a VPC* +**Issue:** *Your Lambda function loses internet access after connecting to a VPC\.* **Error:** *Error: connect ETIMEDOUT 176\.32\.98\.189:443* **Error:** *Error: Task timed out after 10\.00 seconds* -When you connect a function to a VPC, all outbound requests go through your VPC\. To connect to the internet, configure your VPC to send outbound traffic from the function's subnet to a NAT gateway in a public subnet\. For more information and sample VPC configurations, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +**Error:** *ReadTimeoutError: Read timed out\. \(read timeout=15\)* + +When you connect a function to a VPC, all outbound requests go through the VPC\. To connect to the internet, configure your VPC to send outbound traffic from the function's subnet to a NAT gateway in a public subnet\. For more information and sample VPC configurations, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. + +If some of your TCP connections are timing out, this may be due to packet fragmentation\. Lambda functions cannot handle incoming fragmented TCP requests, since Lambda does not support IP fragmentation for TCP or ICMP\. ## VPC: Function needs access to AWS services without using the internet -**Issue:** *Function needs access to AWS services without using the internet* +**Issue:** *Your Lambda function needs access to AWS services without using the internet\.* -To connect to AWS services from a private subnet with no internet access, use VPC endpoints\. For a sample template with VPC endpoints for DynamoDB and Amazon S3, see [Sample VPC configurations](configuration-vpc.md#vpc-samples)\. +To connect a function to AWS services from a private subnet with no internet access, use VPC endpoints\. For a sample AWS CloudFormation template with VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB \(DynamoDB\), see [Sample VPC configurations](configuration-vpc.md#vpc-samples)\. -## VPC: Limit was reached for the function's VPC +## VPC: Elastic network interface limit reached **Error:** *ENILimitReachedException: The elastic network interface limit was reached for the function's VPC\.* -When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of subnet and security group attached to the function\. These network interfaces are limited to 250 per VPC, but this limit can be increased\. To request an increase, use the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. \ No newline at end of file +When you connect a Lambda function to a VPC, Lambda creates an elastic network interface for each combination of subnet and security group attached to the function\. The default service quota is 250 network interfaces per VPC\. To request a quota increase, use the [Service Quotas console](https://console.aws.amazon.com/servicequotas/home/services/lambda/quotas/L-9FEE3D26)\. \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md old mode 100644 new mode 100755 index 845a69f2..a19746ec --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -72,7 +72,7 @@ You add the extension to your function using the same method as you would for an **Add an extension to your function \(console\)** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/welcome.md b/doc_source/welcome.md old mode 100644 new mode 100755 index a6b1bedb..2071ad2b --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -24,7 +24,7 @@ Lambda is a highly available service\. For more information, see the [AWS Lambda ## When should I use Lambda? -Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](runtimes-context.md) and within the resources that Lambda provides\. +Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](runtimes-context.md) and within the resources that Lambda provides\. Lambda is best suited for shorter, event\-driven workloads, since Lambda functions run for up to 15 minutes per invocation\. When using Lambda, you are responsible only for your code\. Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources to run your code\. Because Lambda manages these resources, you cannot log in to compute instances or customize the operating system on [provided runtimes](lambda-runtimes.md)\. Lambda performs operational and administrative activities on your behalf, including managing capacity, monitoring, and logging your Lambda functions\. diff --git a/doc_source/with-android-create-package.md b/doc_source/with-android-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md old mode 100644 new mode 100755 index d8b66f15..205569ac --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -97,7 +97,7 @@ Invoke the function manually using the sample event data\. --payload file://file-path/input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ## Create an Amazon Cognito identity pool diff --git a/doc_source/with-cloudtrail-create-package.md b/doc_source/with-cloudtrail-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-cloudtrail-example.md b/doc_source/with-cloudtrail-example.md old mode 100644 new mode 100755 diff --git a/doc_source/with-cloudtrail.md b/doc_source/with-cloudtrail.md old mode 100644 new mode 100755 index a3d20878..9f23f3e6 --- a/doc_source/with-cloudtrail.md +++ b/doc_source/with-cloudtrail.md @@ -80,6 +80,6 @@ In this scenario, CloudTrail writes access logs to your S3 bucket\. As for AWS L For detailed information about how to configure Amazon S3 as the event source, see [Using AWS Lambda with Amazon S3](with-s3.md)\. **Topics** -+ [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) ++ [Logging Lambda API calls with CloudTrail](logging-using-cloudtrail.md) + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + [Sample function code](with-cloudtrail-create-package.md) \ No newline at end of file diff --git a/doc_source/with-ddb-create-package.md b/doc_source/with-ddb-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md old mode 100644 new mode 100755 index 68549657..1ddadfdb --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -185,7 +185,7 @@ Run the following `invoke` command\. aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The function returns the string `message` in the response body\. @@ -215,10 +215,12 @@ Create an Amazon DynamoDB table with a stream enabled\. 1. Choose the **lambda\-dynamodb\-stream** table\. -1. Under **Overview**, choose **Manage stream**\. +1. Under **Exports and streams**, choose **DynamoDB stream details**\. 1. Choose **Enable**\. +1. Choose **Enable stream**\. + Write down the stream ARN\. You need this in the next step when you associate the stream with your Lambda function\. For more information on enabling streams, see [Capturing table activity with DynamoDB Streams](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html)\. ## Add an event source in AWS Lambda diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md old mode 100644 new mode 100755 index 30a003a7..635f7a30 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -32,7 +32,7 @@ Lambda reads records from the stream and invokes your function [synchronously](i }, "awsRegion": "us-west-2", "eventName": "INSERT", - "eventSourceARN": eventsourcearn, + "eventSourceARN": "arn:aws:dynamodb:us-east-1:111122223333:table/EventSourceTable", "eventSource": "aws:dynamodb" }, { @@ -66,20 +66,21 @@ Lambda reads records from the stream and invokes your function [synchronously](i }, "awsRegion": "us-west-2", "eventName": "MODIFY", - "eventSourceARN": sourcearn, + "eventSourceARN": "arn:aws:dynamodb:us-east-1:111122223333:table/EventSourceTable", "eventSource": "aws:dynamodb" } + ]} ``` Lambda polls shards in your DynamoDB stream for records at a base rate of 4 times per second\. When records are available, Lambda invokes your function and waits for the result\. If processing succeeds, Lambda resumes polling until it receives more records\. -By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. +By default, Lambda invokes your function as soon as records are available\. If the batch that Lambda reads from the event source has only one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batching window*\. Before invoking the function, Lambda continues to read records from the event source until it has gathered a full batch, the batching window expires, or the batch reaches the payload limit of 6 MB\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when you set `ParallelizationFactor` to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. **Topics** + [Execution role permissions](#events-dynamodb-permissions) @@ -101,11 +102,10 @@ Lambda needs the following permissions to manage resources related to your Dynam + [dynamodb:GetRecords](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetRecords.html) + [dynamodb:GetShardIterator](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) + [dynamodb:ListStreams](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListStreams.html) -+ [dynamodb:ListShards](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListShards.html) The `AWSLambdaDynamoDBExecutionRole` managed policy includes these permissions\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. -To send records of failed batches to a queue or topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: +To send records of failed batches to an SQS queue or SNS topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: + **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) + **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) @@ -117,15 +117,15 @@ To configure your function to read from DynamoDB Streams in the Lambda console, **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. 1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. -1. Configure the required options and then choose **Add**\. +1. Configure the required options, and then choose **Add**\. Lambda supports the following options for DynamoDB event sources\. @@ -138,11 +138,11 @@ Lambda supports the following options for DynamoDB event sources\. + **Trim horizon** – Process all records in the stream\. After processing any existing records, the function is caught up and continues to process new records\. -+ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records because it's too old or has exhausted all retries, it sends details about the batch to the queue or topic\. ++ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records that's too old or has exhausted all retries, Lambda sends details about the batch to the queue or topic\. + **Retry attempts** – The maximum number of times that Lambda retries when the function returns an error\. This doesn't apply to service errors or throttles where the batch didn't reach the function\. + **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. + **Split batch on error** – When the function returns an error, split the batch into two before retrying\. -+ **Concurrent batches per shard** – Process multiple batches from the same shard concurrently\. ++ **Concurrent batches per shard** – Concurrently process multiple batches from the same shard\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when the mapping is reenabled\. **Note** @@ -152,14 +152,14 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping APIs -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. +The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that its Amazon Resource Name \(ARN\) specifies, with a batch size of 500\. ``` aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ @@ -256,7 +256,7 @@ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b112 ## Error handling -The event source mapping that reads records from your DynamoDB stream invokes your function synchronously and retries on errors\. If the function is throttled or the Lambda service returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. +The event source mapping that reads records from your DynamoDB stream, invokes your function synchronously, and retries on errors\. If Lambda throttles the function or returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry quota\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry quota\. @@ -266,7 +266,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. **To configure a destination for failed\-event records** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -319,7 +319,7 @@ You can use this information to retrieve the affected records from the stream fo Lambda emits the `IteratorAge` metric when your function finishes processing a batch of records\. The metric indicates how old the last record in the batch was when processing finished\. If your function is processing new events, you can use the iterator age to estimate the latency between when a record is added and when the function processes it\. -An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. ## Time windows @@ -613,7 +613,7 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10000 | +| BatchSize | N | 100 | Maximum: 1,000 | | BisectBatchOnFunctionError | N | false | | | DestinationConfig | N | | Amazon SQS queue or Amazon SNS topic destination for discarded records | | Enabled | N | true | | diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md old mode 100644 new mode 100755 index 3d26a22c..8a6a4dc6 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -8,9 +8,9 @@ This topic describes how to use Lambda with a self\-managed Kafka cluster\. In A Apache Kafka as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) -For an example of how to use self\-managed Kafka as an event source, see [Using self\-hosted Apache Kafka as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-self-hosted-apache-kafka-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. - +For Kafka\-based event sources, Lambda supports processing control parameters, such as batching windows and batch size\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. +For an example of how to use self\-managed Kafka as an event source, see [Using self\-hosted Apache Kafka as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-self-hosted-apache-kafka-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. Lambda sends the batch of messages in the event parameter when it invokes your Lambda function\. The event payload contains an array of messages\. Each array item contains details of the Kafka topic and Kafka partition identifier, together with a timestamp and a base64\-encoded message\. @@ -51,43 +51,146 @@ Lambda sends the batch of messages in the event parameter when it invokes your L ``` **Topics** -+ [Managing access and permissions](#smaa-permissions) -+ [Kafka authentication](#smaa-authentication) -+ [Network configuration](#services-msk-vpc-config) ++ [Kafka cluster authentication](#smaa-authentication) ++ [Managing API access and permissions](#smaa-permissions) ++ [Authentication and authorization errors](#kafka-permissions-errors) ++ [Network configuration](#services-kafka-vpc-config) + [Adding a Kafka cluster as an event source](#services-smaa-topic-add) + [Using a Kafka cluster as an event source](#kafka-using-cluster) + [Auto scaling of the Kafka event source](#services-kafka-scaling) + [Event source API operations](#kafka-hosting-api-operations) + [Event source mapping errors](#services-event-errors) ++ [Amazon CloudWatch metrics](#services-kafka-metrics) + [Self\-managed Apache Kafka configuration parameters](#services-kafka-parms) -## Managing access and permissions +## Kafka cluster authentication + +Lambda supports several methods to authenticate with your self\-managed Apache Kafka cluster\. Make sure that you configure the Kafka cluster to use one of these supported authentication methods\. For more information about Kafka security, see the [Security](http://kafka.apache.org/documentation.html#security) section of the Kafka documentation\. + +### VPC access + +If only Kafka users within your VPC access your Kafka brokers, you must configure the Kafka event source for Amazon Virtual Private Cloud \(Amazon VPC\) access\. + +### SASL/SCRAM authentication + +Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with Transport Layer Security \(TLS\) encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. + +Lambda supports SASL/PLAIN authentication with TLS encryption\. With SASL/PLAIN authentication, Lambda sends credentials as clear text \(unencrypted\) to the server\. -For Lambda to poll your Apache Kafka topic and update other cluster resources, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have the following permissions\. +For SASL authentication, you store the user name and password as a secret in AWS Secrets Manager\. For more information about using Secrets Manager, see [Tutorial: Create and retrieve a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. + +### Mutual TLS authentication + +Mutual TLS \(mTLS\) provides two\-way authentication between the client and server\. The client sends a certificate to the server for the server to verify the client, and the server sends a certificate to the client for the client to verify the server\. + +In self\-managed Apache Kafka, Lambda acts as the client\. You configure a client certificate \(as a secret in Secrets Manager\) to authenticate Lambda with your Kafka brokers\. The client certificate must be signed by a CA in the server's trust store\. + +The Kafka cluster sends a server certificate to Lambda to authenticate the Kafka brokers with Lambda\. The server certificate can be a public CA certificate or a private CA/self\-signed certificate\. The public CA certificate must be signed by a certificate authority \(CA\) that's in the Lambda trust store\. For a private CA/self\-signed certificate, you configure the server root CA certificate \(as a secret in Secrets Manager\)\. Lambda uses the root certificate to verify the Kafka brokers\. + +For more information about mTLS, see [ Introducing mutual TLS authentication for Amazon MSK as an event source](http://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-msk-as-an-event-source)\. + +### Configuring the client certificate secret + +The CLIENT\_CERTIFICATE\_TLS\_AUTH secret requires a certificate field and a private key field\. For an encrypted private key, the secret requires a private key password\. Both the certificate and private key must be in PEM format\. + +**Note** +Lambda supports the [PBES1](https://datatracker.ietf.org/doc/html/rfc2898/#section-6.1) \(but not PBES2\) private key encryption algorithms\. + +The certificate field must contain a list of certificates, beginning with the client certificate, followed by any intermediate certificates, and ending with the root certificate\. Each certificate must start on a new line with the following structure: + +``` +-----BEGIN CERTIFICATE----- + +-----END CERTIFICATE----- +``` + +Secrets Manager supports secrets up to 65,536 bytes, which is enough space for long certificate chains\. + +The private key must be in [PKCS \#8](https://datatracker.ietf.org/doc/html/rfc5208) format, with the following structure: + +``` +-----BEGIN PRIVATE KEY----- + +-----END PRIVATE KEY----- +``` + +For an encrypted private key, use the following structure: + +``` +-----BEGIN ENCRYPTED PRIVATE KEY----- + +-----END ENCRYPTED PRIVATE KEY----- +``` + +The following example shows the contents of a secret for mTLS authentication using an encrypted private key\. For an encrypted private key, include the private key password in the secret\. + +``` +{ + "privateKeyPassword": "testpassword", + "certificate": "-----BEGIN CERTIFICATE----- +MIIE5DCCAsygAwIBAgIRAPJdwaFaNRrytHBto0j5BA0wDQYJKoZIhvcNAQELBQAw +... +j0Lh4/+1HfgyE2KlmII36dg4IMzNjAFEBZiCRoPimO40s1cRqtFHXoal0QQbIlxk +cmUuiAii9R0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFgjCCA2qgAwIBAgIQdjNZd6uFf9hbNC5RdfmHrzANBgkqhkiG9w0BAQsFADBb +... +rQoiowbbk5wXCheYSANQIfTZ6weQTgiCHCCbuuMKNVS95FkXm0vqVD/YpXKwA/no +c8PH3PSoAaRwMMgOSA2ALJvbRz8mpg== +-----END CERTIFICATE-----", + "privateKey": "-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFKzBVBgkqhkiG9w0BBQ0wSDAnBgkqhkiG9w0BBQwwGgQUiAFcK5hT/X7Kjmgp +... +QrSekqF+kWzmB6nAfSzgO9IaoAaytLvNgGTckWeUkWn/V0Ck+LdGUXzAC4RxZnoQ +zp2mwJn2NYB7AZ7+imp0azDZb+8YG2aUCiyqb6PnnA== +-----END ENCRYPTED PRIVATE KEY-----" +} +``` + +### Configuring the server root CA certificate secret + +You create this secret if your Kafka brokers use TLS encryption with certificates signed by a private CA\. You can use TLS encryption for VPC, SASL/SCRAM, SASL/PLAIN, or mTLS authentication\. + +The server root CA certificate secret requires a field that contains the Kafka broker's root CA certificate in PEM format\. The following example shows the structure of the secret\. + +``` +{ + "certificate": "-----BEGIN CERTIFICATE----- + MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx + EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT + HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs + ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dG... + -----END CERTIFICATE-----" +``` + +## Managing API access and permissions + +In addition to accessing your self\-managed Kafka cluster, your Lambda function needs permissions to perform various API actions\. You add these permissions to the function's [execution role](lambda-intro-execution-role.md)\. If your users need access to any API actions, add the required permissions to the identity policy for the AWS Identity and Access Management \(IAM\) user or role\. ### Required Lambda function permissions -To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): +To create and store logs in a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its execution role: + [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) + [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) + [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) ### Optional Lambda function permissions -Your Lambda function might need these permissions: -+ Describe your AWS Secrets Manager secret -+ Access your AWS Key Management Service \(AWS KMS\) customer managed key -+ Access your Amazon Virtual Private Cloud \(Amazon VPC\) +Your Lambda function might also need permissions to: ++ Describe your Secrets Manager secret\. ++ Access your AWS Key Management Service \(AWS KMS\) customer managed key\. ++ Access your Amazon VPC\. -#### Secrets Manager and AWS KMS permissions +#### Secrets Manager and AWS KMS permissions -If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed key\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +Depending on the type of access control that you're configuring for your Kafka brokers, your Lambda function might need permission to access your Secrets Manager secret or to decrypt your AWS KMS customer managed key\. To access these resources, your function's execution role must have the following permissions: + [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) + [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) #### VPC permissions -If only users within a VPC can access your self\-managed Apache Kafka cluster, your Lambda function must have permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources\. These resources include your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +If only users within a VPC can access your self\-managed Apache Kafka cluster, your Lambda function must have permission to access your Amazon VPC resources\. These resources include your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's execution role must have the following permissions: + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) + [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) @@ -97,40 +200,92 @@ If only users within a VPC can access your self\-managed Apache Kafka cluster, y ### Adding permissions to your execution role -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's execution role\. +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's [execution role](lambda-intro-execution-role.md)\. + +By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an [IAM trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#term_trust-policy), and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. + +``` +{ + "Version":"2012-10-17", + "Statement":[ + { + "Effect":"Allow", + "Action":[ + "ec2:CreateNetworkInterface", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeVpcs", + "ec2:DeleteNetworkInterface", + "ec2:DescribeSubnets", + "ec2:DescribeSecurityGroups" + ], + "Resource":"*" + } + ] + } +``` + +For information about creating a JSON policy document in the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. -By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md) +### Granting users access with an IAM policy -### Adding users to an IAM policy +By default, IAM users and roles don't have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you create or update an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. -By default, IAM users and roles do not have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. +## Authentication and authorization errors -## Kafka authentication +If any of the permissions required to consume data from the Kafka cluster are missing, Lambda displays one of the following error messages in the event source mapping under **LastProcessingResult**\. -Lambda supports several methods to authenticate with your self\-managed Apache Kafka cluster\. Make sure that you configure the Kafka cluster to use one of the following authentication methods that Lambda supports: -+ VPC +**Topics** ++ [Cluster failed to authorize Lambda](#kafka-authorize-errors) ++ [SASL authentication failed](#kafka-sasl-errors) ++ [Server failed to authenticate Lambda](#kafka-mtls-errors-server) ++ [Lambda failed to authenticate server](#kafka-mtls-errors-lambda) ++ [Provided certificate or private key is invalid](#kafka-key-errors) + +### Cluster failed to authorize Lambda + +For SASL/SCRAM or mTLS, this error indicates that the provided user doesn't have all of the following required Kafka access control list \(ACL\) permissions: ++ DescribeConfigs Cluster ++ Describe Group ++ Read Group ++ Describe Topic ++ Read Topic + +When you create Kafka ACLs with the required `kafka-cluster` permissions, specify the topic and group as resources\. The topic name must match the topic in the event source mapping\. The group name must match the event source mapping's UUID\. + +After you add the required permissions to the execution role, it might take several minutes for the changes to take effect\. - If only Kafka users within your VPC access your Kafka brokers, you must configure the event source with VPC access\. -+ SASL/SCRAM +### SASL authentication failed - Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with TLS encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. Because the credentials are encrypted, the connection to the cluster does not need to be encrypted\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. -+ SASL/PLAIN +For SASL/SCRAM or SASL/PLAIN, this error indicates that the provided user name and password aren't valid\. - Lambda supports SASL/PLAIN authentication with TLS encryption\. With SASL/PLAIN authentication, credentials are sent as clear text \(unencrypted\) to the server\. Because the credentials are clear text, the connection to the server must use TLS encryption\. +### Server failed to authenticate Lambda -For SASL authentication, you must store the user name and password as a secret in Secrets Manager\. For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. +This error indicates that the Kafka broker failed to authenticate Lambda\. This can occur for any of the following reasons: ++ You didn't provide a client certificate for mTLS authentication\. ++ You provided a client certificate, but the Kafka brokers aren't configured to use mTLS authentication\. ++ A client certificate isn't trusted by the Kafka brokers\. -## Network configuration +### Lambda failed to authenticate server -If you configure Amazon VPC access to your Kafka brokers, Lambda must have access to the Amazon VPC resources\. +This error indicates that Lambda failed to authenticate the Kafka broker\. This can occur for any of the following reasons: ++ The Kafka brokers use self\-signed certificates or a private CA, but didn't provide the server root CA certificate\. ++ The server root CA certificate doesn't match the root CA that signed the broker's certificate\. ++ Hostname validation failed because the broker's certificate doesn't contain the broker's DNS name or IP address as a subject alternative name\. -Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Kafka cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. +### Provided certificate or private key is invalid + +This error indicates that the Kafka consumer couldn't use the provided certificate or private key\. Make sure that the certificate and key use PEM format, and that the private key encryption uses a PBES1 algorithm\. + +## Network configuration + +If you configure Amazon VPC access to your Kafka brokers, Lambda must have access to the Amazon VPC resources associated with your Kafka cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If the broker uses authentication, also deploy a VPC endpoint for Secrets Manager\. Alternatively, ensure that the VPC associated with your Kafka cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -You must configure your Amazon VPC security groups with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. +Configure your Amazon VPC security groups with the following rules \(at minimum\): ++ Inbound rules – Allow all traffic on the Kafka broker port for the security groups specified for your event source\. Kafka uses port 9092 by default\. ++ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the Kafka broker port for the security groups specified for your event source\. Kafka uses port 9092 by default\. ++ If you are using VPC endpoints instead of a NAT gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. @@ -142,7 +297,7 @@ This section describes how to create an event source mapping using the Lambda co ### Prerequisites + A self\-managed Apache Kafka cluster\. Lambda supports Apache Kafka version 0\.10\.0\.0 and later\. -+ A Lambda execution role with permission to access the AWS resources that your self\-managed Kafka cluster uses\. ++ An [execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. ### Adding a self\-managed Kafka cluster \(console\) @@ -168,23 +323,36 @@ Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka to 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. -1. Under **Authentication method**, choose the access or authentication protocol of the Kafka brokers in your cluster\. If only users within your VPC access your Kafka brokers, you must configure VPC access\. If users access your Kafka brokers over the internet, you must configure SASL authentication\. - + To configure VPC access, choose the **VPC** for your Kafka cluster, then choose **VPC subnets** and **VPC security groups**\. - + To configure SASL authentication, under **Secret key**, choose **Add**, then do the following: + 1. \(Optional\) For **VPC**, choose the Amazon VPC for your Kafka cluster\. Then, choose the **VPC subnets** and **VPC security groups**\. + + This setting is required if only users within your VPC access your brokers\. - 1. Choose the key type\. If your Kafka broker uses SASL plaintext, choose **BASIC\_AUTH**\. Otherwise, choose one of the **SASL\_SCRAM** options\. + - 1. Choose the name of the Secrets Manager secret key that contains the credentials for your Kafka cluster\. + 1. \(Optional\) For **Authentication**, choose **Add**, and then do the following: + + 1. Choose the access or authentication protocol of the Kafka brokers in your cluster\. + + If your Kafka broker uses SASL plaintext authentication, choose **BASIC\_AUTH**\. + + If your broker uses SASL/SCRAM authentication, choose one of the **SASL\_SCRAM** protocols\. + + If you're configuring mTLS authentication, choose the **CLIENT\_CERTIFICATE\_TLS\_AUTH** protocol\. + + 1. For SASL/SCRAM or mTLS authentication, choose the Secrets Manager secret key that contains the credentials for your Kafka cluster\. + + 1. \(Optional\) For **Encryption**, choose the Secrets Manager secret containing the root CA certificate that your Kafka brokers use for TLS encryption, if your Kafka brokers use certificates signed by a private CA\. + + This setting applies to TLS encryption for SASL/SCRAM or SASL/PLAIN, and to mTLS authentication\. + + 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. 1. To create the trigger, choose **Add**\. -### Adding a self\-managed Kafka cluster \(AWS CLI\) +### Adding a self\-managed Kafka cluster \(AWS CLI\) Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. -#### Using SASL/SCRAM +#### Using SASL/SCRAM -If Kafka users access your Kafka brokers over the internet, you must specify the Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. +If Kafka users access your Kafka brokers over the internet, specify the Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. ``` aws lambda create-event-source-mapping --topics AWSKafkaTopic @@ -195,7 +363,7 @@ aws lambda create-event-source-mapping --topics AWSKafkaTopic For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. -#### Using a VPC +#### Using a VPC If only Kafka users within your VPC access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. @@ -212,7 +380,7 @@ aws lambda create-event-source-mapping For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. -#### Viewing the status using the AWS CLI +#### Viewing the status using the AWS CLI The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. @@ -225,21 +393,21 @@ aws lambda get-event-source-mapping When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. -Lambda reads event data from the Kafka topics that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) `Topics` based on the starting position that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) `StartingPosition`\. After successful processing, your Kafka topic is committed to your Kafka cluster\. +Lambda reads event data from the Kafka topics that you specify as `Topics` in a [CreateEventSourceMapping](API_CreateEventSourceMapping.md) request, based on the `StartingPosition` that you specify\. After successful processing, your Kafka topic is committed to your Kafka cluster\. -If you specify `LATEST` as the starting position, Lambda starts reading from the latest message in each partition belonging to the topic\. Because there can be some delay after trigger configuration before Lambda starts reading the messages, Lambda does not read any messages produced during this window\. +If you specify the `StartingPosition` as `LATEST`, Lambda starts reading from the latest message in each partition belonging to the topic\. Because there can be some delay after trigger configuration before Lambda starts reading the messages, Lambda doesn't read any messages produced during this window\. -Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) >`BatchSize`, until the function catches up with the topic\. +Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your function\. When more records are available, Lambda continues processing records in batches, based on the `BatchSize` value that you specify in a [CreateEventSourceMapping](API_CreateEventSourceMapping.md) request, until your function catches up with the topic\. -If your Lambda function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. +If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. -The maximum amount of time that Lambda lets a function run before stopping it is 14 minutes\. +Lambda can run your function for up to 14 minutes\. Configure your function timeout to be 14 minutes or less \(the default timeout value is 3 seconds\)\. Lambda may retry invocations that exceed 14 minutes\. ## Auto scaling of the Kafka event source -When you initially create an Apache Kafka [event source](invocation-eventsourcemapping.md), Lambda allocates one consumer to process all of the partitions in the Kafka topic\. Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. +When you initially create an an Apache Kafka [event source](invocation-eventsourcemapping.md), Lambda allocates one consumer to process all partitions in the Kafka topic\. Each consumer has multiple processors running in parallel to handle increased workloads\. Additionally, Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. -Every 15 minutes, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. +In one\-minute intervals, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. The scaling process of adding or removing consumers occurs within three minutes of evaluation\. If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. @@ -249,7 +417,7 @@ To monitor the throughput of your Kafka topic, you can view the Apache Kafka con When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS CLI, Lambda uses APIs to process your request\. -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -263,20 +431,26 @@ When you add your Apache Kafka cluster as an [event source](invocation-eventsour To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: **`ESM_CONFIG_NOT_VALID`** -The event source mapping configuration is not valid\. +The event source mapping configuration isn't valid\. **`EVENT_SOURCE_AUTHN_ERROR`** -Lambda could not authenticate the event source\. +Lambda couldn't authenticate the event source\. **`EVENT_SOURCE_AUTHZ_ERROR`** -Lambda does not have the required permissions to access the event source\. +Lambda doesn't have the required permissions to access the event source\. **`FUNCTION_CONFIG_NOT_VALID`** -The function configuration is not valid\. +The function configuration isn't valid\. **Note** If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. +## Amazon CloudWatch metrics + +Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic, and the last record that Lambda processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your function processes it\. + +An increasing trend in `OffsetLag` can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. + ## Self\-managed Apache Kafka configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Apache Kafka\. diff --git a/doc_source/with-kinesis-create-package.md b/doc_source/with-kinesis-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-kinesis-example-use-app-spec.md b/doc_source/with-kinesis-example-use-app-spec.md old mode 100644 new mode 100755 diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md old mode 100644 new mode 100755 index 247b3ac0..269b3479 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -122,7 +122,7 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The response is saved to `out.txt`\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md old mode 100644 new mode 100755 index d60e978d..139150a5 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -53,13 +53,13 @@ Lambda reads records from the data stream and invokes your function [synchronous } ``` -By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. +By default, Lambda invokes your function as soon as records are available\. If the batch that Lambda reads from the event source has only one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batching window*\. Before invoking the function, Lambda continues to read records from the event source until it has gathered a full batch, the batching window expires, or the batch reaches the payload limit of 6 MB\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when you set `ParallelizationFactor` to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. **Topics** + [Configuring your data stream and function](#services-kinesis-configure) @@ -118,7 +118,7 @@ Lambda needs the following permissions to manage resources that are related to y The `AWSLambdaKinesisExecutionRole` managed policy includes these permissions\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. -To send records of failed batches to a queue or topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: +To send records of failed batches to an SQS queue or SNS topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: + **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) + **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) @@ -130,15 +130,15 @@ To configure your function to read from Kinesis in the Lambda console, create a **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. 1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. -1. Configure the required options and then choose **Add**\. +1. Configure the required options, and then choose **Add**\. Lambda supports the following options for Kinesis event sources\. @@ -153,11 +153,11 @@ Lambda supports the following options for Kinesis event sources\. + **At timestamp** – Process records starting from a specific time\. After processing any existing records, the function is caught up and continues to process new records\. -+ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records because it's too old or has exhausted all retries, it sends details about the batch to the queue or topic\. ++ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records that's too old or has exhausted all retries, Lambda sends details about the batch to the queue or topic\. + **Retry attempts** – The maximum number of times that Lambda retries when the function returns an error\. This doesn't apply to service errors or throttles where the batch didn't reach the function\. + **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. + **Split batch on error** – When the function returns an error, split the batch into two before retrying\. -+ **Concurrent batches per shard** – Process multiple batches from the same shard concurrently\. ++ **Concurrent batches per shard** – Concurrently process multiple batches from the same shard\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when it's reenabled\. **Note** @@ -167,7 +167,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping API -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -274,7 +274,7 @@ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b112 ## Error handling -The event source mapping that reads records from your Kinesis stream invokes your function synchronously and retries on errors\. If the function is throttled or the Lambda service returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. +The event source mapping that reads records from your Kinesis stream, invokes your function synchronously, and retries on errors\. If Lambda throttles the function or returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry quota\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry quota\. @@ -284,7 +284,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. **To configure a destination for failed\-event records** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -302,7 +302,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. The following example shows an invocation record for a Kinesis stream\. -**Example invocation Record** +**Example invocation record** ``` { @@ -337,7 +337,7 @@ You can use this information to retrieve the affected records from the stream fo Lambda emits the `IteratorAge` metric when your function finishes processing a batch of records\. The metric indicates how old the last record in the batch was when processing finished\. If your function is processing new events, you can use the iterator age to estimate the latency between when a record is added and when the function processes it\. -An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. ## Time windows diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md old mode 100644 new mode 100755 index d9414499..b3fa1075 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -34,10 +34,12 @@ By default, Amazon MQ has a weekly maintenance window for brokers\. During that To interact with Amazon MQ, Lambda creates a consumer group which can read from your Amazon MQ brokers\. The consumer group is created with the same ID as the event source mapping UUID\. -Lambda will pull messages until it has processed a maximum of 6 MB, until timeout, or until the batch size is fulfilled\. When configured, batch size determines the maximum number of items to retrieve in a single batch\. Your batch is converted into a Lambda payload, and your target function is invoked\. Messages are neither persisted nor deserialized\. Instead, they are retrieved by the consumer group as a BLOB of bytes and are base64\-encoded for a JSON payload\. +For Amazon MQ event sources, Lambda batches records together and sends them to your function in a single payload\. To control behavior, you can configure the batching window and batch size\. Lambda pulls messages until it processes the payload size maximum of 6 MB, the batching window expires, or the number of records reaches the full batch size\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. + +Lambda converts your batch into a single payload, and then invokes your function\. Messages are neither persisted nor deserialized\. Instead, the consumer group retrieves them as a BLOB of bytes, and then base64\-encodes them into a JSON payload\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. **Note** -The maximum function invocation time is 14 minutes\. +Lambda can run your function for up to 14 minutes\. Configure your function timeout to be 14 minutes or less \(the default timeout value is 3 seconds\)\. Lambda may retry invocations that exceed 14 minutes\. You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. @@ -159,15 +161,15 @@ To configure your function to read from Amazon MQ, create an **MQ** trigger in t **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. 1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. -1. Configure the required options and then choose **Add**\. +1. Configure the required options, and then choose **Add**\. Lambda supports the following options for Amazon MQ event sources: + **MQ broker** – Select an Amazon MQ broker\. @@ -180,7 +182,7 @@ To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in ## Event source mapping API -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -310,7 +312,7 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10000 | +| BatchSize | N | 100 | Maximum: 10,000 | | Enabled | N | true | | | FunctionName | Y | | | | Queues | N | | The name of the Amazon MQ broker destination queue to consume\. | diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md old mode 100644 new mode 100755 index 21cbc233..e40d9def --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -1,14 +1,16 @@ # Using Lambda with Amazon MSK -[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that you can use to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK simplifies the setup, scaling, and management of clusters running Kafka\. Amazon MSK also makes it easier to configure your application for multiple Availability Zones and for security with AWS Identity and Access Management \(IAM\)\. Additionally, Amazon MSK supports multiple open\-source versions of Kafka\. +[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that you can use to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK simplifies the setup, scaling, and management of clusters running Kafka\. Amazon MSK also makes it easier to configure your application for multiple Availability Zones and for security with AWS Identity and Access Management \(IAM\)\. Amazon MSK supports multiple open\-source versions of Kafka\. Amazon MSK as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) -For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. Also, see [ Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs for a complete tutorial\. +For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. For a complete tutorial, see [ Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs\. -Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function times out or returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. +For Kafka\-based event sources, Lambda supports processing control parameters, such as batching windows and batch size\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. -For Amazon MSK invocations, Lambda allows the function to run for up to 14 minutes\. Set your function timeout value to 14 minutes or less \(the default timeout value is 3 seconds\)\. +Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. + +Lambda can run your function for up to 14 minutes\. Configure your function timeout to be 14 minutes or less \(the default timeout value is 3 seconds\)\. Lambda may retry invocations that exceed 14 minutes\. Lambda sends the batch of messages in the event parameter when it invokes your function\. The event payload contains an array of messages\. Each array item contains details of the Amazon MSK topic and partition identifier, together with a timestamp and a base64\-encoded message\. @@ -48,37 +50,46 @@ Lambda sends the batch of messages in the event parameter when it invokes your f } ``` +For an example of how to use Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. For a complete tutorial, see [Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs\. + **Topics** -+ [Managing access and permissions](#msk-permissions) ++ [MSK cluster authentication](#msk-cluster-permissions) ++ [Managing API access and permissions](#msk-permissions) ++ [Authentication and authorization errors](#msk-permissions-errors) + [Network configuration](#services-msk-vpc-config) + [Adding Amazon MSK as an event source](#services-msk-topic-add) + [Auto scaling of the Amazon MSK event source](#services-msk-ops-scaling) ++ [Amazon CloudWatch metrics](#services-msk-metrics) + [Amazon MSK configuration parameters](#services-msk-parms) -## Managing access and permissions +## MSK cluster authentication -You can use IAM access control to handle both authentication and authorization for your Amazon MSK cluster\. This eliminates the need to use one mechanism for authentication and a different mechanism for authorization\. For example, when a client tries to write to your cluster, Amazon MSK uses IAM to check whether that client is an authenticated identity and also whether it is authorized to produce to your cluster\. +Lambda needs permission to access the Amazon MSK cluster, retrieve records, and perform other tasks\. Amazon MSK supports several options for controlling client access to the MSK cluster\. -As an alternative, you can use SASL/SCRAM to authenticate clients and [Apache Kafka ACLs](https://docs.aws.amazon.com/msk/latest/developerguide/msk-acls.html) to control access\. +**Topics** ++ [Unauthenticated access](#msk-permissions-none) ++ [SASL/SCRAM authentication](#msk-permissions-add-secret) ++ [IAM role\-based authentication](#msk-permissions-iam-policy) ++ [Mutual TLS authentication](#msk-permissions-mTLS) ++ [Configuring the mTLS secret](#smaa-auth-secret) -### Required Lambda function permissions +### Unauthenticated access -Your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission to read records from your Amazon MSK cluster on your behalf\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: -+ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) -+ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) +If no clients access the cluster over the internet, you can use unauthenticated access\. + +### SASL/SCRAM authentication -### Additional function permissions for IAM authorization +Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with Transport Layer Security \(TLS\) encryption\. For Lambda to connect to the cluster, you store the authentication credentials \(user name and password\) in an AWS Secrets Manager secret\. -If you plan to use IAM authorization, you need to add the following additional permissions: +For more information about using Secrets Manager, see [User name and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +Amazon MSK doesn't support SASL/PLAIN authentication\. + +### IAM role\-based authentication + +You can use IAM to authenticate the identity of clients that connect to the MSK cluster\. To create and deploy IAM user or role\-based policies, use the IAM console or API\. For more information, see [IAM access control](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +To allow Lambda to connect to the MSK cluster, read records, and perform other required actions, add the following permissions to your function's [execution role](lambda-intro-execution-role.md)\. ``` { @@ -95,18 +106,110 @@ If you plan to use IAM authorization, you need to add the following additional p "kafka-cluster:DescribeClusterDynamicConfiguration" ], "Resource": [ - "arn:aws:kafka:::cluster//", - "arn:aws:kafka:::topic///", - "arn:aws:kafka:::group///" + "arn:aws:kafka:region:account-id:cluster/cluster-name/cluster-uuid", + "arn:aws:kafka:region:account-id:topic/cluster-name/cluster-uuid/topic-name", + "arn:aws:kafka:region:account-id:group/cluster-name/cluster-uuid/group-name" ] } ] } ``` -You can scope these permissions to a specific cluster, topic and group\. See [Amazon MSK Kafka actions](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html#kafka-actions) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. The group name that Lambda uses is equivalent to the event source mapping’s UUID\. +You can scope these permissions to a specific cluster, topic, and group\. For more information, see the [Amazon MSK Kafka actions](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html#kafka-actions) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. The group name that IAM uses is equivalent to the event source mapping's UUID\. + +### Mutual TLS authentication + +Mutual TLS \(mTLS\) provides two\-way authentication between the client and server\. The client sends a certificate to the server for the server to verify the client, and the server sends a certificate to the client for the client to verify the server\. + +For Amazon MSK, Lambda acts as the client\. You configure a client certificate \(as a secret in Secrets Manager\) to authenticate Lambda with the brokers in your MSK cluster\. The client certificate must be signed by a CA in the server's trust store\. The MSK cluster sends a server certificate to Lambda to authenticate the brokers with Lambda\. The server certificate must be signed by a certificate authority \(CA\) that's in the AWS trust store\. + +For instructions on how to generate a client certificate, see [ Introducing mutual TLS authentication for Amazon MSK as an event source](http://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-msk-as-an-event-source)\. + +Amazon MSK doesn't support self\-signed server certificates, because all brokers in Amazon MSK use [public certificates](https://docs.aws.amazon.com/msk/latest/developerguide/msk-encryption.html) signed by [Amazon Trust Services CAs](https://www.amazontrust.com/repository/), which Lambda trusts by default\. + + + +For more information about mTLS for Amazon MSK, see [Mutual TLS Authentication](https://docs.aws.amazon.com/msk/latest/developerguide/msk-authentication.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +### Configuring the mTLS secret + +The CLIENT\_CERTIFICATE\_TLS\_AUTH secret requires a certificate field and a private key field\. For an encrypted private key, the secret requires a private key password\. Both the certificate and private key must be in PEM format\. + +**Note** +Lambda supports the [PBES1](https://datatracker.ietf.org/doc/html/rfc2898/#section-6.1) \(but not PBES2\) private key encryption algorithms\. + +The certificate field must contain a list of certificates, beginning with the client certificate, followed by any intermediate certificates, and ending with the root certificate\. Each certificate must start on a new line with the following structure: + +``` +-----BEGIN CERTIFICATE----- + +-----END CERTIFICATE----- +``` + +Secrets Manager supports secrets up to 65,536 bytes, which is enough space for long certificate chains\. + +The private key must be in [PKCS \#8](https://datatracker.ietf.org/doc/html/rfc5208) format, with the following structure: + +``` +-----BEGIN PRIVATE KEY----- + +-----END PRIVATE KEY----- +``` -### Adding a policy to your execution role +For an encrypted private key, use the following structure: + +``` +-----BEGIN ENCRYPTED PRIVATE KEY----- + +-----END ENCRYPTED PRIVATE KEY----- +``` + +The following example shows the contents of a secret for mTLS authentication using an encrypted private key\. For an encrypted private key, you include the private key password in the secret\. + +``` +{ + "privateKeyPassword": "testpassword", + "certificate": "-----BEGIN CERTIFICATE----- +MIIE5DCCAsygAwIBAgIRAPJdwaFaNRrytHBto0j5BA0wDQYJKoZIhvcNAQELBQAw +... +j0Lh4/+1HfgyE2KlmII36dg4IMzNjAFEBZiCRoPimO40s1cRqtFHXoal0QQbIlxk +cmUuiAii9R0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFgjCCA2qgAwIBAgIQdjNZd6uFf9hbNC5RdfmHrzANBgkqhkiG9w0BAQsFADBb +... +rQoiowbbk5wXCheYSANQIfTZ6weQTgiCHCCbuuMKNVS95FkXm0vqVD/YpXKwA/no +c8PH3PSoAaRwMMgOSA2ALJvbRz8mpg== +-----END CERTIFICATE-----", + "privateKey": "-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFKzBVBgkqhkiG9w0BBQ0wSDAnBgkqhkiG9w0BBQwwGgQUiAFcK5hT/X7Kjmgp +... +QrSekqF+kWzmB6nAfSzgO9IaoAaytLvNgGTckWeUkWn/V0Ck+LdGUXzAC4RxZnoQ +zp2mwJn2NYB7AZ7+imp0azDZb+8YG2aUCiyqb6PnnA== +-----END ENCRYPTED PRIVATE KEY-----" +} +``` + +## Managing API access and permissions + +In addition to accessing the Amazon MSK cluster, your function needs permissions to perform various Amazon MSK API actions\. You add these permissions to the function's execution role\. If your users need access to any of the Amazon MSK API actions, add the required permissions to the identity policy for the IAM user or role\. + +### Required Lambda function execution role permissions + +Your Lambda function's [execution role](lambda-intro-execution-role.md) must have the following permissions to access the MSK cluster on your behalf\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: ++ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) ++ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) + +### Adding permissions to your execution role Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. @@ -120,9 +223,9 @@ Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to 1. On the **Attach policy** page, select your execution role from the list, and then choose **Attach policy**\. -### Granting users access with an IAM policy +### Granting users access with an IAM policy -By default, IAM users and roles do not have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon MSK Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. +By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you can add or update an identity\-based policy\. For more information, see [Amazon MSK Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ### Using SASL/SCRAM authentication @@ -130,43 +233,63 @@ Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Re Note that Amazon MSK does not support SASL/PLAIN authentication\. -### Authentication and authorization Errors +## Authentication and authorization errors -If any of the required permissions to consume data from the Amazon MSK cluster are missing, Lambda displays an error message in the event source mapping under **LastProcessingResult**\. +If any of the permissions required to consume data from the Amazon MSK cluster are missing, Lambda displays one of the following error messages in the event source mapping under **LastProcessingResult**\. -The following error message results from authorization errors\. +**Topics** ++ [Cluster failed to authorize Lambda](#msk-authorize-errors) ++ [SASL authentication failed](#msk-sasl-errors) ++ [Server failed to authenticate Lambda](#msk-mtls-errors) ++ [Provided certificate or private key is invalid](#msk-key-errors) + +### Cluster failed to authorize Lambda -**Example Cluster failed to authorize Lambda** -For SASL/SCRAM, the provided user does not have all of the required Kafka ACL permissions: +For SASL/SCRAM or mTLS, this error indicates that the provided user doesn't have all of the following required Kafka access control list \(ACL\) permissions: + DescribeConfigs Cluster + Describe Group + Read Group + Describe Topic + Read Topic -For IAM access control, the execution role is missing one or more of the permissions required to access the group or topic\. To add the missing permissions to the role, see the example in [Additional function permissions for IAM authorization](#msk-permissions-iam-auth) -When you create either Kafka ACLs or an IAM policy with the required kafka\-cluster permissions listed previously, you must specify the topic and group as resources\. The topic name must match the topic in the event source mapping and the group name must match the event source mapping’s UUID\. -After you add the required permissions to the execution role, there might be a delay of several minutes before the changes take effect\. -The following error message results from authentication failures\. +For IAM access control, your function's execution role is missing one or more of the permissions required to access the group or topic\. Review the list of required permissions in [ IAM role\-based authentication](#msk-permissions-iam-policy)\. + +When you create either Kafka ACLs or an IAM policy with the required Kafka cluster permissions, specify the topic and group as resources\. The topic name must match the topic in the event source mapping\. The group name must match the event source mapping's UUID\. + +After you add the required permissions to the execution role, it might take several minutes for the changes to take effect\. + +### SASL authentication failed -**Example SASL authentication failed** -For SASL/SCRAM, this failure indicates that the provided username and password are invalid\. -For IAM access control, the execution role is missing `kafka-cluster:Connect` permissions for the cluster\. Add this permission to the role and specify the cluster ARN as a resource\. -You might see this error intermittently if the cluster rejects connections because it reached the TCP connection limit set by [Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/limits.html)\. Lambda backs off and retries until a connection is successful\. The last processing result will eventually change to “OK” after Lambda successfully connects to and polls from the cluster\. +For SASL/SCRAM, this error indicates that the provided user name and password aren't valid\. + +For IAM access control, the execution role is missing the `kafka-cluster:Connect` permission for the MSK cluster\. Add this permission to the role and specify the cluster's Amazon Resource Name \(ARN\) as a resource\. + +You might see this error occurring intermittently\. The cluster rejects connections after the number of TCP connections exceeds the [Amazon MSK service quota](https://docs.aws.amazon.com/msk/latest/developerguide/limits.html)\. Lambda backs off and retries until a connection is successful\. After Lambda connects to the cluster and polls for records, the last processing result changes to `OK`\. + +### Server failed to authenticate Lambda + +This error indicates that the Amazon MSK Kafka brokers failed to authenticate with Lambda\. This can occur for any of the following reasons: ++ You didn't provide a client certificate for mTLS authentication\. ++ You provided a client certificate, but the brokers aren't configured to use mTLS\. ++ A client certificate isn't trusted by the brokers\. + +### Provided certificate or private key is invalid + +This error indicates that the Amazon MSK consumer couldn't use the provided certificate or private key\. Make sure that the certificate and key use PEM format, and that the private key encryption uses a PBES1 algorithm\. ## Network configuration Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Amazon MSK cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. -Alternatively, ensure that the VPC associated with your Amazon MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +Alternatively, ensure that the VPC associated with your MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -You must configure your Amazon VPC security groups with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on the MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. -+ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. -+ if you are using VPC endpoints instead of NAT Gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. +Configure your Amazon VPC security groups with the following rules \(at minimum\): ++ Inbound rules – Allow all traffic on the Amazon MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. ++ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the Amazon MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. ++ If you are using VPC endpoints instead of a NAT gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. **Note** -Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and does not need to be configured during setup using the create\-event\-source\-mapping command\. +Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html)\. You don't need to configure it during setup using the create\-event\-source\-mapping command\. For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. @@ -178,7 +301,7 @@ This section describes how to create an event source mapping using the Lambda co ### Prerequisites + An Amazon MSK cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your Amazon MSK cluster uses\. ++ An [execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. ### Adding an Amazon MSK trigger \(console\) @@ -204,7 +327,7 @@ Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. - 1. \(Optional\) For **Secret key**, choose the secret key for SASL/SCRAM authentication of the brokers in your Amazon MSK cluster\. If you are using IAM access control, do not choose a secret key\. + 1. \(Optional\) For **Authentication**, choose the secret key for authenticating with the brokers in your MSK cluster\. 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. @@ -239,16 +362,22 @@ aws lambda get-event-source-mapping \ ## Auto scaling of the Amazon MSK event source -When you initially create an Amazon MSK event source, Lambda allocates one consumer to process all of the partitions in the Kafka topic\. Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. +When you initially create an Amazon MSK event source, Lambda allocates one consumer to process all partitions in the Kafka topic\. Each consumer has multiple processors running in parallel to handle increased workloads\. Additionally, Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. -Every 15 minutes, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. +In one\-minute intervals, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. The scaling process of adding or removing consumers occurs within three minutes of evaluation\. If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. -To monitor the throughput of your Kafka topic, you can view the [Amazon MSK consumer\-lag metrics](https://docs.aws.amazon.com/msk/latest/developerguide/consumer-lag.html)\. To help you find the metrics for this Lambda function, the value of the consumer group field in the logs is set to the event source UUID\. +To monitor the throughput of your Kafka topic, view the [Offset lag metric](#services-msk-metrics) Lambda emits while your function processes records\. To check how many function invocations occur in parallel, you can also monitor the [concurrency metrics](monitoring-metrics.md#monitoring-metrics-concurrency) for your function\. +## Amazon CloudWatch metrics + +Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic, and the last record that Lambda processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your function processes it\. + +An increasing trend in `OffsetLag` can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. + ## Amazon MSK configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon MSK\. diff --git a/doc_source/with-on-demand-custom-android.md b/doc_source/with-on-demand-custom-android.md old mode 100644 new mode 100755 diff --git a/doc_source/with-s3-example-use-app-spec.md b/doc_source/with-s3-example-use-app-spec.md old mode 100644 new mode 100755 index 84dc7760..1195cf42 --- a/doc_source/with-s3-example-use-app-spec.md +++ b/doc_source/with-s3-example-use-app-spec.md @@ -1,6 +1,6 @@ # AWS SAM template for an Amazon S3 application -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. +You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. Below is a sample AWS SAM template for the Lambda application from the [tutorial](with-s3-example.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md old mode 100644 new mode 100755 index b49efe60..6eb4fcf1 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -46,7 +46,7 @@ Use a [function blueprint](gettingstarted-features.md#gettingstarted-features-bl **To create a Lambda function from a blueprint in the console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -238,14 +238,14 @@ Invoke your function when you upload a file to the Amazon S3 source bucket\. 1. On the **Upload** page, upload a few \.jpg or \.png image files to the bucket\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the name of your function \(**my\-s3\-function**\)\. 1. To verify that the function ran once for each file that you uploaded, choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. The count in the **Invocations** graph should match the number of files that you uploaded to the Amazon S3 bucket\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. + For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. 1. \(Optional\) To view the logs in the CloudWatch console, choose **View logs in CloudWatch**\. Choose a log stream to view the logs output for one of the function invocations\. diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md old mode 100644 new mode 100755 index 91b550fc..42c9c8bc --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -3,7 +3,7 @@ In this tutorial, you create a Lambda function and configure a trigger for Amazon Simple Storage Service \(Amazon S3\)\. Amazon S3 invokes the `CreateThumbnail` function for each image file that is uploaded to an S3 bucket\. The function reads the image object from the source S3 bucket and creates a thumbnail image to save in a target S3 bucket\. **Note** -This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We recommend that you first try [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md)\. +This tutorial requires a moderate level of AWS and Lambda domain knowledge, Docker operations, and [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. We recommend that you first try [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md)\. In this tutorial, you use the AWS Command Line Interface \(AWS CLI\) to create the following AWS resources: @@ -488,7 +488,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -502,7 +502,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `lambda_function.lambda_handler`\. This handler name reflects the function name as `lambda_handler`, and the name of the file where the handler code is stored as `lambda_function.py`\. For more information, see [Lambda function handler in Python](python-handler.md)\. The command specifies a runtime of `python3.8`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -516,7 +516,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `example.handler`\. The function can use the abbreviated handler format of `package.Class` because the function implements a handler interface\. For more information, see [AWS Lambda function handler in Java](java-handler.md)\. The command specifies a runtime of `java11`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -586,7 +586,7 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. --payload file://inputFile.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify that the thumbnail is created in the target S3 bucket\. diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md old mode 100644 new mode 100755 index 29b23cba..0900fa4b --- a/doc_source/with-s3.md +++ b/doc_source/with-s3.md @@ -32,7 +32,7 @@ Amazon S3 invokes your function [asynchronously](invocation-async.md) with an ev "s3SchemaVersion": "1.0", "configurationId": "828aa6fc-f7b5-4305-8584-487c791949c1", "bucket": { - "name": "lambda-artifacts-deafc19498e3f2df", + "name": "DOC-EXAMPLE-BUCKET", "ownerIdentity": { "principalId": "A3I5XTEXAMAI3E" }, diff --git a/doc_source/with-scheduledevents-example-use-app-spec.md b/doc_source/with-scheduledevents-example-use-app-spec.md deleted file mode 100644 index 4cb7c422..00000000 --- a/doc_source/with-scheduledevents-example-use-app-spec.md +++ /dev/null @@ -1,52 +0,0 @@ -# AWS SAM template for a EventBridge \(CloudWatch Events\) application - -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. - -Below is a sample AWS SAM template for the Lambda application from the [tutorial](services-cloudwatchevents-tutorial.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. - -**Example template\.yaml** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Parameters: - NotificationEmail: - Type: String -Resources: - CheckWebsitePeriodically: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: LambdaFunctionOverHttps.handler - Runtime: runtime - Policies: AmazonDynamoDBFullAccess - Events: - CheckWebsiteScheduledEvent: - Type: Schedule - Properties: - Schedule: rate(1 minute) - - AlarmTopic: - Type: AWS::SNS::Topic - Properties: - Subscription: - - Protocol: email - Endpoint: !Ref NotificationEmail - - Alarm: - Type: AWS::CloudWatch::Alarm - Properties: - AlarmActions: - - !Ref AlarmTopic - ComparisonOperator: GreaterThanOrEqualToThreshold - Dimensions: - - Name: FunctionName - Value: !Ref CheckWebsitePeriodically - EvaluationPeriods: 1 - MetricName: Errors - Namespace: AWS/Lambda - Period: 60 - Statistic: Sum - Threshold: '1' -``` - -For information on how to package and deploy your serverless application using the package and deploy commands, see [Deploying serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/with-secrets-manager.md b/doc_source/with-secrets-manager.md old mode 100644 new mode 100755 diff --git a/doc_source/with-sns-create-package.md b/doc_source/with-sns-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md old mode 100644 new mode 100755 index b005ec46..e5f82e7b --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -24,19 +24,19 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 In the tutorial, you use two accounts\. The AWS CLI commands illustrate this by using two [named profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html), each configured for use with a different account\. If you use profiles with different names, or the default profile and one named profile, modify the commands as needed\. -## Create an Amazon SNS topic +## Create an Amazon SNS topic \(account A\) -From account A \(01234567891A\), create the source Amazon SNS topic\. +In **Account A**, create the source Amazon SNS topic\. ``` aws sns create-topic --name sns-topic-for-lambda --profile accountA ``` -Note the topic ARN that is returned by the command\. You will need it when you add permissions to the Lambda function to subscribe to the topic\. +After creating the topic, record its Amazon Resource Name \(ARN\)\. You need it later when you add permissions to the Lambda function to subscribe to the topic\. -## Create the execution role +## Create the execution role \(account B\) -From account B \(01234567891B\), create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. +In **Account B**, create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. **To create an execution role** @@ -51,9 +51,9 @@ From account B \(01234567891B\), create the [execution role](lambda-intro-execut The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. -## Create a Lambda function +## Create a Lambda function \(account B\) -From account B \(01234567891B\), create the function that processes events from Amazon SNS\. The following example code receives an Amazon SNS event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. +In **Account B**, create the function that processes events from Amazon SNS\. The following example code receives an Amazon SNS event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. **Note** For sample code in other languages, see [Sample function code](with-sns-create-package.md)\. @@ -87,27 +87,27 @@ exports.handler = function(event, context, callback) { ``` aws lambda create-function --function-name Function-With-SNS \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam::01234567891B:role/service-role/lambda-sns-execution-role \ + --role arn:aws:iam:::role/service-role/lambda-sns-execution-role \ --timeout 60 --profile accountB ``` -Note the function ARN that is returned by the command\. You will need it when you add permissions to allow Amazon SNS to invoke your function\. +After creating the function, record its function ARN\. You need it later when you add permissions to allow Amazon SNS to invoke your function\. -## Set up cross\-account permissions +## Set up cross\-account permissions \(account A and B\) -From account A \(01234567891A\), grant permission to account B \(01234567891B\) to subscribe to the topic: +In **Account A**, grant permission to **Account B** to subscribe to the topic: ``` -aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +aws sns add-permission --label lambda-access --aws-account-id \ +--topic-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ --action-name Subscribe ListSubscriptionsByTopic --profile accountA ``` -From account B \(01234567891B\), add the Lambda permission to allow invocation from Amazon SNS\. +In **Account B**, add the Lambda permission to allow invocation from Amazon SNS\. ``` aws lambda add-permission --function-name Function-With-SNS \ ---source-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +--source-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ --statement-id function-with-sns --action "lambda:InvokeFunction" \ --principal sns.amazonaws.com --profile accountB ``` @@ -117,9 +117,9 @@ You should see the following output: ``` { "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": - \"arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda\"}}, + \"arn:aws:sns:us-east-2::sns-topic-for-lambda\"}}, \"Action\":[\"lambda:InvokeFunction\"], - \"Resource\":\"arn:aws:lambda:us-east-2:01234567891B:function:Function-With-SNS\", + \"Resource\":\"arn:aws:lambda:us-east-2::function:Function-With-SNS\", \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, \"Sid\":\"function-with-sns1\"}" } @@ -130,14 +130,14 @@ Do not use the `--source-account` parameter to add a source account to the Lambd **Note** If the account with the SNS topic is hosted in an opt\-in region, you need to specify the region in the principal\. For an example, see [Invoking Lambda functions using Amazon SNS notifications](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) in the *Amazon Simple Notification Service Developer Guide*\. -## Create a subscription +## Create a subscription \(account B\) -From account B, subscribe the Lambda function to the topic\. When a message is sent to the `sns-topic-for-lambda` topic in account A \(01234567891A\), Amazon SNS invokes the `Function-With-SNS` function in account B \(01234567891B\)\. +In **Account B**, subscribe the Lambda function to the topic\. When a message is sent to the `sns-topic-for-lambda` topic in **Account A**, Amazon SNS invokes the `Function-With-SNS` function in **Account B**\. ``` aws sns subscribe --protocol lambda \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ ---notification-endpoint arn:aws:lambda:us-east-2:12345678901B:function:Function-With-SNS \ +--topic-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ +--notification-endpoint arn:aws:lambda:us-east-2::function:Function-With-SNS \ --profile accountB ``` @@ -145,19 +145,19 @@ You should see the following output: ``` { - "SubscriptionArn": "arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" + "SubscriptionArn": "arn:aws:sns:us-east-2::sns-topic-for-lambda:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" } ``` The output contains the ARN of the topic subscription\. -## Test subscription +## Test subscription \(account A\) -From account A \(01234567891A\), test the subscription\. Type `Hello World` into a text file and save it as `message.txt`\. Then run the following command: +In **Account A**, test the subscription\. Type `Hello World` into a text file and save it as `message.txt`\. Then run the following command: ``` aws sns publish --message file://message.txt --subject Test \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +--topic-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ --profile accountA ``` @@ -169,6 +169,8 @@ To learn more about Amazon SNS, see [What is Amazon Simple Notification Service] You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. +In **Account A**, clean up your Amazon SNS topic\. + **To delete the Amazon SNS topic** 1. Open the [Topics page](https://console.aws.amazon.com/sns/home#topics:) of the Amazon SNS console\. @@ -181,6 +183,8 @@ You can now delete the resources that you created for this tutorial, unless you 1. Choose **Delete**\. +In **Account B**, clean up your execution role, Lambda function, and Amazon SNS subscription\. + **To delete the execution role** 1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md old mode 100644 new mode 100755 diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-sqs-cross-account-example.md b/doc_source/with-sqs-cross-account-example.md old mode 100644 new mode 100755 index f1112160..758947c6 --- a/doc_source/with-sqs-cross-account-example.md +++ b/doc_source/with-sqs-cross-account-example.md @@ -118,7 +118,7 @@ If the handler returns normally without exceptions, Lambda considers the message --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify the output in the file `outputfile.txt`\. diff --git a/doc_source/with-sqs-example-use-app-spec.md b/doc_source/with-sqs-example-use-app-spec.md old mode 100644 new mode 100755 index 1749c182..93a3b751 --- a/doc_source/with-sqs-example-use-app-spec.md +++ b/doc_source/with-sqs-example-use-app-spec.md @@ -1,6 +1,6 @@ # AWS SAM template for an Amazon SQS application -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. +You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. Below is a sample AWS SAM template for the Lambda application from the [tutorial](with-sqs-example.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md old mode 100644 new mode 100755 index 1ef0ff70..e610dccd --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -118,7 +118,7 @@ If the handler returns normally without exceptions, Lambda considers the message --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify the output in the file `outputfile.txt`\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md old mode 100644 new mode 100755 index 50c5db97..31304416 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -1,6 +1,6 @@ -# Using AWS Lambda with Amazon SQS +# Using Lambda with Amazon SQS -You can use an AWS Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. +You can use a Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. Lambda polls the queue and invokes your Lambda function [synchronously](invocation-sync.md) with an event that contains queue messages\. Lambda reads messages in batches and invokes your function once for each batch\. When your function successfully processes a batch, Lambda deletes its messages from the queue\. The following example shows an event for a batch of two messages\. @@ -45,7 +45,7 @@ Lambda polls the queue and invokes your Lambda function [synchronously](invocati } ``` -By default, Lambda polls up to 10 messages in your queue at once and sends that batch to your function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. +By default, Lambda polls up to 10 messages in your queue at once and sends that batch to your function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until the batch window expires, the [invocation payload size quota](gettingstarted-limits.md) is reached, or the configured maximum batch size is reached\. **Note** If you're using a batch window and your SQS queue contains very low traffic, Lambda might wait for up to 20 seconds before invoking your function\. This is true even if you set a batch window lower than 20 seconds\. @@ -80,7 +80,7 @@ For FIFO queues, records contain additional attributes that are related to dedup } ``` -When Lambda reads a batch, the messages stay in the queue but become hidden for the length of the queue's [visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)\. If your function successfully processes the batch, Lambda deletes the messages from the queue\. If your function is [throttled](invocation-scaling.md), returns an error, or doesn't respond, the message becomes visible again\. All messages in a failed batch return to the queue, so your function code must be able to process the same message multiple times without side effects\. +When Lambda reads a batch, the messages stay in the queue but are hidden for the length of the queue's [visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)\. If your function successfully processes the batch, Lambda deletes the messages from the queue\. By default, if your function encounters an error while processing a batch, all messages in that batch become visible in the queue again\. For this reason, your function code must be able to process the same message multiple times without unintended side effects\. You can modify this reprocessing behavior by including batch item failures in your function response\. **Topics** + [Scaling and processing](#events-sqs-scaling) @@ -88,6 +88,7 @@ When Lambda reads a batch, the messages stay in the queue but become hidden for + [Execution role permissions](#events-sqs-permissions) + [Configuring a queue as an event source](#events-sqs-eventsource) + [Event source mapping APIs](#services-dynamodb-api) ++ [Reporting batch item failures](#services-sqs-batchfailurereporting) + [Amazon SQS configuration parameters](#services-sqs-params) + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + [Tutorial: Using a cross\-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) @@ -96,19 +97,19 @@ When Lambda reads a batch, the messages stay in the queue but become hidden for ## Scaling and processing -For standard queues, Lambda uses [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html) to poll a queue until it becomes active\. When messages are available, Lambda reads up to 5 batches and sends them to your function\. If messages are still available, Lambda increases the number of processes that are reading batches by up to 60 more instances per minute\. The maximum number of batches that can be processed simultaneously by an event source mapping is 1000\. +For standard queues, Lambda uses [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html) to poll a queue until it becomes active\. When messages are available, Lambda reads up to five batches and sends them to your function\. If messages are still available, Lambda increases the number of processes that are reading batches by up to 60 more instances per minute\. The maximum number of batches that an event source mapping can process simultaneously is 1,000\. -For FIFO queues, Lambda sends messages to your function in the order that it receives them\. When you send a message to a FIFO queue, you specify a [message group ID](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html)\. Amazon SQS ensures that messages in the same group are delivered to Lambda in order\. Lambda sorts the messages into groups and sends only one batch at a time for a group\. If the function returns an error, all retries are attempted on the affected messages before Lambda receives additional messages from the same group\. +For FIFO queues, Lambda sends messages to your function in the order that it receives them\. When you send a message to a FIFO queue, you specify a [message group ID](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html)\. Amazon SQS ensures that messages in the same group are delivered to Lambda in order\. Lambda sorts the messages into groups and sends only one batch at a time for a group\. If your function returns an error, the function attempts all retries on the affected messages before Lambda receives additional messages from the same group\. -Your function can scale in concurrency to the number of active message groups\. For more information, see [SQS FIFO as an event source](https://aws.amazon.com/blogs/compute/new-for-aws-lambda-sqs-fifo-as-an-event-source/) on the AWS Compute Blog\. +Your function can scale in concurrency to the number of active message groups\. For more information, see [SQS FIFO as an event source](http://aws.amazon.com/blogs/compute/new-for-aws-lambda-sqs-fifo-as-an-event-source/) on the AWS Compute Blog\. ## Configuring a queue to use with Lambda -[Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. +[Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-create-queue.html) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. -To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [ timeout](https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/timeout.html) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. +To allow your function time to process each batch of records, set the source queue's visibility timeout to at least six times the [timeout that you configure](configuration-function-common.md#configuration-common-summary) on your function\. The extra time allows for Lambda to retry if your function is throttled while processing a previous batch\. -If a message fails to be processed multiple times, Amazon SQS can send it to a [dead\-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\. When your function returns an error, Lambda leaves it in the queue\. After the visibility timeout occurs, Lambda receives the message again\. To send messages to a second queue after a number of receives, configure a dead\-letter queue on your source queue\. +If your function fails to process a message multiple times, Amazon SQS can send it to a [dead\-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\. When your function returns an error, Lambda leaves it in the queue\. After the visibility timeout occurs, Lambda receives the message again\. To send messages to a second queue after a number of receives, configure a dead\-letter queue on your source queue\. **Note** Make sure that you configure the dead\-letter queue on the source queue, not on the Lambda function\. The dead\-letter queue that you configure on a function is used for the function's [asynchronous invocation queue](invocation-async.md), not for event source queues\. @@ -117,13 +118,11 @@ If your function returns an error, or can't be invoked because it's at maximum c ## Execution role permissions -Lambda needs the following permissions to manage messages in your Amazon SQS queue\. Add them to your function's execution role\. +Lambda needs the following permissions to manage messages in your Amazon SQS queue\. Add them to your function's [execution role](lambda-intro-execution-role.md)\. + [sqs:ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) + [sqs:DeleteMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessage.html) + [sqs:GetQueueAttributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueAttributes.html) -For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. - ## Configuring a queue as an event source Create an event source mapping to tell Lambda to send items from your queue to a Lambda function\. You can create multiple event source mappings to process items from multiple queues with a single function\. When Lambda invokes the target function, the event can contain multiple items, up to a configurable maximum *batch size*\. @@ -132,42 +131,42 @@ To configure your function to read from Amazon SQS in the Lambda console, create **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. 1. Under **Function overview**, choose **Add trigger**\. -1. Choose a trigger type\. +1. Choose the **SQS** trigger type\. -1. Configure the required options and then choose **Add**\. +1. Configure the required options, and then choose **Add**\. Lambda supports the following options for Amazon SQS event sources\. **Event source options** + **SQS queue** – The Amazon SQS queue to read records from\. -+ **Batch size** – The number of records to send to the function in each batch\. For a standard queue this can be up to 10,000 records\. For a FIFO queue the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. ++ **Batch size** – The number of records to send to the function in each batch\. For a standard queue, this can be up to 10,000 records\. For a FIFO queue, the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [invocation payload size quota](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. - Metadata is generated by both Lambda and Amazon SQS for each record\. This additional metadata is counted towards the total payload size and may cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields sent by Amazon SQS can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) documentation in the *Amazon Simple Queue Service API Reference*\. -+ **Batch window ** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. Only applicable to standard queues\. + Both Lambda and Amazon SQS generate metadata for each record\. This additional metadata is counted towards the total payload size and can cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields that Amazon SQS sends can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) API operation documentation in the *Amazon Simple Queue Service API Reference*\. ++ **Batch window ** – The maximum amount of time to gather records before invoking the function, in seconds\. This applies only to standard queues\. - If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. We recommend setting your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. + If you're using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. We recommend setting your queue visibility timeout to six times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. **Note** -If your batch window is greater than 0, and `(batch window) + (function timeout) > (queue visibility timeout)`, your effective queue visibility timeout will be `(batch window) + (function timeout) + 30s`\. +If your batch window is greater than 0, and `(batch window) + (function timeout) > (queue visibility timeout)`, then your effective queue visibility timeout is `(batch window) + (function timeout) + 30s`\. - Lambda processes up to 5 batches at a time\. This means there are a maximum of 5 workers available to batch and process messages in parallel at any one time\. Each worker will show a distinct Lambda invocation for its current batch of messages\. -+ **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. + Lambda processes up to five batches at a time\. This means that there are a maximum of five workers available to batch and process messages in parallel at any one time\. Each worker shows a distinct Lambda invocation for its current batch of messages\. ++ **Enabled** – The status of the event source mapping\. Set to true to enable the event source mapping\. Set to false to stop processing records\. **Note** -Amazon SQS has a perpetual free tier for requests\. Beyond the free tier, Amazon SQS charges per million requests\. While your event source mapping is active, Lambda makes requests to the queue to get items\. For pricing details, see [Amazon Simple Queue Service pricing](https://aws.amazon.com/sqs/pricing)\. +Amazon SQS has a perpetual free tier for requests\. Beyond the free tier, Amazon SQS charges per million requests\. While your event source mapping is active, Lambda makes requests to the queue to get items\. For pricing details, see [Amazon SQS pricing](http://aws.amazon.com/sqs/pricing)\. -To manage the event source configuration later, choose the trigger in the designer\. +To manage the event source configuration later, in the Lambda console, choose the **SQS** trigger in the designer\. -Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of 5 concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. To eliminate the chance of throttling errors, set the [reserved concurrency](configuration-concurrency.md) value to 1000, which is the maximum number of concurrent executions for an Amazon SQS event source\. +Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of five concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. To eliminate the chance of throttling errors, set the reserved concurrency value to 1,000, which is the maximum number of concurrent executions for an Amazon SQS event source\. ## Event source mapping APIs -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -197,6 +196,86 @@ You should see the following output: } ``` +## Reporting batch item failures + +When your Lambda function encounters an error while processing a batch, all messages in that batch become visible in the queue again by default, including messages that Lambda processed successfully\. As a result, your function can end up processing the same message several times\. + +To avoid reprocessing all messages in a failed batch, you can configure your event source mapping to make only the failed messages visible again\. To do this, when configuring your event source mapping, include the value `ReportBatchItemFailures` in the `FunctionResponseTypes` list\. This lets your function return a partial success, which can help reduce the number of unnecessary retries on records\. + +### Report syntax + +After you include `ReportBatchItemFailures` in your event source mapping configuration, you can return a list of the failed message IDs in your function response\. For example, suppose you have a batch of five messages, with message IDs `id1`, `id2`, `id3`, `id4`, and `id5`\. Your function successfully processes `id1`, `id3`, and `id5`\. To make messages `id2` and `id4` visible again in your queue, your response syntax should look like the following: + +``` +{ + "batchItemFailures": [ + { + "itemIdentifier": "id2" + }, + { + "itemIdentifier": "id4" + } + ] +} +``` + +To return the list of failed message IDs in the batch, you can use a `SQSBatchResponse` class object or create your own custom class\. Here is an example of a response that uses the `SQSBatchResponse` object\. + +``` +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.events.SQSEvent; +import com.amazonaws.services.lambda.runtime.events.SQSBatchResponse; + +import java.util.ArrayList; +import java.util.List; + +public class ProcessSQSMessageBatch implements RequestHandler { + @Override + public SQSBatchResponse handleRequest(SQSEvent sqsEvent, Context context) { + + List batchItemFailures = new ArrayList(); + String messageId = ""; + for (SQSEvent.SQSMessage message : sqsEvent.getRecords()) { + try { + //process your message + messageId = message.getMessageId(); + } catch (Exception e) { + //Add failed message identifier to the batchItemFailures list + batchItemFailures.add(new SQSBatchResponse.BatchItemFailure(messageId)); + } + } + return new SQSBatchResponse(batchItemFailures); + } +} +``` + +To use this feature, your function must gracefully handle errors\. Have your function logic catch all exceptions and report the messages that result in failure in `batchItemFailures` in your function response\. If your function throws an exception, the entire batch is considered a complete failure\. + +**Note** +If you're using this feature with a FIFO queue, your function should stop processing messages after the first failure and return all failed and unprocessed messages in `batchItemFailures`\. This helps preserve the ordering of messages in your queue\. + +### Success and failure conditions + +Lambda treats a batch as a complete success if your function returns any of the following: ++ An empty `batchItemFailures` list ++ A null `batchItemFailures` list ++ An empty `EventResponse` ++ A null `EventResponse` + +Lambda treats a batch as a complete failure if your function returns any of the following: ++ An invalid JSON response ++ An empty string `itemIdentifier` ++ A null `itemIdentifier` ++ An `itemIdentifier` with a bad key name ++ An `itemIdentifier` value with a message ID that doesn't exist + +### CloudWatch metrics + +To determine whether your function is correctly reporting batch item failures, you can monitor the `NumberOfMessagesDeleted` and `ApproximateAgeOfOldestMessage` Amazon SQS metrics in Amazon CloudWatch\. ++ `NumberOfMessagesDeleted` tracks the number of messages removed from your queue\. If this drops to 0, this is a sign that your function response is not correctly returning failed messages\. ++ `ApproximateAgeOfOldestMessage` tracks how long the oldest message has stayed in your queue\. A sharp increase in this metric can indicate that your function is not correctly returning failed messages\. + ## Amazon SQS configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon SQS\. @@ -206,8 +285,9 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10000 | +| BatchSize | N | 10 | For standard queues, the maximum is 10,000\. For FIFO queues, the maximum is 10\. | | Enabled | N | true | | -| EventSourceArn | Y | | ARN of the data stream or a stream consumer | +| EventSourceArn | Y | | The ARN of the data stream or a stream consumer | | FunctionName | Y | | | +| FunctionResponseTypes | N | | To let your function report specific failures in a batch, include the value `ReportBatchItemFailures` in `FunctionResponseTypes`\. For more information, see [Reporting batch item failures](#services-sqs-batchfailurereporting)\. | | MaximumBatchingWindowInSeconds | N | 0 | | \ No newline at end of file