Skip to content

@lastshotlabs/slingshot-infra

npm install @lastshotlabs/slingshot-infra

Inspect a runtime app config and return WebSocket scaling diagnostics.

This is a pure function with no side effects. It is designed to be merged into the output of slingshot infra check.

Detection rules:

  • WS endpoints configured but no transport → info (instance-local delivery).
  • Presence enabled without a transport → info (instance-local presence).
  • Transport configured but db.cache === 'memory'warning.
  • Transport configured but db.sessions === 'memory'warning.
function auditWebsocketScaling(config: AppConfigShape): WsScalingAuditResult

Source: packages/slingshot-infra/src/config/websocketScalingAudit.ts

Compare what infra declares in uses against what the platform provides in resources, and what the app config would auto-derive.

Returns structured diagnostics suitable for the slingshot infra check CLI.

function compareInfraResources(opts: { /** The `uses` array from slingshot.infra.ts (or empty) */ infraUses: string[]; /** The keys of `resources` from slingshot.platform.ts */ platformResources: string[]; /** Auto-derived uses from the app config (via deriveUsesFromAppConfig) */ derivedUses: string[]; }): InfraCheckDiagnostics

Source: packages/slingshot-infra/src/config/deriveUsesFromApp.ts

Compute a deploy plan without executing it.

Compares the current registry state against the desired set of service/stack deployments and produces a DeployPlan with per-service 'add', 'update', or 'unchanged' entries and aggregate summary counts.

Remarks: Algorithm: 1. Calls resolveServiceStacks() to expand infra.services (or produce a single 'default' entry) into { name, stacks } pairs. 2. For each (service, stack) pair, looks up the service in registry.services[name] and then service.stages[stageName]: - Missing service or stage entry → 'add' with change descriptions. - Stage entry with matching imageTag'unchanged'. - Stage entry with a different imageTag'update' with a 'image tag: old → new' change description. If the stack name also changed a second change description is appended. 3. Aggregates counts into summary.additions, summary.updates, and summary.unchanged.

Remarks: The function is pure — it never writes to the registry or touches the filesystem. Pass the result to formatDeployPlan() for CLI display.

function computeDeployPlan(opts: ComputeDeployPlanOptions): DeployPlan

Source: packages/slingshot-infra/src/deploy/plan.ts

Create a DnsClient backed by the Cloudflare v4 API.

Zone ID resolution is lazy — if config.zoneId is not provided it is resolved on the first API call by looking up the base domain in /zones?name=<baseDomain> and cached for the lifetime of the client.

All API calls use Bearer token auth. An error is thrown if the Cloudflare API returns success: false.

function createCloudflareClient(config: { apiToken: string; zoneId?: string }): DnsClient

Source: packages/slingshot-infra/src/dns/cloudflare.ts

Dispatch to the correct DNS manager implementation based on DnsProviderConfig.provider.

function createDnsManager(config: DnsProviderConfig): DnsManager

Source: packages/slingshot-infra/src/dns/manager.ts

Create a resource provisioner for Amazon DocumentDB (Mongo-compatible).

When config.provision is true, generates an SST config with aws.docdb.Cluster and aws.docdb.ClusterInstance Pulumi resources and runs bunx sst deploy. Outputs (host, port, username, password, database) are parsed from SST stdout. When provision is false, the config.connection map is returned as-is.

function createDocumentDbProvisioner(): ResourceProvisioner

Source: packages/slingshot-infra/src/resource/provisioners/documentdb.ts

Create an EC2/nginx (or Caddy) preset provider.

Generates Dockerfiles, a docker-compose file, a reverse-proxy config (Caddyfile or nginx.conf), and a GitHub Actions workflow. Deploy copies files to the remote EC2 host via scp, then runs docker compose pull && up over SSH. Local commands use spawnSync with array args. SSH commands pass a single command string to the remote shell; all user-controlled values (service names, email, domain) are shell-quoted via shellQuote to prevent injection.

Remarks: Deploy strategy limitation: The EC2 preset only supports the rolling deployment strategy. Blue/green and canary deployments require the ECS preset because they depend on AWS CodeDeploy and weighted target group routing which are not available in a standalone EC2 + docker-compose setup.

Remarks: The deploy host is resolved from (in order): stage registry outputs publicIp, stack _meta stage outputs publicIp, or the env var DEPLOY_HOST_<STAGE>.

function createEc2NginxPreset(config?: Ec2NginxPresetConfig): PresetProvider

Source: packages/slingshot-infra/src/preset/ec2-nginx/ec2NginxPreset.ts

Create an ECS Fargate preset provider.

Generates Dockerfiles, an SST config (for ECS cluster, ALB, task definitions, and auto-scaling), and a GitHub Actions workflow that builds, pushes, and deploys the service. Runs bunx sst deploy for both the deploy and provisionStack operations.

function createEcsPreset(config?: EcsPresetConfig): PresetProvider

Source: packages/slingshot-infra/src/preset/ecs/ecsPreset.ts

Create an empty RegistryDocument for first-run initialization.

function createEmptyRegistryDocument(platform: string): RegistryDocument

Source: packages/slingshot-infra/src/types/registry.ts

Create a resource provisioner for Apache Kafka (AWS MSK via Pulumi/SST).

When config.provision is true, generates an SST config with an aws.msk.Cluster Pulumi resource and runs bunx sst deploy. The bootstrap brokers string is parsed from SST stdout. When provision is false, the config.connection.brokers value is returned as-is.

function createKafkaProvisioner(): ResourceProvisioner

Source: packages/slingshot-infra/src/resource/provisioners/kafka.ts

Create a registry provider that persists the RegistryDocument as a JSON file on the local filesystem.

Optimistic concurrency is provided via MD5 ETags: write() checks the current file hash against the supplied etag before overwriting. Parent directories are created automatically on first write.

Intended for local development and single-machine CI pipelines. For team environments use createS3Registry() or createPostgresRegistry().

function createLocalRegistry(config: LocalRegistryConfig): RegistryProvider

Source: packages/slingshot-infra/src/registry/localRegistry.ts

Create a resource provisioner for MongoDB Atlas.

When config.provision is true, creates an Atlas cluster via the Atlas Admin API (Digest auth), polls until the cluster reaches IDLE, creates a database user, and builds the mongodb+srv:// connection string. Polling uses a 10-second interval with a 30-minute timeout.

When provision is false, the config.connection map is returned as-is.

function createMongoProvisioner(): ResourceProvisioner

Source: packages/slingshot-infra/src/resource/provisioners/mongo.ts

Create a resource provisioner for PostgreSQL (Aurora Serverless v2).

When config.provision is true, generates an SST config with an sst.aws.Postgres component and runs bunx sst deploy in a temporary directory. The outputs (host, port, user, password, database) are parsed from SST stdout and stored in the registry. When provision is false, the config.connection map is returned as-is.

function createPostgresProvisioner(): ResourceProvisioner

Source: packages/slingshot-infra/src/resource/provisioners/postgres.ts

Create an in-memory registry of preset providers keyed by name.

Throws immediately when an unknown preset name is requested so errors surface at deploy time rather than silently producing empty output.

function createPresetRegistry(presets: PresetProvider[]): void

Source: packages/slingshot-infra/src/preset/presetRegistry.ts

Create an in-memory registry of resource provisioners keyed by resource type.

Throws immediately when an unknown resource type is requested so errors surface at provision time rather than silently skipping resources.

function createProvisionerRegistry(provisioners: ResourceProvisioner[]): void

Source: packages/slingshot-infra/src/resource/provisionerRegistry.ts

Create a resource provisioner for Redis (ElastiCache Serverless via SST).

When config.provision is true, generates an SST config with an sst.aws.Redis component and runs bunx sst deploy. Outputs (host, port) are parsed from SST stdout and stored in the registry. When provision is false, the config.connection map is returned as-is.

function createRedisProvisioner(): ResourceProvisioner

Source: packages/slingshot-infra/src/resource/provisioners/redis.ts

Dispatch to the correct registry provider factory based on RegistryConfig.provider.

This is the primary factory used by the CLI and deploy pipeline to instantiate whichever registry provider is declared in slingshot.platform.ts.

function createRegistryFromConfig(config: RegistryConfig): RegistryProvider

Source: packages/slingshot-infra/src/registry/createRegistryFromConfig.ts

Create a registry provider that persists the RegistryDocument as a single JSON object in an S3 bucket.

Optimistic concurrency is provided via ETags: write() passes IfMatch to S3 when an etag is supplied. Uses lazy-loaded @aws-sdk/client-s3; the package must be installed as an optional peer dependency.

initialize() creates the bucket (if absent) and enables versioning, then writes an empty registry document if none exists.

function createS3Registry(config: S3RegistryConfig): RegistryProvider

Source: packages/slingshot-infra/src/registry/s3Registry.ts

Create a SecretsManager backed by SSM Parameter Store, env vars, or the local filesystem.

The 'ssm' provider uses AWS SSM SecureString parameters stored at <pathPrefix><stageName>/<key>. The 'env' provider reads from process.env (check-only; push/pull are no-ops). The 'file' provider reads and writes to <directory>/<key> files.

function createSecretsManager(config: PlatformSecretsConfig, stageName: string,): SecretsManager

Source: packages/slingshot-infra/src/secrets/secretsManager.ts

Recursively deep-merge source into target, returning a new object.

Arrays in source replace (not concat) the corresponding array in target. Plain objects are merged recursively. All other values (including null) in source override the corresponding value in target.

function deepMerge(target: Record<string, unknown>, source: Record<string, unknown>,): Record<string, unknown>

Source: packages/slingshot-infra/src/override/resolveOverrides.ts

Define and validate the infrastructure configuration for a single Slingshot app.

Validates config against the Zod schema and returns a frozen, immutable copy. Typically placed in a slingshot.infra.ts file at the app root.

function defineInfra(config: DefineInfraConfig): Readonly<DefineInfraConfig>

Source: packages/slingshot-infra/src/config/infraSchema.ts

Define and validate the platform configuration for a Slingshot organisation.

Validates config against the full Zod schema (registry provider requirements, stage declarations, DNS provider checks) and returns a frozen, immutable copy.

Typically placed in a slingshot.platform.ts file at the repository root, shared by all apps in the monorepo.

function definePlatform(config: DefinePlatformConfig): Readonly<DefinePlatformConfig>

Source: packages/slingshot-infra/src/config/platformSchema.ts

Remove a registered app from the registry.

Uses an optimistic lock to prevent concurrent writes from clobbering each other. If the app is not found, the function returns silently without error.

async function deregisterApp(registry: RegistryProvider, appName: string): Promise<void>

Source: packages/slingshot-infra/src/registry/appRegistry.ts

Inspect a runtime app config object and return the list of shared infrastructure resource names it requires (e.g. ['postgres', 'redis']).

Detection rules:

  • db.redis is truthy (not false) -> 'redis'
  • db.mongo is truthy (not false) -> 'mongo'
  • Any db.* store field equals 'postgres' -> 'postgres'
  • jobs is configured (BullMQ needs Redis) -> 'redis'
  • ssr.isr.adapter is 'redis' or object -> 'redis'

The function never throws — unknown shapes are silently ignored.

function deriveUsesFromAppConfig(appConfig: Record<string, unknown>): string[]

Source: packages/slingshot-infra/src/config/deriveUsesFromApp.ts

Destroy provisioned resources for a given stage.

Guards against destroying a stage that still has deployed services — throws if any service entry has status: 'deployed' for the target stage. For each resource (or the one specified by params.resource), calls the matching provisioner’s destroy() method, removes the stage entry from the registry, and writes the updated document back using an optimistic lock.

async function destroyResources(params: DestroyResourcesParams,): Promise<DestroyResourceResult[]>

Source: packages/slingshot-infra/src/resource/destroyResources.ts

Destroy SST-managed AWS resources for a given resource and stage.

Creates a temporary directory, writes the sst.config.ts, copies relevant package files, and runs bunx sst destroy --stage <stageName>. The temp directory is always removed in the finally block.

function destroyViaSst(opts: SSTDestroyOptions): Promise<void>

Source: packages/slingshot-infra/src/resource/provisionViaSst.ts

Format a DeployPlan as a human-readable text table for CLI output.

Each service entry is prefixed with + (add), ~ (update), or = (unchanged). Changes are listed on indented sub-lines. The summary line appears at the bottom.

function formatDeployPlan(plan: DeployPlan): string

Source: packages/slingshot-infra/src/deploy/formatPlan.ts

Generate a complete slingshot.infra.ts scaffold with sensible defaults.

Produces a ready-to-edit TypeScript source string that can be written to disk by the slingshot infra init CLI command.

function generateInfraTemplate(opts?: { stacks?: string[]; port?: number }): string

Source: packages/slingshot-infra/src/scaffold/infraTemplate.ts

Generate a complete slingshot.platform.ts scaffold with sensible defaults.

Produces a ready-to-edit TypeScript source string that can be written to disk by the slingshot platform init CLI command.

function generatePlatformTemplate(opts?: { org?: string; region?: string; preset?: string; stages?: string[]; resources?: string[]; }): string

Source: packages/slingshot-infra/src/scaffold/platformTemplate.ts

Generate an sst.config.ts file with SST/Pulumi resource definitions.

Uses SST built-in components where available (sst.aws.Postgres, sst.aws.Redis) and falls back to raw Pulumi AWS providers for resources SST doesn’t wrap (MSK Kafka, DocumentDB). All resource blocks are wrapped in # --- section:resource-<name> --- markers for user override support.

function generateResourceSstConfig(resources: ResourceProvisionEntry[], opts: GenerateResourceSstOptions,): string

Source: packages/slingshot-infra/src/resource/generateResourceSst.ts

Return all registered apps that consume the given shared resource.

async function getAppsByResource(registry: RegistryProvider, resourceName: string,): Promise<RegistryAppEntry[]>

Source: packages/slingshot-infra/src/registry/appRegistry.ts

Return all registered apps that deploy to the given stack.

async function getAppsByStack(registry: RegistryProvider, stackName: string,): Promise<RegistryAppEntry[]>

Source: packages/slingshot-infra/src/registry/appRegistry.ts

Get the flat env map for a specific service from a PresetContext.

Handles both single-service (resolvedEnv is a flat map) and multi-service (resolvedEnv is keyed by service name) cases without requiring type casts in preset code.

function getServiceEnv(ctx: PresetContext, serviceName: string): Record<string, string>

Source: packages/slingshot-infra/src/types/preset.ts

List all registered apps in the registry.

async function listApps(registry: RegistryProvider): Promise<RegistryAppEntry[]>

Source: packages/slingshot-infra/src/registry/appRegistry.ts

Load and return the infra config from a slingshot.infra.{ts,js,mts,mjs} file in the specified directory.

Unlike loadPlatformConfig(), the search does not traverse upward — the config file must exist in dir.

TypeScript config files require the Bun runtime.

async function loadInfraConfig(dir?: string): Promise<

Source: packages/slingshot-infra/src/loader/loadInfraConfig.ts

Load and return the platform config by searching the filesystem for a slingshot.platform.{ts,js,mts,mjs} file.

Search strategy:

  1. If the SLINGSHOT_PLATFORM environment variable is set, it is used as the absolute path to the config file.
  2. Otherwise, traverses upward from startDir (default: process.cwd()) until a config file is found or the filesystem root is reached.

TypeScript config files (.ts, .mts) require the Bun runtime — an error is thrown when loading them under Node.js.

async function loadPlatformConfig(startDir?: string): Promise<

Source: packages/slingshot-infra/src/loader/loadPlatformConfig.ts

Parse a SLINGSHOT_REGISTRY URL string into a RegistryConfig.

Supported URL schemes:

  • s3://<bucket>{ provider: 's3', bucket }
  • redis://<host>:<port> or rediss://...{ provider: 'redis', url }
  • postgres://... or postgresql://...{ provider: 'postgres', connectionString }
  • Any other string (filesystem path) → { provider: 'local', path }
function parseRegistryUrl(url: string): RegistryConfig

Source: packages/slingshot-infra/src/registry/parseRegistryUrl.ts

Provision AWS resources by generating an SST config and running sst deploy.

Creates a temporary directory, writes the sst.config.ts, copies relevant package files for Bun dependency resolution, runs bunx sst deploy, then parses key = value output lines and JSON output blocks from stdout. The temp directory is always removed in the finally block.

function provisionViaSst(opts: SSTProvisionOptions): Promise<SSTProvisionResult>

Source: packages/slingshot-infra/src/resource/provisionViaSst.ts

Register (or update) an app entry in the registry for cross-repo coordination.

Uses an optimistic lock to prevent concurrent writes from clobbering each other. After a successful write the app appears in listApps() and can be discovered by getAppsByStack() and getAppsByResource().

async function registerApp(registry: RegistryProvider, app: { name: string; repo: string; stacks: string[]; uses: string[] },): Promise<void>

Source: packages/slingshot-infra/src/registry/appRegistry.ts

Resolve the environment variable map for a service at deploy time.

Merges env sources in priority order (later sources override earlier ones):

  1. Platform stage env (platform.stages[stageName].env).
  2. Resource outputs auto-wired for resources listed in service.uses or infra.uses.
  3. App-level env from infra.env.
  4. Service-level env from service.env (highest priority).
function resolveEnvironment(platform: DefinePlatformConfig, infra: DefineInfraConfig, stageName: string, registry: RegistryDocument, service?: ServiceDeclaration,): Record<string, string>

Source: packages/slingshot-infra/src/deploy/resolveEnv.ts

Apply a user override to a generated deployment file.

Override dispatch rules:

  • undefined → return generated unchanged.
  • string → replace file content entirely with the file at that path.
  • object + .json file → deep-merge into the parsed JSON.
  • object + .yml/.yaml file → deep-merge into the parsed YAML.
  • object + any other format → replace named sections using # --- section:name --- / # --- end:name --- markers.
async function resolveOverride(generated: GeneratedFile, override: OverrideSpec | undefined, appRoot: string,): Promise<GeneratedFile>

Source: packages/slingshot-infra/src/override/resolveOverrides.ts

Resolve multi-platform targeting by merging a named platform entry into the top-level platform config.

When targetPlatform is supplied, the matching entry under rawConfig.platforms[targetPlatform] is merged over the top-level fields (provider, region, registry, secrets, resources, stacks, stages, defaults). This allows a single slingshot.platform.ts to describe multiple deployment targets (e.g. different AWS accounts or regions for different clients).

function resolvePlatformConfig(rawConfig: DefinePlatformConfig, targetPlatform?: string,): DefinePlatformConfig

Source: packages/slingshot-infra/src/config/resolvePlatformConfig.ts

Resolve the required secret/env var keys for an app based on its resource usage.

Collects all unique resources from infra.uses and each service’s uses array, looks them up in RESOURCE_ENV_KEYS, and appends the always-required baseline keys (JWT_SECRET, DATA_ENCRYPTION_KEY).

function resolveRequiredKeys(infra: { uses?: string[]; services?: Record<string, { uses?: string[] }>; }): string[]

Source: packages/slingshot-infra/src/secrets/resolveRequiredKeys.ts

Run the full deploy pipeline for an app.

Groups services by stack, generates deployment files via the stack’s preset, applies user overrides, copies files to a temp directory, and calls preset.deploy(). After a successful deploy, updates DNS records if platform.dns is configured and writes the updated registry document.

When opts.plan is true, returns a DeployPlan without executing. When opts.dryRun is true, prints generated files and returns without writing to the registry.

async function runDeployPipeline(opts: DeployPipelineOptions,): Promise<DeployPipelineResult>

Source: packages/slingshot-infra/src/deploy/pipeline.ts

Roll back one or all deployed services on a stage to a previous image tag.

For each service, resolves the target image tag (from opts.targetTag or the most recent entry in previousTags), regenerates deployment files via the stack’s preset, applies user overrides, and calls preset.deploy(). Updates the registry with the new deploy state.

async function runRollback(opts: RollbackOptions): Promise<RollbackResult>

Source: packages/slingshot-infra/src/deploy/rollback.ts

Env var keys produced by each resource type.

Used by resolveRequiredKeys() to determine which secrets must be present before deployment. Must match frameworkSecretSchema in slingshot-core.

Source: packages/slingshot-infra/src/types/resource.ts

Maps InfraSize names to ECS Fargate-compatible CPU unit and memory (MB) values.

Source: packages/slingshot-infra/src/types/infra.ts

The frozen, validated output of defineInfra().

Describes a single app’s deployment configuration: which stacks it targets, what resources it consumes, how its services are declared, and how generated files should be customized.

Remarks: Always obtained from defineInfra() — never constructed directly. The object is deepFreeze()d at creation time.

Source: packages/slingshot-infra/src/types/infra.ts

The frozen, validated output of definePlatform().

Describes the entire deployment platform: cloud provider, registry backend, shared resources, named stacks, deployment stages, and org-wide defaults. Passed to deploy pipeline functions as the top-level config object.

Remarks: Always obtained from definePlatform() — never constructed directly. The object is deepFreeze()d at creation time.

Source: packages/slingshot-infra/src/types/platform.ts

Options for runDeployPipeline().

Source: packages/slingshot-infra/src/deploy/pipeline.ts

Result returned by runDeployPipeline().

Source: packages/slingshot-infra/src/deploy/pipeline.ts

A computed deploy plan describing what runDeployPipeline() would change.

Source: packages/slingshot-infra/src/deploy/plan.ts

Plan entry for a single service/stack combination.

Source: packages/slingshot-infra/src/deploy/plan.ts

Result returned by PresetProvider.deploy().

Source: packages/slingshot-infra/src/types/preset.ts

Result for a single resource destruction operation.

Source: packages/slingshot-infra/src/resource/destroyResources.ts

Parameters for destroyResources().

Source: packages/slingshot-infra/src/resource/destroyResources.ts

Minimal DNS client interface used by createDnsManager().

All implementations must support upsert, delete, list, and zone resolution. The Cloudflare implementation is the only concrete provider — Route53 is a stub that throws on every method.

Source: packages/slingshot-infra/src/dns/cloudflare.ts

High-level DNS management interface used by the deploy pipeline.

Implementations are created by createDnsManager() based on the DnsProviderConfig.provider field: 'cloudflare' is fully implemented, 'manual' logs instructions without making API calls, and 'route53' throws on every method until implemented.

Source: packages/slingshot-infra/src/dns/manager.ts

DNS provider configuration for automatic domain record management.

Attached to DefinePlatformConfig.dns. The deploy pipeline calls createDnsManager(config) after a successful deploy.

Source: packages/slingshot-infra/src/types/platform.ts

A single DNS record returned by the Cloudflare API.

Source: packages/slingshot-infra/src/dns/cloudflare.ts

Stage-specific domain mapping for a service.

When a service should resolve to a different domain per stage, use this instead of the domain shorthand in ServiceDeclaration.

Source: packages/slingshot-infra/src/types/infra.ts

Configuration options for the EC2/nginx (or Caddy) preset.

Source: packages/slingshot-infra/src/preset/ec2-nginx/ec2NginxPreset.ts

Configuration options for the ECS preset.

Source: packages/slingshot-infra/src/preset/ecs/ecsPreset.ts

A file generated by a PresetProvider for deployment.

Generated files are written to a temp directory during the deploy pipeline. Ephemeral files are never committed to the repository.

Source: packages/slingshot-infra/src/types/preset.ts

Options for generateResourceSstConfig().

Source: packages/slingshot-infra/src/resource/generateResourceSst.ts

Nginx gzip compression settings.

Source: packages/slingshot-infra/src/types/infra.ts

HTTP health check configuration for the load balancer or container runtime.

Source: packages/slingshot-infra/src/types/infra.ts

Structured diagnostics produced by compareInfraResources().

Suitable for direct rendering in the slingshot infra check CLI output.

Source: packages/slingshot-infra/src/config/deriveUsesFromApp.ts

Per-service logging configuration (overrides platform defaults).

Source: packages/slingshot-infra/src/types/infra.ts

Configuration for the local filesystem registry provider.

Source: packages/slingshot-infra/src/registry/localRegistry.ts

Default logging driver and log retention settings.

Source: packages/slingshot-infra/src/types/platform.ts

VPC and network configuration for a stack.

Source: packages/slingshot-infra/src/types/platform.ts

Per-service network configuration override for EC2 deployments.

Source: packages/slingshot-infra/src/types/infra.ts

Nginx reverse-proxy configuration for the EC2/nginx preset.

All fields are optional and generate sensible defaults in the produced nginx.conf.

Source: packages/slingshot-infra/src/types/infra.ts

Nginx rate limiting configuration.

Applied to the specified paths (or all paths) using the limit_req module.

Source: packages/slingshot-infra/src/types/infra.ts

Nginx static file serving configuration.

Requests matching urlPath are served directly from fsPath on the container filesystem instead of being proxied to the app.

Source: packages/slingshot-infra/src/types/infra.ts

Nginx proxy timeout configuration.

Source: packages/slingshot-infra/src/types/infra.ts

Map of per-file override specs for DefineInfraConfig.overrides.

Each key corresponds to a specific generated file. Set a key to an OverrideSpec to customize or replace that file’s content at deploy time.

Source: packages/slingshot-infra/src/types/override.ts

Org-wide defaults applied to all stacks and services unless overridden.

Source: packages/slingshot-infra/src/types/platform.ts

A named platform sub-config used for multi-tenant or multi-client isolation.

Consumer apps can target a specific platform entry via defineInfra({ platform: 'name' }), causing the deploy pipeline to use that entry’s stages/stacks/resources instead of the top-level config.

Source: packages/slingshot-infra/src/types/platform.ts

Secrets provider configuration for SSM Parameter Store, env vars, or file-based secrets.

Source: packages/slingshot-infra/src/types/platform.ts

Context object passed to every PresetProvider method.

Assembles all data a preset needs to generate deployment files and execute the deploy: frozen platform/infra configs, resolved env vars, registry state, sibling services, and runtime metadata (image tag, temp dir, etc.).

Source: packages/slingshot-infra/src/types/preset.ts

A deployment preset that generates files and executes deploys for a specific infrastructure pattern (ECS Fargate, EC2/nginx, etc.).

Remarks: All presets follow the swappable-provider pattern: register via createPresetRegistry() and retrieve by name. New presets implement this interface and add a case to the registry — no changes to existing code.

Source: packages/slingshot-infra/src/types/preset.ts

Result returned by PresetProvider.provisionStack().

Source: packages/slingshot-infra/src/types/preset.ts

Registry entry for a deployed app (for cross-repo coordination).

Written by registerApp() and read by getAppsByStack() / getAppsByResource(). Enables platform operators to discover which repos deploy to which stacks and consume which shared resources.

Source: packages/slingshot-infra/src/types/registry.ts

Registry backend configuration.

Discriminated by provider. Used by createRegistryFromConfig() to instantiate the correct RegistryProvider.

Source: packages/slingshot-infra/src/types/platform.ts

The top-level document stored by all RegistryProvider implementations.

Contains versioned state for stacks, resources, services, and apps. Created with createEmptyRegistryDocument() and mutated exclusively through the registry helper functions (registerApp, runDeployPipeline, etc.).

Source: packages/slingshot-infra/src/types/registry.ts

A logical registry lock returned by RegistryProvider.lock().

Provides the ETag to pass to RegistryProvider.write() for optimistic concurrency. Call release() in a finally block.

Source: packages/slingshot-infra/src/types/registry.ts

Registry storage backend interface.

All implementations must provide optimistic-concurrency writes via ETags, an initialize() method for first-run setup, and a lock() method that returns an ETag-bearing lock object for atomic read-modify-write sequences.

Remarks: Use createRegistryFromConfig() to obtain a RegistryProvider rather than implementing this interface directly.

Source: packages/slingshot-infra/src/types/registry.ts

Per-resource provisioning state entry in the registry.

Source: packages/slingshot-infra/src/types/registry.ts

Per-service deploy state entry in the registry.

Written by updateRegistryService() after every deploy. Stores the current image tag, a previousTags history for rollbacks, and service metadata (port, domain, env) for sibling service compose generation.

Source: packages/slingshot-infra/src/types/registry.ts

Per-stack infrastructure state entry in the registry.

Source: packages/slingshot-infra/src/types/registry.ts

Output from ResourceProvisioner.provision().

outputs contains raw key-value pairs written to the registry. connectionEnv contains the env vars injected into services that consume this resource (e.g. DATABASE_URL, REDIS_HOST).

Source: packages/slingshot-infra/src/types/resource.ts

A single resource to include in the generated SST config.

Source: packages/slingshot-infra/src/resource/generateResourceSst.ts

A pluggable resource provisioner for a specific resource type.

Follows the swappable-provider pattern: register via createProvisionerRegistry() and retrieve by resourceType. Adding support for a new resource type means implementing this interface and adding a case — no changes to existing code.

Source: packages/slingshot-infra/src/types/resource.ts

Context object passed to ResourceProvisioner.provision() and destroy().

Provides all the data a provisioner needs to create or tear down AWS resources for a specific resource/stage combination.

Source: packages/slingshot-infra/src/types/resource.ts

Per-stage overrides for a shared resource.

Source: packages/slingshot-infra/src/types/platform.ts

Options for runRollback().

Source: packages/slingshot-infra/src/deploy/rollback.ts

Result returned by runRollback().

Source: packages/slingshot-infra/src/deploy/rollback.ts

Configuration for the S3-backed registry provider.

Source: packages/slingshot-infra/src/registry/s3Registry.ts

Container/instance scaling configuration.

Source: packages/slingshot-infra/src/types/platform.ts

Result of a secrets presence check.

Source: packages/slingshot-infra/src/secrets/secretsManager.ts

Interface for pushing, pulling, and checking secrets across different provider backends (SSM, env vars, or files).

Source: packages/slingshot-infra/src/secrets/secretsManager.ts

Declaration for a single service within a multi-service app.

Each key in DefineInfraConfig.services is a logical service name that maps to one microservice/container with its own Dockerfile, domain, port, and resource usage.

Source: packages/slingshot-infra/src/types/infra.ts

Shared infrastructure resource definition.

When provision: true, slingshot provisions the resource via SST/Pulumi. When provision: false, the connection map is used as-is.

Source: packages/slingshot-infra/src/types/platform.ts

Options for destroyViaSst(). A subset of SSTProvisionOptions.

Source: packages/slingshot-infra/src/resource/provisionViaSst.ts

Options for provisionViaSst().

Source: packages/slingshot-infra/src/resource/provisionViaSst.ts

Result returned by provisionViaSst().

Source: packages/slingshot-infra/src/resource/provisionViaSst.ts

Named stack configuration — a group of services sharing infrastructure.

Each stack entry maps to a preset (e.g. 'ecs' or 'ec2-nginx') that handles file generation and deployment.

Source: packages/slingshot-infra/src/types/platform.ts

Per-stage overrides for a specific stack (scaling, network).

Source: packages/slingshot-infra/src/types/platform.ts

Deployment stage configuration (e.g. 'development', 'staging', 'production').

Source: packages/slingshot-infra/src/types/platform.ts

A single WebSocket scaling diagnostic entry.

Each diagnostic is frozen on creation (see rule 12 — freeze at the boundary).

Source: packages/slingshot-infra/src/config/websocketScalingAudit.ts

The result of a WebSocket scaling audit, as returned by auditWebsocketScaling().

The entire result object is deep-frozen before being returned.

Source: packages/slingshot-infra/src/config/websocketScalingAudit.ts

Named size preset for container CPU and memory allocation.

Resolved by SIZE_PRESETS to ECS-compatible vCPU units and memory in MB.

Source: packages/slingshot-infra/src/types/infra.ts

Override spec for a single generated deployment file.

  • string: path to a file that replaces the generated one entirely. Absolute paths are used as-is; relative paths are resolved from app root.

  • object: deep-merged into the generated configuration. For structured formats (JSON, YAML), the object is parsed, merged, and re-serialized. For text formats (Dockerfile, NGINX/Caddy config), object keys map to named # --- section:name --- blocks in the generated template.

Source: packages/slingshot-infra/src/types/override.ts

Signature for the process runner used by provisionViaSst() and destroyViaSst(). Matches the spawnSync signature to allow test overrides without spawning real child processes.

Source: packages/slingshot-infra/src/resource/provisionViaSst.ts

Severity level of a WebSocket scaling diagnostic.

  • 'info': the configuration will work but will not scale beyond a single instance without changes.
  • 'warning': the configuration is likely incorrect at any scale (e.g. memory cache with a cross-instance transport).

Source: packages/slingshot-infra/src/config/websocketScalingAudit.ts