Re-encrypt itself is a hyphenated word, so you'll see hyphens in those cases or if the subcommand is two words or more. Check out the s3api CLI documentation for examples.
Thanks that's what I was wondering. I found a few as I was going thru some training.
aws kms encrypt aws kms re-encrypt So that indicates that kms is the command and encrypt and re-encrypt are the subcommands? That's what I don't understand.
As described in Command structure in the AWS CLI, the command structure is:
$ aws <command> <subcommand> [options and parameters]
To my knowledge, none of the commands or subcommands require leading dashes, only the command/subcommand specific options require a leading double dash.
Can you provide any examples of "some CLI commands that have dashes (-)"?
Hello, Larry. From your follow-up question, it is my hope that this adds to your search for clarity.
In the example of your most recent question,
aws kms, in that case, follows the nomenclature of
aws <service> and not of
To be fair, re-encrypt is a hyphenated word on its own, but to be clear, an example from
aws iam list-users is used below, where
list-users is the command, and is singly hyphenated. Mike has included an S3api resource as well, which describes additional instances of multiple worded subcommands that occur without a conventional service declaration.
One reason for the hyphenation between commands containing multiple words, is to prevent unnecessary whitespace between parameters, thereby avoiding conflicts in readability, etc. To add, the double hyphenation tends to occur at the beginning of another command, whether to offer a selection choice (as in file input/output type, seen below with
[--cli-input-json | --cli-input-yaml]), or for the option to pass objects to a specified file location, as seen in
In the portion of the AWS CLI User Guide,
[Generating an AWS CLI skeleton and input file] (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-skeleton.html), the following is shown to illustrate that, in general, the AWS
service input occurs directly after the
$ aws service command help
e.g. of "input":
$ aws iam list-users help ... SYNOPSIS list-users ... [--cli-input-json | --cli-input-yaml] ... [--generate-cli-skeleton <value>] ...
Feel free to ask, if there are any follow-up questions!
AWS CLI commands after AWS SDK credential store authenticationAccepted Answerasked 8 months ago
dashes in CLI commandsasked 10 months ago
Can I enforce MFA for console sign in but not for access key (CLI) sign in?asked 3 years ago
aws cli commands hang on outputasked 8 months ago
Redshift Enhanced VPC Routing and Cross-Region COPY and UNLOAD commandsAccepted Answerasked 3 months ago
Is there any way to create and access game data bundles and items that do not bounds to user? Shared bundlesasked 4 months ago
Is there way for users in china to access my s3, ec2 and api gateways?asked 9 days ago
Accessing files and CLI inside of container deployment in lightsailAccepted Answerasked 5 months ago
Does AWS Has InspectorV2 CLI commandsAccepted Answerasked 6 months ago
is it possible to creating Control Tower OUs programmatically with selected guardrails?asked 2 months ago