Рет қаралды 10,602
The main purpose of this video is to simulate a small portion of an event-based project which is very frequently used by many companies.
Prerequisite:
--------------------
AWS SQS | AWS Simple Queue Service | How SQS Works | AWS Tutorial
• AWS SQS | AWS Simple Q...
Create and Use an Amazon SQS Queue | Practical
• Create and Use an Amaz...
Fan out Architecture in AWS with SNS + SQS + Lambda + Python
• Fan out Architecture i...
Lambda Code:
------------------
import json
def lambda_handler(event, context):
TODO implement
print(event)
try:
for i in event['Records']:
s3_event = json.loads(i['body'])
if 'Event' in s3_event and s3_event['Event'] == 's3:TestEvent':
print("Test Event")
else:
for j in s3_event['Records']:
print("Bucket Name : {} ".format(j['s3']['bucket']['name']))
print("Object Name : {} ".format(j['s3']['object']['key']))
except Exception as exception:
print(exception)
SQS-s3 Access Policy:
----------------------------------
{
"Version": "2012-10-17",
"Id": "Policy1662050523224",
"Statement": [
{
"Sid": "Stmt1662050521697",
"Effect": "Allow",
"Principal": "*",
"Action": "sqs:*",
"Resource": "{SQS Queue ARN}",
"Condition": {
"ArnEquals": {
"aws:SourceArn": "{s3 bucket ARN}"
}
}
}
]
}
Check this playlist for more Data Engineering related videos:
• Demystifying Data Engi...
Snowflake Complete Course from scratch with End-to-End Project with in-depth explanation--
doc.clickup.co...
🙏🙏🙏🙏🙏🙏🙏🙏
YOU JUST NEED TO DO
3 THINGS to support my channel
LIKE
SHARE
&
SUBSCRIBE
TO MY KZbin CHANNEL