You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A feature like the flag; --generate-cli-skeleton , that returns a sample output of a command
Use Case
A lot of times I would like to initialize a variable with a value queried from an output of an aws cli command, but I don't immedeately know what to query. This forces me to search online for the structure of the output, do the command twice (once to see the output structure, and the second time to query items I need), or run the command and copy what I need manually. None of these are the convenient way to do it.
Here is an example; assume I want to save the key material value I get from the command aws ec2 create-key-material to a .pem file. Naturally, I would like to know the structure of the return value of this command, so I would pick the item I want to save to a variable
Proposed Solution
A flag to see sample output of a command without running the command (similar to how --generate-key-skeleton does). E.g, let's assume the flag has a name --show-sample-output, we could do it for the command; aws ec2 create-key-pair --key-name example --show-sample-output and get the following as a sample output;
With the sample output above, I'll know exactly what to query. I'll know I have to add --query 'KeyMaterial' from the result of the command aws ec2 create-key-pair --key-name example, resulting in aws ec2 create-key-pair --key-name 'Example' --query 'KeyMaterial'
Thanks for the feature request. I brought this up for discussion with the team, and the consensus was that this request will not be considered at this time. You can use the help command for this use case, for example aws ec2 create-key-pair help, to view the output of that command.
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
Describe the feature
A feature like the flag; --generate-cli-skeleton , that returns a sample output of a command
Use Case
A lot of times I would like to initialize a variable with a value queried from an output of an aws cli command, but I don't immedeately know what to query. This forces me to search online for the structure of the output, do the command twice (once to see the output structure, and the second time to query items I need), or run the command and copy what I need manually. None of these are the convenient way to do it.
Here is an example; assume I want to save the key material value I get from the command
aws ec2 create-key-material
to a .pem file. Naturally, I would like to know the structure of the return value of this command, so I would pick the item I want to save to a variableProposed Solution
A flag to see sample output of a command without running the command (similar to how --generate-key-skeleton does). E.g, let's assume the flag has a name --show-sample-output, we could do it for the command;
aws ec2 create-key-pair --key-name example --show-sample-output
and get the following as a sample output;With the sample output above, I'll know exactly what to query. I'll know I have to add
--query 'KeyMaterial'
from the result of the commandaws ec2 create-key-pair --key-name example
, resulting inaws ec2 create-key-pair --key-name 'Example' --query 'KeyMaterial'
Other Information
No response
Acknowledgements
CLI version used
aws-cli/2.15.42
Environment details (OS name and version, etc.)
Python/3.11.8 Linux/5.15.153.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off
The text was updated successfully, but these errors were encountered: