AWS neptune documentation change
Summary
Expanded documentation to include multiple methods for submitting Gremlin queries (AWS CLI, SDK, awscurl, and curl) with examples for each approach, and added a note about using awscurl with IAM authentication.
Security assessment
The changes add documentation about using awscurl with IAM authentication and temporary credentials, which is a security feature for secure connections to Neptune clusters. However, there is no evidence of addressing a specific security vulnerability or incident - this appears to be routine documentation enhancement to provide multiple access methods.
Diff
diff --git a/neptune/latest/userguide/access-graph-gremlin-rest.md b/neptune/latest/userguide/access-graph-gremlin-rest.md index 770c2420d..c7c18f46b 100644 --- a//neptune/latest/userguide/access-graph-gremlin-rest.md +++ b//neptune/latest/userguide/access-graph-gremlin-rest.md @@ -25 +25 @@ For information about finding the hostname of your Neptune DB instance, see [Con -The following example uses **curl** to submit a Gremlin query through HTTP **POST**. The query is submitted in JSON format in the body of the post as the `gremlin` property. +The following examples show how to submit a Gremlin query to the REST endpoint. You can use the AWS SDK, the AWS CLI, or **curl**. @@ -26,0 +27 @@ The following example uses **curl** to submit a Gremlin query through HTTP **POS +AWS CLI @@ -28 +28,0 @@ The following example uses **curl** to submit a Gremlin query through HTTP **POS - curl -X POST -d '{"gremlin":"_g.V().limit(1)_ "}' https://your-neptune-endpoint:port/gremlin @@ -30 +29,0 @@ The following example uses **curl** to submit a Gremlin query through HTTP **POS -This example returns the first vertex in the graph by using the `g.V().limit(1)` traversal. You can query for something else by replacing it with another Gremlin traversal. @@ -32 +31,3 @@ This example returns the first vertex in the graph by using the `g.V().limit(1)` -###### Important + aws neptunedata execute-gremlin-query \ + --endpoint-url https://your-neptune-endpoint:port \ + --gremlin-query "g.V().limit(1)" @@ -34 +35,42 @@ This example returns the first vertex in the graph by using the `g.V().limit(1)` -By default, the REST endpoint returns all results in a single JSON result set. If this result set is too large, an `OutOfMemoryError` exception can occur on the Neptune DB instance. +For more information, see [execute-gremlin-query](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/execute-gremlin-query.html) in the AWS CLI Command Reference. + +SDK + + + + import boto3 + import json + from botocore.config import Config + + client = boto3.client( + 'neptunedata', + endpoint_url='https://your-neptune-endpoint:port', + config=Config(read_timeout=None, retries={'total_max_attempts': 1}) + ) + + response = client.execute_gremlin_query( + gremlinQuery='g.V().limit(1)', + serializer='application/vnd.gremlin-v3.0+json;types=false' + ) + + print(json.dumps(response['result'], indent=2)) + +For AWS SDK examples in other languages like Java, .NET, and more, see [AWS SDK](./access-graph-gremlin-sdk.html). + +awscurl + + + + awscurl https://your-neptune-endpoint:port/gremlin \ + --region us-east-1 \ + --service neptune-db \ + -X POST \ + -d '{"gremlin":"g.V().limit(1)"}' + +###### Note + +This example assumes that your AWS credentials are configured in your environment. Replace `us-east-1` with the Region of your Neptune cluster. + +For more information about using **awscurl** with IAM authentication, see [Using awscurl with temporary credentials to securely connect to a DB cluster with IAM authentication enabled](./iam-auth-connect-command-line.html#iam-auth-connect-awscurl). + +curl @@ -36 +78,5 @@ By default, the REST endpoint returns all results in a single JSON result set. I -You can avoid this by enabling chunked responses (results returned in a series of separate responses). See [Use optional HTTP trailing headers to enable multi-part Gremlin responses](./access-graph-gremlin-rest-trailing-headers.html). + +The following example uses **curl** to submit a Gremlin query through HTTP **POST**. The query is submitted in JSON format in the body of the post as the `gremlin` property. + + + curl -X POST -d '{"gremlin":"_g.V().limit(1)_ "}' https://your-neptune-endpoint:port/gremlin @@ -42,0 +89,8 @@ Although HTTP **POST** requests are recommended for sending Gremlin queries, it +These examples return the first vertex in the graph by using the `g.V().limit(1)` traversal. You can query for something else by replacing it with another Gremlin traversal. + +###### Important + +By default, the REST endpoint returns all results in a single JSON result set. If this result set is too large, an `OutOfMemoryError` exception can occur on the Neptune DB instance. + +You can avoid this by enabling chunked responses (results returned in a series of separate responses). See [Use optional HTTP trailing headers to enable multi-part Gremlin responses](./access-graph-gremlin-rest-trailing-headers.html). +