Skip to content

Instantly share code, notes, and snippets.

@spmallette
Last active April 22, 2021 14:13
Show Gist options
  • Save spmallette/91c086cdca79b2a2d77c95b12b0e1bea to your computer and use it in GitHub Desktop.
Save spmallette/91c086cdca79b2a2d77c95b12b0e1bea to your computer and use it in GitHub Desktop.
:install com.amazonaws amazon-neptune-sigv4-signer 2.1.1
:install com.amazonaws aws-java-sdk-core 1.11.748
// above lines only need to be executed once to get the dependencies into the console
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain
import com.amazonaws.neptune.auth.NeptuneNettyHttpSigV4Signer
System.setProperty("aws.accessKeyId","<access-key>")
System.setProperty("aws.secretKey","<secret-key>")
cluster = Cluster.build("<cluster>").
enableSsl(true).keyCertChainFile("SFSRootCAG2.pem").
handshakeInterceptor{ r ->
def sigV4Signer = new NeptuneNettyHttpSigV4Signer("<region>", new DefaultAWSCredentialsProviderChain())
sigV4Signer.signRequest(r)
return r
}.create()
client = cluster.connect()
client.submit("g.V().has('code','IAD')").all().get()
cluster.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment