id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
|---|---|---|
2914dd8aec2c-0
|
Lambda layers are a distribution mechanism for libraries, custom runtimes, and other function dependencies\. Layers let you 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 provided by AWS, or layers from other AWS customers\.
For more information, see [AWS Lambda layers](configuration-layers.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-features.md
|
15487f58f87c-0
|
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)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-features.md
|
deb867bccd22-0
|
Use concurrency settings to ensure that your production applications are highly available and highly responsive\. To prevent a function from using too much concurrency, and to reserve a portion of your account's available concurrency for a function, use *reserved concurrency*\. Reserved concurrency splits the pool of available concurrency into subsets\. A function with reserved concurrency only uses concurrency from its dedicated pool\.
![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency-reserved.png)
To enable functions to scale without fluctuations in latency, use *provisioned concurrency*\. For functions that take a long time to initialize, or require extremely low latency for all invocations, provisioned concurrency enables you to pre\-initialize instances of your function and keep them running at all times\. Lambda integrates with Application Auto Scaling to support autoscaling for provisioned concurrency based on utilization\.
![\[\]](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)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-features.md
|
ceac8440446d-0
|
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, Lambda queues the event for processing and returns a response immediately\.
![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-async.png)
For asynchronous invocations, Lambda handles retries if the function returns an error or is throttled\. To customize this behavior, you can configure error handling settings on a function, version, or alias\. You can also configure Lambda to send events that failed processing to a dead\-letter queue, or to send a record of any invocation to a [destination](#gettingstarted-features-destinations)\.
For more information, see [Asynchronous invocation](invocation-async.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-features.md
|
fb1b0b0dd357-0
|
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\.
![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-eventsourcemapping.png)
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](#gettingstarted-features-destinations)\.
For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-features.md
|
1d39f77a7d04-0
|
A destination is an AWS resource that receives invocation records for a function\. For [asynchronous invocation](#gettingstarted-features-async), you can configure Lambda to send invocation records to a queue, topic, function, or event bus\. You can configure separate destinations for successful invocations and events that failed processing\. The invocation record contains details about the event, the function's response, and the reason that the record was sent\.
![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-destinations.png)
For [event source mappings](#gettingstarted-features-eventsourcemapping) that read from streams, you can configure Lambda to send a record of batches that failed processing to a queue or topic\. A failure record for an event source mapping contains metadata about the batch, and it points to the items in the stream\.
For more information, see [Configuring destinations for asynchronous invocation](invocation-async.md#invocation-async-destinations) and the error handling sections of [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) and [Using AWS Lambda with Amazon Kinesis](with-kinesis.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-features.md
|
d79df5fe8c67-0
|
When you create a function in the Lambda console, you can choose to start from scratch, use a blueprint, 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 only available in the Lambda console\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-features.md
|
3ae03c6748b4-0
|
You can use the Lambda console to create an application with a continuous delivery pipeline\. Application templates in the Lambda console include code for one or more functions, an application template that defines functions and supporting AWS resources, and an infrastructure template that defines an AWS CodePipeline pipeline\. The pipeline has build and deploy stages that run every time you push changes to the included Git repository\.
Application templates are provided for use under the [MIT No Attribution](https://spdx.org/licenses/MIT-0.html) license\. They are only available in the Lambda console\.
For more information, see [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-features.md
|
4f9375aada88-0
|
Sample code is available for the following languages\.
**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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
b63b37480391-0
|
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\.
**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(/\.([^.]*)$/);
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
b63b37480391-1
|
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;
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
b63b37480391-2
|
} 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);
};
```
The deployment package is a \.zip file containing your Lambda function code and dependencies\.
**To create a deployment package**
1. Create a folder \(`examplefolder`\), and then create a subfolder \(`node_modules`\)\.
1. Install dependencies\. The code examples use the following libraries:
+ AWS SDK for JavaScript in Node\.js
+ Sharp for node\.js
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
b63b37480391-3
|
+ AWS SDK for JavaScript in Node\.js
+ Sharp for node\.js
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\.
```
$ npm install sharp
```
For macOS, use the following command\.
```
$ npm install --arch=x64 --platform=linux --target=12.13.0 sharp
```
1. Save the sample code to a file named index\.js\.
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\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
b63b37480391-4
|
+ 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`\.
1. Save the file as `index.js` in `examplefolder`\. After you complete this step, you will have the following folder structure:
```
index.js
/node_modules/sharp
```
1. Zip the index\.js file and the node\_modules folder as `CreateThumbnail.zip`\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
4d72d7ec9ed2-0
|
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\.
**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;
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
4d72d7ec9ed2-1
|
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<S3Event, String> {
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";
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
4d72d7ec9ed2-2
|
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 "";
}
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
4d72d7ec9ed2-3
|
+ 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);
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
4d72d7ec9ed2-4
|
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)) {
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
4d72d7ec9ed2-5
|
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);
}
}
}
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
4d72d7ec9ed2-6
|
throw new RuntimeException(e);
}
}
}
```
Amazon S3 invokes your Lambda function using the `Event` invocation type, where AWS Lambda executes 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\.
**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 [AWS Lambda deployment package in Java](java-package.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
291bb6559458-0
|
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\.
**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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
291bb6559458-1
|
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)
```
**Note**
The image library used by this code must be installed in a Linux environment in order to create a working deployment package\.
**To create a deployment package**
1. Copy the sample code into a file named `lambda_function.py`\.
1. Create a virtual environment\.
```
s3-python$ virtualenv v-env
s3-python$ source v-env/bin/activate
```
1. Install libraries in the virtual environment
```
(v-env) s3-python$ pip install Pillow boto3
```
1. Create a deployment package with the contents of the installed libraries\.
```
(v-env) s3-python$ cd $VIRTUAL_ENV/lib/python3.8/site-packages
(v-env) python-s3/v-env/lib/python3.8/site-packages$ zip -r9 ${OLDPWD}/function.zip .
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
291bb6559458-2
|
```
1. Add the handler code to the deployment package and deactivate the virtual environment\.
```
(v-env) python-s3/v-env/lib/python3.8/site-packages$ cd ${OLDPWD}
(v-env) python-s3$ zip -g function.zip lambda_function.py
adding: lambda_function.py (deflated 55%)
(v-env) python-s3$ deactivate
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/with-s3-example-deployment-pkg.md
|
989fdfb1c86d-0
|
-----
*****Copyright © 2020 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.*****
-----
Amazon's trademarks and trade dress may not be used in
connection with any product or service that is not Amazon's,
in any manner that is likely to cause confusion among customers,
or in any manner that disparages or discredits Amazon. All other
trademarks not owned by Amazon are the property of their respective
owners, who may or may not be affiliated with, connected to, or
sponsored by Amazon.
-----
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-0
|
+ [What is AWS Lambda?](welcome.md)
+ [Getting started with AWS 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)
+ [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)
+ [AWS Lambda concepts](gettingstarted-concepts.md)
+ [AWS Lambda features](gettingstarted-features.md)
+ [Tools for working with AWS Lambda](gettingstarted-tools.md)
+ [AWS 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)
+ [Identity-based IAM policies for AWS 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)
+ [Configuring functions in the AWS Lambda console](configuration-console.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-1
|
+ [Configuring functions in the AWS Lambda console](configuration-console.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)
+ [AWS Lambda layers](configuration-layers.md)
+ [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)
+ [Configuring database access for a Lambda function](configuration-database.md)
+ [Configuring file system access for Lambda functions](configuration-filesystem.md)
+ [Tagging Lambda Functions](configuration-tags.md)
+ [Invoking AWS Lambda functions](lambda-invocation.md)
+ [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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-2
|
+ [Error handling and automatic retries in AWS Lambda](invocation-retries.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 runtimes](lambda-runtimes.md)
+ [AWS Lambda execution context](runtimes-context.md)
+ [Runtime support policy](runtime-support-policy.md)
+ [Custom AWS Lambda runtimes](runtimes-custom.md)
+ [AWS Lambda runtime interface](runtimes-api.md)
+ [Tutorial β Publishing a custom runtime](runtimes-walkthrough.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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-3
|
+ [Best practices for working with AWS Lambda functions](best-practices.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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-4
|
+ [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 AWS Lambda with Amazon 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 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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-5
|
+ [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 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 MSK](with-msk.md)
+ [Using AWS Lambda with Amazon RDS](services-rds.md)
+ [Using AWS Lambda with Amazon S3](with-s3.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-6
|
+ [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)
+ [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)
+ [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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-7
|
+ [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)
+ [AWS Lambda deployment package in Node.js](nodejs-package.md)
+ [AWS Lambda context object in Node.js](nodejs-context.md)
+ [AWS Lambda function logging in Node.js](nodejs-logging.md)
+ [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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-8
|
+ [Building Lambda functions with Python](lambda-python.md)
+ [AWS Lambda function handler in Python](python-handler.md)
+ [AWS Lambda deployment package in Python](python-package.md)
+ [AWS Lambda context object in Python](python-context.md)
+ [AWS Lambda function logging in Python](python-logging.md)
+ [AWS Lambda function errors in Python](python-exceptions.md)
+ [Instrumenting Python code in AWS Lambda](python-tracing.md)
+ [Building Lambda functions with Ruby](lambda-ruby.md)
+ [AWS Lambda function handler in Ruby](ruby-handler.md)
+ [AWS Lambda deployment package in Ruby](ruby-package.md)
+ [AWS Lambda context object in Ruby](ruby-context.md)
+ [AWS Lambda function logging in Ruby](ruby-logging.md)
+ [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 deployment package in Java](java-package.md)
+ [AWS Lambda function handler in Java](java-handler.md)
+ [AWS Lambda context object in Java](java-context.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-9
|
+ [AWS Lambda function handler in Java](java-handler.md)
+ [AWS Lambda context object in Java](java-context.md)
+ [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)
+ [Building Lambda functions with Go](lambda-golang.md)
+ [AWS Lambda deployment package in Go](golang-package.md)
+ [AWS Lambda function handler in Go](golang-handler.md)
+ [AWS Lambda context object in Go](golang-context.md)
+ [AWS Lambda function logging in Go](golang-logging.md)
+ [AWS Lambda function errors in Go](golang-exceptions.md)
+ [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 Deployment Package in C#](csharp-package.md)
+ [.NET Core CLI](csharp-package-cli.md)
+ [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-10
|
+ [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)
+ [AWS Lambda function handler in C#](csharp-handler.md)
+ [AWS Lambda context object in C#](csharp-context.md)
+ [AWS 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)
+ [Setting Up a PowerShell Development Environment](powershell-devenv.md)
+ [AWS Lambda deployment package in PowerShell](powershell-package.md)
+ [AWS Lambda function handler in PowerShell](powershell-handler.md)
+ [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)
+ [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md)
+ [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)
+ [Working with AWS Lambda function metrics](monitoring-metrics.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-11
|
+ [Working with AWS Lambda function metrics](monitoring-metrics.md)
+ [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)
+ [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)
+ [Compliance validation for AWS Lambda](security-compliance.md)
+ [Resilience in AWS Lambda](security-resilience.md)
+ [Infrastructure security in AWS Lambda](security-infrastructure.md)
+ [Configuration and vulnerability analysis in AWS Lambda](security-configuration.md)
+ [Troubleshooting issues in AWS Lambda](lambda-troubleshooting.md)
+ [Troubleshoot deployment issues in AWS Lambda](troubleshooting-deployment.md)
+ [Troubleshoot invocation issues in AWS Lambda](troubleshooting-invocation.md)
+ [Troubleshoot execution issues in AWS Lambda](troubleshooting-execution.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-12
|
+ [Troubleshoot execution issues in AWS Lambda](troubleshooting-execution.md)
+ [Troubleshoot networking issues in AWS Lambda](troubleshooting-networking.md)
+ [AWS Lambda releases](lambda-releases.md)
+ [API reference](API_Reference.md)
+ [Actions](API_Operations.md)
+ [AddLayerVersionPermission](API_AddLayerVersionPermission.md)
+ [AddPermission](API_AddPermission.md)
+ [CreateAlias](API_CreateAlias.md)
+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md)
+ [CreateFunction](API_CreateFunction.md)
+ [DeleteAlias](API_DeleteAlias.md)
+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md)
+ [DeleteFunction](API_DeleteFunction.md)
+ [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md)
+ [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md)
+ [DeleteLayerVersion](API_DeleteLayerVersion.md)
+ [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-13
|
+ [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md)
+ [GetAccountSettings](API_GetAccountSettings.md)
+ [GetAlias](API_GetAlias.md)
+ [GetEventSourceMapping](API_GetEventSourceMapping.md)
+ [GetFunction](API_GetFunction.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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-14
|
+ [InvokeAsync](API_InvokeAsync.md)
+ [ListAliases](API_ListAliases.md)
+ [ListEventSourceMappings](API_ListEventSourceMappings.md)
+ [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md)
+ [ListFunctions](API_ListFunctions.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)
+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md)
+ [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)
+ [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md)
+ [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-15
|
+ [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md)
+ [RemovePermission](API_RemovePermission.md)
+ [TagResource](API_TagResource.md)
+ [UntagResource](API_UntagResource.md)
+ [UpdateAlias](API_UpdateAlias.md)
+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md)
+ [UpdateFunctionCode](API_UpdateFunctionCode.md)
+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)
+ [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md)
+ [Data Types](API_Types.md)
+ [AccountLimit](API_AccountLimit.md)
+ [AccountUsage](API_AccountUsage.md)
+ [AliasConfiguration](API_AliasConfiguration.md)
+ [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md)
+ [Concurrency](API_Concurrency.md)
+ [DeadLetterConfig](API_DeadLetterConfig.md)
+ [DestinationConfig](API_DestinationConfig.md)
+ [Environment](API_Environment.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-16
|
+ [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)
+ [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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
7692e284bb30-17
|
+ [OnFailure](API_OnFailure.md)
+ [OnSuccess](API_OnSuccess.md)
+ [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md)
+ [TracingConfig](API_TracingConfig.md)
+ [TracingConfigResponse](API_TracingConfigResponse.md)
+ [VpcConfig](API_VpcConfig.md)
+ [VpcConfigResponse](API_VpcConfigResponse.md)
+ [AWS glossary](glossary.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/index.md
|
27df930b503d-0
|
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)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetLayerVersionPolicy.md
|
6987144cf177-0
|
```
GET /2018-10-31/layers/LayerName/versions/VersionNumber/policy HTTP/1.1
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetLayerVersionPolicy.md
|
2a1a8a7d7925-0
|
The request uses the following URI parameters\.
** [LayerName](#API_GetLayerVersionPolicy_RequestSyntax) ** <a name="SSS-GetLayerVersionPolicy-request-LayerName"></a>
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) ** <a name="SSS-GetLayerVersionPolicy-request-VersionNumber"></a>
The version number\.
Required: Yes
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetLayerVersionPolicy.md
|
d41a3b1b8ab5-0
|
The request does not have a request body\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetLayerVersionPolicy.md
|
d06cbe4241b4-0
|
```
HTTP/1.1 200
Content-type: application/json
{
"Policy": "string",
"RevisionId": "string"
}
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetLayerVersionPolicy.md
|
fee082a51b4c-0
|
If the action is successful, the service sends back an HTTP 200 response\.
The following data is returned in JSON format by the service\.
** [Policy](#API_GetLayerVersionPolicy_ResponseSyntax) ** <a name="SSS-GetLayerVersionPolicy-response-Policy"></a>
The policy document\.
Type: String
** [RevisionId](#API_GetLayerVersionPolicy_ResponseSyntax) ** <a name="SSS-GetLayerVersionPolicy-response-RevisionId"></a>
A unique identifier for the current revision of the policy\.
Type: String
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetLayerVersionPolicy.md
|
73e2b9b15a0c-0
|
**InvalidParameterValueException**
One of the parameters in the request is invalid\.
HTTP Status Code: 400
**ResourceNotFoundException**
The resource specified in the request does not exist\.
HTTP Status Code: 404
**ServiceException**
The AWS Lambda service encountered an internal error\.
HTTP Status Code: 500
**TooManyRequestsException**
The request throughput limit was exceeded\.
HTTP Status Code: 429
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetLayerVersionPolicy.md
|
d36bc7273f41-0
|
For more information about using this API in one of the language\-specific AWS SDKs, see the following:
+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/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](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetLayerVersionPolicy)
+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetLayerVersionPolicy.md
|
d36bc7273f41-1
|
+ [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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_GetLayerVersionPolicy.md
|
f05fa62a839f-0
|
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)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
1fe0afba4e11-0
|
```
POST /2018-10-31/layers/LayerName/versions HTTP/1.1
Content-type: application/json
{
"CompatibleRuntimes": [ "string" ],
"Content": {
"S3Bucket": "string",
"S3Key": "string",
"S3ObjectVersion": "string",
"ZipFile": blob
},
"Description": "string",
"LicenseInfo": "string"
}
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
cf25d062fdee-0
|
The request uses the following URI parameters\.
** [LayerName](#API_PublishLayerVersion_RequestSyntax) ** <a name="SSS-PublishLayerVersion-request-LayerName"></a>
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
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
acddfa1eb75d-0
|
The request accepts the following data in JSON format\.
** [CompatibleRuntimes](#API_PublishLayerVersion_RequestSyntax) ** <a name="SSS-PublishLayerVersion-request-CompatibleRuntimes"></a>
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 5 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`
Required: No
** [Content](#API_PublishLayerVersion_RequestSyntax) ** <a name="SSS-PublishLayerVersion-request-Content"></a>
The function layer archive\.
Type: [LayerVersionContentInput](API_LayerVersionContentInput.md) object
Required: Yes
** [Description](#API_PublishLayerVersion_RequestSyntax) ** <a name="SSS-PublishLayerVersion-request-Description"></a>
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
acddfa1eb75d-1
|
The description of the version\.
Type: String
Length Constraints: Minimum length of 0\. Maximum length of 256\.
Required: No
** [LicenseInfo](#API_PublishLayerVersion_RequestSyntax) ** <a name="SSS-PublishLayerVersion-request-LicenseInfo"></a>
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`\.
+ The full text of the license\.
Type: String
Length Constraints: Maximum length of 512\.
Required: No
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
2ea5efe23b0e-0
|
```
HTTP/1.1 201
Content-type: application/json
{
"CompatibleRuntimes": [ "string" ],
"Content": {
"CodeSha256": "string",
"CodeSize": number,
"Location": "string"
},
"CreatedDate": "string",
"Description": "string",
"LayerArn": "string",
"LayerVersionArn": "string",
"LicenseInfo": "string",
"Version": number
}
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
e10b004c2b6f-0
|
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) ** <a name="SSS-PublishLayerVersion-response-CompatibleRuntimes"></a>
The layer's compatible runtimes\.
Type: Array of strings
Array Members: Maximum number of 5 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`
** [Content](#API_PublishLayerVersion_ResponseSyntax) ** <a name="SSS-PublishLayerVersion-response-Content"></a>
Details about the layer version\.
Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object
** [CreatedDate](#API_PublishLayerVersion_ResponseSyntax) ** <a name="SSS-PublishLayerVersion-response-CreatedDate"></a>
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
e10b004c2b6f-1
|
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) ** <a name="SSS-PublishLayerVersion-response-Description"></a>
The description of the version\.
Type: String
Length Constraints: Minimum length of 0\. Maximum length of 256\.
** [LayerArn](#API_PublishLayerVersion_ResponseSyntax) ** <a name="SSS-PublishLayerVersion-response-LayerArn"></a>
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) ** <a name="SSS-PublishLayerVersion-response-LayerVersionArn"></a>
The ARN of the layer version\.
Type: String
Length Constraints: Minimum length of 1\. Maximum length of 140\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
e10b004c2b6f-2
|
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) ** <a name="SSS-PublishLayerVersion-response-LicenseInfo"></a>
The layer's software license\.
Type: String
Length Constraints: Maximum length of 512\.
** [Version](#API_PublishLayerVersion_ResponseSyntax) ** <a name="SSS-PublishLayerVersion-response-Version"></a>
The version number\.
Type: Long
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
303a7c979b64-0
|
**CodeStorageExceededException**
You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html)
HTTP Status Code: 400
**InvalidParameterValueException**
One of the parameters in the request is invalid\.
HTTP Status Code: 400
**ResourceNotFoundException**
The resource specified in the request does not exist\.
HTTP Status Code: 404
**ServiceException**
The AWS Lambda service encountered an internal error\.
HTTP Status Code: 500
**TooManyRequestsException**
The request throughput limit was exceeded\.
HTTP Status Code: 429
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
58fc0190a08f-0
|
For more information about using this API in one of the language\-specific AWS SDKs, see the following:
+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/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](https://docs.aws.amazon.com/goto/SdkForJava/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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
58fc0190a08f-1
|
+ [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)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_PublishLayerVersion.md
|
a0b0755c3727-0
|
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\.
**To access the monitoring console**
1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\.
1. Choose **Monitoring**\.
![\[Graphs of various CloudWatch metrics.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png)
The console provides the following graphs\.
**Lambda monitoring graphs**
+ **Invocations** β The number of times that the function was invoked in each 5\-minute period\.
+ **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\.
+ **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\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/monitoring-functions-access-metrics.md
|
a0b0755c3727-1
|
+ **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)\.
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\.
![\[AWS CloudWatch Logs Insights reports\]](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\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/monitoring-functions-access-metrics.md
|
a80cb3e70786-0
|
AWS Lambda supports multiple languages through the use of runtimes\. You choose a runtime when you create a function, and you can change runtimes by updating your function's configuration\. 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)
+ Linux kernel β 4\.14\.171\-105\.231\.amzn1\.x86\_64
**Amazon Linux 2**
+ 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 allows you to save resources like database connections and temporary files in the [execution context](runtimes-context.md) to avoid creating them every time your function runs\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-runtimes.md
|
a80cb3e70786-1
|
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\.
**Node\.js runtimes**
| Name | Identifier | AWS SDK for JavaScript | Operating system |
| --- | --- | --- | --- |
| Node\.js 12 | `nodejs12.x` | 2\.712\.0 | Amazon Linux 2 |
| Node\.js 10 | `nodejs10.x` | 2\.712\.0 | Amazon Linux 2 |
**Python runtimes**
| Name | Identifier | AWS SDK for Python | Operating system |
| --- | --- | --- | --- |
| Python 3\.8 | `python3.8` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux 2 |
| Python 3\.7 | `python3.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux |
| Python 3\.6 | `python3.6` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-runtimes.md
|
a80cb3e70786-2
|
| Python 2\.7 | `python2.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux |
**Ruby runtimes**
| Name | Identifier | AWS 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 |
**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 |
**Go runtimes**
| Name | Identifier | Operating system |
| --- | --- | --- |
| Go 1\.x | `go1.x` | Amazon Linux |
**\.NET runtimes**
| Name | Identifier | Operating system |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-runtimes.md
|
a80cb3e70786-3
|
**\.NET runtimes**
| Name | Identifier | Operating system |
| --- | --- | --- |
| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 |
| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux |
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)\.
**Custom runtime**
| Name | Identifier | Operating system |
| --- | --- | --- |
| Custom Runtime | `provided.al2` | Amazon Linux 2 |
| Custom Runtime | `provided` | Amazon Linux |
**Topics**
+ [AWS Lambda execution context](runtimes-context.md)
+ [Runtime support policy](runtime-support-policy.md)
+ [Custom AWS Lambda runtimes](runtimes-custom.md)
+ [AWS Lambda runtime interface](runtimes-api.md)
+ [Tutorial β Publishing a custom runtime](runtimes-walkthrough.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-runtimes.md
|
1741d6914f57-0
|
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 designer is at the top of the configuration page\.
![\[The function designer 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\. 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 archive that contains libraries, a custom runtime, or other dependencies\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-console.md
|
1741d6914f57-1
|
+ **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 function node selected in the designer, you can modify the following settings\.
**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, upload a [deployment package](gettingstarted-features.md#gettingstarted-features-package)\. If your deployment package is larger than 50 MB, choose **Upload a file from Amazon S3**\.
+ **Runtime** β The [Lambda runtime](lambda-runtimes.md) that executes your function\.
+ **Handler** β The method that the runtime executes 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\. [ Use environment variables](configuration-envvars.md) to extend your function's configuration outside of code\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-console.md
|
1741d6914f57-2
|
+ **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 [IAM role](lambda-intro-execution-role.md) that AWS Lambda assumes when it executes your function\.
+ **Description** β A description of the function\.
+ **Memory**β The amount of memory available to the function during execution\. Choose an amount [between 128 MB and 3,008 MB](gettingstarted-limits.md) in 64\-MB increments\.
Lambda allocates CPU power linearly in proportion to the amount of memory configured\. At 1,792 MB, a function has the equivalent of one full vCPU \(one vCPU\-second of credits per second\)\.
+ **Timeout** β 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\.
+ **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 VPC](configuration-vpc.md)\.
+ **Database proxies** β [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-console.md
|
1741d6914f57-3
|
+ **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\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-console.md
|
1741d6914f57-4
|
+ [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
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-console.md
|
1741d6914f57-5
|
```
$ 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)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-console.md
|
bd7f09a46dc7-0
|
The function's AWS X\-Ray tracing configuration\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_TracingConfigResponse.md
|
7c536e63d384-0
|
**Mode** <a name="SSS-Type-TracingConfigResponse-Mode"></a>
The tracing mode\.
Type: String
Valid Values:` Active | PassThrough`
Required: No
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_TracingConfigResponse.md
|
d6fe11d660a7-0
|
For more information about using this API in one of the language\-specific AWS SDKs, see the following:
+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/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 Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_TracingConfigResponse.md
|
46b497fe2099-0
|
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\.
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**
```
#Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'}
Write-Host `## Environment variables
Write-Host AWS_LAMBDA_FUNCTION_VERSION=$Env:AWS_LAMBDA_FUNCTION_VERSION
Write-Host AWS_LAMBDA_LOG_GROUP_NAME=$Env:AWS_LAMBDA_LOG_GROUP_NAME
Write-Host AWS_LAMBDA_LOG_STREAM_NAME=$Env:AWS_LAMBDA_LOG_STREAM_NAME
Write-Host AWS_EXECUTION_ENV=$Env:AWS_EXECUTION_ENV
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
46b497fe2099-1
|
Write-Host AWS_EXECUTION_ENV=$Env:AWS_EXECUTION_ENV
Write-Host AWS_LAMBDA_FUNCTION_NAME=$Env:AWS_LAMBDA_FUNCTION_NAME
Write-Host PATH=$Env:PATH
Write-Host `## Event
Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 3)
```
**Example log format**
```
START RequestId: 56639408-xmpl-435f-9041-ac47ae25ceed Version: $LATEST
Importing module ./Modules/AWSPowerShell.NetCore/3.3.618.0/AWSPowerShell.NetCore.psd1
[Information] - ## Environment variables
[Information] - AWS_LAMBDA_FUNCTION_VERSION=$LATEST
[Information] - AWS_LAMBDA_LOG_GROUP_NAME=/aws/lambda/blank-powershell-function-18CIXMPLHFAJJ
[Information] - AWS_LAMBDA_LOG_STREAM_NAME=2020/04/01/[$LATEST]53c5xmpl52d64ed3a744724d9c201089
[Information] - AWS_EXECUTION_ENV=AWS_Lambda_dotnetcore2.1_powershell_1.0.0
[Information] - AWS_LAMBDA_FUNCTION_NAME=blank-powershell-function-18CIXMPLHFAJJ
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
46b497fe2099-2
|
[Information] - AWS_LAMBDA_FUNCTION_NAME=blank-powershell-function-18CIXMPLHFAJJ
[Information] - PATH=/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin
[Information] - ## Event
[Information] -
{
"Records": [
{
"messageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78",
"receiptHandle": "MessageReceiptHandle",
"body": "Hello from SQS!",
"attributes": {
"ApproximateReceiveCount": "1",
"SentTimestamp": "1523232000000",
"SenderId": "123456789012",
"ApproximateFirstReceiveTimestamp": "1523232000001"
},
...
END RequestId: 56639408-xmpl-435f-9041-ac47ae25ceed
REPORT RequestId: 56639408-xmpl-435f-9041-ac47ae25ceed Duration: 3906.38 ms Billed Duration: 4000 ms Memory Size: 512 MB Max Memory Used: 367 MB Init Duration: 5960.19 ms
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
46b497fe2099-3
|
XRAY TraceId: 1-5e843da6-733cxmple7d0c3c020510040 SegmentId: 3913xmpl20999446 Sampled: true
```
The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. The report line provides the following details\.
**Report Log**
+ **RequestId** β The unique request ID for the invocation\.
+ **Duration** β The amount of time that your function's handler method spent processing the event\.
+ **Billed Duration** β The amount of time billed for the invocation\.
+ **Memory Size** β The amount of memory allocated to the function\.
+ **Max Memory Used** β The amount of memory used by the function\.
+ **Init Duration** β For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\.
+ **XRAY TraceId** β For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\.
+ **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\.
**Topics**
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
46b497fe2099-4
|
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](#powershell-logging-console)
+ [Using the AWS CLI](#powershell-logging-cli)
+ [Deleting logs](#powershell-logging-delete)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
d8c277d4807a-0
|
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)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
b04320dc6eb5-0
|
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
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
b04320dc6eb5-1
|
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: 100 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`\.
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**
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
b04320dc6eb5-2
|
**Example get\-logs\.sh Script**
This example requires that `my-function` returns a log stream ID\.
```
#!/bin/bash
aws lambda invoke --function-name my-function --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
```
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
{
"StatusCode": 200,
"ExecutedVersion": "$LATEST"
}
{
"events": [
{
"timestamp": 1559763003171,
"message": "START RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf Version: $LATEST\n",
"ingestionTime": 1559763003309
},
{
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
b04320dc6eb5-3
|
"ingestionTime": 1559763003309
},
{
"timestamp": 1559763003173,
"message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tENVIRONMENT VARIABLES\r{\r \"AWS_LAMBDA_FUNCTION_VERSION\": \"$LATEST\",\r ...",
"ingestionTime": 1559763018353
},
{
"timestamp": 1559763003173,
"message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tEVENT\r{\r \"key\": \"value\"\r}\n",
"ingestionTime": 1559763018353
},
{
"timestamp": 1559763003218,
"message": "END RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\n",
"ingestionTime": 1559763018353
},
{
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
b04320dc6eb5-4
|
"ingestionTime": 1559763018353
},
{
"timestamp": 1559763003218,
"message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 100 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n",
"ingestionTime": 1559763018353
}
],
"nextForwardToken": "f/34783877304859518393868359594929986069206639495374241795",
"nextBackwardToken": "b/34783877303811383369537420289090800615709599058929582080"
}
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
c55b225fd70d-0
|
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\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/powershell-logging.md
|
b41bafafc5d7-0
|
The code for the Lambda function\. You can specify either an object in Amazon S3, or upload a deployment package directly\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_FunctionCode.md
|
9118e4910774-0
|
**S3Bucket** <a name="SSS-Type-FunctionCode-S3Bucket"></a>
An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\.
Type: String
Length Constraints: Minimum length of 3\. Maximum length of 63\.
Pattern: `^[0-9A-Za-z\.\-_]*(?<!\.)$`
Required: No
**S3Key** <a name="SSS-Type-FunctionCode-S3Key"></a>
The Amazon S3 key of the deployment package\.
Type: String
Length Constraints: Minimum length of 1\. Maximum length of 1024\.
Required: No
**S3ObjectVersion** <a name="SSS-Type-FunctionCode-S3ObjectVersion"></a>
For versioned objects, the version of the deployment package object to use\.
Type: String
Length Constraints: Minimum length of 1\. Maximum length of 1024\.
Required: No
**ZipFile** <a name="SSS-Type-FunctionCode-ZipFile"></a>
The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\.
Type: Base64\-encoded binary data object
Required: No
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_FunctionCode.md
|
481d7a471df8-0
|
For more information about using this API in one of the language\-specific AWS SDKs, see the following:
+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/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 Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_FunctionCode.md
|
b0b79fa9bbf9-0
|
An AWS Lambda function's execution role grants it permission to access AWS services and resources\. You provide this role when you create a function, and Lambda assumes the role when your function is invoked\. You can create an execution role for development that has permission to send logs to Amazon CloudWatch and upload trace data to AWS X\-Ray\.
**To view a function's execution role**
1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\.
1. Choose a function\.
1. Choose **Permissions**\.
1. The resource summary shows the services and resources that the function has access to\. 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. Choose a service from the drop\-down menu to see permissions related to that service\.
You can add or remove permissions from a function's execution role at any time, or configure your function to use a different role\. Add permissions for any services that your function calls with the AWS SDK, and for services that Lambda uses to enable optional features\.
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\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-intro-execution-role.md
|
7c8b15fd12d2-0
|
By default, Lambda creates an execution role with minimal permissions when you [create a function](getting-started-create-function.md) in the Lambda console\. You can also create an execution role in the IAM console\.
**To create an execution role in the IAM console**
1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\.
1. Choose **Create role**\.
1. Under **Common use cases**, choose **Lambda**\.
1. Choose **Next: Permissions**\.
1. Under **Attach permissions policies**, choose the **AWSLambdaBasicExecutionRole** and **AWSXRayDaemonWriteAccess** managed policies\.
1. Choose **Next: Tags**\.
1. Choose **Next: Review**\.
1. For **Role name**, enter **lambda\-role**\.
1. Choose **Create role**\.
For detailed instructions, see [Creating a role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html#roles-creatingrole-service-console) in the IAM User Guide\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-intro-execution-role.md
|
b58ef002948f-0
|
An execution role is an IAM role that Lambda has permission to assume when you invoke a function\. 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
{
"Role": {
"Path": "/",
"RoleName": "lambda-ex",
"RoleId": "AROAQFOXMPL6TZ6ITKWND",
"Arn": "arn:aws:iam::123456789012:role/lambda-ex",
"CreateDate": "2020-01-17T23:19:12Z",
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
}
}
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-intro-execution-role.md
|
b58ef002948f-1
|
}
]
}
}
}
```
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\.
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-intro-execution-role.md
|
b58ef002948f-2
|
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\.
```
$ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-intro-execution-role.md
|
14b5e3381c3e-0
|
The following 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\.
+ **AWSLambdaMSKExecutionRole** β Permission to read records from an 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 VPC\.
+ **AWSXRayDaemonWriteAccess** β Permission to upload trace data to X\-Ray\.
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\. Add the relevant managed policies to your execution role before enabling features to avoid creating extra policies\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/lambda-intro-execution-role.md
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.