AWS Testing Permissions With Dry Run Option & Testing Functionality With JEMSPath Terminal

AWS Testing Permissions With Dry Run Option & Testing Functionality With JEMSPath Terminal

#AWS Testing Permissions With Dry Run Option:

How we can verify, if current IAM user has permissions or not to perform operations on AWS CLI.

To check this we have a AWS feature that is Dry Run Option.

Lets see how we can use this feature...

>> aws ec2 describe-regions --dry-run

Output>> An error occurred (Dry Run Operation) when calling describe regions Operations:Request would have succeed, but Dry-Run flag is set.

Here above output statement tells that IAM user which we are using has necessary permissions to execute this command. Since we are executing this command with dry-run parameters / flag, It does not give out but it shows an informational message which confirm IAM user has permission to run this command.

#Testing Functionality With JEMSPath Terminal:

JEMSPath terminal is a JEMSPath expression tool which run in terminals. This tool will help us to write query expressions for aws cli commands.

To install this tool type command below and press enter.

>> sudo pip install jmespath-terminal

lets checkout this tool's feature provided for AWS CLI...

>> aws ec2 describe-regions | jpterm

So, on above example we are exporting output of left side command of pipe separator JEMSPath window. You will see jpterm has two blocks below.

1: Left Block (Input JSON) 
2: Right BLock (JMESPath Result)

So on the left block you can see much more easy formatted JSON output and on the right side block we can write query to filter out the output.




So instead of manually checking, editing and repeatedly rechecking JEMSPath expression and using hit & try method, to write your query expression. Using JEMSPath terminal is best way to execute query expressions.

JEMSPath Expression: Regions[?RegionName=='us-west-2']  

Once you run above expression in JEMSPath terminal, it will filter out result and display output on right side block.

To execute JEMSPath terminal use "F5" or "ctrl + c"

AWS Testing Permissions With Dry Run Option & Testing Functionality With JEMSPath Terminal AWS Testing Permissions With Dry Run Option & Testing Functionality With JEMSPath Terminal Reviewed by Pranay Gondane on 5:33:00 AM Rating: 5

No comments

Free! Free!Free! Subscribe to Get Free PHP (Magento) tutorial Update in Your Inbox!!! Hurry Up!!!