Note: if you are running CloudGraph locally you can view the interactive, automatically generated documentation in either GraphQL Playground or Altair by clicking the docs button on the right-hand side of the screen. After reading the below information we highly suggest you use one of these tools to test your queries as they will autocomplete fields for you and let you know if your queries are valid before you even submit them.
Overview
You can currently query the following attributes and connections on an Route 53 Record:
GraphQL
|
query{queryawsRoute53Record{idaccountIdzoneIdalias{zoneIdnameevaluateTargetHealth}typettlrecordsroute53HostedZone{arn# Other fields and connections here...}elb{arn# Other fields and connections here...}alb{arn# Other fields and connections here...}restApi{arn# Other fields and connections here...}}}
Filtering
Get data for a single Route 53 Record that you know the id for:
GraphQL
|
query{getawsRoute53Record(id:"12345"){id# Other fields and connections here...}}
Get data for all of the Route 53 Records in a certain AWS account:
GraphQL
|
query{queryawsRoute53Record(filter:{accountId:{eq:"12345"}}){id# Other fields and connections here...}}# Note that in addition to "accountId" you can# Filter based on any of the following attributes:# id# zoneId# type# ttl# And the following Dgraph filters can also be applied:# has# and# or# not# regexp (regular expressions)# fulltext filters# alloftext# anyoftext
Get data for all of the Route 53 Records that are NOT in a certain AWS account:
GraphQL
|
query{queryawsRoute53Record(filter:{not:{accountId:{eq:"12345"}}}){id# Other fields and connections here...}}
Advanced Filtering
Get data for all of the Route 53 Records that have a Hosted Zone:
GraphQL
|
query{queryawsRoute53Record(filter:{has:route53HostedZone}){id# Other fields and connections here...}}# Note that in addition to "route53HostedZone" you can filter# Using "has" based on any of the following attributes:# id# accountId# zoneId# alias# ttl# records# elb# alb# restApi
Use multiple filter selectors, (i.e. has, and, not, or) to get data for all of the Route 53 Records that have a restApi AND records OR that do not have an alb. Note that you can use has, and, not, or completely independently of each other:
GraphQL
|
query{queryawsRoute53Record(filter:{has:restApiand:{has:records}or:{not:{has:alb}}}){id# Other fields and connections here...}}
You may also filter using a regex when filtering on a string field like, type if you want to look for a value that matches say, cname (case insensitive):
GraphQL
|
query{queryawsRoute53Record(filter:{type:{regexp:"/.*cname*./i"}}){arn# Other fields and connections here...}}
Ordering
You can order the results you get back either asc or desc depending on your preference:
GraphQL
|
query{queryawsRoute53Record(order:{desc:type}){zoneId# Other fields and connections here...}}# Note that in addition to "type" you can filter# Using "asc" or "desc" based on any of the following attributes:# id# accountId# zoneId# ttl
Only select and return the first two Route 53 Records that are found:
GraphQL
|
query{queryawsRoute53Record(first:2,order:{desc:type}){id# Other fields and connections here...}}
Only select and return the first two Route 53 Records that are found, but offset by one so Route 53 Records two & three are returned:
GraphQL
|
query{queryawsRoute53Record(first:2,order:{desc:type},offset:1){id# Other fields and connections here...}}
Aggregation
Count the number of Route 53 Records across all scanned AWS accounts:
GraphQL
|
query{aggregateawsRoute53Record{count# Other fields and connections here...}}# Note that in addition to "count" you can request the# Following min and max values based on attributes of your Route 53 Records:# idMin# idMax# accountIdMin# accountIdMax# zoneIdMin# zoneIdMax# typeMin# typeMax# ttlMin# ttlMax
Count the number of Route 53 Records in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:
GraphQL
|
query{aggregateawsRoute53Record(filter:{accountId:{eq:"12345"}}){count# Other fields and connections here...}}
Examples
Get All the Route 53 Records along with their albs and Hosted Zones for AWS Account 12345:
GraphQL
|
query{queryawsRoute53Record(filter:{accountId:{eq:"12345"}}){id# Other fields and connections here...alb{arn# Other fields and connections here...}route53HostedZone{arn# Other fields and connections here...}}}
With CloudGraph you can run multiple queries at the same time so you can combine the above two queries if you like:
GraphQL
|
query{aggregateawsRoute53Record(filter:{accountId:{eq:"12345"}}){count# Other fields and connections here...}queryawsRoute53Record(filter:{accountId:{eq:"12345"}}){id# Other fields and connections here...alb{arn# Other fields and connections here...}route53HostedZone{arn# Other fields and connections here...}}}
Kitchen Sink
Putting it all together; get all data for all Route 53 Records across all regions for all scanned AWS accounts in a single query. For the purposes of this example we will only get direct children of the API Gateway REST APIs but if you want to it's easy to go from say, Route 53 Record -> ALB -> VPC ...etc:
GraphQL
|
query{queryawsRoute53Record{idaccountIdzoneIdtypettlrecordsalias{zoneIdnameevaluateTargetHealth}route53HostedZone{idaccountIdarnnamecommentdelegationSetIdnameServersroute53Record{id# Other fields and connections here...}vpc{arn# Other fields and connections here...}}elb{idaccountIdarndnsNamehostedZonecreatedAttypestatusschemevpcIdsourceSecurityGroup{groupName# Other fields and connections here...}securityGroupsIdssubnetsaccessLogscrossZoneLoadBalancingidleTimeoutinstances{id# Other fields and connections here...}healthCheck{target# Other fields and connections here...}listeners{id# Other fields and connections here...}tags{idkeyvalue}cloudfrontDistribution{arn# Other fields and connections here...}securityGroups{arn# Other fields and connections here...}vpc{arn# Other fields and connections here...}route53Record{id# Other fields and connections here...}subnet{arn# Other fields and connections here...}}alb{idaccountIdarndnsNameschemetypesubnetshostedZonedefaultVpcipAddressTypeidleTimeoutdeletionProtectionhttp2accessLogsEnableddropInvalidHeaderFieldscreatedAtstatustags{idkeyvalue}securityGroups{arn# Other fields and connections here...}ec2Instance{arn# Other fields and connections here...}vpc{arn# Other fields and connections here...}route53Record{id# Other fields and connections here...}listeners{arn# Other fields and connections here...}subnet{arn# Other fields and connections here...}}restApi{idaccountIdarndescriptionpolicy{id# Other fields and connections here...}endpointConfiguration{idtypesvpcEndpointIds}apiKeySourcecreatedDateminimumCompressionSizebinaryMediaTypestags{idkeyvalue}stages{arn# Other fields and connections here...}resources{arn# Other fields and connections here...}route53Record{id# Other fields and connections here...}}}}