Skip to content

Commit

Permalink
database groundwork
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Couillard authored and Nicholas Couillard committed Oct 5, 2023
1 parent 7cef8a4 commit 5a3b31d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
23 changes: 23 additions & 0 deletions DynamoDB.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from boto3 import resource
from boto3.dynamodb.conditions import Attr, Key

course_table = resource('dynamodb').Table('Courses')

def insert():
courseInsertion = course_table.put_item(
Item = {
'CourseId' : 'CSE1010', # partition key
'Section' : '001L', # sort key?
'Professor' : 'Gregory Jackson', # TODO: support multiple instructors
'StudentsEnrolled' : 0,
'StartTime' : 1630, # is storing times in the form of 24-hour time easier? it's simple to convert when necessary
'EndTime' : 1720,
'OpenStatus' : True # this attribute could be useful for hiding unavailable courses
}
)

print(f"Insert response: {courseInsertion}")

if __name__ == '__main__':
insert()

25 changes: 25 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
pip3 install boto3 # installs necessary dependency

curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" # line 1 for installing aws commandline
sudo installer -pkg AWSCLIV2.pkg -target / # line 2 for installing aws commandline

which aws # line 1 for verifying installation was successful
aws --version # line 2 for verifying installation was successful

aws configure # prompts for info to connect to AWS

Tyler:
AKIAZYS7TP7NH7ZTXR4L - Access Key ID
SP/hdEJXlbdOyw53PeZGgC1t7ZA4U9RbW9cn0n9o - Secret Access Key [write this down, unrecoverable]

Zach:
AKIAZYS7TP7NP4YXGZXK - Access Key ID
kQKm9wSkbqcUw+NDgEO7Pt8v9Vg/kLKhl4yX31dK - Secret Access Key [write this down, unrecoverable]

Tageria:
AKIAZYS7TP7NHURRN3Z2 - Access Key ID
FXQ/ZOyK8SfhGOlF+LE7YuUxfgEVWARwZx0uCZIP - Secret Access Key [write this down, unrecoverable]

Region: us-east-1
Output format: json

0 comments on commit 5a3b31d

Please sign in to comment.