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.
You can currently query the following attributes and connections on an AWS RDS DB Cluster
query {
queryawsRdsCluster {
id
accountId
arn
allocatedStorage
backupRetentionPeriod
characterSetName
databaseName
dbClusterIdentifier
subnets
status
percentProgress
readerEndpoint
multiAZ
engine
engineVersion
port
username
replicationSourceIdentifier
hostedZoneId
encrypted
kmsKey
resourceId
iamDbAuthenticationEnabled
cloneGroupId
createdTime
capacity
engineMode
deletionProtection
httpEndpointEnabled
copyTagsToSnapshot
crossAccountClone
tags {
id
key
value
}
globalWriteForwardingRequested
instances {
arn
}
securityGroups {
arn
}
}
}
Get data for a single RDS DB Cluster that you know the ARN for:
query {
getawsRdsCluster(arn: "arn:12345") {
arn
}
}
Get data for all of the RDS DB Clusters in a certain AWS account:
query {
queryawsRdsCluster(filter: { accountId: { eq: "12345" } }) {
arn
}
}
Get data for all of the RDS DB Clusters that are NOT in a certain AWS account:
query {
queryawsRdsCluster(filter: { not: { accountId: { eq: "12345" } } }) {
arn
}
}
Get data for all of the RDS DB Clusters that have RDS DB Instances:
query {
queryawsRdsCluster(filter: { has: instances }) {
arn
}
}
Use multiple filter selectors, (i.e. has, and, not, or) to get data for all of the RDS DB Clusters that have Tags AND RDS DB Instances OR that do not have a KMS Key. Note that you can use has, and, not, or completely independently of each other:
query {
queryawsRdsCluster(
filter: { has: tags, and: { has: instances }, or: { not: { has: kmsKey } } }
) {
arn
}
}
You may also filter using a regex when filtering on a string field like, engineVersion if you want to look for a value that matches say, 11.1:
query {
queryawsRdsCluster(filter: { engineVersion: { regexp: "/.*11.1.*/" } }) {
arn
}
}
You can order the results you get back either asc or desc depending on your preference:
query {
queryawsRdsCluster(order: { desc: engineVersion }) {
engineVersion
}
}
Only select and return the first two RDS DB Clusters that are found:
query {
queryawsRdsCluster(first: 2, order: { desc: engineVersion }) {
engineVersion
}
}
Only select and return the first two RDS DB Clusters that are found, but offset by one so RDS DB Clusters two & three are returned:
query {
queryawsRdsCluster(first: 2, order: { desc: engineVersion }, offset: 1) {
engineVersion
}
}
Count the number RDS DB Clusters across all scanned AWS accounts:
query {
aggregateawsRdsCluster {
count
}
}
Count the number RDS DB Clusters in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:
query {
aggregateawsRdsCluster(filter: { accountId: { eq: "12345" } }) {
count
}
}
For each Aurora Postgres RDS DB Cluster running on Postgres version 11.x without deletion protection enabled in AWS Account 12345, get the encryption status and check to see if the database is publicly accessible:
query {
queryawsRdsCluster(
filter: {
accountId: { eq: "12345" }
engine: { eq: "aurora-postgresql" }
engineVersion: { regexp: "/^11.*/" }
deletionProtection: false
}
) {
arn
}
}
Find all of the RDS DB Clusters that have a tag of Environment:Production for a single AWS Account:
query {
queryawsTag(
filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
) {
rdsCluster(filter: { accountId: { eq: "12345" } }) {
arn
}
}
}
With CloudGraph you can run multiple queries at the same time so you can combine the above two queries if you like:
query {
queryawsRdsCluster(
filter: {
accountId: { eq: "12345" }
engine: { eq: "aurora-postgresql" }
engineVersion: { regexp: "/^11.*/" }
deletionProtection: false
}
) {
arn
}
queryawsTag(
filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
) {
rdsCluster(filter: { accountId: { eq: "12345" } }) {
arn
}
}
}
Putting it all together; get all data for all RDS DB Clusters 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 RDS DB Clusters but if you want to it's easy to go from say, RDS DB Cluster -> RDS DB Instance -> SG...etc:
query {
queryawsRdsCluster {
id
accountId
arn
allocatedStorage
backupRetentionPeriod
characterSetName
databaseName
dbClusterIdentifier
subnets
status
percentProgress
readerEndpoint
multiAZ
engine
engineVersion
port
username
replicationSourceIdentifier
hostedZoneId
encrypted
kmsKey
resourceId
iamDbAuthenticationEnabled
cloneGroupId
createdTime
capacity
engineMode
deletionProtection
httpEndpointEnabled
copyTagsToSnapshot
crossAccountClone
tags {
id
key
value
}
globalWriteForwardingRequested
instances {
id
accountId
arn
name
port
address
hostedZoneId
username
resourceId
engine
engineVersion
createdTime
copyTagsToSnapshot
deletionProtection
dBInstanceIdentifier
performanceInsightsEnabled
autoMinorVersionUpgrade
iamDbAuthenticationEnabled
optionsGroups
parameterGroup
storageType
instanceClass
allocatedStorage
multiAZ
subnetGroup
availabilityZone
publiclyAccessible
certificateAuthority
status
failoverPriority
kmsKey
encrypted
tags {
id
key
value
}
cluster {
arn
}
securityGroups {
arn
}
subnet {
arn
}
vpc {
arn
}
}
securityGroups {
id
accountId
arn
name
vpcId
description
tags {
id
key
value
}
owner
default
inboundRules {
id
}
outboundRules {
id
}
inboundRuleCount
outboundRuleCount
alb {
arn
}
lambda {
arn
}
elb {
arn
}
ec2Instance {
arn
}
asg {
arn
}
rdsCluster {
arn
}
rdsDbInstance {
arn
}
}
}
}