Last active
April 22, 2021 14:13
-
-
Save spmallette/91c086cdca79b2a2d77c95b12b0e1bea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: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