Skip to content

Commit 01d2c6f

Browse files
committed
Lambda function scripts
1 parent 82a3177 commit 01d2c6f

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ build/*
88
*.zip
99
*.sh
1010
!bin/*.sh
11+
!_lambda/*.sh
1112
lib
1213
_lambda/random-name/node_modules/*

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ From branch: [`lambda`](https://github.com/awslabs/eb-java-scorekeep/tree/lambda
1111
In the [`UserFactory`](https://github.com/awslabs/eb-java-scorekeep/tree/xray/src/main/java/scorekeep/UserFactory.java) class, Scorekeep calls a Node.js AWS Lambda function to generate random usernames. If the call to Lambda fails, Scorekeep falls back on a public API to generate names.
1212

1313
Run the script in the `_lambda` folder to create the AWS Lambda function that Scorekeep calls to generate random names:
14-
eb-java-scorekeep/_lambda$ ./create-lambda-role.sh
14+
eb-java-scorekeep/_lambda$ ./create-random-name.sh
1515

1616
The script uses a CloudFormation template and the AWS CLI to create the function and its execution role:
17-
- `_lambda/lambda-role.yml` - Template that defines the role
18-
- `_lambda/create-lambda-role.sh` - Script to create the role
19-
- `_lambda/delete-lambda-role.sh` - Script to delete the role
17+
- `_lambda/random-name.yml` - Template that defines the role and function
18+
- `_lambda/create-random-name.sh` - Script to create the role and function
19+
- `_lambda/delete-random-name.sh` - Script to delete the role and function
2020

2121
If you don't have the AWS CLI, [install it](http://docs.aws.amazon.com/cli/latest/userguide/installing.html) or use the CloudFormation console to create a stack with the template.
2222

_lambda/create-random-name.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
aws cloudformation create-stack --stack-name scorekeep-random-name
2+
--capabilities CAPABILITY_NAMED_IAM --template-body file://random-name.yml

_lambda/delete-random-name.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aws cloudformation delete-stack --stack-name scorekeep-random-name

0 commit comments

Comments
 (0)