https://github.com/mashiike/lambda-gojq
lambda bootstrap for gojq
https://github.com/mashiike/lambda-gojq
Last synced: 6 months ago
JSON representation
lambda bootstrap for gojq
- Host: GitHub
- URL: https://github.com/mashiike/lambda-gojq
- Owner: mashiike
- License: mit
- Created: 2023-03-13T08:48:49.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-05T21:00:58.000Z (over 2 years ago)
- Last Synced: 2025-03-13T23:14:32.624Z (10 months ago)
- Language: Go
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# lambda-gojq


[](https://github.com/mashiike/lambda-gojq/blob/master/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](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html)
for example.
deploy lambda functions, in [lambda directory(default mode)](lambda/default)
The example of lambda directory uses [lambroll](https://github.com/fujiwara/lambroll) for deployment.
For more information on the infrastructure around lambda functions, please refer to [example.tf](lambda/default/example.tf).
```shell
$ cd lambda/
$ make terraform/init
$ make terraform/plan
$ make terraform/apply
$ make deploy
```
## lambda Payload (MODE=default)
for example
```json
{
"query": ". | .time=(now | strftime(\"%Y-%m-%dT%%H:%M:%SZ\"))",
"data": {
"env": "pord",
"port": 80
}
}
```
output
```json
{"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](lambda/firehose)
You can run it as a Lambda for data conversion of Kinesis Data Firehose.
Set the following two environment variables for the Lambda function.
```shell
MODE=firehose
QUERY=""
```
And associate the function with the data conversion Lambda of the delivarly stream of Firehose.
## LICENSE
MIT