title: Python accessing AWS SQS message created by S3
body: <p>Whenever a file is uploaded to S3, I appreciate that S3 can write a message to SQS. However, accessing the file name ("key":"filename.txt") in the SQS message body from Python is a bit problematic since it's a dictionary that contains a list with multiple dictionaries. </p>
  
  <p>Has anyone accessed the filename in the SQS message body when <em>that message was created by an S3 event</em>?  </p>
  
  <p>The full message is:</p>
  
  <pre><code>{
      "Records": [{
          "eventVersion": "2.0",
          "eventSource": "aws:s3",
          "awsRegion": "us-west-2",
          "eventTime": "2016-12-04T22:14:52.325Z",
          "eventName": "ObjectCreated:Put",
          "userIdentity": {
              "principalId": "ABC123"
          },
          "requestParameters": {
              "sourceIPAddress": "12.345.687.899"
          },
          "responseElements": {
              "x-amz-request-id": "ABC123",
              "x-amz-id-2": "ABCDEF"
          },
          "s3": {
              "s3SchemaVersion": "1.0",
              "configurationId": "MyQueueName",
              "bucket": {
                  "name": "mybucket",
                  "ownerIdentity": {
                      "principalId": "ABC123"
                  },
                  "arn": "arn:aws:s3:::mybucket"
              },
              "object": {
                  "key": "filename.txt",
                  "size": 2310,
                  "eTag": "defg123",
                  "sequencer": "00345"
              }
          }
      }]
  }
  </code></pre>