lambda-gojq

command module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2023 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

lambda-gojq

Latest GitHub release Github Actions test License

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}    

Usage with Amazon Kinesis Data Firehose for Data tranform

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL