Skip to content

Commit 1513960

Browse files
authored
minor README changes
1 parent 235d8e9 commit 1513960

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

documentdb-lambda-java-sam/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Java AWS Lambda Amazon DocumentDB Streams consumer, using AWS SAM
22

3-
This pattern is an example of a AWS Lambda function written in Java that consumes messages from Amazon DocumentDB Streams. The pattern demonstrates how a SAM project can be configured to deploy an AWS Lambda function written in Java with an Amazon DocumentDB event trigger. The pattern demonstrates how Amazon DocumentDB streams can be parsed in an AWS Lambda function and the parsed content output to an Amazon DynamoDB table. The pattern provides an AWS CloudFormation template to install and set-up an Amazon DocumentDB cluster. The CloudFormation template also installs an Amazon EC2 instance with tools necessary to configure the Amazon DocumentDB cluster to generate Amazon DocumentDB streams and configuration needed by a Java producer that can generate the Amazon DocumentDB streams.
3+
This pattern demonstrates consuming messages from an Amazon DocumentDB stream with AWS Lambda. This Java Lambda function parses the stream data and writes the results to an Amazon DynamoDB table. The pattern provides an AWS CloudFormation template to install and configure an Amazon DocumentDB cluster, configures an Amazon EC2 instance with Amazon DocumentDB tools, and creates a Java producer for generating sample data.
44

55
This project contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.
66

@@ -20,7 +20,8 @@ Important: this application uses various AWS services and there are costs associ
2020

2121
* [Create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) if you do not already have one and log in. The IAM user that you use must have sufficient permissions to make necessary AWS service calls and manage AWS resources.
2222

23-
## Run the Cloudformation template to create the Amazon DocumentDB Cluster and Client Amazon EC2 instance
23+
## Deployment instructions
24+
### Run the Cloudformation template to create the Amazon DocumentDB Cluster and Client Amazon EC2 instance
2425

2526
* [Run the Cloudformation template using the file DocumentDBAndMongoClientEC2.yaml] - You can go to the AWS Cloudformation console, create a new stack by specifying the template file. You can keep the defaults for input parameters or modify them as necessary. Wait for the Cloudformation stack to be created. This CloudFormation template will create an Amazon DocumentDB cluster. It will also create an EC2 instance that you can use as a client.
2627

@@ -34,7 +35,7 @@ The AWS SAM CLI is a serverless tool for building and testing Lambda application
3435
* [Check if the database and cluster are available] - Once you are inside the EC2 instance, you should be in the /home/ec2-user folder. cd to the mongoshell folder and then run ./connect_to_mongo_shell.sh. This connects the mongosh tool to the Amazon DocumentDB cluster created by the CloudFormation template. Once inside the mongosh, you can issue commands like show dbs to see if the database was created, use <database name> to switch to the created database, and then show collections to see if the collection was created. If you did not modify the defaults in the CloudFormation template, then the name of the database should be DocumentDBJavaLambdaDB and the name of the collection should be DocumentDBJavaLambdaCollection
3536

3637

37-
## Pre-requisites to Deploy the sample Lambda function
38+
### Pre-requisites to Deploy the sample Lambda function
3839

3940
* Java - On the EC2 machine, we have installed the version of Java that you selected. We have installed Amazon Corrretto JDK of the version that you had selected at the time of specifying the input parameters in the Cloudformation template. At the time of publishing this pattern, only Java versions 11, 17 and 21 are supported by AWS SAM
4041
* Maven - On the EC2 machine, we have installed Maven (https://maven.apache.org/install.html)
@@ -49,7 +50,7 @@ Change directory to the pattern directory:
4950
cd serverless-patterns/documentdb-lambda-java-sam
5051
```
5152

52-
## Use the SAM CLI to build and deploy the lambda function
53+
### Use the SAM CLI to build and deploy the lambda function
5354

5455
Make sure you are connected to the EC2 instance as mentioned in the "Connect to the EC2 instance" step above
5556

@@ -92,7 +93,7 @@ REPORT RequestId: 717b4978-4112-4f63-947f-bb9552482687 Init Duration: 0.03 ms
9293
```
9394

9495

95-
## Deploy the sample application
96+
### Deploy the sample application
9697

9798

9899
To deploy your application for the first time, run the following in your shell. Make sure the shell variable $AWS_REGION is set. If not, replace $AWS_REGION with the region in which you are deploying the AWS Lambda function:
@@ -120,7 +121,7 @@ The sam deploy command will package and deploy your application to AWS, with a s
120121
* **SAM configuration file [samconfig.toml]**: Name of the configuration file to store configuration information locally
121122
* **SAM configuration environment [default]**: Environment for storing deployment information locally
122123

123-
You should get a message "Successfully created/updated stack - <StackName> in <Region>" if all goes well
124+
The message "Successfully created/updated stack - <StackName> in <Region>" indicates a successful deployment.
124125

125126
**Note: In case you want to deploy the Lambda function by pointing to an existing DocumentDB Cluster and not the one created by running the CloudFormation template provided in this pattern, you will need to modify the values of the above parameters accordingly**
126127

@@ -198,4 +199,4 @@ sam delete
198199
Confirm the delete by selecting Y at both prompts.
199200
AWS SAM confirms the stack deletion with the "Deleted successfully" message in the terminal.
200201

201-
Next you need to delete the Amazon CloudFormation template containing the Amazon DocumentDB cluster and the Amazon EC2 instance. Open the Amazon CloudFormation console, select the stack, then choose Delete. The delete will take some time.
202+
Next you need to delete the Amazon CloudFormation template containing the Amazon DocumentDB cluster and the Amazon EC2 instance. Open the Amazon CloudFormation console, select the stack, then choose Delete. The delete will take some time.

0 commit comments

Comments
 (0)