We have a simple architecture as shown in the photo below, where clients sends a request to the API Gateway. API Gateway invokes a custom Auhtorizer which then responds with IAM Policy and Context. The request is then forwarded to the ECS service if allowed.
Our API Gateway integration request type is configured as VPC Link (VPC_PROXY).
We would like to attach the Auhorizers Context to the API Gateway request that is then passed to the ECS Service.
The returned context from the Authorizer looks like this:
"context": {
"users": "[\"21661\"]"
}
We tried mapping the context to the HTTP Headers as suggested by many sources, but it didn't work.
Is it possible to pass the context to ECS service in any other way?