AWS Classroom Series – 21/Jan/2021

JMES Path

  • This is a query language for JSON
  • Lets create a simple json
{
    "course": "AWS",
    "Duration": "75 days",
    "faculty": "khaja"
}
  • For jmes path expressions Refer Here
  • Now lets have a different json file
{
    "Institute": "QualityThought",
    "Courses" : [
        {
            "course": "AWS",
            "Duration": "75 days",
            "faculty": "khaja"
        },
        {
            "course": "Azure",
            "Duration": "75 days",
            "faculty": "khaja"
        },
        {
            "course": "DevOps",
            "Duration": "75 days",
            "faculty": "khaja"
        },
        {
            "course": "Agile",
            "Duration": "30 days",
            "faculty": "Ramana"
        }

        
    ]
}
  • Write a query using aws cli to fetch database instance identifiers
aws rds describe-db-instances --query "DBInstances[*].DBInstanceIdentifier"
  • Write a query using aws cli
    • to fetch database instance id and masterusername
    aws rds describe-db-instances --query "DBInstances[*].[DBInstanceIdentifier, MasterUsername]"
    
      aws rds describe-db-instances --query "DBInstances[*].{ID: DBInstanceIdentifier, Username:MasterUsername}"
    
      aws rds describe-db-instances --query "DBInstances[*].{ID: DBInstanceIdentifier, Username:MasterUsername}" --output table 
    
      aws rds describe-db-instances --query "DBInstances[*].{ID: DBInstanceIdentifier, Username:MasterUsername}" --output text 
    
      aws rds describe-db-instances --query "DBInstances[*].{ID: DBInstanceIdentifier, Username:MasterUsername}" --output yaml
    
    
    • to fetch endpoint address for all mysql database instances
    • Refer Here for the changeset containing all the queries
    • to fetch all the database snapshot identifiers and Status
    aws rds describe-db-snapshots --query "DBSnapshots[*].{Id: DBSnapshotIdentifier, DBId: DBInstanceIdentifier, Status: Status}"
      aws rds describe-db-snapshots --query "DBSnapshots[*].{Id: DBSnapshotIdentifier, DBId: DBInstanceIdentifier, Status: Status}" --output table
    
    • to fetch all the database snapshot identifiers and Snapshot Creation time for mysql engine
    • to fetch all the db subnet group names other than default.
    • Exercise: Delete all the database created and the snapshots

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin