Configure Response Header Mappings
Configure response header mappings to pass ADRUM_n headers back to the browser. You can configure response header mappings using the AWS API Gateway or pass them directly using AWS Lambda Proxy Integration.
Response Header Mappings in Amazon API Gateway
Add header mappings for each ADRUM_n header in the Amazon API Gateway. To configure response header mappings in the Amazon API Gateway, refer to the Amazon documentation.
Next, return the ADRUM_n headers as part of the AWS Lambda function output. You can use another field name, as long your function code is consistent with the response header mappings.
This code snippet shows how to add the headers field to an output object class:
// add the field eumMetadata to your output object class
// return the EUM ADRUM_n headers in the output object
String outputString = "success";
Output outputObj = new Output(outputString);
OutputObj.eumMetadata = eumMetadata;
output.write(new Gson().toJson(outputObj).getBytes(StandardCharsets.UTF_8));
Response Header Mappings in AWS Lambda Proxy Integration
As an alternative to custom integration, AWS Lambda proxy integration allows the client to call each function in the backend and returns output in a JSON format. Map these responses by adding each single-value ADRUM_n header directly to the headers field in your output object class. Refer to the Amazon documentation for details.