Skip to content

Commit 779926c

Browse files
committed
updates. Two new function configuration files
1 parent 9f715b4 commit 779926c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+597
-177
lines changed

doc_source/access-control-identity-based.md

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ AWS managed policies grant permission to API actions without restricting the Lam
2020

2121
## Function development<a name="permissions-user-function"></a>
2222

23+
Use identity\-based policies to allow users to perform operations on Lambda functions\.
24+
25+
**Note**
26+
For a function defined as a container image, the user permission to access the image MUST be configured in the Amazon Elastic Container Registry For an example, see [Amazon ECR permissions\.](configuration-images.md#configuration-images-permissions)
27+
2328
The following shows an example of a permissions policy with limited scope\. It allows a user to create and manage Lambda functions named with a designated prefix \(`intern-`\), and configured with a designated execution role\.
2429

2530
**Example Function development policy**

doc_source/configuration-console.md

-58
This file was deleted.

doc_source/configuration-envvars.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Environment variables are not evaluated prior to the function invocation\. Any v
1818

1919
## Configuring environment variables<a name="configuration-envvars-config"></a>
2020

21-
You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-console.md)\.
21+
You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-function-common.md)\.
2222

2323
You create an environment variable on your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\.
2424

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# Configuring Lambda function options<a name="configuration-function-common"></a>
2+
3+
After you create a function, you can configure additional capabilities for the function, such as triggers, network acccess, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\.
4+
5+
You can also create and edit test events to test your function using the console\.
6+
7+
For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\.
8+
9+
**Topics**
10+
+ [Function versions](#configuration-function-latest)
11+
+ [Using the function overview](#configuration-functions-designer)
12+
+ [Configuring functions \(console\)](#configuration-common-summary)
13+
+ [Configuring functions \(API\)](#configuration-function-api)
14+
+ [Configuring function memory \(console\)](#configuration-memory-console)
15+
+ [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept)
16+
+ [Configuring triggers \(console\)](#configuration-common-triggers)
17+
+ [Testing functions \(console\)](#configuration-common-test)
18+
19+
## Function versions<a name="configuration-function-latest"></a>
20+
21+
A function has an unpublished version, and can have published versions and aliases\. By default, the console displays configuration information for the unpublished version of the function\. You change the unpublished version when you update your function's code and configuration\.
22+
23+
A published version is a snapshot of your function code and configuration that can't be changed \(except for a few configuration items relevant to a function version, such as provisioned concurrency\)\.
24+
25+
## Using the function overview<a name="configuration-functions-designer"></a>
26+
27+
The **Function overview** shows a visualization of your function and its upstream and downstream resources\. You can use it to jump to trigger and destination configuration\. You can use it to jump to layer configuration for functions defined as \.zip file archives\.
28+
29+
![\[The Lambda function overview, with no configured triggers or destinations.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png)
30+
31+
## Configuring functions \(console\)<a name="configuration-common-summary"></a>
32+
33+
For most function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **configuration** tab provides the following sections:
34+
+ **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function timeout and the execution role\.
35+
+ **Triggers** – Configure [triggers](#configuration-common-triggers)\.
36+
+ **Permissions** – Configure the execution role and other [permissions](lambda-permissions.md)\.
37+
+ **Destinations** – Configure [destinations](invocation-async.md#invocation-async-destinations) for asynchronous invocations \.
38+
+ **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\.
39+
+ **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\.
40+
41+
Tags apply to the entire function, including all versions and aliases\.
42+
+ **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\.
43+
+ **Monitoring and operations tools** – configure CloudWatch and other monitoring tools\.
44+
+ **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\.
45+
46+
Reserved concurrency applies to the entire function, including all versions and aliases\.
47+
+ **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\.
48+
49+
You can configure on a function, version, or alias\.
50+
+ **Code signing** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\.
51+
+ **Database proxies**[Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\.
52+
+ **File systems** – Connect your function to a [file system](configuration-filesystem.md)\.
53+
54+
The console provides separate tabs to configure aliases and versions:
55+
+ **Aliases** – An alias is a named resource that maps to a function version\. You can change an alias to map to a different function version\.
56+
+ **Versions** – Lambda assigns a new version number each time you publish your function\. For more information about managing versions, see [Lambda function versions](configuration-versions.md)\.
57+
58+
You can configure the following items for a published function version:
59+
+ Triggers
60+
+ Destinations
61+
+ Provisioned concurrency
62+
+ Asynchronous invocation
63+
+ Database proxies
64+
65+
## Configuring functions \(API\)<a name="configuration-function-api"></a>
66+
67+
To configure functions with the Lambda API, use the following actions:
68+
+ [UpdateFunctionCode](API_UpdateFunctionCode.md) – Update the function's code\.
69+
+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) – Update version\-specific settings\.
70+
+ [TagResource](API_TagResource.md) – Tag a function\.
71+
+ [AddPermission](API_AddPermission.md) – Modify the [resource\-based policy](access-control-resource-based.md) of a function, version, or alias\.
72+
+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) – Configure a function's reserved concurrency\.
73+
+ [PublishVersion](API_PublishVersion.md) – Create an immutable version with the current code and configuration\.
74+
+ [CreateAlias](API_CreateAlias.md) – Create aliases for function versions\.
75+
+ [PutFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionEventInvokeConfig.html) – Configure error handling for asynchronous invocation\.
76+
77+
## Configuring function memory \(console\)<a name="configuration-memory-console"></a>
78+
79+
Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your Lambda function at runtime\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\.
80+
81+
You can configure the memory of your function in the Lambda console\.
82+
83+
**To update the memory of a function**
84+
85+
1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\.
86+
87+
1. Choose a function\.
88+
89+
1. On the function configuration page, on the **General configuration** pane, choose **Edit**\.
90+
91+
1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\.
92+
93+
1. Choose **Save**\.
94+
95+
## Accepting function memory recommendations \(console\)<a name="configuration-memory-optimization-accept"></a>
96+
97+
If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\.
98+
99+
When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\.
100+
101+
**To accept a function memory recommendation**
102+
103+
1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\.
104+
105+
1. Choose a function\.
106+
107+
1. On the function configuration page, on the **General configuration** pane, choose **Edit**\.
108+
109+
1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\.
110+
111+
1. Choose **Save**\.
112+
113+
## Configuring triggers \(console\)<a name="configuration-common-triggers"></a>
114+
115+
You can configure other AWS services to trigger your function each time a specified event occurs\.
116+
117+
For details about how services trigger Lambda functions, see [Using AWS Lambda with other services](lambda-services.md)\.
118+
119+
**To add a trigger to your function\.**
120+
121+
1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\.
122+
123+
1. Choose the function to update\.
124+
125+
1. Under **Function overview**, choose **Add trigger**\.
126+
127+
1. From the drop\-down list of triggers, choose a trigger\. The console displays additional configuration fields required for this trigger\.
128+
129+
1. Choose **Add**\.
130+
131+
## Testing functions \(console\)<a name="configuration-common-test"></a>
132+
133+
You can create test events for your function from the **Test** tab\.
134+
135+
**To create a test event**
136+
137+
1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\.
138+
139+
1. Choose the function to test, and choose **Test**\.
140+
141+
1. Under **Test event**, select **New event**\.
142+
143+
1. Select a **Template**\.
144+
145+
1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\.
146+
147+
1. Choose **Save changes**\.
148+
149+
Saved test events are also available from the **Code** tab, under the **Test** menu\. After you create one or more test events, you can invoke your function using one of your tests as an event\.
150+
151+
**To test the function**
152+
153+
1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\.
154+
155+
1. Choose the function to test, and choose **Test**\.
156+
157+
1. Under **Test event**, select **Saved events** and select the event you want to use\.
158+
159+
1. Choose **Test**\.
160+
161+
1. Expand the **Execution result** panel to display details about the test\.

0 commit comments

Comments
 (0)