我目前正在使用以下映射模板将发送到AWS API Gateway端点的数据传递给AWS Kinesis Firehose流:
{
"DeliveryStreamName": "[STREAMNAME]",
"Record": {
"Data": "$util.base64Encode($input.body)"
}
}
Run Code Online (Sandbox Code Playgroud)
我想要做的是:向$input.body正在编码的信息添加信息,就像$context.identity.sourceIp发出请求的客户端一样.
当传递给Kinesis Firehose的输出需要进行Base64编码时,我该如何解决这个问题呢?理想情况下,我希望发布到Kinesis Firehose的数据如下所示:
{
"x": 1,
"y": 2,
"z": 3,
..., // all the properties from the JSON-request by the client
"clientIp": "x.x.x.x" // property added by API-Gateway into client's object
}
Run Code Online (Sandbox Code Playgroud)