Skip to content

Commit 357b2f1

Browse files
committed
notification instructions
1 parent 685a057 commit 357b2f1

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ Create a Java 8 SE environment in Elastic Beanstalk to host the application.
2222
3. When your environment is ready, the console redirects you to the environment Dashboard.
2323
4. Click the URL at the top of the page to open the site.
2424

25-
## Give the application permission to use DynamoDB
26-
When the Scorekeep API runs in AWS Elastic Beanstalk, it uses the permissions of its EC2 instance to call AWS. Elastic Beanstalk provides a default instance profile that you can extend to grant the application the permissions it needs to read from and write to resource tables in DynamoDB.
25+
## Give the application permission to use DynamoDB and SNS
26+
When the Scorekeep API runs in AWS Elastic Beanstalk, it uses the permissions of its EC2 instance to call AWS. Elastic Beanstalk provides a default instance profile that you can extend to grant the application the permissions it needs to read from and write to resource tables in DynamoDB, and send notifications with SNS.
2727

28-
*To add DynamoDB permissions to the instances in your Elastic Beanstalk environment*
28+
*To add DynamoDB and SNS permissions to the instances in your Elastic Beanstalk environment*
2929

3030
1. Open the Elastic Beanstalk instance profile in the IAM console: [aws-elasticbeanstalk-ec2-role](https://console.aws.amazon.com/iam/home#roles/aws-elasticbeanstalk-ec2-role)
3131
2. Click **Attach Policy**.
3232
3. Select [AmazonDynamoDBFullAccess](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess) and click **Attach Policy**.
33+
3. Select [AmazonSNSFullAccess](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AmazonSNSFullAccess) and click **Attach Policy**.
3334

3435
## Deploy the application
3536
Deploy the source code for the project to your Elastic Beanstalk environment.
@@ -47,6 +48,17 @@ Deploy the source code for the project to your Elastic Beanstalk environment.
4748

4849
Click through the app to explore its functionality. Use the network console in your browser to see the HTTP requests that it sends to the API to read and write users, sessions, games, moves and game state to DynamoDB via the API.
4950

51+
## Configure Notifications
52+
The API uses Amazon SNS to send a notification email whenever a game ends. Configure your email address in the source code and redeploy to enable notifications.
53+
54+
*To enable notifications*
55+
1. Clone this repository
56+
2. Add your email address to the `env.config` configuration file in the `.ebextensions` folder.
57+
3. [Create a source bundle](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-sourcebundle.html).
58+
4. [Deploy the source bundle](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.deploy-existing-version.html#deployments-newversion).
59+
5. Check your email for a subscription confirmation.
60+
6. Complete a game to trigger a notification.
61+
5062
# How it works
5163
The project includes two independent components, an HTML and JavaScript frontend in Angular 1.5 and a Java backend that uses Spring to provide a public API.
5264

0 commit comments

Comments
 (0)