Skip to content

chore(infra): the production Neon project #492

Closed

Description

@allisonmahmood

Part of the launch (#416). HITL: Allison creates this in Neon. Do it before #416 deploys: #415's secrets need its connection strings.

Why

Production needs its own Neon project. Neon holds the platform database, one Postgres database per company (ADR-0009), and Neon Object Storage for patch files and CLI releases. None of it exists yet. The patchy-prod project from 2026-07-01 predates this codebase, so leave it alone rather than reusing it.

Steps

  1. Create a project in the Patchy org, aws-us-east-1 (same region as the AWS stack), Postgres 17 like the spike, on the Launch plan or above so point-in-time restore is available (7 days on Launch).

  2. Turn suspend off on the production compute, and let it autoscale from ¼ to 1 CU. Raise the ceiling later if the data says so.

  3. Create the roles as docs/OPERATIONS.md (Neon company databases) describes:

    • a provisioning login allowed to CREATE DATABASE, which becomes PATCHY_COMPANY_DB_ADMIN_URL;
    • an unprivileged data login, which becomes the PATCHY_COMPANY_DB_URL template;
    • GRANT patchy_data TO patchy_admin WITH SET TRUE, INHERIT FALSE.

    The platform database is DATABASE_URL. Use direct URLs with sslmode=verify-full and no channel_binding; the server refuses that parameter at startup.

  4. Create a private Object Storage bucket on the production branch. Its five settings, PATCHY_S3_BUCKET, _ENDPOINT, _REGION, _ACCESS_KEY_ID and _SECRET_ACCESS_KEY, are in docs/OPERATIONS.md (Neon Object Storage). Don't add expiry rules: the bucket also holds every CLI release users have pinned.

  5. Set the history retention you want (7 days is Launch's maximum). chore(infra): the first deploy of Patchy to AWS #416's restore drill uses it.

  6. Record on this issue that the project is done. This repo is public, so keep the project id and connection strings off it; the operator holds them privately, and chore(infra): the first deploy of Patchy to AWS #416 places them in feat(infra): production infrastructure in AWS CDK and the deploy workflow #415's host secret.

Done when

The project exists with suspend off and restore available, the roles and bucket match OPERATIONS.md, and the connection strings are ready for #416 to place in #415's host secret.

Activity

  1. added
    ready-for-human
    on Oct 2, 2026
  2. allisonmahmood commented on Oct 4, 2026

    @allisonmahmood
    OwnerAuthor

    Done on 2026-10-04 with the neon CLI. The project matches the steps above and docs/OPERATIONS.md:

    • Launch plan, aws-us-east-1, Postgres 17. The compute autoscales from ¼ to 1 CU with suspend off, and history is 7 days.
    • The provisioning login is a Neon API role, so it can CREATE DATABASE. The data login was created in SQL with no attributes, then GRANT patchy_data TO patchy_admin WITH SET TRUE, INHERIT FALSE. DATABASE_URL uses the project's default owner role, so the provisioning login does not own the platform data.
    • A private Object Storage bucket on the production branch, no expiry rules, with a read/write storage credential.
    • All three URLs are direct, sslmode=verify-full, without channel_binding.

    Checked: each login connects as its role, the server's create, configure and drop sequence for a company database works against it, and an object round-trips through the bucket.

    The project id and connection strings stay off this public issue. They are ready for #416, which places them in #415's host secret (patchy/production/host) once its base stack exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions