- A Free Tier AWS account
- An EC2 instance to deploy the infrastructure
- Launch an EC2 instance with the shared AMI named "SWEN_TEAM8_TERM_PROJECT_AMI" and connect to it using SSH
- Clone this repository and enter its directory
git clone https://github.com/RIT-cloud-computing/term-project-team-team-8.git && cd term-project-team-team-8
- Change permission of the automation bash script that will spin up all resources:
chmod u+x automate.sh
- Convert the line endings of the automation bash script from Windows to Unix line endings:
sed -i -e 's/\r$//' automate.sh
- Open sns-lambda.py using Vim:
vim sns-lambda.py
- On line 23, the TargetArn is given a parameter in the following format:
TargetArn='arn:aws:sns:us-east-1:AWS_ACCOUNT_ID_NUMBER:crowd_lambda'
. Replace AWS_ACCOUNT_ID_NUMBER with the ID number of your AWS account - Save the changes, exit vim and open lambda.tf:
vim lambda.tf
- Add your emails in line 4 to get SNS notifications:
emails = ["email1@email.com","email2@email.com",...]
- Exit vim
- Run the automation bash script to automatically spin up resources. This will result in additional prompts:
./automate.sh
- Enter your AWS access key ID and AWS secret access key
- Enter
us-east-1
as the default region - Enter
text
as default output format - Terraform needs an access token to deploy the Ampify app. To find the access token, please check the Slack channel's pinned message, as entering it in GitHub immediately revokes it
- Enter
yes
to give permission to Terraform to create all the resources and wait for it to complete - You will receive an email regarding a subscription from AWS Notifications. Confirm the subscription by clicking on the link in the email
- Navigate to the Amplify app on the AWS console and check if "amp-terr-test" has been completely deployed
- Press Enter to run the program. This will run test.sh
- test.sh is a script that will process the video feed used in this repository. Since it is a small video feed, the script will stop at some point. Once the script outputs
Working on frame number: n
, you can open the Amplify app link in the AWS console - The Amplify app will display a video feed looking for any social distancing violations. You may receive an email with a link to a frame of the video if too many social distancing violations occur in a period of time.
- When the feed has stopped processing, a prompt will appear asking you to destroy the created resources. Press Enter to continue