{
  "name": "sql-to-s3",
  "title": "Run a SQL query and write results to S3 as CSV",
  "category": "Data",
  "tags": [
    "data",
    "python"
  ],
  "version": "1.1.0",
  "date": "2026-08-12",
  "notes": "Cut ahead of the first image push: build-item-images reads the tag it pushes out of this file, so the version has to move before the dispatch or the first tag names the release that installs psycopg2-binary and boto3 from PyPI on every run. The template still does that install. It moves onto the image, and this entry gets the digest, once the package exists and is public.",
  "latest": false,
  "installable": false,
  "url": "https://catalog.dagweave.com/api/v1/items/sql-to-s3/1.1.0.json",
  "entrypoint": "export",
  "parameters": [
    {
      "name": "bucket",
      "title": "Bucket",
      "description": "Target S3 bucket for the CSV result (no s3:// prefix).",
      "type": "string",
      "required": true,
      "example": "my-data-bucket"
    },
    {
      "name": "key",
      "title": "Object key",
      "description": "Destination object key for the CSV result.",
      "type": "string",
      "required": true,
      "example": "exports/users.csv"
    },
    {
      "name": "query",
      "title": "SQL query",
      "description": "SQL query to run against the Postgres database.",
      "type": "string",
      "required": true,
      "example": "SELECT id, email FROM users WHERE active"
    },
    {
      "name": "aws-access-key-id-key",
      "title": "Access key id secret key",
      "description": "Key within the Secret that holds the AWS access key id.",
      "type": "string",
      "required": false,
      "default": "access-key-id"
    },
    {
      "name": "aws-secret-access-key-key",
      "title": "Secret access key secret key",
      "description": "Key within the Secret that holds the AWS secret access key.",
      "type": "string",
      "required": false,
      "default": "secret-access-key"
    },
    {
      "name": "aws-secret-name",
      "title": "AWS secret name",
      "description": "Name of the Kubernetes Secret in the run namespace holding the AWS credentials.",
      "type": "string",
      "required": false,
      "default": "aws-credentials"
    },
    {
      "name": "db-secret-key",
      "title": "DB secret key",
      "description": "Key within the Secret that holds the Postgres connection string.",
      "type": "string",
      "required": false,
      "default": "connection-string"
    },
    {
      "name": "db-secret-name",
      "title": "DB secret name",
      "description": "Name of the Kubernetes Secret holding the Postgres connection string (DSN / libpq URL).",
      "type": "string",
      "required": false,
      "default": "postgres-credentials"
    },
    {
      "name": "region",
      "title": "AWS region",
      "description": "AWS region of the bucket.",
      "type": "string",
      "required": false,
      "default": "us-east-1"
    }
  ],
  "images": [
    {
      "ref": "python@sha256:94d3426f1def7db4a106a232ac121bfd975393e5dfd40a619b955fae45fe7913",
      "repository": "python",
      "digest": "sha256:94d3426f1def7db4a106a232ac121bfd975393e5dfd40a619b955fae45fe7913"
    }
  ],
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/sql-to-s3",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
