-
-
Save tluv2006/393f730dfb6f14a972d3a8f77384b29e to your computer and use it in GitHub Desktop.
Handler
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
#Talk python to me | |
import json | |
import boto3 | |
s3 = boto3.client('s3') | |
def lambda_handler(event, context): | |
bucket = 'aws-simplified-transactions' | |
key = 'transactions.json' | |
response = s3.get_object(Bucket=bucket, Key=key) | |
content = response['Body'] | |
jsonObject = json.loads(content.read()) | |
transactions = jsonObject['transactions'] | |
for record in transactions: | |
print("TransactionType: " + record['transactionType']) | |
print("TransactionAmount: " + str(record['amount'])) | |
print("---") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment