Sam deploy --help
Jump to navigation
Jump to search
sam deploy --help
Usage: sam deploy [OPTIONS]
The sam deploy command creates a Cloudformation Stack and deploys your
resources.
e.g. sam deploy --template-file packaged.yaml --stack-name sam-app --capabilities CAPABILITY_IAM
Options:
--config-env TEXT The environment name specifying the default
parameter values in the configuration file
to use. Its default value is 'default'. For
more information about configuration files,
see: https://docs.aws.amazon.com/serverless-
application-
model/latest/developerguide/serverless-sam-
cli-config.html.
--config-file TEXT The path and file name of the configuration
file containing default parameter values to
use. Its default value is 'samconfig.toml'
in project directory. For more information
about configuration files, see:
https://docs.aws.amazon.com/serverless-
application-
model/latest/developerguide/serverless-sam-
cli-config.html.
-g, --guided Specify this flag to allow SAM CLI to guide
you through the deployment using guided
prompts.
-t, --template-file, --template PATH
AWS SAM template which references built
artifacts for resources in the template. (if
applicable) [default:
template.[yaml|yml|json]]
--stack-name TEXT The name of the AWS CloudFormation stack
you're deploying to. If you specify an
existing stack, the command updates the
stack. If you specify a new stack, the
command creates it.
--s3-bucket TEXT The name of the S3 bucket where this command
uploads your CloudFormation template. This
is required the deployments of templates
sized greater than 51,200 bytes
--image-repository ECR repo uri where this command uploads the
image artifacts that are referenced in your
template.
--image-repositories Specify mapping of Function Logical ID to
ECR Repo uri, of the form
Function_Logical_ID=ECR_Repo_Uri.This option
can be specified multiple times.
--force-upload Indicates whether to override existing files
in the S3 bucket. Specify this flag to
upload artifacts even if they match existing
artifacts in the S3 bucket.
--s3-prefix TEXT A prefix name that the command adds to the
artifacts' name when it uploads them to the
S3 bucket. The prefix name is a path name
(folder name) for the S3 bucket.
--kms-key-id TEXT The ID of an AWS KMS key that the command
uses to encrypt artifacts that are at rest
in the S3 bucket.
--no-execute-changeset Indicates whether to execute the change set.
Specify this flag if you want to view your
stack changes before executing the change
set. The command creates an AWS
CloudFormation change set and then exits
without executing the change set. if the
changeset looks satisfactory, the stack
changes can be made by running the same
command without specifying `--no-execute-
changeset`
--role-arn TEXT The Amazon Resource Name (ARN) of an AWS
Identity and Access Management (IAM) role
that AWS CloudFormation assumes when
executing the change set.
--fail-on-empty-changeset / --no-fail-on-empty-changeset
Specify if the CLI should return a non-
zero exit code if there are no changes to be
made to the stack. The default behavior is
to return a non-zero exit code.
--confirm-changeset / --no-confirm-changeset
Prompt to confirm if the computed changeset
is to be deployed by SAM CLI.
--use-json Indicates whether to use JSON as the format
for the output AWS CloudFormation template.
YAML is used by default.
--resolve-s3 Automatically resolve s3 bucket for non-
guided deployments.Do not use --s3-guided
parameter with this option.
--metadata Optional. A map of metadata to attach to ALL
the artifacts that are referenced in your
template.
--notification-arns LIST Amazon Simple Notification Service
topicAmazon Resource Names (ARNs) that
AWS CloudFormation associates withthe stack.
--tags A list of tags to associate with the stack
that is created or updated.AWS
CloudFormation also propagates these tags to
resources in the stack if the resource
supports it.
--parameter-overrides Optional. A string that contains AWS
CloudFormation parameter overrides encoded
as key=value pairs.For example, 'ParameterKe
y=KeyPairName,ParameterValue=MyKey Parameter
Key=InstanceType,ParameterValue=t1.micro' or
KeyPairName=MyKey InstanceType=t1.micro
--signing-profiles Optional. A string that contains Code Sign
configuration parameters as FunctionOrLayerN
ameToSign=SigningProfileName:SigningProfileO
wner Since signing profile owner is
optional, it could also be written as
FunctionOrLayerNameToSign=SigningProfileName
--no-progressbar Does not showcase a progress bar when
uploading artifacts to s3
--capabilities LIST A list of capabilities that you must
specifybefore AWS Cloudformation can
create certain stacks. Some stack tem-plates
might include resources that can affect
permissions in your AWSaccount, for
example, by creating new AWS Identity and
Access Manage-ment (IAM) users. For those
stacks, you must explicitly
acknowledgetheir capabilities by specifying
this parameter. The only valid valuesare
CAPABILITY_IAM and CAPABILITY_NAMED_IAM. If
you have IAM resources,you can specify
either capability. If you have IAM resources
with cus-tom names, you must specify
CAPABILITY_NAMED_IAM. If you don't
specifythis parameter, this action returns
an InsufficientCapabilities error.
--profile TEXT Select a specific profile from your
credential file to get AWS credentials.
--region TEXT Set the AWS Region of the service (e.g. us-
east-1).
--debug Turn on debug logging to print debug message
generated by SAM CLI and display timestamps.
-h, --help Show this message and exit.
See also[edit]
- AWS SAM:
sam[init | deploy | build | local ],sam --version,sam --help
Advertising: