Publish Module
The publish
command is used to upload the compiled module and its artifacts to the deployment bucket.
Arguments
The publish
command takes an optional path. The path can either refer to a manifest file, a module definition, or a folder containing a Module.yml
file.
If the path does not refer to a manifest file, the publish
command invokes the build
command to compile the module and its artifacts.
lash new function MyNewFunction
Options
--no-assembly-validation
-
(optional) Disable validating LambdaSharp assembly references in function project files
-c|--configuration <CONFIGURATION>
-
(optional) Build configuration for function projects (default: "Release")
--git-sha <VALUE>
-
(optional) Git SHA of most recent git commit (default: invoke
git rev-parse HEAD
command) --git-branch <VALUE>
-
(optional) (optional) Git branch name (default: invoke
git rev-parse --abbrev-ref HEAD
command) --output|-o <DIRECTORY>
-
(optional) Path to output directory (default: bin)
--selector <NAME>
-
(optional) Selector for resolving conditional compilation choices in module
--cfn-output <FILE>
-
(optional) Name of generated CloudFormation template file (default: bin/cloudformation.json)
--module-origin <ORIGIN>
-
(optional) Set alternative module origin when publishing a locally built module
--module-version <VERSION>
-
(optional) Override the module version
--module-build-date <DATE>
-
(optional) Override module build date [yyyyMMddHHmmss]
--from-bucket <BUCKET>
-
(optional) Use specified S3 bucket to import module from instead of module origin
--force-build
-
(optional) Always build function packages
--force-refresh
-
(optional) Always refresh manifests from their origin
--build-policy <FILEPATH>
-
(optional) Provide build policy document file path
--dryrun[:<LEVEL>]
-
(optional) Generate output artifacts without deploying (0=everything, 1=cloudformation)
--tier|-T <NAME>
-
(optional) Name of deployment tier (default:
LAMBDASHARP_TIER
environment variable) --aws-profile|-P <NAME>
-
(optional) Use a specific AWS profile from the AWS credentials file
--aws-region <NAME>
-
(optional) Use a specific AWS region (default: read from AWS profile)
--verbose|-V[:<LEVEL>]
-
(optional) Show verbose output (0=Quiet, 1=Normal, 2=Detailed, 3=Exceptions; Normal if LEVEL is omitted)
--no-ansi
-
(optional) Disable colored ANSI terminal output
--quiet
-
(optional) Don't show banner or execution time
--no-beep
-
(optional) Don't emit beep when finished
Examples
Build and publish module in current folder
Using PowerShell/Bash:
lash publish
Output:
LambdaSharp CLI (v0.7.0) - Publish LambdaSharp module
Reading module: Module.yml
Compiling: Demo.SlackTodo (v1.0-DEV)
=> Building function SlackCommand [netcoreapp3.1, Release]
=> Module compilation done: bin\cloudformation.json
Publishing module: Demo.SlackTodo
=> Uploading artifact: s3://lambdasharp-bucket-name/lambdasharp-bucket-name/LambdaSharp/Demo.SlackTodo/.artifacts/function_Demo.SlackTodo_SlackCommand_E0F4477DDAFDC152C8B66343657E9425.zip
=> Uploading template: s3://lambdasharp-bucket-name/lambdasharp-bucket-name/LambdaSharp/Demo.SlackTodo/.artifacts/cloudformation_Demo.SlackTodo_939992254E194760372083264D08D795.json
Done (finished: 9/5/2019 1:07:28 PM; duration: 00:00:11.1692368)
Publish manifest
Using PowerShell/Bash:
lash publish bin/cloudformation.json
Output:
LambdaSharp CLI (v0.7.0) - Publish LambdaSharp module
Publishing module: Demo.SlackTodo
=> Uploading artifact: s3://lambdasharp-bucket-name/lambdasharp-bucket-name/LambdaSharp/Demo.SlackTodo/.artifacts/function_Demo.SlackTodo_SlackCommand_E0F4477DDAFDC152C8B66343657E9425.zip
=> Uploading template: s3://lambdasharp-bucket-name/lambdasharp-bucket-name/LambdaSharp/Demo.SlackTodo/.artifacts/cloudformation_Demo.SlackTodo_939992254E194760372083264D08D795.json
Done (finished: 9/5/2019 1:07:28 PM; duration: 00:00:11.1692368)