Neptune DB Cluster Deployer
An AWS CloudOps agent skill that provisions Amazon Neptune DB clusters
(graph database) with correct defaults. The skill walks the operator
through a provisioning procedure, captures the operator's instance,
topology, security, and query-language decisions, explains why each
default matters, and emits a READY_TO_DEPLOY checklist with
copy-pasteable verification commands.
Activation keywords
create Neptune, provision Neptune, Neptune cluster, graph database,
Gremlin, SPARQL, openCypher, Neptune Multi-AZ, Neptune reader instance,
Neptune bulk load, Neptune Loader, Neptune Streams, Neptune parameter
group, neptune_enforce_ssl, neptune_query_timeout, IAM database auth,
Neptune subnet group, Neptune KMS encryption, db.r6g.large,
db.r6g.8xlarge, db.x2gdb.16xlarge.
STRICT output contract
When this skill is invoked with a Neptune-provisioning request
(cluster name, instance class, workload shape, region, or a partial
configuration), the agent MUST respond with the READY_TO_DEPLOY
checklist defined in the "Output format" section using the literal
all-caps labels NEPTUNE:, VERDICT:, CHECKLIST:, and
VERIFICATION_COMMANDS:. Do NOT preface the checklist with prose,
headings, or disclaimers — emit the block as the first lines of the
response. This contract is what assertion-based evals and downstream
provisioning pipelines rely on; deviating from the literal labels
breaks automation silently.
If any prerequisite is missing, the verdict is
PREREQUISITES_MISSING with a specific gap citation in the checklist
(marked [✗]), and READY_TO_DEPLOY MUST NOT also appear.
Quick navigation
| Section |
When to read |
| Prerequisites |
Always — verify before provisioning |
| Step 1 — Neptune DB vs Neptune Analytics |
Boundary call (avoid the common misroute) |
| Step 2 — Instance class + cluster size |
Sizing writer + readers |
| Step 3 — Multi-AZ with reader promotion |
Production topology |
| Step 4 — Network + security (VPC, subnet group, SG) |
VPC wiring |
| Step 5 — Encryption (KMS at creation, immutable) |
TLS + at-rest |
| Step 6 — Parameter groups |
neptune_enforce_ssl, neptune_query_timeout |
| Step 7 — IAM database auth |
Token-based access |
| Step 8 — Bulk load from S3 |
Initial data ingest |
| Step 9 — Query languages (Gremlin, SPARQL, openCypher) |
API surface |
| Step 10 — Streams / snapshots / recent features |
Change capture, recovery |
| NEVER do these things |
Review before signing off |
| Output format |
The literal checklist template |
| references/instance-and-topology.md |
Writer/reader math, instance classes |
| references/provisioning-cli-commands.md |
Copy-pasteable CLI sequence |
Mindset
One-line takeaway: Neptune correctness is decided at creation
time. Encryption at rest (KMS) and the cluster's VPC/subnet placement
are immutable post-creation — modifying them requires a snapshot
restore into a new cluster. The procedure treats each one-way door as
an explicit decision before the create-db-cluster call.
The three provisioning-time misconceptions (DB vs Analytics, encryption-at-creation, single-instance production) moved to references/advanced-patterns.md.
Load on demand; the one-line takeaway above is the operative rule.
Configuration dependency graph (novel heuristic)
Full dependency graph table and cross-dependency gotchas moved to references/advanced-patterns.md.
Load on demand to sequence provisioning and debug immutable/one-way-door settings.
Expert heuristic: graph sizing (memory budget)
Graph sizing heuristic (60% buffer-cache budget, 3x index rule, worked example) moved to references/instance-and-topology.md.
Sizing rules in Step 2 summarize the operative constraints.
Expert heuristic: failover promotion semantics
Failover promotion semantics (cluster endpoint stability, ~30s promotion, zero committed-transaction loss, AZ spread) moved to references/instance-and-topology.md.
Load on demand for SLA analysis; Step 3 keeps the requirements.
Prerequisites (verify before provisioning)
Before emitting provisioning commands, verify these prerequisites. If
any are missing, the verdict is PREREQUISITES_MISSING with a
specific gap citation.
| Prerequisite |
Why it matters |
How to verify |
| AWS account with Neptune access |
Can't provision without it |
aws sts get-caller-identity |
| Region selected |
Neptune clusters and subnet groups are region-scoped |
aws configure get region |
| VPC ID + at least 2 subnets in different AZs (3+ preferred) |
Neptune is VPC-only; Multi-AZ requires multi-AZ subnet group |
aws ec2 describe-subnets --filters "Name=vpc-id,Values=<vpc>" — confirm >=2 distinct AvailabilityZone values |
| Cluster name unique in this region |
Names are region-unique |
aws neptune describe-db-clusters --db-cluster-identifier <name> returns DBClusterNotFound |
| KMS key ARN (if encryption with customer CMK) |
Custom encryption requires a CMK in the same region |
aws kms describe-key --key-id <cmk-id> — confirm Enabled=true |
| Security group with port 8182 inbound from application SG |
Wrong port = silent connectivity failure; Neptune listens on 8182 |
aws ec2 describe-security-groups --group-ids <sg> — verify inbound rule on 8182 |
| Workload description (graph size, query depth, write rate) |
Drives instance class, replica count, parameter group decisions |
Captured in the prompt or follow-up question |
| S3 bucket + IAM role for bulk load (if loading data) |
Loader needs IAM role with s3:GetObject and Neptune trust policy; bucket in same region |
aws iam get-role --role-name <role>; bucket in same region |
| Engine choice (DB vs Analytics) |
Neptune Analytics is a separate service; this skill is DB only |
If the user asks for graph algorithms / large-scale analytics, redirect to Neptune Analytics |
If any prerequisite is missing, output VERDICT: PREREQUISITES_MISSING
and cite the specific gap.
Step 1 — Neptune DB vs Neptune Analytics (boundary call)
The single highest-impact Neptune decision is which SERVICE to use.
This skill only provisions Neptune DB. If the user wants Neptune
Analytics, stop and redirect.
Decision tree:
What is the workload shape?
├── Transactional (OLTP) — point lookups, short traversals,
│ real-time app queries, frequent writes
│ └── Neptune DB (this skill)
├── Analytical (OLAP) — PageRank / connected-components /
│ community-detection on a large static graph, batch
│ └── Neptune Analytics (NOT this skill — separate API:
│ aws graph create-graph, no writer/reader split)
└── Both └── Neptune DB for transactions + export to Neptune
Analytics for batch algorithm runs
Feature comparison:
| Feature |
Neptune DB |
Neptune Analytics |
| API family |
aws neptune create-db-cluster |
aws graph create-graph (different CLI namespace) |
| Topology |
writer + reader replicas (Multi-AZ) |
single graph (no writer/reader split) |
| Failover |
YES (writer promotion) |
N/A (recreate on failure) |
| Gremlin transactions |
YES |
NO (read-only analytic queries) |
| SPARQL |
YES |
NO |
| openCypher |
YES |
YES |
| Graph algorithms (built-in) |
NO (write your own Gremlin) |
YES (PageRank, BFS, etc.) |
| Storage |
cluster-shared (6-way) |
ephemeral snapshot-loaded |
| Pricing |
instance-hour + storage + IO |
GB-hour (memory) + snapshot |
Common mistake: provisioning Neptune DB for a PageRank workload.
Neptune DB has no built-in algorithm library; running PageRank in
Gremlin on a large graph will time out and exhaust memory. Use Neptune
Analytics.
Step 2 — Instance class + cluster size
Neptune offers db.r5, db.r6g, db.r6i, db.x2g families.
Memory-bound graphs favor r6g/x2g. Avoid t3/t4g burstable for
production (Neptune is not supported on burstable in some regions).
Cluster size by workload:
- Dev / test: 1 writer instance,
db.r6g.large. No failover.
- Small production (read-heavy, < 100 GB working set): 1 writer +
1 reader (Multi-AZ),
db.r6g.2xlarge.
- Mid production (100-500 GB, mixed read/write): 1 writer + 2
readers across 3 AZs,
db.r6g.8xlarge.
- Large production (500 GB+, deep traversals): 1 writer + 3+
readers,
db.r6g.16xlarge or db.x2gdb.16xlarge.
Sizing rules:
- Plan for 60% of instance memory as the buffer cache budget (see
Expert heuristic above). The graph working set (vertices + edges +
3x indexes) MUST fit in the buffer cache for sub-second traversals.
- Readers scale reads, not writes. There is exactly one writer per
Neptune cluster.
- Cluster storage auto-scales; do NOT size for storage, size for
memory.
Step 3 — Multi-AZ with reader promotion
Multi-AZ is the primary resilience control for Neptune DB.
Requirements:
- At least 1 reader instance in a DIFFERENT AZ than the writer.
- DB subnet group spanning at least 2 AZs (3+ preferred for
spreading readers).
- Deletion protection enabled on the cluster.
Behavior on writer failure:
- Neptune detects writer loss (health check).
- A reader in a different AZ is promoted to writer (~30 seconds).
- The cluster endpoint repoints to the new writer automatically.
- Clients reconnect via the cluster endpoint — no code change.
- Data loss window: zero committed transactions (cluster-shared
storage).
Common mistake: subnet group with only one AZ. Multi-AZ cannot
place the reader in a different AZ, and the cluster silently degrades
to writer-only (no failover). Verify the subnet group spans >=2 AZs
before create-db-cluster.
Step 4 — Network + security (VPC, subnet group, security group)
Neptune is VPC-only — there is no public IP option. All clusters
live inside a VPC and are reachable only from inside the VPC (or via
a bastion / VPN / PrivateLink).
Subnet-group and security-group CLI blocks moved to references/provisioning-cli-commands.md.
NEVER open port 8182 to 0.0.0.0/0 — rule retained below.
NEVER open port 8182 to 0.0.0.0/0 — even with TLS and IAM auth,
this exposes the cluster to internet scanning. Always scope inbound to
the application's SG.
Step 5 — Encryption (KMS at creation, immutable)
Neptune encryption at rest is immutable: set at creation via
--storage-encrypted. Adding it later requires a snapshot → restore
into a new encrypted cluster.
--storage-encrypted enables encryption (AWS-managed KMS key by
default).
--kms-key-id <cmk-arn> uses a customer-managed CMK (required for
most compliance regimes — HIPAA, PCI, SOC2).
- TLS in transit is controlled by the parameter group via
neptune_enforce_ssl=1 (see Step 6). Pair at-rest + in-transit
encryption for defense in depth.
Common mistake: planning to "enable encryption later." A
non-encrypted Neptune cluster CANNOT be encrypted without a full
snapshot/restore cycle. Decide at creation.
Step 6 — Parameter groups (neptune_enforce_ssl, neptune_query_timeout)
Parameter groups control Neptune runtime behavior. Most parameters
require an instance reboot to take effect — set them at cluster
creation in the DB cluster parameter group.
| Parameter |
Default |
Recommended |
Why |
neptune_enforce_ssl |
0 (off) |
1 (on) for all production |
Forces TLS-only connections; plaintext rejected. Defense against network sniffing. |
neptune_query_timeout |
120000 (ms) |
30000 (30s) for OLTP; 120000+ for analytics |
Caps runaway traversals. Long-running queries consume CPU/memory and starve other queries. |
neptune_streams |
0 (off) |
1 (on) if change capture needed |
Enables Neptune Streams for CDC (see Step 10). |
neptune_lab_mode |
varies |
Leave at default unless AWS support advises |
Labs features may change; do not enable in production without testing. |
Parameter-group creation/modify CLI moved to references/provisioning-cli-commands.md.
Parameter table above stays authoritative.
Common mistake: enabling neptune_enforce_ssl=1 on an existing
production cluster without a maintenance window. The rolling reboot
drops plaintext clients. Enable at creation.
Step 7 — IAM database auth
Neptune supports IAM database auth — token-based access using AWS SigV4
instead of static passwords. Recommended for production; pairs with
neptune_enforce_ssl=1.
IAM enable flag and the neptune-db:Connect policy JSON moved to references/provisioning-cli-commands.md.
Gotchas below remain in-file.
Common gotchas:
- IAM auth and password auth can coexist. To enforce IAM-only, do NOT
set a password and rely on IAM tokens.
- IAM tokens are SigV4-derived — short-lived (~15 minutes). The
Gremlin/SPARQL driver must refresh tokens automatically (most modern
drivers do; verify your client lib).
- IAM auth requires TLS — pair with
neptune_enforce_ssl=1.
Step 8 — Bulk load from S3 (Neptune Loader)
For initial data ingest, use the Neptune Loader (NOT a script that
issues individual Gremlin g.addV calls — that is 10-100x slower).
Prerequisites:
- S3 bucket in the SAME region as the Neptune cluster.
- IAM role with trust policy allowing Neptune and permissions
s3:GetObject on the bucket.
- Data in a supported format: Gremlin CSV/JSON/n-quad, or SPARQL
N-Triples/RDF.
Neptune Loader curl payload moved to references/provisioning-cli-commands.md.
Prerequisites and common mistakes below remain in-file.
Common mistakes:
- Cross-region S3 bucket — the Loader fails silently or with a
generic permissions error. Always same-region.
- Concurrent loads on the same cluster conflict. Run one load at a
time per cluster.
mode=AUTO overwrites existing vertices; mode=NEW errors on
duplicates; mode=RESUME continues an interrupted load.
Step 9 — Query languages (Gremlin, SPARQL, openCypher)
Neptune supports three query languages on the SAME cluster (no need
to pick at creation). Endpoints:
| Language |
Endpoint path |
Use when |
| Gremlin |
:8182/gremlin |
Apache TinkerPop-compatible; property graph; deep traversals |
| SPARQL |
:8182/sparql |
RDF / semantic web; triple-store; SPARQL queries |
| openCypher |
:8182/opencypher |
Cypher (Neo4j-compatible) syntax; property graph; declarative patterns |
Common mistake: loading property-graph data then trying SPARQL.
Gremlin and openCypher operate on the property graph; SPARQL operates
on RDF triples. They are different data models. Pick the model at load
time.
Step 10 — Streams / snapshots / recent features
Neptune Streams (CDC):
- Enable via
neptune_streams=1 in the parameter group + reboot.
- Exposes an HTTP endpoint (
:8182/streams) returning change records
(vertex/edge insertions, updates, deletions).
- Pair with a consumer (Kinesis Data Streams + Lambda, or a custom
poller) for downstream replication / audit.
- Stream records are retained for ~24 hours.
Snapshots (automated + manual):
- Automated: set
--backup-retention-period 7 (days) at creation.
- Manual:
aws neptune create-db-cluster-snapshot before upgrades.
- Restore creates a NEW cluster (the snapshot is cluster-scoped).
Recent AWS features (2023-2026) moved to references/advanced-patterns.md.
Streams and snapshot guidance above remain in-file.
NEVER do these things
NEVER plan to "enable encryption at rest later." Neptune
encryption is immutable post-creation. Adding it requires a
snapshot → restore into a new encrypted cluster. Decide at creation.
NEVER provision Neptune DB for a graph-algorithm (PageRank,
connected components) workload. Neptune DB has no built-in
algorithm library. Use Neptune Analytics (separate service). A
baseline model conflates the two.
NEVER enable neptune_enforce_ssl=1 on an existing production
cluster without a maintenance window. The rolling reboot drops
plaintext clients. Enable at creation.
NEVER open port 8182 to 0.0.0.0/0. Even with TLS and IAM
auth, internet exposure invites scanning. Always scope inbound to
the application's SG.
NEVER use a single-AZ subnet group for Multi-AZ Neptune.
Multi-AZ requires the promoted reader in a different AZ than the
writer. Verify aws ec2 describe-subnets shows >=2 distinct AZs in
the subnet group before create-db-cluster.
NEVER run a Neptune DB cluster with only a writer instance in
production. There is no failover target. The minimum production
topology is 1 writer + 1 reader in a different AZ.
NEVER load data via individual Gremlin g.addV() calls for bulk
ingest. Use the Neptune Loader (10-100x faster). Per-vertex
inserts are for incremental app writes only.
NEVER use a cross-region S3 bucket for the Neptune Loader. It
fails silently or with a generic permissions error. Always
same-region.
NEVER load property-graph data then expect SPARQL to work.
Gremlin/openCypher operate on the property graph; SPARQL operates
on RDF triples. Different data models. Pick at load time.
NEVER size Neptune by spec-sheet memory. Plan for 60% buffer
cache budget; the graph working set (vertices + edges + 3x
indexes) MUST fit in 60% of nominal or traversals slow 10-100x.
NEVER disable deletion protection on a production cluster
outside of a planned teardown. Accidental delete-db-cluster
destroys the cluster + storage irrecoverably.
NEVER use the engine version "latest" in production. Pin the
major version explicitly; auto-upgrades during maintenance windows
can introduce breaking behavior.
Output format
NEPTUNE: <cluster-name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
CHECKLIST:
[✓|✗] Service: Neptune DB (NOT Analytics)
[✓|✗] Engine version: 1.3.x.x (pinned)
[✓|✗] Writer instance: db.<family>.<size>
[✓|✗] Reader instances: <N> (across <AZ-count> AZs for Multi-AZ)
[✓|✗] Multi-AZ with reader promotion: Enabled | Disabled (writer-only — NO failover)
[✓|✗] Subnet group: <name> (spans <N> AZs)
[✓|✗] Security group: <sg-id> (inbound port 8182 from <app-sg>)
[✓|✗] Encryption at rest: Enabled (customer CMK <key-arn> | AWS-managed) | Disabled
[✓|✗] TLS / neptune_enforce_ssl: Enabled | Disabled
[✓|✗] IAM database auth: Enabled | Disabled
[✓|✗] Parameter group: <name> (neptune_query_timeout=<ms>, neptune_streams=<0|1>)
[✓|✗] Snapshot retention: <N> days | Disabled
[✓|✗] Deletion protection: Enabled | Disabled
[✓|✗] Bulk load source: s3://<bucket>/<prefix> (same region, IAM role <role-arn>) | N/A
[✓|✗] Query languages: Gremlin | SPARQL | openCypher
VERIFICATION_COMMANDS:
aws neptune describe-db-clusters --db-cluster-identifier <name>
aws neptune describe-db-instances --db-instance-identifier <name>-instance-1
aws neptune describe-db-cluster-parameters --db-cluster-parameter-group-name <pg>
aws ec2 describe-subnets --subnet-ids <subnet-ids>
aws kms describe-key --key-id <cmk-id>
Worked example — production Neptune DB with Multi-AZ
NEPTUNE: prod-graph
VERDICT: READY_TO_DEPLOY
CHECKLIST:
[✓] Service: Neptune DB (NOT Analytics)
[✓] Engine version: 1.3.2.0 (pinned)
[✓] Writer instance: db.r6g.8xlarge
[✓] Reader instances: 2 (across us-east-1b, us-east-1c for Multi-AZ)
[✓] Multi-AZ with reader promotion: Enabled
[✓] Subnet group: prod-neptune-subnet (3 AZs)
[✓] Security group: sg-neptune123 (inbound 8182 from sg-app456)
[✓] Encryption at rest: Enabled (customer CMK alias/prod-graph-kms)
[✓] TLS / neptune_enforce_ssl: Enabled
[✓] IAM database auth: Enabled
[✓] Parameter group: prod-neptune-pg (neptune_query_timeout=30000, neptune_streams=1)
[✓] Snapshot retention: 7 days
[✓] Deletion protection: Enabled
[✓] Bulk load source: s3://prod-graph-bucket/initial-load/ (same region, IAM role NeptuneLoadRole)
[✓] Query languages: Gremlin, openCypher
VERIFICATION_COMMANDS:
aws neptune describe-db-clusters --db-cluster-identifier prod-graph
aws neptune describe-db-instances --db-instance-identifier prod-graph-instance-1
aws neptune describe-db-cluster-parameters --db-cluster-parameter-group-name prod-neptune-pg
aws ec2 describe-subnets --subnet-ids subnet-0aaa subnet-0bbb subnet-0ccc
aws kms describe-key --key-id alias/prod-graph-kms
Decision tree: Neptune DB vs Neptune Analytics
Is the workload transactional (OLTP) — point lookups, short
traversals, real-time app queries, frequent writes?
├── YES → Neptune DB (this skill)
│ writer + readers, Multi-AZ, Gremlin/SPARQL/openCypher
└── NO → Is the workload analytical (OLAP) — PageRank,
connected-components, community-detection on a large
static graph?
├── YES → Neptune Analytics (NOT this skill — aws graph)
│ single graph, built-in algorithms, GB-hour pricing
└── NO → Neptune DB for transactions + scheduled export to
Neptune Analytics for batch algorithm runs
Error handling
API error deep dives (DBClusterAlreadyExists, DBSubnetGroup AZ span, IAM AccessDenied, Loader assume-role) moved to references/error-handling.md.
Load on demand when a provisioning call fails.
References (load on demand)
- references/error-handling.md — provisioning API error deep dives and fixes.
- references/advanced-patterns.md — misconceptions, configuration dependency graph, recent AWS features.
- references/instance-and-topology.md — sizing heuristic and failover promotion semantics.
- references/provisioning-cli-commands.md — full copy-pasteable CLI sequence (subnet group, SG, parameter group, IAM, loader).
Domain
AWS CloudOps / Amazon Neptune DB Provisioning & Graph Topology Design.
AWS documentation
1---2name: neptune-db-cluster-deployer3description: 'Provisions Amazon Neptune DB clusters (graph database) with production defaults: cluster creation (instance type, cluster size, reader replicas), VPC networking (DB subnet group across >=3 AZs, security groups on port 8182), encryption (KMS at creation — immutable), auto-failover (Multi-AZ with reader promotion), parameter groups (neptune_enforce_ssl, neptune_query_timeout), IAM database auth, loading data (bulk load from S3 via the Neptune Loader), querying (Gremlin, SPARQL, openCypher), Neptune Streams, snapshot/restore, and the Neptune Analytics boundary. Emits a READY_TO_DEPLOY checklist. Use when creating a Neptune DB cluster, sizing writer/reader instances, designing a Multi-AZ graph topology, hardening TLS/IAM, loading graph data from S3, or choosing between Neptune DB and Neptune Analytics. Triggers: create Neptune, provision graph database, Neptune cluster, Gremlin, SPARQL, openCypher, Neptune bulk load, Neptune Streams, neptune_enforce_ssl, Neptune Multi-AZ.'4license: Apache-2.05compatibility: 'Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). For live deployment: AWS CLI v2 with neptune, ec2, kms, iam, and s3 access. Works with Terraform aws_neptune_cluster / aws_neptune_cluster_instance resources and CloudFormation AWS::Neptune::DBCluster / AWS::Neptune::DBInstance templates.'6metadata:7 source: https://skillmd.com/skills/jhkchan/neptune-db-cluster-deployer8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '1'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Databases15 task_type: deploy16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY_TO_DEPLOY | PREREQUISITES_MISSING19 version: 0.1.020 author: Jacky Chan — AWS Community Builder21 tags: aws, neptune, graph-database, cloudops, deploy, databases, provisioning, gremlin, sparql, opencypher, multi-az, encryption, iam-db-auth, neptune-streams22 dependencies: aws-orchestrator23 keywords: aws, neptune, graph database, cloudops, deploy, provisioning, gremlin, sparql, opencypher, multi-az, failover, encryption at rest, tls, iam database auth, subnet group, parameter group, neptune_enforce_ssl, neptune_query_timeout, bulk load, neptune loader, neptune streams, reader instance24 when_to_use: Invoke when the user wants to create a new Amazon Neptune DB cluster (graph database), size writer and reader instances, design a Multi-AZ topology with reader promotion, harden TLS via neptune_enforce_ssl, enable IAM database auth, load graph data from S3 via the Neptune Loader, query via Gremlin / SPARQL / openCypher, enable Neptune Streams for change capture, or generate provisioning CLI commands / IaC templates. Do NOT invoke for Neptune Analytics (analytics graph service, separate API), for self-managed Neo4j / JanusGraph on EC2, or for auditing an existing Neptune cluster's posture.25---2627# Neptune DB Cluster Deployer2829An AWS CloudOps agent skill that provisions Amazon Neptune DB clusters30(graph database) with correct defaults. The skill walks the operator31through a provisioning procedure, captures the operator's instance,32topology, security, and query-language decisions, explains why each33default matters, and emits a READY_TO_DEPLOY checklist with34copy-pasteable verification commands.3536## Activation keywords3738create Neptune, provision Neptune, Neptune cluster, graph database,39Gremlin, SPARQL, openCypher, Neptune Multi-AZ, Neptune reader instance,40Neptune bulk load, Neptune Loader, Neptune Streams, Neptune parameter41group, neptune_enforce_ssl, neptune_query_timeout, IAM database auth,42Neptune subnet group, Neptune KMS encryption, db.r6g.large,43db.r6g.8xlarge, db.x2gdb.16xlarge.4445## STRICT output contract4647When this skill is invoked with a Neptune-provisioning request48(cluster name, instance class, workload shape, region, or a partial49configuration), the agent MUST respond with the READY_TO_DEPLOY50checklist defined in the "Output format" section using the literal51all-caps labels `NEPTUNE:`, `VERDICT:`, `CHECKLIST:`, and52`VERIFICATION_COMMANDS:`. Do NOT preface the checklist with prose,53headings, or disclaimers — emit the block as the first lines of the54response. This contract is what assertion-based evals and downstream55provisioning pipelines rely on; deviating from the literal labels56breaks automation silently.5758If any prerequisite is missing, the verdict is59`PREREQUISITES_MISSING` with a specific gap citation in the checklist60(marked `[✗]`), and `READY_TO_DEPLOY` MUST NOT also appear.6162## Quick navigation6364| Section | When to read |65|---|---|66| Prerequisites | Always — verify before provisioning |67| Step 1 — Neptune DB vs Neptune Analytics | Boundary call (avoid the common misroute) |68| Step 2 — Instance class + cluster size | Sizing writer + readers |69| Step 3 — Multi-AZ with reader promotion | Production topology |70| Step 4 — Network + security (VPC, subnet group, SG) | VPC wiring |71| Step 5 — Encryption (KMS at creation, immutable) | TLS + at-rest |72| Step 6 — Parameter groups | neptune_enforce_ssl, neptune_query_timeout |73| Step 7 — IAM database auth | Token-based access |74| Step 8 — Bulk load from S3 | Initial data ingest |75| Step 9 — Query languages (Gremlin, SPARQL, openCypher) | API surface |76| Step 10 — Streams / snapshots / recent features | Change capture, recovery |77| NEVER do these things | Review before signing off |78| Output format | The literal checklist template |79| references/instance-and-topology.md | Writer/reader math, instance classes |80| references/provisioning-cli-commands.md | Copy-pasteable CLI sequence |8182## Mindset8384**One-line takeaway:** Neptune correctness is decided at creation85time. Encryption at rest (KMS) and the cluster's VPC/subnet placement86are immutable post-creation — modifying them requires a snapshot87restore into a new cluster. The procedure treats each one-way door as88an explicit decision before the `create-db-cluster` call.8990> The three provisioning-time misconceptions (DB vs Analytics, encryption-at-creation, single-instance production) moved to [references/advanced-patterns.md](references/advanced-patterns.md).91> Load on demand; the one-line takeaway above is the operative rule.9293## Configuration dependency graph (novel heuristic)9495> Full dependency graph table and cross-dependency gotchas moved to [references/advanced-patterns.md](references/advanced-patterns.md).96> Load on demand to sequence provisioning and debug immutable/one-way-door settings.9798## Expert heuristic: graph sizing (memory budget)99100> Graph sizing heuristic (60% buffer-cache budget, 3x index rule, worked example) moved to [references/instance-and-topology.md](references/instance-and-topology.md).101> Sizing rules in Step 2 summarize the operative constraints.102103## Expert heuristic: failover promotion semantics104105> Failover promotion semantics (cluster endpoint stability, ~30s promotion, zero committed-transaction loss, AZ spread) moved to [references/instance-and-topology.md](references/instance-and-topology.md).106> Load on demand for SLA analysis; Step 3 keeps the requirements.107108## Prerequisites (verify before provisioning)109110Before emitting provisioning commands, verify these prerequisites. If111any are missing, the verdict is **PREREQUISITES_MISSING** with a112specific gap citation.113114| Prerequisite | Why it matters | How to verify |115|---|---|---|116| AWS account with Neptune access | Can't provision without it | `aws sts get-caller-identity` |117| Region selected | Neptune clusters and subnet groups are region-scoped | `aws configure get region` |118| VPC ID + at least 2 subnets in different AZs (3+ preferred) | Neptune is VPC-only; Multi-AZ requires multi-AZ subnet group | `aws ec2 describe-subnets --filters "Name=vpc-id,Values=<vpc>"` — confirm >=2 distinct `AvailabilityZone` values |119| Cluster name unique in this region | Names are region-unique | `aws neptune describe-db-clusters --db-cluster-identifier <name>` returns `DBClusterNotFound` |120| KMS key ARN (if encryption with customer CMK) | Custom encryption requires a CMK in the same region | `aws kms describe-key --key-id <cmk-id>` — confirm `Enabled=true` |121| Security group with port 8182 inbound from application SG | Wrong port = silent connectivity failure; Neptune listens on 8182 | `aws ec2 describe-security-groups --group-ids <sg>` — verify inbound rule on 8182 |122| Workload description (graph size, query depth, write rate) | Drives instance class, replica count, parameter group decisions | Captured in the prompt or follow-up question |123| S3 bucket + IAM role for bulk load (if loading data) | Loader needs IAM role with `s3:GetObject` and Neptune trust policy; bucket in same region | `aws iam get-role --role-name <role>`; bucket in same region |124| Engine choice (DB vs Analytics) | Neptune Analytics is a separate service; this skill is DB only | If the user asks for graph algorithms / large-scale analytics, redirect to Neptune Analytics |125126If any prerequisite is missing, output `VERDICT: PREREQUISITES_MISSING`127and cite the specific gap.128129## Step 1 — Neptune DB vs Neptune Analytics (boundary call)130131The single highest-impact Neptune decision is which SERVICE to use.132This skill only provisions Neptune DB. If the user wants Neptune133Analytics, stop and redirect.134135**Decision tree:**136137```text138What is the workload shape?139├── Transactional (OLTP) — point lookups, short traversals,140│ real-time app queries, frequent writes141│ └── Neptune DB (this skill)142├── Analytical (OLAP) — PageRank / connected-components /143│ community-detection on a large static graph, batch144│ └── Neptune Analytics (NOT this skill — separate API:145│ aws graph create-graph, no writer/reader split)146└── Both └── Neptune DB for transactions + export to Neptune147 Analytics for batch algorithm runs148```149150**Feature comparison:**151152| Feature | Neptune DB | Neptune Analytics |153|---|---|---|154| API family | `aws neptune create-db-cluster` | `aws graph create-graph` (different CLI namespace) |155| Topology | writer + reader replicas (Multi-AZ) | single graph (no writer/reader split) |156| Failover | YES (writer promotion) | N/A (recreate on failure) |157| Gremlin transactions | YES | NO (read-only analytic queries) |158| SPARQL | YES | NO |159| openCypher | YES | YES |160| Graph algorithms (built-in) | NO (write your own Gremlin) | YES (PageRank, BFS, etc.) |161| Storage | cluster-shared (6-way) | ephemeral snapshot-loaded |162| Pricing | instance-hour + storage + IO | GB-hour (memory) + snapshot |163164**Common mistake:** provisioning Neptune DB for a PageRank workload.165Neptune DB has no built-in algorithm library; running PageRank in166Gremlin on a large graph will time out and exhaust memory. Use Neptune167Analytics.168169## Step 2 — Instance class + cluster size170171Neptune offers `db.r5`, `db.r6g`, `db.r6i`, `db.x2g` families.172Memory-bound graphs favor `r6g`/`x2g`. Avoid `t3`/`t4g` burstable for173production (Neptune is not supported on burstable in some regions).174175**Cluster size by workload:**176177- **Dev / test:** 1 writer instance, `db.r6g.large`. No failover.178- **Small production (read-heavy, < 100 GB working set):** 1 writer +179 1 reader (Multi-AZ), `db.r6g.2xlarge`.180- **Mid production (100-500 GB, mixed read/write):** 1 writer + 2181 readers across 3 AZs, `db.r6g.8xlarge`.182- **Large production (500 GB+, deep traversals):** 1 writer + 3+183 readers, `db.r6g.16xlarge` or `db.x2gdb.16xlarge`.184185**Sizing rules:**186- Plan for 60% of instance memory as the buffer cache budget (see187 Expert heuristic above). The graph working set (vertices + edges +188 3x indexes) MUST fit in the buffer cache for sub-second traversals.189- Readers scale reads, not writes. There is exactly one writer per190 Neptune cluster.191- Cluster storage auto-scales; do NOT size for storage, size for192 memory.193194## Step 3 — Multi-AZ with reader promotion195196Multi-AZ is the primary resilience control for Neptune DB.197198**Requirements:**199- At least 1 reader instance in a DIFFERENT AZ than the writer.200- DB subnet group spanning at least 2 AZs (3+ preferred for201 spreading readers).202- Deletion protection enabled on the cluster.203204**Behavior on writer failure:**205- Neptune detects writer loss (health check).206- A reader in a different AZ is promoted to writer (~30 seconds).207- The cluster endpoint repoints to the new writer automatically.208- Clients reconnect via the cluster endpoint — no code change.209- Data loss window: zero committed transactions (cluster-shared210 storage).211212**Common mistake:** subnet group with only one AZ. Multi-AZ cannot213place the reader in a different AZ, and the cluster silently degrades214to writer-only (no failover). Verify the subnet group spans >=2 AZs215before `create-db-cluster`.216217## Step 4 — Network + security (VPC, subnet group, security group)218219Neptune is **VPC-only** — there is no public IP option. All clusters220live inside a VPC and are reachable only from inside the VPC (or via221a bastion / VPN / PrivateLink).222223> Subnet-group and security-group CLI blocks moved to [references/provisioning-cli-commands.md](references/provisioning-cli-commands.md).224> NEVER open port 8182 to 0.0.0.0/0 — rule retained below.225226**NEVER** open port 8182 to `0.0.0.0/0` — even with TLS and IAM auth,227this exposes the cluster to internet scanning. Always scope inbound to228the application's SG.229230## Step 5 — Encryption (KMS at creation, immutable)231232Neptune encryption at rest is **immutable**: set at creation via233`--storage-encrypted`. Adding it later requires a snapshot → restore234into a new encrypted cluster.235236- `--storage-encrypted` enables encryption (AWS-managed KMS key by237 default).238- `--kms-key-id <cmk-arn>` uses a customer-managed CMK (required for239 most compliance regimes — HIPAA, PCI, SOC2).240- TLS in transit is controlled by the parameter group via241 `neptune_enforce_ssl=1` (see Step 6). Pair at-rest + in-transit242 encryption for defense in depth.243244**Common mistake:** planning to "enable encryption later." A245non-encrypted Neptune cluster CANNOT be encrypted without a full246snapshot/restore cycle. Decide at creation.247248## Step 6 — Parameter groups (neptune_enforce_ssl, neptune_query_timeout)249250Parameter groups control Neptune runtime behavior. Most parameters251require an instance reboot to take effect — set them at cluster252creation in the DB cluster parameter group.253254| Parameter | Default | Recommended | Why |255|---|---|---|---|256| `neptune_enforce_ssl` | `0` (off) | `1` (on) for all production | Forces TLS-only connections; plaintext rejected. Defense against network sniffing. |257| `neptune_query_timeout` | `120000` (ms) | `30000` (30s) for OLTP; `120000+` for analytics | Caps runaway traversals. Long-running queries consume CPU/memory and starve other queries. |258| `neptune_streams` | `0` (off) | `1` (on) if change capture needed | Enables Neptune Streams for CDC (see Step 10). |259| `neptune_lab_mode` | varies | Leave at default unless AWS support advises | Labs features may change; do not enable in production without testing. |260261> Parameter-group creation/modify CLI moved to [references/provisioning-cli-commands.md](references/provisioning-cli-commands.md).262> Parameter table above stays authoritative.263264**Common mistake:** enabling `neptune_enforce_ssl=1` on an existing265production cluster without a maintenance window. The rolling reboot266drops plaintext clients. Enable at creation.267268## Step 7 — IAM database auth269270Neptune supports IAM database auth — token-based access using AWS SigV4271instead of static passwords. Recommended for production; pairs with272`neptune_enforce_ssl=1`.273274> IAM enable flag and the neptune-db:Connect policy JSON moved to [references/provisioning-cli-commands.md](references/provisioning-cli-commands.md).275> Gotchas below remain in-file.276277**Common gotchas:**278- IAM auth and password auth can coexist. To enforce IAM-only, do NOT279 set a password and rely on IAM tokens.280- IAM tokens are SigV4-derived — short-lived (~15 minutes). The281 Gremlin/SPARQL driver must refresh tokens automatically (most modern282 drivers do; verify your client lib).283- IAM auth requires TLS — pair with `neptune_enforce_ssl=1`.284285## Step 8 — Bulk load from S3 (Neptune Loader)286287For initial data ingest, use the Neptune Loader (NOT a script that288issues individual Gremlin `g.addV` calls — that is 10-100x slower).289290**Prerequisites:**291- S3 bucket in the SAME region as the Neptune cluster.292- IAM role with trust policy allowing Neptune and permissions293 `s3:GetObject` on the bucket.294- Data in a supported format: Gremlin CSV/JSON/n-quad, or SPARQL295 N-Triples/RDF.296297> Neptune Loader curl payload moved to [references/provisioning-cli-commands.md](references/provisioning-cli-commands.md).298> Prerequisites and common mistakes below remain in-file.299300**Common mistakes:**301- Cross-region S3 bucket — the Loader fails silently or with a302 generic permissions error. Always same-region.303- Concurrent loads on the same cluster conflict. Run one load at a304 time per cluster.305- `mode=AUTO` overwrites existing vertices; `mode=NEW` errors on306 duplicates; `mode=RESUME` continues an interrupted load.307308## Step 9 — Query languages (Gremlin, SPARQL, openCypher)309310Neptune supports three query languages on the SAME cluster (no need311to pick at creation). Endpoints:312313| Language | Endpoint path | Use when |314|---|---|---|315| Gremlin | `:8182/gremlin` | Apache TinkerPop-compatible; property graph; deep traversals |316| SPARQL | `:8182/sparql` | RDF / semantic web; triple-store; SPARQL queries |317| openCypher | `:8182/opencypher` | Cypher (Neo4j-compatible) syntax; property graph; declarative patterns |318319**Common mistake:** loading property-graph data then trying SPARQL.320Gremlin and openCypher operate on the property graph; SPARQL operates321on RDF triples. They are different data models. Pick the model at load322time.323324## Step 10 — Streams / snapshots / recent features325326**Neptune Streams (CDC):**327- Enable via `neptune_streams=1` in the parameter group + reboot.328- Exposes an HTTP endpoint (`:8182/streams`) returning change records329 (vertex/edge insertions, updates, deletions).330- Pair with a consumer (Kinesis Data Streams + Lambda, or a custom331 poller) for downstream replication / audit.332- Stream records are retained for ~24 hours.333334**Snapshots (automated + manual):**335- Automated: set `--backup-retention-period 7` (days) at creation.336- Manual: `aws neptune create-db-cluster-snapshot` before upgrades.337- Restore creates a NEW cluster (the snapshot is cluster-scoped).338339> Recent AWS features (2023-2026) moved to [references/advanced-patterns.md](references/advanced-patterns.md).340> Streams and snapshot guidance above remain in-file.341342## NEVER do these things3433441. **NEVER plan to "enable encryption at rest later."** Neptune345 encryption is immutable post-creation. Adding it requires a346 snapshot → restore into a new encrypted cluster. Decide at creation.3473482. **NEVER provision Neptune DB for a graph-algorithm (PageRank,349 connected components) workload.** Neptune DB has no built-in350 algorithm library. Use Neptune Analytics (separate service). A351 baseline model conflates the two.3523533. **NEVER enable `neptune_enforce_ssl=1` on an existing production354 cluster without a maintenance window.** The rolling reboot drops355 plaintext clients. Enable at creation.3563574. **NEVER open port 8182 to `0.0.0.0/0`.** Even with TLS and IAM358 auth, internet exposure invites scanning. Always scope inbound to359 the application's SG.3603615. **NEVER use a single-AZ subnet group for Multi-AZ Neptune.**362 Multi-AZ requires the promoted reader in a different AZ than the363 writer. Verify `aws ec2 describe-subnets` shows >=2 distinct AZs in364 the subnet group before `create-db-cluster`.3653666. **NEVER run a Neptune DB cluster with only a writer instance in367 production.** There is no failover target. The minimum production368 topology is 1 writer + 1 reader in a different AZ.3693707. **NEVER load data via individual Gremlin `g.addV()` calls for bulk371 ingest.** Use the Neptune Loader (10-100x faster). Per-vertex372 inserts are for incremental app writes only.3733748. **NEVER use a cross-region S3 bucket for the Neptune Loader.** It375 fails silently or with a generic permissions error. Always376 same-region.3773789. **NEVER load property-graph data then expect SPARQL to work.**379 Gremlin/openCypher operate on the property graph; SPARQL operates380 on RDF triples. Different data models. Pick at load time.38138210. **NEVER size Neptune by spec-sheet memory.** Plan for 60% buffer383 cache budget; the graph working set (vertices + edges + 3x384 indexes) MUST fit in 60% of nominal or traversals slow 10-100x.38538611. **NEVER disable deletion protection on a production cluster387 outside of a planned teardown.** Accidental `delete-db-cluster`388 destroys the cluster + storage irrecoverably.38939012. **NEVER use the engine version "latest" in production.** Pin the391 major version explicitly; auto-upgrades during maintenance windows392 can introduce breaking behavior.393394## Output format395396```text397NEPTUNE: <cluster-name>398VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING399CHECKLIST:400 [✓|✗] Service: Neptune DB (NOT Analytics)401 [✓|✗] Engine version: 1.3.x.x (pinned)402 [✓|✗] Writer instance: db.<family>.<size>403 [✓|✗] Reader instances: <N> (across <AZ-count> AZs for Multi-AZ)404 [✓|✗] Multi-AZ with reader promotion: Enabled | Disabled (writer-only — NO failover)405 [✓|✗] Subnet group: <name> (spans <N> AZs)406 [✓|✗] Security group: <sg-id> (inbound port 8182 from <app-sg>)407 [✓|✗] Encryption at rest: Enabled (customer CMK <key-arn> | AWS-managed) | Disabled408 [✓|✗] TLS / neptune_enforce_ssl: Enabled | Disabled409 [✓|✗] IAM database auth: Enabled | Disabled410 [✓|✗] Parameter group: <name> (neptune_query_timeout=<ms>, neptune_streams=<0|1>)411 [✓|✗] Snapshot retention: <N> days | Disabled412 [✓|✗] Deletion protection: Enabled | Disabled413 [✓|✗] Bulk load source: s3://<bucket>/<prefix> (same region, IAM role <role-arn>) | N/A414 [✓|✗] Query languages: Gremlin | SPARQL | openCypher415VERIFICATION_COMMANDS:416 aws neptune describe-db-clusters --db-cluster-identifier <name>417 aws neptune describe-db-instances --db-instance-identifier <name>-instance-1418 aws neptune describe-db-cluster-parameters --db-cluster-parameter-group-name <pg>419 aws ec2 describe-subnets --subnet-ids <subnet-ids>420 aws kms describe-key --key-id <cmk-id>421```422423### Worked example — production Neptune DB with Multi-AZ424425```text426NEPTUNE: prod-graph427VERDICT: READY_TO_DEPLOY428CHECKLIST:429 [✓] Service: Neptune DB (NOT Analytics)430 [✓] Engine version: 1.3.2.0 (pinned)431 [✓] Writer instance: db.r6g.8xlarge432 [✓] Reader instances: 2 (across us-east-1b, us-east-1c for Multi-AZ)433 [✓] Multi-AZ with reader promotion: Enabled434 [✓] Subnet group: prod-neptune-subnet (3 AZs)435 [✓] Security group: sg-neptune123 (inbound 8182 from sg-app456)436 [✓] Encryption at rest: Enabled (customer CMK alias/prod-graph-kms)437 [✓] TLS / neptune_enforce_ssl: Enabled438 [✓] IAM database auth: Enabled439 [✓] Parameter group: prod-neptune-pg (neptune_query_timeout=30000, neptune_streams=1)440 [✓] Snapshot retention: 7 days441 [✓] Deletion protection: Enabled442 [✓] Bulk load source: s3://prod-graph-bucket/initial-load/ (same region, IAM role NeptuneLoadRole)443 [✓] Query languages: Gremlin, openCypher444VERIFICATION_COMMANDS:445 aws neptune describe-db-clusters --db-cluster-identifier prod-graph446 aws neptune describe-db-instances --db-instance-identifier prod-graph-instance-1447 aws neptune describe-db-cluster-parameters --db-cluster-parameter-group-name prod-neptune-pg448 aws ec2 describe-subnets --subnet-ids subnet-0aaa subnet-0bbb subnet-0ccc449 aws kms describe-key --key-id alias/prod-graph-kms450```451452## Decision tree: Neptune DB vs Neptune Analytics453454```text455Is the workload transactional (OLTP) — point lookups, short456traversals, real-time app queries, frequent writes?457├── YES → Neptune DB (this skill)458│ writer + readers, Multi-AZ, Gremlin/SPARQL/openCypher459└── NO → Is the workload analytical (OLAP) — PageRank,460 connected-components, community-detection on a large461 static graph?462 ├── YES → Neptune Analytics (NOT this skill — aws graph)463 │ single graph, built-in algorithms, GB-hour pricing464 └── NO → Neptune DB for transactions + scheduled export to465 Neptune Analytics for batch algorithm runs466```467468## Error handling469470> API error deep dives (DBClusterAlreadyExists, DBSubnetGroup AZ span, IAM AccessDenied, Loader assume-role) moved to [references/error-handling.md](references/error-handling.md).471> Load on demand when a provisioning call fails.472473## References (load on demand)474475- [references/error-handling.md](references/error-handling.md) — provisioning API error deep dives and fixes.476- [references/advanced-patterns.md](references/advanced-patterns.md) — misconceptions, configuration dependency graph, recent AWS features.477- [references/instance-and-topology.md](references/instance-and-topology.md) — sizing heuristic and failover promotion semantics.478- [references/provisioning-cli-commands.md](references/provisioning-cli-commands.md) — full copy-pasteable CLI sequence (subnet group, SG, parameter group, IAM, loader).479480## Domain481482AWS CloudOps / Amazon Neptune DB Provisioning & Graph Topology Design.483484## AWS documentation485486- **Amazon Neptune User Guide** — https://docs.aws.amazon.com/neptune/latest/userguide/intro.html487- **Neptune instance classes** — https://docs.aws.amazon.com/neptune/latest/userguide/instance-types.html488- **Neptune encryption at rest** — https://docs.aws.amazon.com/neptune/latest/userguide/encrypt.html489- **Neptune TLS / neptune_enforce_ssl** — https://docs.aws.amazon.com/neptune/latest/userguide/security-ssl.html490- **Neptune IAM database auth** — https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth.html491- **Neptune Loader** — https://docs.aws.amazon.com/neptune/latest/userguide/load-data.html492- **Neptune Streams** — https://docs.aws.amazon.com/neptune/latest/userguide/streams.html493- **Neptune Analytics (separate service)** — https://docs.aws.amazon.com/neptune-analytics/latest/dg/what-is-neptune-analytics.html494- **Gremlin / SPARQL / openCypher in Neptune** — https://docs.aws.amazon.com/neptune/latest/userguide/graph-engines.html495