Skip to content

Commit 23c6985

Browse files
committed
Update README.md
1 parent b1a8bc0 commit 23c6985

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

README.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,11 @@ A simple Java Lambda based server-less application that implements a reimburseme
88
3. Set up a DynamoDB table 'lambda-reimbursment' with Hash Key 'employee_id' (String). Set the DynamoDB tables as event source for LambdaSendMail and LambdaApproval. Create an API method, so that a click on the link (HTTP GET) calls the LambdaApproval Function (with a parameter 'employee_id').
99
4. Call the LambdaForm Function from Eclipse with the following JSON input:
1010
```{"employee_id":"1", "employee_name":"John Doh", "expense_type":"travel","amount": "456.75" }```
11-
* If the Lambda Function completes successfully, a new entry will be added to the DynamoDB table lambda-reimbursment that you created in step 1 of the AWS Services setup.
12-
* LambdaSendMail gets triggered by the DynamoDB stream (pull model) and sends an e-mail with the info that has been added to the table.
13-
* If you have received the e-mail and click on the approval URL in the e-mail body, the LambdaApproval Function will be called and add an "approved" column entry to DynamoDB.
1411

15-
More detailed "Getting Started" info: https://github.com/markusklems/aws-lambda-java-example/wiki/Getting-Started
16-
17-
### IDE Setup
18-
1. Open Eclipse
19-
2. Install the AWS Toolkit for Eclipse and set up your AWS access key id and secret access key: http://docs.aws.amazon.com/AWSToolkitEclipse/latest/ug/tke_setup_install.html
20-
3. Import project LambdaForm: Right click on the Package Explorer > Import > General > Existing Projects into Workspace. Do the same for LambdaSendMail and LambdaApproval.
21-
4. Sign up for AWS Lambda, API Gateway, DynamoDB, and SES (if you have not done so, yet).
12+
If the Lambda Function completes successfully, a new entry will be added to the DynamoDB table lambda-reimbursment that you created in step 1 of the AWS Services setup.
2213

23-
### Upload Lambda Functions
24-
1. Right click on the LambdaForm project folder > Amazon Web Services > Upload Function to AWS Lambda > Follow the steps in the wizard and create a new Lambda Function.
25-
2. Upload the Lambda Functions of the other two projects LambdaSendMail and LambdaApproval.
26-
3. Give the Lambda Functions an IAM role that allows access to DynamoDB and SES.
14+
LambdaSendMail gets triggered by the DynamoDB stream (pull model) and sends an e-mail with the info that has been added to the table.
2715

28-
### AWS Services setup
29-
1. Set up a DynamoDB table named 'lambda-reimbursment' with the Hash Key 'employee_id' of type String. In the example, the EU-WEST-1 region (Ireland) is chosen.
30-
2. In the AWS dashboard, go to Lambda > LambdaSendMail > Event source. Add an event source of type DynamoDB (table: lambda-reimbursment) with default settings.
31-
3. Do the same (as in step 2) for LambdaApproval.
32-
4. In the AWS dashboard, go to API Gateway and create a new API that points at the LambdaApproval Function. Create a Resource "reimbursment" and a GET method. Click on "Method Request" and add a query string parameter "id". Click on "Integration Request" and add a Mapping Template with content type "application/json" and Template:
33-
```
34-
{
35-
"employee_id" : "$input.params('id')"
36-
}
37-
```
38-
Deploy the API.
16+
If you have received the e-mail and click on the approval URL in the e-mail body, the LambdaApproval Function will be called and add an "approved" column entry to DynamoDB.
3917

40-
### Run Lambda Functions
41-
1. Right click on the LambdaForm project folder > Amazon Web Services > Run Function on AWS Lambda > Enter a JSON object like this one:
42-
```{"employee_id":"1", "employee_name":"John Doh", "expense_type":"travel","amount": "456.75" }```
43-
2. If the Lambda Function completes successfully, a new entry will be added to the DynamoDB table lambda-reimbursment that you created in step 1 of the AWS Services setup.
44-
3. LambdaSendMail gets triggered by the DynamoDB stream (pull model) and sends an e-mail with the info that has been added to the table.
45-
4. If you have received the e-mail and click on the approval URL in the e-mail body, the LambdaApproval Function will be called and add an "approved" column entry to DynamoDB.
18+
More detailed "Getting Started" info: https://github.com/markusklems/aws-lambda-java-example/wiki/Getting-Started

0 commit comments

Comments
 (0)