-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcde2df
commit 67fca10
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
HELP.md | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
!**/src/main/**/target/ | ||
!**/src/test/**/target/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
build/ | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Misc ### | ||
*.log | ||
.DS_Store | ||
docker/volume/ |
33 changes: 33 additions & 0 deletions
33
aws-lambda-project/.localstack/init-aws.sh
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Set the JAR file path | ||
JAR_FILE="target/aws-lambda-project-0.0.1-SNAPSHOT-aws.jar" | ||
|
||
# Check if the JAR file exists | ||
if [ -f "$JAR_FILE" ]; then | ||
# Zip the JAR file | ||
zip -j function.zip "$JAR_FILE" | ||
|
||
# Create Lambda function | ||
awslocal lambda create-function \ | ||
--function-name localstack-lambda-url-example \ | ||
--runtime java17 \ | ||
--zip-file fileb://function.zip \ | ||
--handler org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest \ | ||
--role arn:aws:iam::000000000000:role/lambda-role | ||
|
||
echo "created lambda function" | ||
|
||
awslocal lambda create-function-url-config \ | ||
--function-name localstack-lambda-url-example \ | ||
--auth-type NONE | ||
|
||
echo "created function URL" | ||
|
||
awslocal lambda invoke --function-name localstack-lambda-url-example \ | ||
--cli-binary-format raw-in-base64-out \ | ||
--payload '{"body": "{\"name\": \"profile\"}" }' output.txt | ||
|
||
echo "invoked lambda function" | ||
else | ||
echo "Error: JAR file not found at $JAR_FILE" | ||
fi |