Skip to content

Instantly share code, notes, and snippets.

@omurbekjk
Last active December 14, 2017 11:15
Show Gist options
  • Save omurbekjk/2b35c96a13f38340fede4ab93cb01a67 to your computer and use it in GitHub Desktop.
Save omurbekjk/2b35c96a13f38340fede4ab93cb01a67 to your computer and use it in GitHub Desktop.

Cloud Coreo | Continuous Cloud Automation

Introduction

Moose FINAL green transparent

CloudCoreo has taken a snapshot of your AWS cloud account and stored the data in this neo4j graph.

Favorite Queries

We added some favorite queries to highlight interesting relationships in your AWS cloud account.

Standard Model

// comment goes here
match (node) where not node:owner and not node:instance_owner and not node:network_interface and not node:reservation and not node:security_group and not node:snapshot and not node:spot_instance_request return (node)

Public instances:

// comment goes here
match (n)-[:internet_gateway_route]-(p)-[:route_route_table]-(p2)-[:route_table_route_table_association]-(p3)-[:route_table_association_subnet]-(p4)-[:instance_subnet]-(p5) return n,p,p2,p3,p4,p5

Public instances with key pair "dev-shared":

// comment goes here
match (n)-[:internet_gateway_route]-(p)-[:route_route_table]-(p2)-[:route_table_route_table_association]-(p3)-[:route_table_association_subnet]-(p4)-[:instance_subnet]-(p5)-[:instance_key_pair]-(p6 {key_name: 'dev-shared'}) return n,p,p2,p3,p4,p5,p6

VPCs with instances:

// comment goes here
match (n)-[:internet_gateway_route]-(p)-[:route_route_table]-(p2)-[:route_table_route_table_association]-(p3)-[:route_table_association_subnet]-(p4)-[:instance_subnet]-(p5)-[:instance_key_pair]-(p6 {key_name: 'dev-shared'}) return n,p,p2,p3,p4,p5,p6

Isolated EC2 instances:

// it will return isolated EC2 instances
match (n:instance)-[*]-(p) where not (n:instance)-[:instance_subnet]-() return n,p

Shortest path closest connection:

// it will return isolated EC2 instances
MATCH p=shortestPath(
  (node1:instance )-[*]-(node2:internet_gateway)
)
RETURN p

Created by CloudCoreo Team. Twitter: @cloudcoreo

Play this GraphGist in your Neo4j console Run this line in your Neo4j web console:

:playhttps://portal.graphgist.org/graph_gists/cloudcoreo-candidate-2/graph_guide You will likely need to configure your whitelist in Neo4j:

Neo4j 3.0

browser.remote_content_hostname_whitelist=http://portal.graphgist.org Before Neo4j 3.0

dbms.browser.remote_content_hostname_whitelist="http://portal.graphgist.org"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment