Skip to content

Commit 5718285

Browse files
authored
Update the Lambda Scenario (#6929)
1 parent cabed10 commit 5718285

File tree

18 files changed

+607
-884
lines changed

18 files changed

+607
-884
lines changed

.doc_gen/metadata/lambda_metadata.yaml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ lambda_Hello:
1313
excerpts:
1414
- description:
1515
snippet_tags:
16-
- lambda.java2.ListLambdaFunctions.complete
16+
- lambda.java2.list.main
1717
.NET:
1818
versions:
1919
- sdk_version: 3
@@ -384,6 +384,15 @@ lambda_Invoke:
384384
lambda: {Invoke}
385385
lambda_GetFunction:
386386
languages:
387+
Java:
388+
versions:
389+
- sdk_version: 2
390+
github: javav2/example_code/lambda
391+
sdkguide:
392+
excerpts:
393+
- description:
394+
snippet_tags:
395+
- lambda.java2.get.function.main
387396
.NET:
388397
versions:
389398
- sdk_version: 3
@@ -469,6 +478,15 @@ lambda_GetFunction:
469478
lambda: {GetFunction}
470479
lambda_UpdateFunctionCode:
471480
languages:
481+
Java:
482+
versions:
483+
- sdk_version: 2
484+
github: javav2/example_code/lambda
485+
sdkguide:
486+
excerpts:
487+
- description:
488+
snippet_tags:
489+
- lambda.java2.get.function.main
472490
.NET:
473491
versions:
474492
- sdk_version: 3
@@ -555,6 +573,15 @@ lambda_UpdateFunctionCode:
555573
lambda: {UpdateFunctionCode}
556574
lambda_UpdateFunctionConfiguration:
557575
languages:
576+
Java:
577+
versions:
578+
- sdk_version: 2
579+
github: javav2/example_code/lambda
580+
sdkguide:
581+
excerpts:
582+
- description:
583+
snippet_tags:
584+
- lambda.java2.update.config.main
558585
.NET:
559586
versions:
560587
- sdk_version: 3
@@ -724,15 +751,13 @@ lambda_ListFunctions:
724751
services:
725752
lambda: {ListFunctions}
726753
lambda_Scenario_GettingStartedFunctions:
727-
title: Get started creating and invoking &LAM; functions using an &AWS; SDK
728-
title_abbrev: Get started with functions
729754
synopsis_list:
730755
- Create an &IAM; role and &LAM; function, then upload handler code.
731756
- Invoke the function with a single parameter and get results.
732757
- Update the function code and configure with an environment variable.
733758
- Invoke the function with new parameters and get results. Display the returned execution log.
734759
- List the functions for your account, then clean up resources.
735-
category: Scenarios
760+
category: Basics
736761
guide_topic:
737762
title: Create a &LAM; function with the console
738763
url: lambda/latest/dg/getting-started-create-function.html

cpp/example_code/lambda/README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ Next, for information on code example structures and how to build and run the ex
4242
- [Hello Lambda](hello_lambda/CMakeLists.txt#L4) (`ListFunctions`)
4343

4444

45+
### Basics
46+
47+
Code examples that show you how to perform the essential operations within a service.
48+
49+
- [Learn the basics](get_started_with_functions_scenario.cpp)
50+
51+
4552
### Single actions
4653

4754
Code excerpts that show you how to call individual service functions.
@@ -60,7 +67,6 @@ Code examples that show you how to accomplish a specific task by calling multipl
6067
functions within the same service.
6168

6269
- [Create a serverless application to manage photos](../../example_code/cross-service/photo_asset_manager)
63-
- [Get started with functions](get_started_with_functions_scenario.cpp)
6470

6571

6672
<!--custom.examples.start-->
@@ -91,35 +97,35 @@ folder.
9197
This example shows you how to get started using Lambda.
9298

9399

100+
#### Learn the basics
94101

95-
#### Create a serverless application to manage photos
102+
This example shows you how to do the following:
96103

97-
This example shows you how to create a serverless application that lets users manage photos using labels.
104+
- Create an IAM role and Lambda function, then upload handler code.
105+
- Invoke the function with a single parameter and get results.
106+
- Update the function code and configure with an environment variable.
107+
- Invoke the function with new parameters and get results. Display the returned execution log.
108+
- List the functions for your account, then clean up resources.
98109

110+
<!--custom.basic_prereqs.lambda_Scenario_GettingStartedFunctions.start-->
111+
<!--custom.basic_prereqs.lambda_Scenario_GettingStartedFunctions.end-->
99112

100-
<!--custom.scenario_prereqs.cross_PAM.start-->
101-
<!--custom.scenario_prereqs.cross_PAM.end-->
102113

114+
<!--custom.basics.lambda_Scenario_GettingStartedFunctions.start-->
115+
<!--custom.basics.lambda_Scenario_GettingStartedFunctions.end-->
103116

104-
<!--custom.scenarios.cross_PAM.start-->
105-
<!--custom.scenarios.cross_PAM.end-->
106117

107-
#### Get started with functions
118+
#### Create a serverless application to manage photos
108119

109-
This example shows you how to do the following:
120+
This example shows you how to create a serverless application that lets users manage photos using labels.
110121

111-
- Create an IAM role and Lambda function, then upload handler code.
112-
- Invoke the function with a single parameter and get results.
113-
- Update the function code and configure with an environment variable.
114-
- Invoke the function with new parameters and get results. Display the returned execution log.
115-
- List the functions for your account, then clean up resources.
116122

117-
<!--custom.scenario_prereqs.lambda_Scenario_GettingStartedFunctions.start-->
118-
<!--custom.scenario_prereqs.lambda_Scenario_GettingStartedFunctions.end-->
123+
<!--custom.scenario_prereqs.cross_PAM.start-->
124+
<!--custom.scenario_prereqs.cross_PAM.end-->
119125

120126

121-
<!--custom.scenarios.lambda_Scenario_GettingStartedFunctions.start-->
122-
<!--custom.scenarios.lambda_Scenario_GettingStartedFunctions.end-->
127+
<!--custom.scenarios.cross_PAM.start-->
128+
<!--custom.scenarios.cross_PAM.end-->
123129

124130
### Tests
125131

dotnetv3/Lambda/README.md

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ For prerequisites, see the [README](../README.md#Prerequisites) in the `dotnetv3
3434
- [Hello Lambda](Actions/HelloLambda.cs#L4) (`ListFunctions`)
3535

3636

37+
### Basics
38+
39+
Code examples that show you how to perform the essential operations within a service.
40+
41+
- [Learn the basics](Actions/LambdaWrapper.cs)
42+
43+
3744
### Single actions
3845

3946
Code excerpts that show you how to call individual service functions.
@@ -53,7 +60,6 @@ functions within the same service.
5360

5461
- [Create a serverless application to manage photos](../cross-service/PhotoAssetManager)
5562
- [Create an application to analyze customer feedback](../cross-service/FeedbackSentimentAnalyzer)
56-
- [Get started with functions](Actions/LambdaWrapper.cs)
5763
- [Transform data with S3 Object Lambda](../cross-service/S3ObjectLambdaFunction)
5864

5965

@@ -90,6 +96,23 @@ Alternatively, you can run the example from within your IDE.
9096
This example shows you how to get started using Lambda.
9197

9298

99+
#### Learn the basics
100+
101+
This example shows you how to do the following:
102+
103+
- Create an IAM role and Lambda function, then upload handler code.
104+
- Invoke the function with a single parameter and get results.
105+
- Update the function code and configure with an environment variable.
106+
- Invoke the function with new parameters and get results. Display the returned execution log.
107+
- List the functions for your account, then clean up resources.
108+
109+
<!--custom.basic_prereqs.lambda_Scenario_GettingStartedFunctions.start-->
110+
<!--custom.basic_prereqs.lambda_Scenario_GettingStartedFunctions.end-->
111+
112+
113+
<!--custom.basics.lambda_Scenario_GettingStartedFunctions.start-->
114+
<!--custom.basics.lambda_Scenario_GettingStartedFunctions.end-->
115+
93116

94117
#### Create a serverless application to manage photos
95118

@@ -115,42 +138,6 @@ This example shows you how to create an application that analyzes customer comme
115138
<!--custom.scenarios.cross_FSA.start-->
116139
<!--custom.scenarios.cross_FSA.end-->
117140

118-
#### Get started with functions
119-
120-
This example shows you how to do the following:
121-
122-
- Create an IAM role and Lambda function, then upload handler code.
123-
- Invoke the function with a single parameter and get results.
124-
- Update the function code and configure with an environment variable.
125-
- Invoke the function with new parameters and get results. Display the returned execution log.
126-
- List the functions for your account, then clean up resources.
127-
128-
<!--custom.scenario_prereqs.lambda_Scenario_GettingStartedFunctions.start-->
129-
<!--custom.scenario_prereqs.lambda_Scenario_GettingStartedFunctions.end-->
130-
131-
132-
<!--custom.scenarios.lambda_Scenario_GettingStartedFunctions.start-->
133-
Before you can run the getting started with Lambda scenario, you must upload
134-
the following two files to an Amazon Simple Storage Service (Amazon S3) bucket that you
135-
own:
136-
137-
* [LambdaIncrement.zip](LambdaIncrement.zip)
138-
* [LambdaCalculator.zip](LambdaCalculator.zip)
139-
140-
##### Configuration settings
141-
142-
The scenario includes the following settings in `settings.json`:
143-
144-
* `FunctionName` - A name for the Lambda function.
145-
* `Handler` - "LambdaIncrement::LambdaIncrement.Function::FunctionHandler"
146-
* `UpdatedHandler` - "LambdaCalculator::LambdaCalculator.Function::FunctionHandler"
147-
* `BucketName` - The name of the bucket containing the .zip files for the sample functions.
148-
* `IncrementKey` - "LambdaIncrement.zip",
149-
* `CalculatorKey` - "LambdaCalculator.zip",
150-
* `RoleName` - The name of the IAM role that gives the scenario permissions to access Lambda.
151-
* `PolicyArn` - The Amazon Resource Name (ARN) of a policy giving the IAM role permissions to access Lambda.
152-
<!--custom.scenarios.lambda_Scenario_GettingStartedFunctions.end-->
153-
154141
#### Transform data with S3 Object Lambda
155142

156143
This example shows you how to transform data for your application with S3 Object Lambda.

gov2/lambda/README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ For prerequisites, see the [README](../README.md#Prerequisites) in the `gov2` fo
3434
- [Hello Lambda](hello/hello.go#L4) (`ListFunctions`)
3535

3636

37+
### Basics
38+
39+
Code examples that show you how to perform the essential operations within a service.
40+
41+
- [Learn the basics](scenarios/scenario_get_started_functions.go)
42+
43+
3744
### Single actions
3845

3946
Code excerpts that show you how to call individual service functions.
@@ -53,7 +60,6 @@ functions within the same service.
5360

5461
- [Automatically confirm known users with a Lambda function](../workflows/user_pools_and_lambda_triggers/workflows/scenario_auto_confirm_trusted_accounts.go)
5562
- [Automatically migrate known users with a Lambda function](../workflows/user_pools_and_lambda_triggers/workflows/scenario_migrate_user.go)
56-
- [Get started with functions](scenarios/scenario_get_started_functions.go)
5763
- [Write custom activity data with a Lambda function after Amazon Cognito user authentication](../workflows/user_pools_and_lambda_triggers/workflows/scenario_activity_log.go)
5864

5965

@@ -84,6 +90,23 @@ and to get help for running a scenario, use the following command:
8490
```
8591
go run ./cmd -h
8692
```
93+
#### Learn the basics
94+
95+
This example shows you how to do the following:
96+
97+
- Create an IAM role and Lambda function, then upload handler code.
98+
- Invoke the function with a single parameter and get results.
99+
- Update the function code and configure with an environment variable.
100+
- Invoke the function with new parameters and get results. Display the returned execution log.
101+
- List the functions for your account, then clean up resources.
102+
103+
<!--custom.basic_prereqs.lambda_Scenario_GettingStartedFunctions.start-->
104+
<!--custom.basic_prereqs.lambda_Scenario_GettingStartedFunctions.end-->
105+
106+
107+
<!--custom.basics.lambda_Scenario_GettingStartedFunctions.start-->
108+
<!--custom.basics.lambda_Scenario_GettingStartedFunctions.end-->
109+
87110

88111
#### Automatically confirm known users with a Lambda function
89112

@@ -118,23 +141,6 @@ This example shows you how to automatically migrate known Amazon Cognito users w
118141
<!--custom.scenarios.cross_CognitoAutoMigrateUser.start-->
119142
<!--custom.scenarios.cross_CognitoAutoMigrateUser.end-->
120143

121-
#### Get started with functions
122-
123-
This example shows you how to do the following:
124-
125-
- Create an IAM role and Lambda function, then upload handler code.
126-
- Invoke the function with a single parameter and get results.
127-
- Update the function code and configure with an environment variable.
128-
- Invoke the function with new parameters and get results. Display the returned execution log.
129-
- List the functions for your account, then clean up resources.
130-
131-
<!--custom.scenario_prereqs.lambda_Scenario_GettingStartedFunctions.start-->
132-
<!--custom.scenario_prereqs.lambda_Scenario_GettingStartedFunctions.end-->
133-
134-
135-
<!--custom.scenarios.lambda_Scenario_GettingStartedFunctions.start-->
136-
<!--custom.scenarios.lambda_Scenario_GettingStartedFunctions.end-->
137-
138144
#### Write custom activity data with a Lambda function after Amazon Cognito user authentication
139145

140146
This example shows you how to write custom activity data with a Lambda function after Amazon Cognito user authentication.

javascriptv3/example_code/lambda/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `javas
3434
- [Hello Lambda](hello.js#L6) (`ListFunctions`)
3535

3636

37+
### Basics
38+
39+
Code examples that show you how to perform the essential operations within a service.
40+
41+
- [Learn the basics](../iam/actions/attach-role-policy.js)
42+
43+
3744
### Single actions
3845

3946
Code excerpts that show you how to call individual service functions.
@@ -46,13 +53,6 @@ Code excerpts that show you how to call individual service functions.
4653
- [UpdateFunctionCode](actions/update-function-code.js#L15)
4754
- [UpdateFunctionConfiguration](actions/update-function-configuration.js#L12)
4855

49-
### Scenarios
50-
51-
Code examples that show you how to accomplish a specific task by calling multiple
52-
functions within the same service.
53-
54-
- [Get started with functions](../iam/actions/attach-role-policy.js)
55-
5656

5757
<!--custom.examples.start-->
5858
<!--custom.examples.end-->
@@ -98,8 +98,7 @@ This example shows you how to get started using Lambda.
9898
node ./hello.js
9999
```
100100

101-
102-
#### Get started with functions
101+
#### Learn the basics
103102

104103
This example shows you how to do the following:
105104

@@ -109,12 +108,13 @@ This example shows you how to do the following:
109108
- Invoke the function with new parameters and get results. Display the returned execution log.
110109
- List the functions for your account, then clean up resources.
111110

112-
<!--custom.scenario_prereqs.lambda_Scenario_GettingStartedFunctions.start-->
113-
<!--custom.scenario_prereqs.lambda_Scenario_GettingStartedFunctions.end-->
111+
<!--custom.basic_prereqs.lambda_Scenario_GettingStartedFunctions.start-->
112+
<!--custom.basic_prereqs.lambda_Scenario_GettingStartedFunctions.end-->
113+
114114

115+
<!--custom.basics.lambda_Scenario_GettingStartedFunctions.start-->
116+
<!--custom.basics.lambda_Scenario_GettingStartedFunctions.end-->
115117

116-
<!--custom.scenarios.lambda_Scenario_GettingStartedFunctions.start-->
117-
<!--custom.scenarios.lambda_Scenario_GettingStartedFunctions.end-->
118118

119119
### Tests
120120

0 commit comments

Comments
 (0)