Skip to content

Commit 16fd1e0

Browse files
committed
list manager sample app
1 parent 2fd0bc1 commit 16fd1e0

27 files changed

+177
-54
lines changed

doc_source/applications-tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTa
140140
ReadCapacityUnits: 1
141141
WriteCapacityUnits: 1
142142
helloFromLambdaFunction:
143-
Type: AWS::Serverless::Function
143+
Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
144144
Properties:
145145
CodeUri: ./
146146
Handler: src/handlers/hello-from-lambda.helloFromLambdaHandler
@@ -229,7 +229,7 @@ Next, update the function code to use the table\. The following code uses the Dy
229229
```
230230
...
231231
helloFromLambdaFunction:
232-
Type: AWS::Serverless::Function
232+
Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
233233
Properties:
234234
CodeUri: ./
235235
Handler: src/handlers/index.handler

doc_source/best-practices.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Best Practices for Working with AWS Lambda Functions<a name="best-practices"></a>
1+
# Best practices for working with AWS Lambda functions<a name="best-practices"></a>
22

33
The following are recommended best practices for using AWS Lambda:
44

55
**Topics**
6-
+ [Function Code](#function-code)
7-
+ [Function Configuration](#function-configuration)
8-
+ [Alarming and Metrics](#alarming-metrics)
9-
+ [Stream Event Invokes](#stream-events)
6+
+ [Function code](#function-code)
7+
+ [Function configuration](#function-configuration)
8+
+ [Metrics and alarms](#alarming-metrics)
9+
+ [Working with streams](#stream-events)
1010

11-
## Function Code<a name="function-code"></a>
11+
## Function code<a name="function-code"></a>
1212
+ **Separate the Lambda handler from your core logic\.** This allows you to make a more unit\-testable function\. In Node\.js this may look like:
1313

1414
```
@@ -34,7 +34,7 @@ The following are recommended best practices for using AWS Lambda:
3434
+ **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution context](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\.
3535
+ **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function concurrent execution limit to `0` immediately to throttle all invocations to the function, while you update the code\.
3636

37-
## Function Configuration<a name="function-configuration"></a>
37+
## Function configuration<a name="function-configuration"></a>
3838
+ **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [AWS CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below:
3939

4040
```
@@ -50,11 +50,11 @@ The following are recommended best practices for using AWS Lambda:
5050
+ In the case of **CreateFunction**, AWS Lambda will fail the function creation process\.
5151
+ In the case of **UpdateFunctionConfiguration**, it could result in duplicate invocations of the function\.
5252

53-
## Alarming and Metrics<a name="alarming-metrics"></a>
53+
## Metrics and alarms<a name="alarming-metrics"></a>
5454
+ **Use [Working with AWS Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function execution time in order to address any bottlenecks or latencies attributable to your function code\.
5555
+ **Leverage your logging library and [AWS Lambda Metrics and Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/lam-metricscollected.html)** to catch app errors \(e\.g\. ERR, ERROR, WARNING, etc\.\)
5656

57-
## Stream Event Invokes<a name="stream-events"></a>
57+
## Working with streams<a name="stream-events"></a>
5858
+ **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. [BatchSize](API_CreateEventSourceMapping.md#SSS-CreateEventSourceMapping-request-BatchSize) controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\.
5959

6060
By default, Lambda invokes your function as soon as records are available in the stream\. If the batch it reads from the stream only has one record in it, Lambda only sends one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\.

doc_source/build-pipeline.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Transform: AWS::Serverless-2016-10-31
131131
Description: Outputs the time
132132
Resources:
133133
TimeFunction:
134-
Type: AWS::Serverless::Function
134+
Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
135135
Properties:
136136
Handler: index.handler
137137
Runtime: nodejs10.x

doc_source/configuration-console.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ For example, to update a function's memory setting with the AWS CLI, use the `up
5555
$ aws lambda update-function-configuration --function-name my-function --memory-size 256
5656
```
5757

58-
For function configuration best practices, see [Function Configuration](best-practices.md#function-configuration)\.
58+
For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\.

doc_source/csharp-tracing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF
105105
```
106106
Resources:
107107
function:
108-
Type: AWS::Lambda::Function
108+
Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html)
109109
Properties:
110110
TracingConfig:
111111
Mode: Active
@@ -119,7 +119,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function`
119119
```
120120
Resources:
121121
function:
122-
Type: AWS::Serverless::Function
122+
Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
123123
Properties:
124124
Tracing: Active
125125
...

doc_source/deploying-lambda-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ The [AWS CLI](gettingstarted-tools.md#gettingstarted-tools-awscli) and [SAM CLI]
1313
+ [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md)
1414
+ [Rolling deployments for Lambda functions](lambda-rolling-deployments.md)
1515
+ [Common Lambda application types and use cases](applications-usecases.md)
16-
+ [Best Practices for Working with AWS Lambda Functions](best-practices.md)
16+
+ [Best practices for working with AWS Lambda functions](best-practices.md)

doc_source/golang-tracing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF
8181
```
8282
Resources:
8383
function:
84-
Type: AWS::Lambda::Function
84+
Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html)
8585
Properties:
8686
TracingConfig:
8787
Mode: Active
@@ -95,7 +95,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function`
9595
```
9696
Resources:
9797
function:
98-
Type: AWS::Serverless::Function
98+
Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
9999
Properties:
100100
Tracing: Active
101101
...

doc_source/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Amazon's trademarks and trade dress may not be used in
6060
+ [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md)
6161
+ [Rolling deployments for Lambda functions](lambda-rolling-deployments.md)
6262
+ [Common Lambda application types and use cases](applications-usecases.md)
63-
+ [Best Practices for Working with AWS Lambda Functions](best-practices.md)
63+
+ [Best practices for working with AWS Lambda functions](best-practices.md)
6464
+ [Using AWS Lambda with other services](lambda-services.md)
6565
+ [Using AWS Lambda with Alexa](services-alexa.md)
6666
+ [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)
@@ -119,6 +119,7 @@ Amazon's trademarks and trade dress may not be used in
119119
+ [Lambda sample applications](lambda-samples.md)
120120
+ [Blank function sample application for AWS Lambda](samples-blank.md)
121121
+ [Error processor sample application for AWS Lambda](samples-errorprocessor.md)
122+
+ [List manager sample application for AWS Lambda](samples-listmanager.md)
122123
+ [Building Lambda functions with Node.js](lambda-nodejs.md)
123124
+ [AWS Lambda function handler in Node.js](nodejs-handler.md)
124125
+ [AWS Lambda deployment package in Node.js](nodejs-package.md)

doc_source/java-package.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Transform: 'AWS::Serverless-2016-10-31'
264264
Description: An AWS Lambda application that calls the Lambda API.
265265
Resources:
266266
function:
267-
Type: AWS::Serverless::Function
267+
Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
268268
Properties:
269269
CodeUri: build/distributions/java-basic.zip
270270
Handler: example.Handler

doc_source/java-tracing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF
8888
```
8989
Resources:
9090
function:
91-
Type: AWS::Lambda::Function
91+
Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html)
9292
Properties:
9393
TracingConfig:
9494
Mode: Active
@@ -102,7 +102,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function`
102102
```
103103
Resources:
104104
function:
105-
Type: AWS::Serverless::Function
105+
Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
106106
Properties:
107107
Tracing: Active
108108
...
@@ -119,15 +119,15 @@ The following example shows an `AWS::Serverless::LayerVersion` resource that sto
119119
```
120120
Resources:
121121
function:
122-
Type: AWS::Serverless::Function
122+
Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
123123
Properties:
124124
CodeUri: build/distributions/blank-java.zip
125125
Tracing: Active
126126
Layers:
127127
- !Ref libs
128128
...
129129
libs:
130-
Type: AWS::Serverless::LayerVersion
130+
Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html)
131131
Properties:
132132
LayerName: blank-java-lib
133133
Description: Dependencies for the blank-java sample app.

0 commit comments

Comments
 (0)