You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-31Lines changed: 4 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,38 +8,11 @@ A simple Java Lambda based server-less application that implements a reimburseme
8
8
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').
9
9
4. Call the LambdaForm Function from Eclipse with the following JSON input:
* 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.
14
11
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.
22
13
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.
27
15
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.
39
17
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:
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