As part of an asynchronous content handling system, we've defined an API Gateway method bound to the S3 integration service that forwards POST requests to an S3 bucket. We then use an S3 event trigger to an ObjectCreated
event to an SQS queue, which is eventually consumed by a Lambda function for subsequent processing.
We have a new processing requirement that requires us to identify the API Key ID used to authenticate the original APIGW request in the SQS handler lambda, but we've not come up with an approach. We looked for a way to pass the Authorization
header of the client request as part of the event content received by the processing lambda, without success – I suspect the incoming request to S3 to create the object may well be completely distinct from the context of the S3 trigger (which fires regardless of where the new object came from). We've also looked for some way to map an Authorization
header (or mapped query parameter) to S3 metadata, again, no joy. The AWS S3 integration service is a black box with black ports, not well documented, so I can't tell if there's a way to do this
Worst case we can probably use the RequestId
to correlate the ObjectCreated
event with some kind of log entry, but that's more fragile than I'd prefer; I'd much rather do it as part of proxy integration configuration if possible.
Any thoughts?