File tree 3 files changed +22
-2
lines changed
3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 9
9
10
10
## How to try it?
11
11
12
- First create a package: ` mvn clean package `
12
+ Just execute:
13
13
14
- After that, a ` zip ` with our code should be in ` target ` folder. Let's execute ` terraform init ` and ` terraform apply ` to upload our code to AWS.
14
+ * ` cd terraform && terraform init && cd .. ` (First time only)
15
+ * ` sh build_and_deploy.sh `
15
16
16
17
DONE. Now you can try your lambda just executing the last line of the terraform output, it should be something like this:
17
18
` curl -H 'Content-Type: application/json' -X POST -d '{"name": "Josemy", "greeting":"Hello"}' https://[ACCOUNT_ID].execute-api.[REGION].amazonaws.com/beta/helloworld `
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ cd helloworldjava
4
+ printf ' \n\nBuilding the Java Lambda Function!\n\n'
5
+ mvn clean package
6
+ if [ $? -ne 0 ]; then
7
+ printf ' \n\nJava application build failed! No new Lambda Function will be deployed!!!\n'
8
+ exit -1
9
+ fi
10
+
11
+ printf ' \n\nStarting the Terraforming!\n\n'
12
+ cd terraform
13
+ terraform plan -out=plan.out
14
+ terraform apply plan.out
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ cd terraform
4
+ terraform destroy -force
5
+ rm plan.out
You can’t perform that action at this time.
0 commit comments