Skip to content

Commit

Permalink
Merge pull request #68 from fujiwara/invoke-qualifier
Browse files Browse the repository at this point in the history
invoke --qualifier
  • Loading branch information
fujiwara authored Aug 7, 2020
2 parents d718552 + 1b75264 commit f3adb20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ Flags:
--function="function.json" Function file path
--async invocation type async
--log-tail output tail of log to STDERR
--qualifier=QUALIFIER version or alias to invoke
```

`lambroll invoke` accepts multiple JSON payloads for invocations from STDIN.
Expand Down
1 change: 1 addition & 0 deletions cmd/lambroll/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func _main() int {
FunctionFilePath: function,
Async: invoke.Flag("async", "invocation type async").Bool(),
LogTail: invoke.Flag("log-tail", "output tail of log to STDERR").Bool(),
Qualifier: invoke.Flag("qualifier", "version or alias to invoke").String(),
}

archive := kingpin.Command("archive", "archive zip")
Expand Down
4 changes: 4 additions & 0 deletions invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type InvokeOption struct {
FunctionFilePath *string
Async *bool
LogTail *bool
Qualifier *string
}

// Invoke invokes function
Expand Down Expand Up @@ -56,6 +57,9 @@ PAYLOAD:
LogType: logType,
Payload: b,
}
if len(*opt.Qualifier) > 0 {
in.Qualifier = opt.Qualifier
}
log.Println("[debug] invoking function", in.String())
res, err := app.lambda.Invoke(in)
if err != nil {
Expand Down

0 comments on commit f3adb20

Please sign in to comment.