lambda-gojq
AWS Lambda bootstrap for https://github.com/itchyny/gojq
Usage with AWS Lambda (serverless)
Let's solidify the Lambda package with the following zip arcive (runtime provided.al2
)
lambda.zip
└── bootstrap
A related document is https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html
for example.
deploy lambda functions, in lambda directory(default mode)
The example of lambda directory uses lambroll for deployment.
For more information on the infrastructure around lambda functions, please refer to example.tf.
$ cd lambda/
$ make terraform/init
$ make terraform/plan
$ make terraform/apply
$ make deploy
lambda Payload (MODE=default)
for example
{
"query": ". | .time=(now | strftime(\"%Y-%m-%dT%%H:%M:%SZ\"))",
"data": {
"env": "pord",
"port": 80
}
}
output
{"env":"pord","hoge":"2023-03-13T%H:32:52Z","port":80}
example is lambda/firehose directory
You can run it as a Lambda for data conversion of Kinesis Data Firehose.
Set the following two environment variables for the Lambda function.
MODE=firehose
QUERY="<gojq expression to apply to each record>"
And associate the function with the data conversion Lambda of the delivarly stream of Firehose.
LICENSE
MIT