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 AWS Client VPN Endpoint
GraphQL
|
query{queryawsClientVpnEndpoint{idaccountIdarnregionstatuscreationTimedescriptiondeletionTimednsNameclientCidrBlockdnsServerssplitTunnelvpnProtocoltransportProtocolvpnPortserverCertificateArnsecurityGroupIdstags{idkeyvalue}associatedTargetNetworks{idnetworkIdnetworkType}authenticationOptions{idtypeactiveDirectory{directoryId}mutualAuthentication{clientRootCertificateChain}federatedAuthentication{samlProviderArnselfServiceSamlProviderArn}}connectionLogOptions{enabledcloudwatchLogGroupcloudwatchLogStream}clientConnectOptions{enabledlambdaFunctionArnstatus}securityGroups{arn# Other fields and connections here...}}}
Filtering
Get data for a single AWS Client VPN Endpoint that you know the ID or arn for:
GraphQL
|
query{getawsClientVpnEndpoint(id:"12345"){arn# Other fields and connections here...}}
GraphQL
|
query{getawsClientVpnEndpoint(arn:"arn:aws:ec2:us-east-1:111122223333:transit-gateway/tgw-11122223333f466ec"){arn# Other fields and connections here...}}
Get data for all of the Client VPN Endpoints in a certain AWS account:
GraphQL
|
query{queryawsClientVpnEndpoint(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# region# status# creationTime# description# deletionTime# dnsName# clientCidrBlock# dnsServers# splitTunnel# vpnProtocol# transportProtocol# vpnPort# serverCertificateArn# securityGroupIds# And the following Dgraph filters can also be applied:# has# and# or# not# regexp (regular expressions)
Get data for all of the Client VPN Endpoints that are NOT in a certain AWS account:
GraphQL
|
query{queryawsClientVpnEndpoint(filter:{not:{accountId:{eq:"12345"}}}){arn# Other fields and connections here...}}
Advanced Filtering
Get data for all of the Client VPN Endpoints that have a connected securityGroups:
GraphQL
|
query{queryawsTransitGateway(filter:{has:securityGroups}){arn# Other fields and connections here...}}# Note that in addition to "securityGroups" you can filter# Using "has" based on any of the following attributes:# id# accountId# arn# region# status# creationTime# description# deletionTime# dnsName# clientCidrBlock# dnsServers# splitTunnel# vpnProtocol# transportProtocol# vpnPort# serverCertificateArn# securityGroupIds# tags# associatedTargetNetworks# authenticationOptions# connectionLogOptions# clientConnectOptions
Use multiple filter selectors, (i.e. has, and, not, or) to get data for all of the Client VPN Endpoints that have securityGroups instances connected to them AND have tags. Note that you can use has, and, not, or completely independently of each other:
GraphQL
|
query{queryawsClientVpnEndpoint(filter:{has:securityGroupsand:{has:tags}}){arn# Other fields and connections here...}}
You may also filter using a regex when filtering on a string field like, region if you want to look for a value that matches say, us- to get all Client VPN Endpoints in us regions:
GraphQL
|
query{queryawsClientVpnEndpoint(filter:{region:{regexp:"/.*us-*/"}}){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{queryawsClientVpnEndpoint(order:{desc:region}){arn# Other fields and connections here...}}# Note that in addition to "region" you can filter# Using "asc" or "desc" based on any of the following attributes:# id# accountId# arn# status# creationTime# description# deletionTime# dnsName# clientCidrBlock# dnsServers# splitTunnel# vpnProtocol# transportProtocol# vpnPort# serverCertificateArn# securityGroupIds
Only select and return the first two Client VPN Endpoints that are found:
GraphQL
|
query{queryawsClientVpnEndpoint(first:2,order:{desc:region}){arn# Other fields and connections here...}}
Only select and return the first two Client VPN Endpoints that are found, but offset by one so Client VPN Endpoints two & three are returned:
GraphQL
|
query{queryawsClientVpnEndpoint(first:2,order:{desc:region},offset:1){arn# Other fields and connections here...}}
Aggregation
Count the number Client VPN Endpoints across all scanned AWS accounts:
GraphQL
|
query{aggregateawsClientVpnEndpoint{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 Client VPN Endpoint:# idMin# idMax# accountIdMin# accountIdMax# arnMin# arnMax# regionMin# regionMax# statusMin# statusMax# creationTimeMin# creationTimeMax# descriptionMin# descriptionMax# deletionTimeMin# deletionTimeMax# dnsNameMin# dnsNameMax# clientCidrBlockMin# clientCidrBlockMax# dnsServersMin# dnsServersMax# vpnProtocolMin# vpnProtocolMax# transportProtocolMin# transportProtocolMax# vpnPortMin# vpnPortMax# serverCertificateArnMin# serverCertificateArnMax# securityGroupIdsMin# securityGroupIdsMax
Count the number of Client VPN Endpoints in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:
GraphQL
|
query{aggregateawsClientVpnEndpoint(filter:{accountId:{eq:"12345"}}){count# Other fields and connections here...}}
Examples
Find all of the Client VPN Endpoints that are in the us-east-1 region across all your accounts:
GraphQL
|
query{queryawsClientVpnEndpoint(filter:{region:{eq:"us-east-1"}}){arn# Other fields and connections here...}}
Kitchen Sink
Putting it all together; get all data for all Client VPN Endpoints 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 client vpn endpoints but if you want to it's easy to go from say, clientVpnEndpoint -> securityGroup -> alb ...etc:
GraphQL
|
query{queryawsClientVpnEndpoint{idaccountIdarnregionstatuscreationTimedescriptiondeletionTimednsNameclientCidrBlockdnsServerssplitTunnelvpnProtocoltransportProtocolvpnPortserverCertificateArnsecurityGroupIdstags{idkeyvalue}associatedTargetNetworks{idnetworkIdnetworkType}authenticationOptions{idtypeactiveDirectory{directoryId}mutualAuthentication{clientRootCertificateChain}federatedAuthentication{samlProviderArnselfServiceSamlProviderArn}}connectionLogOptions{enabledcloudwatchLogGroupcloudwatchLogStream}clientConnectOptions{enabledlambdaFunctionArnstatus}securityGroups{idaccountIdarnnamevpcIddescriptiontags{idkeyvalue}ownerdefaultinboundRules{id# Other fields and connections here...}outboundRules{id# Other fields and connections here...}inboundRuleCountoutboundRuleCountalb{arn# Other fields and connections here...}lambda{arn# Other fields and connections here...}elb{arn# Other fields and connections here...}ec2Instance{arn# Other fields and connections here...}asg{arn# Other fields and connections here...}rdsCluster{arn# Other fields and connections here...}rdsDbInstance{arn# Other fields and connections here...}}}}