command.md

December 7, 2018 ยท View on GitHub

Update configuration

Update configurations by supplied command options.

$ ginger config [options]
optiondescription
--profileAccout profile name. If empty, ginger uses default or environment variable
--regionRegion name to deploy
--bucketS3 bucket name
--hookDeploy hook command

Deploy all

Deploy all functions, resources, storage items.

$ ginger deploy all [options]
optiondescription
--stageStage name. If this option is supplied, create deployment to stage.

Deploy functions

Build and deploy lambda functions to AWS.

$ ginger deploy function [options]
optiondescription
--nameFunction name. if this option didn't supply, deploy all functions

Deploy resources

Deploy API Gateway resources to AWS.

$ ginger deploy resource [options]

If resource has some integrations, create integration as well.

optiondescription
--stageStage name. If this option is supplied, create deployment to stage.

Deploy storage items

Deploy storage files to S3.

$ ginger deploy storage

Create new function

Create new lambda function.

$ ginger function create [options]
optiondescription
--nameFunction name. If this option isn't supplied, ginger will ask it
--eventFunction event source. function template switches by this option. enable values are s3 or apigateway

Delete function

Delete lambda function.

$ ginger function delete [options]
optiondescription
--name[Required] function name

Invoke function

Invoke lambda function.

$ ginger function invoke [options]
optiondescription
--name[Required] function name
--eventPassing event source data. data must be JSON format string, or can specify file name like @filename

List function

List registered lambda functions.

$ ginger function list

Log function

Tailing log function output via CloudWatch Log.

$ ginger function log [options]
optiondescription
--nameFunction name. If this option isn't supplied, ginger will ask it

Mount function

Create function integration to destination resource.

$ ginger function mount [options]
optiondescription
--nameFunction name. If this option isn't supplied, ginger will ask it
--pathResource path. If this option isn't supplied, ginger will ask it
--methodIntegration method

Unmount function

Delete function integration to destination resource.

$ ginger function unmount [options]
optiondescription
--pathResource path. If this option isn't supplied, ginger will ask it
--methodIntegration method

Build function

Build function binary for your runtime.

$ ginger function build [options]
optiondescription
--nameTarget function name

Test function

Run test on project environment.

$ ginger function test [options]
optiondescription
--nameTarget function name

Run function

Run Lambda function locally. The --event argument accepts event payload of JSON file. In default, use (function-directory)/event.json file if exists. Or, you can use template JSON which corredspons to event source in ginger bundled following:

  • s3
  • apigateway
  • sqs
  • kinesis
  • cloudwatch For example, you can run function with s3 event source as:
$ ginger fn run --name example-function --event s3

And, additional client context data also can provide. put (function-directory)/context.json and defined some JSON values.

$ ginger function run [options]
optiondescription
--nameTarget function name
--eventEvent payload JSON file path

Install dependencies

Install dependency packages for build lambda function.

$ ginger install

This command is run automatically on initialize, but if you checkout project after initialize, You can install dependency packages via this command. ginger detects imports from your *.go file and install inside .ginger directory.

Create new scheduler

Create new cloudwatch scheduler .

$ ginger scheduler create [options]
optiondescription
--nameFunction name. If this option isn't supplied, ginger will ask it

After defined name, ginger want to input expression, you need to input CloudWatchEvent expression. see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html

Delete scheduler

Delete CloudWatchEvent scheduler.

$ ginger scheduler delete [options]
optiondescription
--name[Required] scheduler name

List schedulers

List registered schedulers.

$ ginger scheduler list

Attach scheduler to Lambda function

Relates scheduler to Lambda function.

$ ginger scheduler attach [options]
optiondescription
--nameScheduler name. If this option isn't supplied, ginger will ask it

Ginger will ask attach target function name by list UI.

Show version

Show binary release version.

$ ginger version