Skip to content

Instantly share code, notes, and snippets.

@em-shea
Last active June 25, 2021 09:04
Show Gist options
  • Save em-shea/e60d0ba082f67deaab34b381b7682af2 to your computer and use it in GitHub Desktop.
Save em-shea/e60d0ba082f67deaab34b381b7682af2 to your computer and use it in GitHub Desktop.
# Mock S3 new file uploaded event
def s3_upload_event(self, file_name):
return {
"Records":[
{
"eventVersion":"2.1",
"eventSource":"aws:s3",
"awsRegion":"us-east-1",
"eventTime":"2021-06-18T16:03:17.567Z",
"eventName":"ObjectCreated:Put",
"userIdentity":{
"principalId":"AWS:AIDAI7123123XY"
},
"requestParameters":{
"sourceIPAddress":"12.21.123.69"
},
"responseElements":{
"x-amz-request-id":"D104123123BXXE",
"x-amz-id-2":"DJH/123123/123/76dtHg7yYQ+LHws0xBUmqUrM5bdW"
},
"s3":{
"s3SchemaVersion":"1.0",
"configurationId":"677496ca-4ead-123-123-123",
"bucket":{
"name":"my-bucket-name",
"ownerIdentity":{
"principalId":"A3123123AR5"
},
"arn":"arn:aws:s3:::my-bucket-name"
},
"object":{
"key":file_name,
"size":24,
"eTag":"06a83081d2bb215",
"sequencer":"0060CCC3C"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment