The sam package command doesn't document the --output-template-file in the options list. It does use it in the example, but them leaves it out of the documented options.
Also suggest it should document the --s3-prefix option.
sam package --help
Usage: sam package [OPTIONS] [ARGS]...
The SAM package command creates a zip of your code and dependencies and
uploads it to S3. The command returns a copy of your template, replacing
references to local artifacts with the S3 location where the command
uploaded the artifacts.
e.g. sam package --template-file template.yaml --output-template-file packaged.yaml
--s3-bucket REPLACE_THIS_WITH_YOUR_S3_BUCKET_NAME
This is an alias for aws cloudformation package. To learn about other parameters you can use,
run aws cloudformation package help.
Options:
--template-file PATH The path where your AWS SAM template is located
--s3-bucket TEXT The name of the S3 bucket where this command uploads
the artifacts that are referenced in your template.
[required]
--debug Turn on debug logging to print debug message generated
by SAM CLI.
--help Show this message and exit.
Expected --output-template-file option to be documented under 'Options'. And suggest the --s3-prefix option should be there too.
sam --version: SAM CLI, version 0.18.0Aside from the fact that the documentation is missing the text on --output-template-file under _OPTIONS_ does sam-cli honor if the flag is passed ?
Yes @amieka the options work fine if passed. Just that this and some other highly useful options aren't documented, so you can only find out about them through other people's examples or some reverse engineering.
This will be addressed with #1437.
sam package shells out to aws cloudformation package in AWS CLI. Any option your installed AWS CLI version supports is supported by sam package. Which is also mentioned in the help text: "This is an alias for aws cloudformation package. To learn about other parameters you can use,
run aws cloudformation package help."
This is an alias for aws cloudformation package. To learn about other parameters you can use,
run aws cloudformation package help.
Good point @jfuss, didn't even see that; my eye steers straight to the Options: heading and ignored the intro 馃槃 My fault, but it maybe worth moving that sentence at the end of 'Options' rather than in the intro.
We have recently removed our reliance on aws cli for sam package. Starting in v0.31.0, all options are present in the help text. We are still working through deploy.
Given this issue is about package, I am going to close this one.
Most helpful comment
We have recently removed our reliance on aws cli for
sam package. Starting in v0.31.0, all options are present in the help text. We are still working through deploy.Given this issue is about package, I am going to close this one.