Created
January 18, 2020 16:58
-
-
Save mamiwinsfall93/f44b8acac9410486c3e116c45f98fd90 to your computer and use it in GitHub Desktop.
Dynamo DB
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
mport boto3 | |
dynamodb = boto3.resource('dynamodb') | |
table = dynamodb.Table('courses') | |
print(table.creation_date_time) | |
with table.batch_writer() as batch: | |
batch.put_item( | |
Item={ | |
'courseID':2, | |
'Title': 'Building Secure Web Applications', | |
'Subject ': 'SDEV', | |
'NumCredits': 3, | |
'CatalogNbr': 300 | |
}) | |
batch.put_item( | |
Item={ | |
'courseID':3, | |
'Title': 'Software Security Testing ', | |
'Subject ': 'SDEV', | |
'NumCredits': 3, | |
'CatalogNbr': 500 | |
} ) | |
batch.put_item( | |
Item={ | |
'courseID':4, | |
'Title': 'Risk Analysis and Threat Modeling', | |
'Subject ': 'SDEV', | |
'NumCredits': 3, | |
'CatalogNbr': 100 | |
}) | |
batch.put_item( | |
Item={ | |
'courseID':5, | |
'Title': 'Secure Software Engineering', | |
'Subject ': 'SDEV', | |
'NumCredits': 3, | |
'CatalogNbr': 600 | |
}) | |
batch.put_item( | |
Item={ | |
'courseID':6, | |
'Title': 'Mitigating Software Vulnerabilities', | |
'Subject ': 'SDEV', | |
'NumCredits': 3, | |
'CatalogNbr': 700 | |
} | |
) | |
batch.put_item( | |
Item={ | |
'courseID':7, | |
'Title': 'Securing Mobile Apps', | |
'Subject ': 'SDEV', | |
'NumCredits': 3, | |
'CatalogNbr': 800 | |
} | |
) | |
batch.put_item( | |
Item={ | |
'courseID':8, | |
'Title': 'Workplace Learning in Software Development', | |
'Subject ': 'SDEV', | |
'NumCredits': 3, | |
'CatalogNbr': 400 | |
} | |
) | |
batch.put_item( | |
Item={ | |
'courseID':9, | |
'Title': 'Database Security', | |
'Subject ': 'SDEV', | |
'NumCredits': 3, | |
'CatalogNbr': 900 | |
} | |
) | |
batch.put_item( | |
Item={ | |
'courseID':10, | |
'Title': 'Detecting Software Vulnerabilities', | |
'Subject ': 'SDEV', | |
'NumCredits': 3, | |
'CatalogNbr': 200 | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment