-
Notifications
You must be signed in to change notification settings - Fork 0
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
Nicholas Couillard
authored and
Nicholas Couillard
committed
Oct 5, 2023
1 parent
7cef8a4
commit 5a3b31d
Showing
2 changed files
with
48 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,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() | ||
|
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,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 | ||
|