Sample Queries ============== Find old IAM user access keys :: select ?account_id ?iam_user_name ?access_key_id ?access_key_create_date ?access_key_status where { ?iam_user a ; ?iam_user_name ; ?account . ?account ?account_id optional { ?iam_user ?access_key . ?access_key ?access_key_id ; ?access_key_create_date ; ?access_key_status } } order by ?access_key_create_date Locate vpcs with no ec2 instances, rds instances lambdas or ENIs attached. :: select ?account_id ?region_name ?vpc_id where { ?vpc a ; ?account ; ?region ; ?vpc_id ; ?is_default . ?region ?region_name . ?account ?account_id . FILTER NOT EXISTS { ?resource ?vpc . ?resource a ?resource_type . FILTER ( ?resource_type = || ?resource_type = || ?resource_type = || ?resource_type = ) } } order by ?account_id ?region_name ?vpc_id Locate EC2 instances which are running, have a public IP and have security groups which allow tcp port 22, ordered by uptime. :: select ?launch_time ?ec2_instance_id ?sg_id ?public_ip_address ?from_port ?to_port where { ?ec2_instance a ; ?ec2_instance_id ; ?account ; ?public_ip_address ; 'running' ; ?launch_time ; ?sg . ?sg ?sg_id ; ?ingress_rule . ?ingress_rule 'tcp' ; ?from_port ; ?to_port FILTER (?from_port <= 22 && ?to_port >= 22) } order by desc(?launch_time)