website logo
HomeGithubSlack
⌘K
Overview
Quick Start
Supported Services
Running CloudGraph in EKS
Compliance
Rules Engine
AWS
Querying AWS Data
AWS Policy Packs
Billing Data
Services
Azure
Querying Azure Data
Azure Policy Packs
Services
GCP
Querying GCP Data
GCP Policy Packs
Services
K8s
Querying Kubernetes Data
Services
Docs powered by archbee 

Route 53 Hosted Zone

17min

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 Hosted Zone:

GraphQL
|
query {
  queryawsRoute53HostedZone {
    id
    accountId
    arn
    name
    comment
    delegationSetId
    nameServers
    route53Record {
      id
      # Other fields and connections here...
    }
    vpc {
      arn
      # Other fields and connections here...
    }
  }
}


Filtering

Get data for a single Route 53 Hosted Zone that you know the arn for:

GraphQL
|
query {
  getawsRoute53HostedZone(arn: "arn:aws:route53:::hostedzone/Z148QEXAMPLE8V") {
    arn
    # Other fields and connections here...
  }
}


Get data for all of the Route 53 Hosted Zones in a certain AWS account:

GraphQL
|
query {
  queryawsRoute53HostedZone(filter: { accountId: { eq: "12345" } }) {
    arn
    # Other fields and connections here...
  }
}

# Note that in addition to "accountId" you can
# Filter based on any of the following attributes:

# id
# arn
# name
# comment
# delegationSetId
# nameServers

# 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 Hosted Zones that are NOT in a certain AWS account:

GraphQL
|
query {
  queryawsRoute53HostedZone(filter: { not: { accountId: { eq: "12345" } } }) {
    arn
    # Other fields and connections here...
  }
}


Advanced Filtering

Get data for all of the Route 53 Hosted Zones that have a route53Record:

GraphQL
|
query {
  queryawsRoute53HostedZone(filter: { has: route53Record }) {
    arn
    # Other fields and connections here...
  }
}

# Note that in addition to "route53Record" you can filter
# Using "has" based on any of the following attributes:

# id
# accountId
# name
# comment
# delegationSetId
# nameServers
# vpc


Use multiple filter selectors, (i.e. has, and, not, or) to get data for all of the Route 53 Hosted Zones that have a route53Records AND nameServers OR that do not have a vpc. Note that you can use has, and, not, or completely independently of each other:

GraphQL
|
query {
  queryawsRoute53HostedZone(
    filter: {
      has: route53Record
      and: { has: nameServers }
      or: { not: { has: vpc } }
    }
  ) {
    id
    # Other fields and connections here...
  }
}


You may also filter using a regex when filtering on a string field like, comment if you want to look for a value that matches say, prod-hosted-zone (case insensitive):

GraphQL
|
query {
  queryawsRoute53HostedZone(
    filter: { comment: { regexp: "/.*prod-hosted-zone*./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 {
  queryawsRoute53HostedZone(order: { desc: name }) {
    arn
    # Other fields and connections here...
  }
}

# Note that in addition to "name" you can filter
# Using "asc" or "desc" based on any of the following attributes:

# id
# accountId
# arn
# comment
# delegationSetId
# nameServers


Only select and return the first two Route 53 Hosted Zones that are found:

GraphQL
|
query {
  queryawsRoute53HostedZone(first: 2, order: { desc: name }) {
    arn
    # Other fields and connections here...
  }
}


Only select and return the first two Route 53 Hosted Zones that are found, but offset by one so Route 53 Hosted Zones two & three are returned:

GraphQL
|
query {
  queryawsRoute53HostedZone(first: 2, order: { desc: name }, offset: 1) {
    arn
    # Other fields and connections here...
  }
}


Aggregation

Count the number of Route 53 Hosted Zones across all scanned AWS accounts:

GraphQL
|
query {
  aggregateawsRoute53HostedZone {
    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 Hosted Zones:

# idMin
# idMax
# accountIdMin
# accountIdMax
# arnMin
# arnMax
# nameMin
# nameMax
# commentMin
# commentMax
# delegationSetIdMin
# delegationSetIdMax
# nameServersMin
# nameServersMax


Count the number of Route 53 Hosted Zones in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:

GraphQL
|
query {
  aggregateawsRoute53HostedZone(filter: { accountId: { eq: "12345" } }) {
    count
    # Other fields and connections here...
  }
}


Examples

Get All the Route 53 Hosted Zones along with their route53Records and vpc for AWS Account 12345:

GraphQL
|
query {
  queryawsRoute53HostedZone(filter: { accountId: { eq: "12345" } }) {
    arn
    # Other fields and connections here...
    route53Record {
      id
      # Other fields and connections here...
    }
    vpc {
      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 {
  aggregateawsRoute53HostedZone(filter: { accountId: { eq: "12345" } }) {
    count
    # Other fields and connections here...
  }
  queryawsRoute53HostedZone(filter: { accountId: { eq: "12345" } }) {
    id
    # Other fields and connections here...
    route53Record {
      id
      # Other fields and connections here...
    }
    vpc {
      arn
      # Other fields and connections here...
    }
  }
}


Kitchen Sink

Putting it all together; get all data for all Route 53 Hosted Zones 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 Hosted Zone -> VPC -> ALB ...etc:

GraphQL
|
query {
  queryawsRoute53HostedZone {
    id
    accountId
    arn
    name
    comment
    delegationSetId
    nameServers
    route53Record {
      id
      accountId
      zoneId
      type
      ttl
      records
      alias {
        zoneId
        name
        evaluateTargetHealth
      }
      route53HostedZone {
        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...
      }
    }
    vpc {
      accountId
      arn
      defaultVpc
      dhcpOptionsSet
      enableDnsHostnames
      enableDnsSupport
      id
      instanceTenancy
      ipV4Cidr
      ipV6Cidr
      state
      alb {
        arn
        # Other fields and connections here...
      }
      eip {
        arn
        # Other fields and connections here...
      }
      elb {
        arn
        # Other fields and connections here...
      }
      igw {
        arn
        # Other fields and connections here...
      }
      tags {
        id
        key
        value
      }
      nacl {
        arn
        # Other fields and connections here...
      }
      lambda {
        arn
        # Other fields and connections here...
      }
      subnet {
        arn
        # Other fields and connections here...
      }
      natGateway {
        arn
        # Other fields and connections here...
      }
      routeTable {
        arn
        # Other fields and connections here...
      }
      rdsDbInstance {
        # Other fields and connections here...
        arn
      }
      route53HostedZone {
        # Other fields and connections here...
        arn
      }
    }
  }
}


References

Dgraph documentation on querying

Route 53 Hosted Zones documentation: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html

Updated 03 Mar 2023
Did this page help you?
Yes
No
PREVIOUS
Route 53 Record
NEXT
Client VPN Endpoint
Docs powered by archbee 
TABLE OF CONTENTS
Overview
Filtering
Advanced Filtering
Ordering
Aggregation
Examples
Kitchen Sink
References