【发布时间】:2017-03-11 14:47:39
【问题描述】:
我目前正在使用以下映射模板将发送到 AWS API Gateway 端点的数据传递到 AWS Kinesis Firehose 流:
{
"DeliveryStreamName": "[STREAMNAME]",
"Record": {
"Data": "$util.base64Encode($input.body)"
}
}
我想做的是:向$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
}
【问题讨论】:
标签: base64 aws-api-gateway amazon-kinesis-firehose