Last active
April 2, 2020 16:42
-
-
Save rmchale/63c6c5a12d2314bd731be6d101d1131c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import boto3 | |
dynamodb = boto3.client('dynamodb', region_name='us-east-2') | |
dynamodb.put_item(TableName='emails', | |
Item={ | |
'id': {'S': '[email protected]'} | |
} | |
) |
This file contains hidden or 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
import boto3 | |
dynamodb = boto3.client('dynamodb', region_name='us-east-2') | |
table = dynamodb.get_item(TableName='emails', | |
Key={ | |
'id': {'S': '[email protected]'} | |
} | |
) | |
print('exists' if 'Item' in table else 'does not exist'); | |
table = dynamodb.get_item(TableName='emails', | |
Key={ | |
'id': {'S': 'foo'} | |
} | |
) | |
print('exists' if 'Item' in table else 'does not exist'); | |
This file contains hidden or 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
boto3==1.12.34 | |
botocore==1.15.34 | |
docutils==0.15.2 | |
jmespath==0.9.5 | |
python-dateutil==2.8.1 | |
s3transfer==0.3.3 | |
six==1.14.0 | |
urllib3==1.25.8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment