> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neptune.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Resources Overview

> Provision storage buckets, secrets, and databases for your applications

Neptune can provision and manage cloud resources alongside your application deployments. Resources are defined in your `neptune.json` configuration and automatically wired to your application.

## Available Resources

> [card] [Storage Buckets](https://docs.neptune.dev/resources/storage.md)
>
> S3-compatible object storage for files and assets

> [card] [Secrets](https://docs.neptune.dev/resources/secrets.md)
>
> Secure storage for API keys and sensitive configuration

> [card] [Databases](https://docs.neptune.dev/resources/databases.md)
>
> Managed Postgres databases

## Adding Resources

The easiest way to add resources is to ask your AI assistant:

> "Add an S3 bucket for user uploads to my project"

Or you can define them directly in your `neptune.json`:

```json neptune.json theme={"dark"}
{
  "kind": "Service",
  "name": "my-app",
  "resources": [
    {
      "kind": "StorageBucket",
      "name": "uploads"
    },
    {
      "kind": "Secret",
      "name": "STRIPE_API_KEY"
    },
    {
      "kind": "Database",
      "name": "my-app-db"
    }
  ]
}
```

## Resource Lifecycle

**1. Define**

Add resources to your `neptune.json` configuration (or ask your AI assistant to add them)

**2. Provision**

Neptune provisions the cloud resources and returns the physical resource names to your AI assistant.

**3. Code**

Write your application code using the physical resource names, or let your AI assistant write it for you.

**4. Deploy**

Your app is deployed with all IAM permissions pre-configured to access its resources.

> [!TIP]
>
> Your AI assistant handles this flow automatically - it provisions resources, knows the physical names, and can write code that accesses them correctly.

## How Resources Work

When Neptune provisions a resource, it creates:

1. **A unique physical name** - e.g., `neptune-abc123-uploads` for global uniqueness
2. **IAM permissions** - Your service automatically has access to its own resources
3. **No manual credential setup** - Just use standard AWS SDKs like `boto3`

Your AI assistant receives the physical resource names after provisioning and can use them when writing code for you.

## Example: Web App with Storage and Secrets

Here's a complete configuration for a typical web application:

```json neptune.json theme={"dark"}
{
  "kind": "Service",
  "name": "my-saas-app",
  "port_mappings": [
    { "container_port": 3000, "host_port": 8080 }
  ],
  "resources": [
    {
      "kind": "StorageBucket", 
      "name": "user-uploads"
    },
    {
      "kind": "Secret",
      "name": "STRIPE_SECRET_KEY"
    },
    {
      "kind": "Secret",
      "name": "RESEND_API_KEY"
    },
    {
      "kind": "Database",
      "name": "myapp-db"
    }
  ]
}
```

Your application can then access these resources using standard AWS SDKs:

```python theme={"dark"}
import boto3
import stripe
from resend import Resend

# Physical names provided by your AI assistant after provisioning
BUCKET_NAME = "neptune-abc123-user-uploads"
STRIPE_SECRET_NAME = "neptune-abc123-STRIPE_SECRET_KEY"
RESEND_SECRET_NAME = "neptune-abc123-RESEND_API_KEY"

# Storage - permissions are pre-configured
s3 = boto3.client("s3")
s3.put_object(Bucket=BUCKET_NAME, Key="example.txt", Body=b"Hello!")

# Secrets - accessed via AWS Secrets Manager
sm = boto3.client("secretsmanager")

stripe_key = sm.get_secret_value(SecretId=STRIPE_SECRET_NAME)['SecretString']
stripe.api_key = stripe_key

resend_key = sm.get_secret_value(SecretId=RESEND_SECRET_NAME)['SecretString']
resend = Resend(api_key=resend_key)
```

## Managing Resources

Ask your AI assistant to help with common resource operations:

| Task | Example Request |
| - | - |
| Add a resource | "Add an S3 bucket called 'uploads' to my project" |
| Add a database | "Add a database called 'app' to my project" |
| Set a secret | "Set my STRIPE\_API\_KEY secret" |
| List bucket files | "What files are in my uploads bucket?" |
| Check status | "What's the status of my resources?" |
| Get resource names | "What are the physical names of my resources?" |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.