id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
051a41a00b34-1
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) ** <a name="SSS-ListAliases-request-Marker"></a> Specify the pagination token that's returned by a previous request to retrieve the next page of results\. ** [MaxItems](#API_ListAliases_RequestSyntax) ** <a name="SSS-ListAliases-request-MaxItems"></a> Limit the number of aliases returned\. Valid Range: Minimum value of 1\. Maximum value of 10000\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_ListAliases.md
6ba7c29d0b65-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_ListAliases.md
323c602ec2f2-0
``` HTTP/1.1 200 Content-type: application/json { "Aliases": [ { "AliasArn": "string", "Description": "string", "FunctionVersion": "string", "Name": "string", "RevisionId": "string", "RoutingConfig": { "AdditionalVersionWeights": { "string" : number } } } ], "NextMarker": "string" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_ListAliases.md
c2ec2ea60351-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\. ** [Aliases](#API_ListAliases_ResponseSyntax) ** <a name="SSS-ListAliases-response-Aliases"></a> A list of aliases\. Type: Array of [AliasConfiguration](API_AliasConfiguration.md) objects ** [NextMarker](#API_ListAliases_ResponseSyntax) ** <a name="SSS-ListAliases-response-NextMarker"></a> The pagination token that's included if more results are available\. Type: String
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_ListAliases.md
eb9fb90f7c43-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_ListAliases.md
a93a63cc175e-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/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](https://docs.aws.amazon.com/goto/SdkForJava/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)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_ListAliases.md
a93a63cc175e-1
+ [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)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_ListAliases.md
a9cc6470c8dc-0
AWS Lambda is a compute service that lets you run code without provisioning or managing servers\. AWS Lambda executes 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 you consume \- there is no charge when your code is not running\. With AWS Lambda, you can run code for virtually any type of application or backend service \- all with zero administration\. AWS 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 AWS Lambda supports](lambda-runtimes.md)\. You can use AWS Lambda to run your code in response to events, such as changes to data in an Amazon S3 bucket or an Amazon DynamoDB table; to run your code in response to HTTP requests using Amazon API Gateway; or invoke your code using API calls made using AWS SDKs\. With these capabilities, you can use Lambda to easily build data processing triggers for AWS services like Amazon S3 and Amazon DynamoDB, process streaming data stored in Kinesis, or create your own back end that operates at AWS scale, performance, and security\. You can also build serverless applications composed of functions that are triggered by events and automatically deploy them using CodePipeline and AWS CodeBuild\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/welcome.md
c53dcfe77812-0
AWS Lambda is an ideal compute platform for many application scenarios, provided that you can write your application code in languages supported by AWS Lambda, and run within the AWS Lambda standard runtime environment and resources provided by Lambda\. When using AWS Lambda, you are responsible only for your code\. AWS 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 AWS 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\. If you need to manage your own compute resources, Amazon Web Services also offers other compute services to meet your needs\. + Amazon Elastic Compute Cloud \(Amazon EC2\) service 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, but you are responsible for provisioning capacity, monitoring fleet health and performance, and using Availability Zones for fault tolerance\. + Elastic Beanstalk offers an easy\-to\-use service for deploying and scaling applications onto Amazon EC2 in which 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](https://aws.amazon.com/lambda/sla/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/welcome.md
6f1d83faabcb-0
If you are a first\-time user of AWS Lambda, we recommend that you read the following sections in order: 1. **Read the product overview and watch the introductory video to understand sample use cases\.** These resources are available on the [AWS Lambda webpage](https://aws.amazon.com/lambda/)\. 1. **Try the console\-based getting started exercise\.** The exercise provides instructions for you to create and test your first Lambda function using the console\. You also learn about the programming model and other Lambda concepts\. For more information, see [Getting started with AWS Lambda](getting-started.md)\. 1. **Read the [deploying applications with AWS Lambda](deploying-lambda-apps.md) section of this guide\. **This section introduces various AWS Lambda components you work with to create an end\-to\-end experience\. Beyond the Getting Started exercise, you can explore the various use cases, each of which is provided with 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 specific tutorials that meet your specific needs\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/welcome.md
e91a52f1653e-0
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\. 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\. + A unique Amazon Resource Name \(ARN\) to identify the specific version of the function\. 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 AWS Lambda console](configuration-console.md)\. **To create a new version of a function** 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. 1. Choose the name of the function that you want to publish\. 1. On the function configuration page, choose **Actions**, **Publish new version**\. 1. \(Optional\) Enter a version description\. 1. Choose **Publish**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-versions.md
e91a52f1653e-1
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\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-versions.md
b2ab63f0ad6d-0
To publish a version of a function, use the [PublishVersion](API_PublishVersion.md) API operation\. 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 { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:1", "Version": "1", "Role": "arn:aws:iam::123456789012:role/lambda-role", "Handler": "function.handler", "Runtime": "nodejs12.x", ... } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-versions.md
e9bfc5617d5d-0
You can reference your Lambda function using either a qualified ARN or an unqualified ARN\. + **Qualified ARN** – The function ARN with a version suffix\. The following example refers to version 42 of the `helloworld` function\. ``` arn:aws:lambda:aws-region:acct-id:function:helloworld:42 ``` + **Unqualified ARN** – The function ARN without a version suffix\. ``` arn:aws:lambda:aws-region:acct-id:function:helloworld ``` You can use a qualified or an unqualified ARN in all relevant API operations\. However, you can't use an unqualified ARN to create an alias\. If you decide not to publish function versions, you can invoke the function using either the qualified or unqualified ARN in your [event source mapping](invocation-eventsourcemapping.md)\. When you invoke a function using an unqualified ARN, Lambda implicitly invokes $LATEST\. Lambda publishes a new function version only if the code has never been published or if the code has changed from the last published version\. If there is no change, the function version remains at the last published version\. The qualified ARN for each Lambda function version is unique\. After you publish a version, you can't change the ARN or the function code\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-versions.md
3dcc5db56767-0
You can use a [resource\-based policy](access-control-resource-based.md) or an [identity\-based policy](access-control-identity-based.md) to grant access to your function\. The scope of the permission depends on whether you apply the policy to a function or to one version of a function\. For more information about function resource names in policies, see [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md)\. You can simplify the management of event sources and AWS Identity and Access Management \(IAM\) policies by using function aliases\. For more information, see [Lambda function aliases](configuration-aliases.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-versions.md
6bcd25b778fa-0
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) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. **To enable active tracing** 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. 1. Choose a function\. 1. Under **AWS X\-Ray**, choose **Active tracing**\. 1. Choose **Save**\. **Pricing**
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/golang-tracing.md
6bcd25b778fa-1
1. Choose **Save**\. **Pricing** X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. 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\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/golang-tracing.md
6bcd25b778fa-2
![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) 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 ``` To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. ``` xray.AWS(s3.Client) ``` 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) 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\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/golang-tracing.md
6bcd25b778fa-3
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\. + **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\. You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Go](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go.html) in the AWS X\-Ray Developer Guide\. **Topics** + [Enabling active tracing with the Lambda API](#golang-tracing-api) + [Enabling active tracing with AWS CloudFormation](#golang-tracing-cloudformation)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/golang-tracing.md
7a66f0675a8b-0
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) The following example AWS CLI command enables active tracing on a function named my\-function\. ``` $ aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/golang-tracing.md
5e14899e440a-0
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** ``` Resources: function: Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: TracingConfig: Mode: Active ... ``` 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** ``` Resources: function: Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Tracing: Active
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/golang-tracing.md
5e14899e440a-1
Properties: Tracing: Active ... ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/golang-tracing.md
4fb9fb9c970a-0
*This action has been deprecated\.* **Important** For asynchronous function invocation, use [Invoke](API_Invoke.md)\. Invokes a function asynchronously\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_InvokeAsync.md
b854a2b77119-0
``` POST /2014-11-13/functions/FunctionName/invoke-async/ HTTP/1.1 InvokeArgs ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_InvokeAsync.md
4ce3d560fb72-0
The request uses the following URI parameters\. ** [FunctionName](#API_InvokeAsync_RequestSyntax) ** <a name="SSS-InvokeAsync-request-FunctionName"></a> The name of the Lambda function\. **Name formats** + **Function name** \- `my-function`\. + **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 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
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_InvokeAsync.md
c43961edf6fd-0
The request accepts the following binary data\. ** [InvokeArgs](#API_InvokeAsync_RequestSyntax) ** <a name="SSS-InvokeAsync-request-InvokeArgs"></a> The JSON that you want to provide to your Lambda function as input\. Required: Yes
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_InvokeAsync.md
fd5b3a903cc4-0
``` HTTP/1.1 Status ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_InvokeAsync.md
f9ccc33e6e81-0
If the action is successful, the service sends back the following HTTP response\. ** [Status](#API_InvokeAsync_ResponseSyntax) ** <a name="SSS-InvokeAsync-response-Status"></a> The status code\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_InvokeAsync.md
a1184ae20b21-0
**InvalidRequestContentException** The request body could not be parsed as JSON\. HTTP Status Code: 400 **InvalidRuntimeException** The runtime or runtime version specified is not supported\. HTTP Status Code: 502 **ResourceConflictException** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 **ResourceNotFoundException** The resource specified in the request does not exist\. HTTP Status Code: 404 **ServiceException** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_InvokeAsync.md
1a2f9e87051c-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/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](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/InvokeAsync) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_InvokeAsync.md
1a2f9e87051c-1
+ [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)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_InvokeAsync.md
dacaf14587b0-0
When Lambda runs your function, it passes a context object to the [handler](ruby-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. **Context methods** + `get_remaining_time_in_millis` – Returns the number of milliseconds left before the execution times out\. **Context properties** + `function_name` – The name of the Lambda function\. + `function_version` – The [version](configuration-versions.md) of the function\. + `invoked_function_arn` – The Amazon Resource Name \(ARN\) that's used to invoke the function\. Indicates if the invoker specified a version number or alias\. + `memory_limit_in_mb` – The amount of memory that's allocated for the function\. + `aws_request_id` – The identifier of the invocation request\. + `log_group_name` – The log group for the function\. + `log_stream_name` – The log stream for the function instance\. + `deadline_ms`– The date that the execution times out, in Unix time milliseconds\. + `identity` – \(mobile apps\) Information about the Amazon Cognito identity that authorized the request\. + `client_context`– \(mobile apps\) Client context that's provided to Lambda by the client application\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-context.md
b86cde161233-0
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\. **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)\. **To set environment variables in the Lambda console** 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. 1. Choose a function\. 1. Under **Environment variables**, choose **Edit**\. 1. Choose **Add environment variable**\. 1. Enter a key and value\. **Requirements** + Keys start with a letter and are at least two characters\. + Keys only contain letters, numbers, and the underscore character \(`_`\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
b86cde161233-1
+ Keys only contain letters, numbers, and the underscore character \(`_`\)\. + Keys aren't [reserved by Lambda](#configuration-envvars-runtime)\. + The total size of all environment variables doesn't exceed 4 KB\. 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\. You might also set an environment variable to configure your test environment to use more verbose logging or more detailed tracing\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-env.png) To retrieve environment variables in your function code, use the standard method for your programming language\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
d16ca28aed97-0
``` let region = process.env.AWS_REGION ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
9a31fbd81905-0
``` import os region = os.environ['AWS_REGION'] ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
4a0d4e0b0a51-0
``` region = ENV["AWS_REGION"] ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
606c123bb9a9-0
``` String region = System.getenv("AWS_REGION"); ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
ed39a25e363b-0
``` var region = os.Getenv("AWS_REGION") ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
de7ff2d0756c-0
``` string region = Environment.GetEnvironmentVariable("AWS_REGION"); ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
4aea9aea9903-0
``` $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)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
aacaf84fc858-0
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\. **Reserved environment variables** + `_HANDLER` – The handler location configured on the function\. + `AWS_REGION` – The AWS Region where the Lambda function is executed\. + `AWS_EXECUTION_ENV` – The [runtime identifier](lambda-runtimes.md), prefixed by `AWS_Lambda_`β€”for example, `AWS_Lambda_java8`\. + `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_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)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
aacaf84fc858-1
+ `AWS_LAMBDA_RUNTIME_API` – \([Custom runtime](runtimes-custom.md)\) The host and port of the [runtime API](runtimes-api.md)\. + `LAMBDA_TASK_ROOT` – The path to your Lambda function code\. + `LAMBDA_RUNTIME_DIR` – The path to runtime libraries\. + `TZ` – The environment's time zone \(`UTC`\)\. The execution environment uses NTP to synchronize the system clock\. The following additional environment variables aren't reserved and can be extended in your function configuration\. **Unreserved environment variables** + `LANG` – The locale of the runtime \(`en_US.UTF-8`\)\. + `PATH` – The execution path \(`/usr/local/bin:/usr/bin/:/bin:/opt/bin`\)\. + `LD_LIBRARY_PATH` – The system library path \(`/lib64:/usr/lib64:$LAMBDA_RUNTIME_DIR:$LAMBDA_RUNTIME_DIR/lib:$LAMBDA_TASK_ROOT:$LAMBDA_TASK_ROOT/lib:/opt/lib`\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
aacaf84fc858-2
+ `NODE_PATH` – \([Node\.js](lambda-nodejs.md)\) The Node\.js library path \(`/opt/nodejs/node12/node_modules/:/opt/nodejs/node_modules:$LAMBDA_RUNTIME_DIR/node_modules`\)\. + `PYTHONPATH` – \([Python 2\.7, 3\.6, 3\.8](lambda-python.md)\) The Python library path \(`$LAMBDA_RUNTIME_DIR`\)\. + `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`\)\. + `_X_AMZN_TRACE_ID` – The [X\-Ray tracing header](services-xray.md)\. + `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\. The sample values shown reflect the latest runtimes\. The presence of specific variables or their values can vary on earlier runtimes\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
aedd3a8ad4cc-0
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\. 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\. **To use a customer managed CMK** 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. 1. Choose a function\. 1. Under **Environment variables**, choose **Edit**\. 1. Expand **Encryption configuration**\. 1. Choose **Use a customer master key**\. 1. Choose your customer managed CMK\. 1. Choose **Save**\. Customer managed CMKs incur standard [AWS KMS charges](https://aws.amazon.com/kms/pricing/)\. 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\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
aedd3a8ad4cc-1
+ `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\. 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\. Users without `Decrypt` permissions can still manage functions, but they can't view environment variables or manage them in the Lambda console\. To prevent a user from viewing environment variables, add a statement to the user's permissions that denies access to the default key, a customer managed key, or all keys\. **Example IAM policy – Deny access by key ARN** ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Deny", "Action": [ "kms:Decrypt" ],
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
aedd3a8ad4cc-2
"Effect": "Deny", "Action": [ "kms:Decrypt" ], "Resource": "arn:aws:kms:us-east-2:123456789012:key/3be10e2d-xmpl-4be4-bc9d-0405a71945cc" } ] } ``` ![\[\]](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 Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. 1. Choose a function\. 1. Under **Environment variables**, choose **Edit**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
aedd3a8ad4cc-3
1. Choose a function\. 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\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
42081b01fc3c-0
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 { "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",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
42081b01fc3c-1
"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 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
fa93015fed50-0
Sample applications in this guide's GitHub repository demonstrate the use of environment variables in function code and AWS CloudFormation templates\. **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\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/configuration-envvars.md
0cae6737e259-0
Removes [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) from a function\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UntagResource.md
f48581d37ac7-0
``` DELETE /2017-03-31/tags/ARN?tagKeys=TagKeys HTTP/1.1 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UntagResource.md
974e02ed4b2e-0
The request uses the following URI parameters\. ** [ARN](#API_UntagResource_RequestSyntax) ** <a name="SSS-UntagResource-request-Resource"></a> 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) ** <a name="SSS-UntagResource-request-TagKeys"></a> A list of tag keys to remove from the function\. Required: Yes
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UntagResource.md
3123f618b833-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_UntagResource.md
4df665e214ca-0
``` HTTP/1.1 204 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UntagResource.md
abd07e7d493f-0
If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UntagResource.md
d18d580032a0-0
**InvalidParameterValueException** 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 **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_UntagResource.md
bd04e73e9e25-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/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](https://docs.aws.amazon.com/goto/SdkForJava/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)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UntagResource.md
bd04e73e9e25-1
+ [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)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_UntagResource.md
ebd3b306b926-0
The following data types are supported: + [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) + [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)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Types.md
ebd3b306b926-1
+ [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) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) + [VpcConfig](API_VpcConfig.md) + [VpcConfigResponse](API_VpcConfigResponse.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_Types.md
594d02e77775-0
AWS 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\-region and 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)\. | Resource | Default quota | Can Be Increased Up To | | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | | Function and layer storage | 75 GB | Terabytes | | [Elastic network interfaces per VPC](configuration-vpc.md) | 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)\. The following quotas apply to function configuration, deployments, and execution\. They cannot be changed\. | Resource | Quota | | --- | --- | | Function [memory allocation](configuration-console.md) | 128 MB to 3,008 MB, in 64 MB increments\. | | 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 |
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-limits.md
594d02e77775-1
| Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | 5 layers | | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \([varies per region](invocation-scaling.md)\) | | [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | | [Deployment package](gettingstarted-features.md#gettingstarted-features-package) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | | Test events \(console editor\) | 10 | | `/tmp` directory storage | 512 MB | | File descriptors | 1,024 | | Execution processes/threads | 1,024 | The following quotas are associated with AWS Lambda API requests\. | Resource | Quota | | --- | --- |
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-limits.md
594d02e77775-2
The following quotas are associated with AWS 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\) Unlimited \(asynchronous – [AWS service sources](lambda-services.md)\) | | Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota only applies 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 | Quotas for other services, such as AWS Identity and Access Management, Amazon CloudFront \(Lambda@Edge\), and Amazon Virtual Private Cloud, can impact your Lambda functions\. For more information, see [AWS service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) and [Using AWS Lambda with other services](lambda-services.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/gettingstarted-limits.md
e1280fb2aae3-0
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) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. **To enable active tracing** 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. 1. Choose a function\. 1. Under **AWS X\-Ray**, choose **Active tracing**\. 1. Choose **Save**\. **Pricing**
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
e1280fb2aae3-1
1. Choose **Save**\. **Pricing** X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. 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\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
e1280fb2aae3-2
![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) 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)** ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
b0435489ae7e-0
source 'https://rubygems.org' gem 'aws-xray-sdk', '0.11.4' 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\. **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** ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
1d43e0732c1c-0
require 'logger' require 'json' require 'aws-sdk-lambda' $client = Aws::Lambda::Client.new() $client.get_account_settings() require 'aws-xray-sdk/lambda' def lambda_handler(event:, context:) logger = Logger.new($stdout) ... ``` 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) 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\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
1d43e0732c1c-1
+ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Ruby](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-ruby.html) in the AWS X\-Ray Developer Guide\. **Topics** + [Enabling active tracing with the Lambda API](#ruby-tracing-api) + [Enabling active tracing with AWS CloudFormation](#ruby-tracing-cloudformation) + [Storing runtime dependencies in a layer](#ruby-tracing-layers)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
abc56246d494-0
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) The following example AWS CLI command enables active tracing on a function named my\-function\. ``` $ aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
b57ad01658e2-0
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** ``` Resources: function: Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: TracingConfig: Mode: Active ... ``` 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** ``` Resources: function: Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Tracing: Active
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
b57ad01658e2-1
Properties: Tracing: Active ... ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
01deb2a25037-0
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\. **Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/template.yml) – Dependencies layer** ``` Resources: function: Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: CodeUri: function/. 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-ruby-lib Description: Dependencies for the blank-ruby sample app. ContentUri: lib/. CompatibleRuntimes:
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
01deb2a25037-1
Description: Dependencies for the blank-ruby sample app. ContentUri: lib/. CompatibleRuntimes: - ruby2.5 ``` 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\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/ruby-tracing.md
71bc4bdffb90-0
When you [create an application](applications-tutorial.md) in the AWS Lambda console, Lambda applies a *permissions boundary* to the application's IAM roles\. The permissions boundary limits the scope of the [execution role](lambda-intro-execution-role.md) that the application's template creates for each of its functions, and any roles that you add to the template\. The permissions boundary prevents users with write access to the application's Git repository from escalating the application's permissions beyond the scope of its own resources\. The application templates in the Lambda console include a global property that applies a permissions boundary to all functions that they create\. ``` Globals: Function: PermissionsBoundary: !Sub 'arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${AppId}-${AWS::Region}-PermissionsBoundary' ``` The boundary limits the permissions of the functions' roles\. You can add permissions to a function's execution role in the template, but that permission is only effective if it's also allowed by the permissions boundary\. The role that AWS CloudFormation assumes to deploy the application enforces the use of the permissions boundary\. That role only has permission to create and pass roles that have the application's permissions boundary attached\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/permissions-boundary.md
71bc4bdffb90-1
By default, an application's permissions boundary enables functions to perform actions on the resources in the application\. For example, if the application includes an Amazon DynamoDB table, the boundary allows access to any API action that can be restricted to operate on specific tables with resource\-level permissions\. You can only use actions that don't support resource\-level permissions if they're specifically permitted in the boundary\. These include Amazon CloudWatch Logs and AWS X\-Ray API actions for logging and tracing\. **Example permissions boundary** ``` { "Version": "2012-10-17", "Statement": [ { "Action": [ "*" ], "Resource": [ "arn:aws:lambda:us-east-2:123456789012:function:my-app-getAllItemsFunction-*", "arn:aws:lambda:us-east-2:123456789012:function:my-app-getByIdFunction-*", "arn:aws:lambda:us-east-2:123456789012:function:my-app-putItemFunction-*", "arn:aws:dynamodb:us-east-1:123456789012:table/my-app-SampleTable-*" ], "Effect": "Allow", "Sid": "StackResources"
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/permissions-boundary.md
71bc4bdffb90-2
], "Effect": "Allow", "Sid": "StackResources" }, { "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:DescribeLogGroups", "logs:PutLogEvents", "xray:Put*" ], "Resource": "*", "Effect": "Allow", "Sid": "StaticPermissions" }, ... ] } ``` To access other resources or API actions, you or an administrator must expand the permissions boundary to include those resources\. You might also need to update the execution role or deployment role of an application to allow the use of additional actions\. + **Permissions boundary** – Extend the application's permissions boundary when you add resources to your application, or the execution role needs access to more actions\. In IAM, add resources to the boundary to allow the use of API actions that support resource\-level permissions on that resource's type\. For actions that don't support resource\-level permissions, add them in a statement that isn't scoped to any resource\. + **Execution role** – Extend a function's execution role when it needs to use additional actions\. In the application template, add policies to the execution role\. The intersection of permissions in the boundary and execution role is granted to the function\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/permissions-boundary.md
71bc4bdffb90-3
+ **Deployment role** – Extend the application's deployment role when it needs additional permissions to create or configure resources\. In IAM, add policies to the application's deployment role\. The deployment role needs the same user permissions that you need to deploy or update an application in AWS CloudFormation\. For a tutorial that walks through adding resources to an application and extending its permissions, see [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md)\. For more information, see [Permissions boundaries for IAM entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the IAM User Guide\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/permissions-boundary.md
3ffc6cdc38f8-0
In this tutorial, you do the following: + Create an Amazon ElastiCache cluster in your default Amazon Virtual Private Cloud\. For more information about Amazon ElastiCache, see [Amazon ElastiCache](https://aws.amazon.com/elasticache/)\. + Create a Lambda function to access the ElastiCache cluster\. When you create the Lambda function, you provide subnet IDs in your Amazon VPC and a VPC security group to allow the Lambda function to access resources in your VPC\. For illustration in this tutorial, the Lambda function generates a UUID, writes it to the cache, and retrieves it from the cache\. + Invoke the Lambda function and verify that it accessed the ElastiCache cluster in your VPC\. For details on using Lambda with Amazon VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-elasticache-tutorial.md
7505a5f0f74f-0
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 AWS Lambda](getting-started.md) to create your first Lambda function\. To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command this is output ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-elasticache-tutorial.md
59953667a953-0
Create the [execution role](lambda-intro-execution-role.md) that gives your 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** – **AWSLambdaVPCAccessExecutionRole**\. + **Role name** – **lambda\-vpc\-role**\. The **AWSLambdaVPCAccessExecutionRole** has the permissions that the function needs to manage network connections to a VPC\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-elasticache-tutorial.md
44012514137c-0
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.m3.medium --engine memcached --num-cache-nodes 1 \ --security-group-ids sg-0897d5f549934c2fb ``` 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\. 1. Write down the configuration endpoint for the cache cluster that you launched\. You can get this from the Amazon ElastiCache console\. You will specify this value in your Lambda function code in the next section\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-elasticache-tutorial.md
283dd04c215e-0
The following example Python code reads and writes an item to your ElastiCache cluster\. **Example app\.py** ``` from __future__ import print_function import time import uuid import sys import socket import elasticache_auto_discovery from pymemcache.client.hash import HashClient #elasticache settings elasticache_config_endpoint = "your-elasticache-cluster-endpoint:port" nodes = elasticache_auto_discovery.discover(elasticache_config_endpoint) nodes = map(lambda x: (x[1], int(x[2])), nodes) memcache_client = HashClient(nodes) def handler(event, context): """ This function puts into memcache and get from it. Memcache is hosted using elasticache """ #Create a random UUID... this will be the sample element we add to the cache. uuid_inserted = uuid.uuid4().hex #Put the UUID to the cache. memcache_client.set('uuid', uuid_inserted) #Get item (UUID) from the cache. uuid_obtained = memcache_client.get('uuid')
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-elasticache-tutorial.md
283dd04c215e-1
#Get item (UUID) from the cache. uuid_obtained = memcache_client.get('uuid') if uuid_obtained.decode("utf-8") == uuid_inserted:
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-elasticache-tutorial.md
e92193206656-0
print ("Success: Fetched value %s from memcache" %(uuid_inserted)) else: raise Exception("Value is not the same as we put :(. Expected %s got %s" %(uuid_inserted, uuid_obtained)) return "Fetched value from memcache: " + uuid_obtained.decode("utf-8") ``` **Dependencies** + [pymemcache](https://pypi.python.org/pypi/pymemcache) – The Lambda function code uses this library to create a `HashClient` object to set and get items from memcache\. + [elasticache\-auto\-discovery](https://pypi.python.org/pypi/elasticache-auto-discovery) – The Lambda function uses this library to get the nodes in your Amazon ElastiCache cluster\. Install dependencies with Pip and create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-elasticache-tutorial.md
30ed32bc4a7f-0
Create the Lambda function with the `create-function` command\. ``` $ 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 ``` You can find the subnet IDs and the default security group ID of your VPC from the VPC console\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-elasticache-tutorial.md
5fc6163e151d-0
In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function executes, it generates a UUID and writes it to the ElastiCache cluster that you specified in your Lambda code\. The Lambda function then retrieves the item from the cache\. 1. Invoke the Lambda function with the `invoke` command\. ``` $ aws lambda invoke --function-name AccessMemCache output.txt ``` 1. Verify that the Lambda function executed successfully as follows: + Review the output\.txt file\. + Review the results in the AWS Lambda console\. + Verify the results in CloudWatch Logs\. Now that you have created a Lambda function that accesses an ElastiCache cluster 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)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/services-elasticache-tutorial.md
744e7736fafc-0
The AWS Lambda console helps you monitor and manage your [Lambda applications](deploying-lambda-apps.md)\. The **Applications** menu lists AWS CloudFormation stacks with Lambda functions\. The menu includes stacks that you launch in AWS CloudFormation by using the AWS CloudFormation console, the AWS Serverless Application Repository, the AWS CLI, or the AWS SAM CLI\. **To view a Lambda application** 1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. 1. Choose an application\. ![\[A monitoring widget.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/applications-page.png) The overview shows the following information about your application\. + **AWS CloudFormation template** or **SAM template** – The template that defines your application\. + **Resources** – The AWS resources that are defined in your application's template\. To manage your application's Lambda functions, choose a function name from the list\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/applications-console.md
a0a669e5cdea-0
The **Monitoring** tab shows an Amazon CloudWatch dashboard with aggregate metrics for the resources in your application\. **To monitor a Lambda application** 1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. 1. Choose **Monitoring**\. By default, the Lambda console shows a basic dashboard\. You can customize this page by defining custom dashboards in your application template\. When your template includes one or more dashboards, the page shows your dashboards instead of the default dashboard\. You can switch between dashboards with the drop\-down menu on the top right of the page\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/applications-console.md
250eaa3ee401-0
Customize your application monitoring page by adding one or more Amazon CloudWatch dashboards to your application template with the [AWS::CloudWatch::Dashboard](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-dashboard.html) resource type\. The following example creates a dashboard with a single widget that graphs the number of invocations of a function named `my-function`\. **Example function dashboard template** ``` Resources: MyDashboard: Type: AWS::CloudWatch::Dashboard Properties: DashboardName: my-dashboard DashboardBody: | { "widgets": [ { "type": "metric", "width": 12, "height": 6, "properties": { "metrics": [ [ "AWS/Lambda", "Invocations", "FunctionName", "my-function", { "stat": "Sum", "label": "MyFunction" } ], [ { "expression": "SUM(METRICS())", "label": "Total Invocations" } ] ],
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/applications-console.md
250eaa3ee401-1
"label": "Total Invocations" } ] ], "region": "us-east-1", "title": "Invocations", "view": "timeSeries", "stacked": false } } ] } ``` You can get the definition for any of the widgets in the default monitoring dashboard from the CloudWatch console\. **To view a widget definition** 1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. 1. Choose an application that has the standard dashboard\. 1. Choose **Monitoring**\. 1. On any widget, choose **View in metrics** from the drop\-down menu\. ![\[A monitoring widget.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/applications-monitoring-widget.png) 1. Choose **Source**\. For more information about authoring CloudWatch dashboards and widgets, see [Dashboard body structure and syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html) in the *Amazon CloudWatch API Reference*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/applications-console.md
73f1546fb7d6-0
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)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_RemovePermission.md
3f32d2bdee2c-0
``` DELETE /2015-03-31/functions/FunctionName/policy/StatementId?Qualifier=Qualifier&RevisionId=RevisionId HTTP/1.1 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_RemovePermission.md
bcbd06c9a78f-0
The request uses the following URI parameters\. ** [FunctionName](#API_RemovePermission_RequestSyntax) ** <a name="SSS-RemovePermission-request-FunctionName"></a> The name of the Lambda function, version, or alias\. **Name formats** + **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. + **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_RemovePermission.md
bcbd06c9a78f-1
Required: Yes ** [Qualifier](#API_RemovePermission_RequestSyntax) ** <a name="SSS-RemovePermission-request-Qualifier"></a> 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) ** <a name="SSS-RemovePermission-request-RevisionId"></a> 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) ** <a name="SSS-RemovePermission-request-StatementId"></a> Statement ID of the permission to remove\. Length Constraints: Minimum length of 1\. Maximum length of 100\. Pattern: `([a-zA-Z0-9-_.]+)` Required: Yes
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_RemovePermission.md
7862187a03cc-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_RemovePermission.md
00ff6a680cb4-0
``` HTTP/1.1 204 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_RemovePermission.md
394882e54cb4-0
If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-lambda-developer-guide/doc_source/API_RemovePermission.md