Skip to content

Provision what the execution-service spike needs on AWS and Neon #376

Closed

Description

@allisonmahmood

Part of #294.

Question

Provision what the execution-service spike needs on AWS and Neon before it starts, and record where the facts live. Decided on the hosting cloud ticket: Patchy hosts on AWS, company Postgres is Neon in us-east-1.

AWS (Allison holds the account; the agent drives what the credentials allow):

  • An AWS account or organisation member account for Patchy with the credit applied; note the root owner and where MFA lives.
  • An IAM user or role for the spike scoped to a tagged set of resources in us-east-1, never Allison's root; a second, disposable identity for subagents as the Azure spike had.
  • An ECS cluster on Fargate, an ECR repository, a VPC with a private subnet for execution tasks and the security-group pair the spike compares: the task's bootstrap side (registry, secrets, logs via VPC endpoints or NAT, note the fixed cost) and the patch-facing side with no outbound rule.
  • An Application Load Balancer, or a note that the spike measures the SSE and HTTP/2 checks through it with the idle timeout raised past 60 s.

Neon:

  • One Neon project in aws-us-east-1 on the grant, with one compute for the spike and suspend left on so the spike measures cold start; a console-made role carrying neon_superuser for the ADR-0009 provisioning path.

Housekeeping:

  • Keys written to ~/.config/patchy-cloud/aws-spike.env and neon-spike.env, never to the tree.
  • Retire the Azure spike group rg-patchy-tier2-spike and its service principal (az group delete plus az ad sp delete, about $20 a month) once the AWS side exists. rg-patchy-prod is an earlier, separate Patchy codebase, not this project; leave it alone. PatchPage stays on Azure.

Output: the resolution records what exists, where the keys are, the monthly cost of leaving it in place, and anything the AWS console refused.

Activity

  1. added
    wayfinder:task
    on Sep 25, 2026
  2. allisonmahmood commented on Sep 25, 2026

    @allisonmahmood
    OwnerAuthor

    Resolution

    Provisioned on 2026-09-25 from Allison's AWS SSO login and her Neon org; everything below was verified by use, not by reading the console. One addition from Allison mid-task: the content store goes on Neon Object Storage, not an AWS S3 bucket, so the Neon side now carries a bucket too.

    AWS

    Account. 614817375332 "Patchy" is the management account of organisation o-d5e88luf8g; the root user is Srikar's ([email protected]) with MFA enabled on the root, and the account contact is Patchy. Allison reaches it through IAM Identity Center (instance in us-east-2) as AdministratorAccess, profile patchy; no human holds long-lived keys. Cost Explorer shows the credit record offsetting every usage line this month; the credit balance itself is only readable on Srikar's billing console.

    Disposable identity for subagents. IAM user patchy-tier2-spike-agent with one access key, inline policy tier2-spike-us-east-1: ECS, ECR, logs, ELB, application autoscaling, CloudWatch reads and quota reads, all conditioned on aws:RequestedRegion = us-east-1; security-group rule edits only on resources tagged patchy:spike=tier2; iam:PassRole only for patchy-tier2-spike-* roles to ecs-tasks. Verified: works in us-east-1, denied in us-east-2, denied iam:CreateUser.

    Network (all tagged patchy:spike=tier2), VPC 10.42.0.0/16:

    • Two public subnets (us-east-1a, us-east-1b) behind an internet gateway, for the ALB and the hosting-server task. The host task runs there with a public IP for the spike so it reaches Neon without a NAT gateway.
    • One private subnet (us-east-1a) with no default route, for execution tasks. Bootstrap reaches the registry and logs through interface endpoints ecr.api, ecr.dkr and logs plus a free S3 gateway endpoint (image layers). No secrets endpoint: the execution task holds no credentials, so it needs none.
    • The security-group pair the spike compares: tier2-spike-exec-bootstrap allows outbound 443 to the endpoint group and the S3 prefix list only; tier2-spike-exec-sealed has no outbound rule at all. A Fargate task has one ENI, so these are two configurations to run, not two sides of one task; the sealed one is expected to fail the image pull, which is the measurement that puts the patch-facing seal inside the container (workerd's globalOutbound: null) with the ENI keeping the bootstrap rule. Both accept 8080 from tier2-spike-host; the host accepts 8080 from tier2-spike-alb.

    Compute and images. ECS cluster patchy-tier2-spike (Fargate and Fargate Spot capacity providers, Container Insights off); ECR repository patchy-tier2-spike; log group /patchy/tier2-spike with 14-day retention. Roles: patchy-tier2-spike-task-execution (the managed ECS task-execution policy: pull and log) and patchy-tier2-spike-host-task (empty). The execution task should launch with no task role at all so the metadata endpoint yields nothing; that is the spike's "reach the metadata endpoint" check.

    Ingress. ALB patchy-tier2-spike, internet-facing across both public subnets, idle timeout 3600 s, target group tier2-spike-host (IP targets, port 8080, health check /healthz, 30 s deregistration delay for the drain test). Listeners on 80 and 443. There is no domain in Route53, and ALB speaks HTTP/2 only over TLS, so a self-signed certificate for the ALB's DNS name is imported into ACM on the 443 listener: the HTTP/2 and SSE checks run with curl -k --http2 or a trusted cert in the test browser.

    Quotas. Fargate on-demand vCPU is 6 in this fresh account; an increase to 32 is pending. Enough for the first tasks, not for the pool plus a rollout.

    Neon

    Project patchy-tier2-spike (fancy-mode-72369071) in aws-us-east-1 on the org's grant, Postgres 17, one branch main, one read-write compute fixed at 1 CU with suspend left on (default five-minute timeout) so the spike measures cold start. Role patchy_admin owns database patchy and holds neon_superuser; verified CREATE DATABASE and DROP DATABASE for the ADR-0009 provisioning path. A project-scoped API key tier2-spike lets the spike suspend and restart the compute for the forced-restart measurement and nothing outside the project.

    Object storage. Bucket patchy-content (private) on main, reached through the branch's S3 endpoint with path-style addressing and SigV4; verified put, get and delete with the AWS CLI. Storage credential tier2-spike scoped to storage:read and storage:write. Buckets branch with the database, so the content store shares the project's branch model; whether companies get a bucket each or a prefix in one is build work with the content-store layer.

    Keys

    ~/.config/patchy-cloud/aws-spike.env (the agent user's key, every resource id, the quota request id) and ~/.config/patchy-cloud/neon-spike.env (project, branch and endpoint ids, DATABASE_URL, the API key, the bucket name and its AWS_* S3 variables), both mode 600. Subagents source one or both; never the tree.

    Retired

    Azure spike group rg-patchy-tier2-spike deleted and service principal sp-patchy-tier2-spike removed with its app registration; ~/.config/patchy-cloud/tier2-spike.env removed. rg-patchy-prod and PatchPage untouched.

    Cost of leaving it in place

    Item Monthly
    Three interface endpoints, one AZ about $22
    ALB, idle about $16
    ECR, logs, S3 gateway endpoint under $1
    Neon compute (suspends), storage, bucket about $0 on the grant
    Idle total about $39, credit-covered

    A running Fargate task at 0.5 vCPU and 1 GB adds about $18 a month if left up around the clock; the spike should stop its services when not measuring.

    What AWS refused or made awkward

    • The first CreateCluster failed with "unable to assume the service linked role" although the role existed moments later; a fresh account creates it on that first call, so retry once.
    • No Route53 zone, so no real certificate; the self-signed import is the workaround until Patchy has a domain in this account.
    • The Fargate vCPU quota of 6 in a fresh account; the increase is a support-queue item, not instant.
    • az group delete runs asynchronously; the group read Deleting when this was written.

    Recorded by Claude Fable 5.1 via Claude Code, 2026-09-25.

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

Metadata

Metadata

Labels

wayfinder:task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions