The aws.details() function in CQL allows you to query and retrieve detailed information about AWS resources. It provides access to metadata and specific attributes of AWS entities, such as load balancers, enabling you to extract specific information like the resource scheme (internal vs public).
To retrieve specific information about AWS load balancers, such as determining whether a load balancer is internal or public, you can use the following CQL query:
jq(aws.details(), ".resources[0].metadata.Scheme")This query combines the aws.details() function with the jq() function to extract the specific Scheme metadata from the AWS resource details.
For DynamoDB tables, you can access specific metadata fields using a different approach. The following CQL query demonstrates how to check if point-in-time recovery is enabled for a DynamoDB table:
aws.details().resources.firstOrNull().metadata.get("PointInTimeRecoverySpecification").get("PointInTimeRecoveryEnabled")This query uses the get() method to navigate through the resource's metadata structure and access specific fields.
When working with the aws.details() function in CQL:
Use the
jq()function for complex path navigation when neededUse the
get()method for accessing nested propertiesUse
firstOrNull()when you need to access the first resource in a collection