Command Line Options
var lambdaFunctions *sparta.LambdaAWSInfo lambdaFunctions = append(lambdaFunctions, lambdaFn) err := sparta.Main("SpartaHelloWorld", fmt.Sprintf("Test HelloWorld resource command"), lambdaFunctions, nil, nil)
A compiled application provides several command line options which are available by providing the
-h/--help option as in:
$ ./SpartaHelloWorld --help Test HelloWorld resource command Usage: SpartaHelloWorld [command] Available Commands: version Sparta framework version provision Provision service delete Delete service execute Execute describe Describe service explore Interactively explore service Flags: -l, --level string Log level [panic, fatal, error, warn, info, debug]' (default "info") -n, --noop Dry-run behavior only (do not perform mutations) Use "SpartaHelloWorld [command] --help" for more information about a command.
provision option is the verb most likely to be used during development. It provisions the Sparta application to AWS Lambda.
This simply deletes the stack (if present). Attempting to delete a non-empty stack is not treated as an error.
describe command line option produces an HTML summary (see graph.html for an example) of your Sparta service.
The report also includes the automatically generated CloudFormation template which can be helpful when diagnosing provisioning errors.
execute option is typically used when the compiled application is launched in the AWS Lambda environment. It starts up an HTTP listener to which the NodeJS proxing tier forwards requests.
explore option creates a localhost server to allow Sparta lambda functions to be tested locally.
NOTE: API Gateway mapping templates are not currently supported.
version option is a diagnostic command that prints the version of the Sparta framework embedded in the application.