Labels

Aws (32) MySQL (20) Aurora (12) Rds (7) DynamoDB (6) Cloudformation (4) Python3 (4) Unix (3) MongoDB (1)

Saturday, 9 April 2022

AWS CLI tips #1

 Using the query parameter to filter the output.

Quering using the JMESPath syntax to create expressions to filter out your output.


filter by tag using query

aws rds describe-db-instances --query "DBInstances[0].[DBInstanceIdentifier,TagList[?Key=='Name'].Value]"

rds with their name tag

aws rds describe-db-instances --query "DBInstances[].[DBInstanceIdentifier,TagList[?Key=='Name'].Value]"  --output text | awk 'NR%2{printf $0" ";next;}1'

References link