title: Cant get API Gateway `RequestId` in Lambda function
body: <p>I sent a post and get the response from amazon API Gateway as:</p>
  
  <pre><code>{"MD5OfMessageBody": "bc709a65868c21309969a07cfeeac12f", "MD5OfMessageAttributes": "8a66ae91e9109cb75717520c287736eb", "MessageId": "b70a5453-5f30-4914-8006-b6cf7fa4ff93", "ResponseMetadata": {"RequestId": "1a38fbb5-859a-53f9-9551-a805d864768c", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Fri, 29 Jun 2018 16:18:06 GMT", "content-type": "text/xml", "content-length": "459", "connection": "keep-alive", "x-amzn-requestid": "1a38fbb5-859a-53f9-9551-a805d864768c"}, "RetryAttempts": 0}}
  </code></pre>
  
  <p>When I look in the event object passed into the handler function in lambda:
  <code>def lambda_handler(event, context):</code></p>
  
  <pre><code>{'resource': '/python_job_to_sqs', 'path': '/python_job_to_sqs', 'httpMethod': 'POST', 'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'CloudFront-Forwarded-Proto': 'https', 'CloudFront-Is-Desktop-Viewer': 'true', 'CloudFront-Is-Mobile-Viewer': 'false', 'CloudFront-Is-SmartTV-Viewer': 'false', 'CloudFront-Is-Tablet-Viewer': 'false', 'CloudFront-Viewer-Country': 'US', 'Content-Type': 'application/json', 'Host': '5p1xcqn2y5.execute-api.us-east-1.amazonaws.com', 'User-Agent': 'python-requests/2.14.2', 'Via': '1.1 c7db0c4b178dd73a64add79be10805c2.cloudfront.net (CloudFront)', 'X-Amz-Cf-Id': 'QkdNKg7VrrB6tJ0wynZwYvCxSYpLMTGkm9CK6CsYhw-jLDqTI0-x6g==', 'X-Amzn-Trace-Id': 'Root=1-5b365bbd-9dd143fc6325d468485f44a0', 'X-Forwarded-For': '38.77.16.218, 204.246.180.73', 'X-Forwarded-Port': '443', 'X-Forwarded-Proto': 'https'}, 'queryStringParameters': None, 'pathParameters': None, 'stageVariables': None, 'requestContext': {'resourceId': 'i42qmv', 'resourcePath': '/python_job_to_sqs', 'httpMethod': 'POST', 'extendedRequestId': 'JQNFqFZjoAMFf8g=', 'requestTime': '29/Jun/2018:16:18:05 +0000', 'path': '/production/python_job_to_sqs', 'accountId': '130491730454', 'protocol': 'HTTP/1.1', 'stage': 'production', 'requestTimeEpoch': 1530289085866, 'requestId': '012c013f-7bb8-11e8-bed9-1ff9514513cd', 'identity': {'cognitoIdentityPoolId': None, 'accountId': None, 'cognitoIdentityId': None, 'caller': None, 'sourceIp': '38.77.16.218', 'accessKey': None, 'cognitoAuthenticationType': None, 'cognitoAuthenticationProvider': None, 'userArn': None, 'userAgent': 'python-requests/2.14.2', 'user': None}, 'apiId': '5p1xcqn2y5'}, 'body': '{"input": [{"value": "test.co", "fieldName": "tld"}]}, 'isBase64Encoded': False}
  </code></pre>
  
  <p>It seems in other frameworks the <code>requestContext['requestId']</code> which here is <code>012c013f-7bb8-11e8-bed9-1ff9514513cd</code> is supposed to be the request ID passed in from the API Gateway. But <code>012c013f-7bb8-11e8-bed9-1ff9514513cd != 1a38fbb5-859a-53f9-9551-a805d864768c</code>. Is this a bug in their framework that they're replacing this with the lambda function ID?</p>