Loading...
Loading...
Provisions and manages Neo4j Aura instances via CLI (aura-cli v1.7+) or REST API. Use when creating, pausing, resuming, resizing, or deleting AuraDB Free/Professional/Business Critical/VDC instances; downloading credentials; scripting CI/CD pipelines; polling async status; or using the Terraform neo4j/neo4j-aura provider. Covers auth setup (client credentials OAuth2), credential lifecycle (download once — never recoverable), instance type selection, region codes, and Python provisioning scripts. Does NOT handle Cypher queries — use neo4j-cypher-skill. Does NOT cover Graph Data Science algorithms — use neo4j-gds-skill or neo4j-aura-graph-analytics-skill. Does NOT cover neo4j-admin/cypher-shell — use neo4j-cli-tools-skill.
npx skill4agent add neo4j-contrib/neo4j-skills neo4j-aura-provisioning-skillcreatingrunningneo4j-cypher-skillneo4j-gds-skillneo4j-aura-graph-analytics-skillneo4j-cli-tools-skill| Tier | API type code | Memory | GDS | Replicas | Use when |
|---|---|---|---|---|---|
| AuraDB Free | | 1 GB | ❌ | ❌ | Dev/demo; ≤200k nodes/400k rels |
| AuraDB Professional | | 2–64 GB | plugin available | ❌ | Production workloads |
| AuraDB Business Critical | | 4–384 GB | plugin available | ✅ | HA, multi-AZ, SLA |
| AuraDB VDC | | custom | ✅ | ✅ | Dedicated infra, compliance |
| AuraDS Professional | | 2–64 GB | ✅ built-in | ❌ | Data science / GDS |
| AuraDS Enterprise | | custom | ✅ | ✅ | Enterprise GDS |
# macOS
curl -L https://github.com/neo4j/aura-cli/releases/latest/download/aura-cli-darwin-amd64.tar.gz | tar xz
sudo mv aura-cli /usr/local/bin/
aura-cli -v # verifyaura-cli credential add \
--name "my-creds" \
--client-id "$AURA_CLIENT_ID" \
--client-secret "$AURA_CLIENT_SECRET"
aura-cli credential use --name "my-creds"aura-cli instance list --output tablePOST https://api.neo4j.io/oauth/tokenTOKEN=$(curl -s --request POST 'https://api.neo4j.io/oauth/token' \
--user "${AURA_CLIENT_ID}:${AURA_CLIENT_SECRET}" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
| jq -r '.access_token')
echo "Token: ${TOKEN:0:20}..."--header "Authorization: Bearer $TOKEN"aura-cli tenants list --output table
# Copy TENANT_ID for create operationscurl -s https://api.neo4j.io/v1/tenants \
-H "Authorization: Bearer $TOKEN" | jq '.data[] | {id, name}'aura-creds.jsonaura-cli instance create \
--name "my-instance" \
--cloud-provider gcp \
--region europe-west1 \
--type professional-db \
--tenant-id "$TENANT_ID" \
--output json | tee aura-creds.json
# Extract for .env
INSTANCE_ID=$(jq -r '.id' aura-creds.json)
PASSWORD=$(jq -r '.password' aura-creds.json)RESPONSE=$(curl -s -X POST https://api.neo4j.io/v1/instances \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "my-instance",
"cloud_provider": "gcp",
"region": "europe-west1",
"type": "professional-db",
"tenant_id": "'"$TENANT_ID"'",
"memory": "4GB",
"version": "5"
}')
echo "$RESPONSE" | tee aura-creds.json
INSTANCE_ID=$(echo "$RESPONSE" | jq -r '.data.id')
PASSWORD=$(echo "$RESPONSE" | jq -r '.data.password')| Field | Required | Values |
|---|---|---|
| ✅ | any string |
| ✅ | |
| ✅ | see region table |
| ✅ | see tier table |
| ✅ | from tenant list |
| ✗ | |
| ✗ | |
runningpausedpoll_status() {
local INSTANCE_ID=$1 TARGET=$2 MAX_WAIT=${3:-600}
local ELAPSED=0 STATUS
echo "Polling for status=$TARGET (max ${MAX_WAIT}s)..."
while [ $ELAPSED -lt $MAX_WAIT ]; do
STATUS=$(aura-cli instance get --instance-id "$INSTANCE_ID" --output json \
| jq -r '.status' 2>/dev/null)
echo " [${ELAPSED}s] status=$STATUS"
[ "$STATUS" = "$TARGET" ] && echo "Ready." && return 0
[ "$STATUS" = "destroying" ] && echo "ERROR: instance is being destroyed" && return 1
sleep 10; ELAPSED=$((ELAPSED + 10))
done
echo "TIMEOUT after ${MAX_WAIT}s — last status: $STATUS" && return 1
}
poll_status "$INSTANCE_ID" "running" 600while true; do
STATUS=$(curl -s "https://api.neo4j.io/v1/instances/$INSTANCE_ID" \
-H "Authorization: Bearer $TOKEN" | jq -r '.data.status')
[ "$STATUS" = "running" ] && break
sleep 10
donecreating → running → pausing → paused → resuming → running
↘ destroying → (gone)CONNECTION_URI="neo4j+s://${INSTANCE_ID}.databases.neo4j.io"
cat > .env <<EOF
NEO4J_URI=${CONNECTION_URI}
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=${PASSWORD}
NEO4J_DATABASE=neo4j
AURA_INSTANCE_ID=${INSTANCE_ID}
EOF
# Ensure .env never committed
grep -q '^\.env$' .gitignore 2>/dev/null || echo '.env' >> .gitignore
# Verify connectivity
cypher-shell -a "$CONNECTION_URI" -u neo4j -p "$PASSWORD" "RETURN 'connected' AS status"runningaura-cli instance pause --instance-id "$INSTANCE_ID"
poll_status "$INSTANCE_ID" "paused" 600pausedaura-cli instance resume --instance-id "$INSTANCE_ID"
poll_status "$INSTANCE_ID" "running" 900 # resume can take longerrunning# REST only — CLI resize not available in v1.7
curl -s -X PATCH "https://api.neo4j.io/v1/instances/$INSTANCE_ID" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"memory": "8GB"}'
poll_status "$INSTANCE_ID" "running" 600
# Cannot reduce below current usage levelaura-cli instance delete --instance-id "$INSTANCE_ID"
# No poll needed — immediatecurl -s -X DELETE "https://api.neo4j.io/v1/instances/$INSTANCE_ID" \
-H "Authorization: Bearer $TOKEN"import os, time, requests
CLIENT_ID = os.environ["AURA_CLIENT_ID"]
CLIENT_SECRET = os.environ["AURA_CLIENT_SECRET"]
BASE = "https://api.neo4j.io/v1"
def get_token() -> str:
r = requests.post(
"https://api.neo4j.io/oauth/token",
auth=(CLIENT_ID, CLIENT_SECRET),
data={"grant_type": "client_credentials"},
)
r.raise_for_status()
return r.json()["access_token"]
def auth_headers(token: str) -> dict:
return {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
def create_instance(token: str, tenant_id: str, **kwargs) -> dict:
payload = {"tenant_id": tenant_id, "version": "5", **kwargs}
r = requests.post(f"{BASE}/instances", headers=auth_headers(token), json=payload)
r.raise_for_status()
return r.json()["data"] # contains id, password, connection_url
def poll_status(token: str, instance_id: str, target: str, timeout: int = 600) -> None:
deadline = time.time() + timeout
while time.time() < deadline:
r = requests.get(f"{BASE}/instances/{instance_id}", headers=auth_headers(token))
r.raise_for_status()
status = r.json()["data"]["status"]
print(f" status={status}")
if status == target:
return
if status == "destroying":
raise RuntimeError("Instance destroyed unexpectedly")
time.sleep(10)
raise TimeoutError(f"Instance {instance_id} did not reach '{target}' in {timeout}s")
# --- usage ---
token = get_token()
instance = create_instance(
token,
tenant_id = os.environ["AURA_TENANT_ID"],
name = "ci-test-instance",
cloud_provider = "aws",
region = "us-east-1",
type = "professional-db",
memory = "2GB",
)
# SAVE CREDENTIALS IMMEDIATELY — password never retrievable again
print(f"ID: {instance['id']}")
print(f"URI: neo4j+s://{instance['id']}.databases.neo4j.io")
print(f"Password: {instance['password']}") # log to secure vault NOW
poll_status(token, instance["id"], "running", timeout=600)
print("Instance ready.")| Region code | Location |
|---|---|
| N. Virginia |
| Ohio |
| Oregon |
| Ireland |
| Paris |
| Frankfurt |
| Singapore |
| Sydney |
| Mumbai |
| São Paulo |
| Region code | Location |
|---|---|
| Belgium |
| Frankfurt |
| Netherlands |
| Iowa |
| S. Carolina |
| N. Virginia |
| Taiwan |
| Tokyo |
| Singapore |
| Sydney |
| Region code | Location |
|---|---|
| E. US |
| E. US 2 |
| Netherlands |
| Ireland |
| London |
| Singapore |
| Brazil |
| Korea |
terraform {
required_providers {
aura = {
source = "neo4j/neo4j-aura"
}
}
}
provider "aura" {
client_id = var.aura_client_id # or AURA_CLIENT_ID env var
client_secret = var.aura_client_secret # or AURA_CLIENT_SECRET env var
}
resource "aura_instance" "db" {
name = "prod-db"
type = "professional-db"
cloud_provider = "gcp"
region = "europe-west1"
memory = "4GB"
tenant_id = var.aura_tenant_id
}
output "neo4j_uri" {
value = "neo4j+s://${aura_instance.db.id}.databases.neo4j.io"
sensitive = false
}
output "neo4j_password" {
value = aura_instance.db.password
sensitive = true
}terraform applyrunning| Error | Cause | Fix |
|---|---|---|
| Token expired (1 h TTL) | Re-run |
| Name already exists in tenant | Change name or delete existing |
| Instance not | Check status; wait for ongoing op to finish |
| Instance not | Check status |
| Below current usage | Reduce data first; can't shrink below usage |
| Region not found | Tier doesn't support that region | Use |
| Credentials lost after create | Password only returned at create time | Delete + recreate — no reset exists |
| Rate limit hit (25 req/min Free, 125 req/min Pro+) | Add |
| Wrong credential active | |
| Tier | Requests/minute |
|---|---|
| Free / Pro Trial (no billing) | 25 |
| Pro with billing, BC, VDC | 125 |
Retry-After.env.env.gitignorePASSWORDfrom_env()os.environ.envpython-dotenvload_dotenv()| Need | URL |
|---|---|
| REST API spec (OpenAPI) | |
| CLI reference | |
| Region list | |
| Auth details | |
| Instance actions | |
.env.env.gitignorepoll_statusrunningpoll_status