@lastshotlabs/slingshot-infra
npm install @lastshotlabs/slingshot-infra
Functions
Section titled “Functions”auditWebsocketScaling
Section titled “auditWebsocketScaling”WebSocket scaling diagnostics — pure helper that inspects a runtime app config and returns scaling-related warnings/infos.
Designed to be merged into the output of slingshot infra check. The function
is stateless and has no side effects.
function auditWebsocketScaling(config: AppConfigShape): WsScalingAuditResultSource: packages/slingshot-infra/src/config/websocketScalingAudit.ts
compareInfraResources
Section titled “compareInfraResources”Derives the uses resource list from a runtime app config object.
This is a best-effort heuristic that inspects the shape of a createApp() /
createServer() config to determine which shared infrastructure resources
the application needs. It is NOT a strict contract — users can always
override with an explicit uses array in slingshot.infra.ts.
Usage in slingshot.infra.ts:
import { defineInfra, deriveUsesFromAppConfig } from '@lastshotlabs/slingshot-infra';import appConfig from './src/appConfig';
export default defineInfra({stacks: ['main'],uses: deriveUsesFromAppConfig(appConfig),});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[]; }): InfraCheckDiagnosticsSource: packages/slingshot-infra/src/config/deriveUsesFromApp.ts
computeDeployPlan
Section titled “computeDeployPlan”A computed deploy plan describing what runDeployPipeline() would change.
function computeDeployPlan(opts: ComputeDeployPlanOptions): DeployPlanSource: packages/slingshot-infra/src/deploy/plan.ts
createCloudflareClient
Section titled “createCloudflareClient”A single DNS record returned by the Cloudflare API.
function createCloudflareClient(config: { apiToken: string; zoneId?: string }): DnsClientSource: packages/slingshot-infra/src/dns/cloudflare.ts
createDnsManager
Section titled “createDnsManager”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.
function createDnsManager(config: DnsProviderConfig): DnsManagerSource: packages/slingshot-infra/src/dns/manager.ts
createDocumentDbProvisioner
Section titled “createDocumentDbProvisioner”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(): ResourceProvisionerSource: packages/slingshot-infra/src/resource/provisioners/documentdb.ts
createEc2NginxPreset
Section titled “createEc2NginxPreset”Configuration options for the EC2/nginx (or Caddy) preset.
function createEc2NginxPreset(config?: Ec2NginxPresetConfig): PresetProviderSource: packages/slingshot-infra/src/preset/ec2-nginx/ec2NginxPreset.ts
createEcsPreset
Section titled “createEcsPreset”Configuration options for the ECS preset.
function createEcsPreset(config?: EcsPresetConfig): PresetProviderSource: packages/slingshot-infra/src/preset/ecs/ecsPreset.ts
createEmptyRegistryDocument
Section titled “createEmptyRegistryDocument”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.
function createEmptyRegistryDocument(platform: string): RegistryDocumentSource: packages/slingshot-infra/src/types/registry.ts
createKafkaProvisioner
Section titled “createKafkaProvisioner”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(): ResourceProvisionerSource: packages/slingshot-infra/src/resource/provisioners/kafka.ts
createLocalRegistry
Section titled “createLocalRegistry”Configuration for the local filesystem registry provider.
function createLocalRegistry(config: LocalRegistryConfig): RegistryProviderSource: packages/slingshot-infra/src/registry/localRegistry.ts
createMongoProvisioner
Section titled “createMongoProvisioner”Extended shared resource config for MongoDB Atlas provisioning.
Extends the base SharedResourceConfig with Atlas-specific project and
organization identifiers. Credentials (ATLAS_PUBLIC_KEY,
ATLAS_PRIVATE_KEY) must be present in environment variables at provision
time.
function createMongoProvisioner(): ResourceProvisionerSource: packages/slingshot-infra/src/resource/provisioners/mongo.ts
createPostgresProvisioner
Section titled “createPostgresProvisioner”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(): ResourceProvisionerSource: packages/slingshot-infra/src/resource/provisioners/postgres.ts
createPresetRegistry
Section titled “createPresetRegistry”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[]): voidSource: packages/slingshot-infra/src/preset/presetRegistry.ts
createProvisionerRegistry
Section titled “createProvisionerRegistry”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[]): voidSource: packages/slingshot-infra/src/resource/provisionerRegistry.ts
createRedisProvisioner
Section titled “createRedisProvisioner”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(): ResourceProvisionerSource: packages/slingshot-infra/src/resource/provisioners/redis.ts
createRegistryFromConfig
Section titled “createRegistryFromConfig”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): RegistryProviderSource: packages/slingshot-infra/src/registry/createRegistryFromConfig.ts
createS3Registry
Section titled “createS3Registry”Configuration for the S3-backed registry provider.
function createS3Registry(config: S3RegistryConfig): RegistryProviderSource: packages/slingshot-infra/src/registry/s3Registry.ts
createSecretsManager
Section titled “createSecretsManager”Result of a secrets presence check.
function createSecretsManager(config: PlatformSecretsConfig, stageName: string,): SecretsManagerSource: packages/slingshot-infra/src/secrets/secretsManager.ts
deepMerge
Section titled “deepMerge”Apply a user override to a generated deployment file.
Override dispatch rules:
undefined→ returngeneratedunchanged.string→ replace file content entirely with the file at that path.object+.jsonfile → deep-merge into the parsed JSON.object+.yml/.yamlfile → deep-merge into the parsed YAML.object+ any other format → replace named sections using# --- section:name ---/# --- end:name ---markers.
function deepMerge(target: Record<string, unknown>, source: Record<string, unknown>,): Record<string, unknown>Source: packages/slingshot-infra/src/override/resolveOverrides.ts
defineInfra
Section titled “defineInfra”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
definePlatform
Section titled “definePlatform”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
deregisterApp
Section titled “deregisterApp”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 deregisterApp(registry: RegistryProvider, appName: string): Promise<void>Source: packages/slingshot-infra/src/registry/appRegistry.ts
deriveUsesFromAppConfig
Section titled “deriveUsesFromAppConfig”Derives the uses resource list from a runtime app config object.
This is a best-effort heuristic that inspects the shape of a createApp() /
createServer() config to determine which shared infrastructure resources
the application needs. It is NOT a strict contract — users can always
override with an explicit uses array in slingshot.infra.ts.
Usage in slingshot.infra.ts:
import { defineInfra, deriveUsesFromAppConfig } from '@lastshotlabs/slingshot-infra';import appConfig from './src/appConfig';
export default defineInfra({stacks: ['main'],uses: deriveUsesFromAppConfig(appConfig),});function deriveUsesFromAppConfig(appConfig: Record<string, unknown>): string[]Source: packages/slingshot-infra/src/config/deriveUsesFromApp.ts
destroyResources
Section titled “destroyResources”Parameters for destroyResources().
async function destroyResources(params: DestroyResourcesParams,): Promise<DestroyResourceResult[]>Source: packages/slingshot-infra/src/resource/destroyResources.ts
destroyViaSst
Section titled “destroyViaSst”Signature for the process runner used by provisionViaSst() and
destroyViaSst(). Matches the spawnSync signature to allow test
overrides without spawning real child processes.
function destroyViaSst(opts: SSTDestroyOptions): Promise<void>Source: packages/slingshot-infra/src/resource/provisionViaSst.ts
formatDeployPlan
Section titled “formatDeployPlan”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): stringSource: packages/slingshot-infra/src/deploy/formatPlan.ts
generateInfraTemplate
Section titled “generateInfraTemplate”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 }): stringSource: packages/slingshot-infra/src/scaffold/infraTemplate.ts
generatePlatformTemplate
Section titled “generatePlatformTemplate”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[]; }): stringSource: packages/slingshot-infra/src/scaffold/platformTemplate.ts
generateResourceSstConfig
Section titled “generateResourceSstConfig”Generates SST config content for provisioning shared AWS resources.
Each resource type maps to Pulumi AWS providers (since SST v3 is built on Pulumi), giving fine-grained control over resource configuration.
function generateResourceSstConfig(resources: ResourceProvisionEntry[], opts: GenerateResourceSstOptions,): stringSource: packages/slingshot-infra/src/resource/generateResourceSst.ts
getAppsByResource
Section titled “getAppsByResource”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 getAppsByResource(registry: RegistryProvider, resourceName: string,): Promise<RegistryAppEntry[]>Source: packages/slingshot-infra/src/registry/appRegistry.ts
getAppsByStack
Section titled “getAppsByStack”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 getAppsByStack(registry: RegistryProvider, stackName: string,): Promise<RegistryAppEntry[]>Source: packages/slingshot-infra/src/registry/appRegistry.ts
getServiceEnv
Section titled “getServiceEnv”A sibling service entry — a deployed service from another repo on the same stack.
Used by the EC2/nginx preset to generate composite docker-compose and Caddyfile configs that include all services on the stack, not just the current app’s services.
function getServiceEnv(ctx: PresetContext, serviceName: string): Record<string, string>Source: packages/slingshot-infra/src/types/preset.ts
listApps
Section titled “listApps”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 listApps(registry: RegistryProvider): Promise<RegistryAppEntry[]>Source: packages/slingshot-infra/src/registry/appRegistry.ts
loadInfraConfig
Section titled “loadInfraConfig”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
loadPlatformConfig
Section titled “loadPlatformConfig”Load and return the platform config by searching the filesystem for a
slingshot.platform.{ts,js,mts,mjs} file.
Search strategy:
- If the
SLINGSHOT_PLATFORMenvironment variable is set, it is used as the absolute path to the config file. - 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
parseRegistryUrl
Section titled “parseRegistryUrl”Parse a SLINGSHOT_REGISTRY URL string into a RegistryConfig.
Supported URL schemes:
s3://<bucket>→{ provider: 's3', bucket }redis://<host>:<port>orrediss://...→{ provider: 'redis', url }postgres://...orpostgresql://...→{ provider: 'postgres', connectionString }- Any other string (filesystem path) →
{ provider: 'local', path }
function parseRegistryUrl(url: string): RegistryConfigSource: packages/slingshot-infra/src/registry/parseRegistryUrl.ts
provisionViaSst
Section titled “provisionViaSst”Signature for the process runner used by provisionViaSst() and
destroyViaSst(). Matches the spawnSync signature to allow test
overrides without spawning real child processes.
function provisionViaSst(opts: SSTProvisionOptions): Promise<SSTProvisionResult>Source: packages/slingshot-infra/src/resource/provisionViaSst.ts
registerApp
Section titled “registerApp”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
resolveEnvironment
Section titled “resolveEnvironment”Resolve the environment variable map for a service at deploy time.
Merges env sources in priority order (later sources override earlier ones):
- Platform stage env (
platform.stages[stageName].env). - Resource outputs auto-wired for resources listed in
service.usesorinfra.uses. - App-level env from
infra.env. - 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
resolveOverride
Section titled “resolveOverride”Apply a user override to a generated deployment file.
Override dispatch rules:
undefined→ returngeneratedunchanged.string→ replace file content entirely with the file at that path.object+.jsonfile → deep-merge into the parsed JSON.object+.yml/.yamlfile → 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
resolvePlatformConfig
Section titled “resolvePlatformConfig”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,): DefinePlatformConfigSource: packages/slingshot-infra/src/config/resolvePlatformConfig.ts
resolveRequiredKeys
Section titled “resolveRequiredKeys”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
runDeployPipeline
Section titled “runDeployPipeline”Options for runDeployPipeline().
async function runDeployPipeline(opts: DeployPipelineOptions,): Promise<DeployPipelineResult>Source: packages/slingshot-infra/src/deploy/pipeline.ts
runRollback
Section titled “runRollback”Options for runRollback().
async function runRollback(opts: RollbackOptions): Promise<RollbackResult>Source: packages/slingshot-infra/src/deploy/rollback.ts
Constants
Section titled “Constants”RESOURCE_ENV_KEYS
Section titled “RESOURCE_ENV_KEYS”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
SIZE_PRESETS
Section titled “SIZE_PRESETS”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
Interfaces
Section titled “Interfaces”DefineInfraConfig
Section titled “DefineInfraConfig”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
DefinePlatformConfig
Section titled “DefinePlatformConfig”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
DeployPipelineOptions
Section titled “DeployPipelineOptions”Options for runDeployPipeline().
Source: packages/slingshot-infra/src/deploy/pipeline.ts
DeployPipelineResult
Section titled “DeployPipelineResult”Options for runDeployPipeline().
Source: packages/slingshot-infra/src/deploy/pipeline.ts
DeployPlan
Section titled “DeployPlan”A computed deploy plan describing what runDeployPipeline() would change.
Source: packages/slingshot-infra/src/deploy/plan.ts
DeployPlanEntry
Section titled “DeployPlanEntry”A computed deploy plan describing what runDeployPipeline() would change.
Source: packages/slingshot-infra/src/deploy/plan.ts
DeployResult
Section titled “DeployResult”A sibling service entry — a deployed service from another repo on the same stack.
Used by the EC2/nginx preset to generate composite docker-compose and Caddyfile configs that include all services on the stack, not just the current app’s services.
Source: packages/slingshot-infra/src/types/preset.ts
DestroyResourceResult
Section titled “DestroyResourceResult”Parameters for destroyResources().
Source: packages/slingshot-infra/src/resource/destroyResources.ts
DestroyResourcesParams
Section titled “DestroyResourcesParams”Parameters for destroyResources().
Source: packages/slingshot-infra/src/resource/destroyResources.ts
DnsClient
Section titled “DnsClient”A single DNS record returned by the Cloudflare API.
Source: packages/slingshot-infra/src/dns/cloudflare.ts
DnsManager
Section titled “DnsManager”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
DnsProviderConfig
Section titled “DnsProviderConfig”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
DnsRecord
Section titled “DnsRecord”A single DNS record returned by the Cloudflare API.
Source: packages/slingshot-infra/src/dns/cloudflare.ts
DomainConfig
Section titled “DomainConfig”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
Ec2NginxPresetConfig
Section titled “Ec2NginxPresetConfig”Configuration options for the EC2/nginx (or Caddy) preset.
Source: packages/slingshot-infra/src/preset/ec2-nginx/ec2NginxPreset.ts
EcsPresetConfig
Section titled “EcsPresetConfig”Configuration options for the ECS preset.
Source: packages/slingshot-infra/src/preset/ecs/ecsPreset.ts
GeneratedFile
Section titled “GeneratedFile”A sibling service entry — a deployed service from another repo on the same stack.
Used by the EC2/nginx preset to generate composite docker-compose and Caddyfile configs that include all services on the stack, not just the current app’s services.
Source: packages/slingshot-infra/src/types/preset.ts
GenerateResourceSstOptions
Section titled “GenerateResourceSstOptions”Generates SST config content for provisioning shared AWS resources.
Each resource type maps to Pulumi AWS providers (since SST v3 is built on Pulumi), giving fine-grained control over resource configuration.
Source: packages/slingshot-infra/src/resource/generateResourceSst.ts
GzipConfig
Section titled “GzipConfig”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
HealthCheckConfig
Section titled “HealthCheckConfig”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
InfraCheckDiagnostics
Section titled “InfraCheckDiagnostics”Derives the uses resource list from a runtime app config object.
This is a best-effort heuristic that inspects the shape of a createApp() /
createServer() config to determine which shared infrastructure resources
the application needs. It is NOT a strict contract — users can always
override with an explicit uses array in slingshot.infra.ts.
Usage in slingshot.infra.ts:
import { defineInfra, deriveUsesFromAppConfig } from '@lastshotlabs/slingshot-infra';import appConfig from './src/appConfig';
export default defineInfra({stacks: ['main'],uses: deriveUsesFromAppConfig(appConfig),});Source: packages/slingshot-infra/src/config/deriveUsesFromApp.ts
InfraLoggingConfig
Section titled “InfraLoggingConfig”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
LocalRegistryConfig
Section titled “LocalRegistryConfig”Configuration for the local filesystem registry provider.
Source: packages/slingshot-infra/src/registry/localRegistry.ts
LoggingDefaults
Section titled “LoggingDefaults”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
NetworkConfig
Section titled “NetworkConfig”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
NetworkOverride
Section titled “NetworkOverride”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
NginxConfig
Section titled “NginxConfig”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
NginxRateLimitConfig
Section titled “NginxRateLimitConfig”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
NginxStaticConfig
Section titled “NginxStaticConfig”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
NginxTimeoutConfig
Section titled “NginxTimeoutConfig”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
OverrideMap
Section titled “OverrideMap”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
PlatformDefaults
Section titled “PlatformDefaults”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
PlatformEntry
Section titled “PlatformEntry”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
PlatformSecretsConfig
Section titled “PlatformSecretsConfig”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
PresetContext
Section titled “PresetContext”A sibling service entry — a deployed service from another repo on the same stack.
Used by the EC2/nginx preset to generate composite docker-compose and Caddyfile configs that include all services on the stack, not just the current app’s services.
Source: packages/slingshot-infra/src/types/preset.ts
PresetProvider
Section titled “PresetProvider”A sibling service entry — a deployed service from another repo on the same stack.
Used by the EC2/nginx preset to generate composite docker-compose and Caddyfile configs that include all services on the stack, not just the current app’s services.
Source: packages/slingshot-infra/src/types/preset.ts
ProvisionResult
Section titled “ProvisionResult”A sibling service entry — a deployed service from another repo on the same stack.
Used by the EC2/nginx preset to generate composite docker-compose and Caddyfile configs that include all services on the stack, not just the current app’s services.
Source: packages/slingshot-infra/src/types/preset.ts
RegistryAppEntry
Section titled “RegistryAppEntry”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
RegistryConfig
Section titled “RegistryConfig”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
RegistryDocument
Section titled “RegistryDocument”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
RegistryLock
Section titled “RegistryLock”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
RegistryProvider
Section titled “RegistryProvider”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
RegistryResourceEntry
Section titled “RegistryResourceEntry”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
RegistryServiceEntry
Section titled “RegistryServiceEntry”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
RegistryStackEntry
Section titled “RegistryStackEntry”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
ResourceOutput
Section titled “ResourceOutput”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
ResourceProvisionEntry
Section titled “ResourceProvisionEntry”Generates SST config content for provisioning shared AWS resources.
Each resource type maps to Pulumi AWS providers (since SST v3 is built on Pulumi), giving fine-grained control over resource configuration.
Source: packages/slingshot-infra/src/resource/generateResourceSst.ts
ResourceProvisioner
Section titled “ResourceProvisioner”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
ResourceProvisionerContext
Section titled “ResourceProvisionerContext”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
ResourceStageOverride
Section titled “ResourceStageOverride”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
RollbackOptions
Section titled “RollbackOptions”Options for runRollback().
Source: packages/slingshot-infra/src/deploy/rollback.ts
RollbackResult
Section titled “RollbackResult”Options for runRollback().
Source: packages/slingshot-infra/src/deploy/rollback.ts
S3RegistryConfig
Section titled “S3RegistryConfig”Configuration for the S3-backed registry provider.
Source: packages/slingshot-infra/src/registry/s3Registry.ts
ScalingConfig
Section titled “ScalingConfig”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
SecretsCheckResult
Section titled “SecretsCheckResult”Result of a secrets presence check.
Source: packages/slingshot-infra/src/secrets/secretsManager.ts
SecretsManager
Section titled “SecretsManager”Result of a secrets presence check.
Source: packages/slingshot-infra/src/secrets/secretsManager.ts
ServiceDeclaration
Section titled “ServiceDeclaration”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
SharedResourceConfig
Section titled “SharedResourceConfig”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
SSTDestroyOptions
Section titled “SSTDestroyOptions”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
SSTProvisionOptions
Section titled “SSTProvisionOptions”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
SSTProvisionResult
Section titled “SSTProvisionResult”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
StackConfig
Section titled “StackConfig”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
StackStageOverride
Section titled “StackStageOverride”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
StageConfig
Section titled “StageConfig”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
WsDiagnostic
Section titled “WsDiagnostic”WebSocket scaling diagnostics — pure helper that inspects a runtime app config and returns scaling-related warnings/infos.
Designed to be merged into the output of slingshot infra check. The function
is stateless and has no side effects.
Source: packages/slingshot-infra/src/config/websocketScalingAudit.ts
WsScalingAuditResult
Section titled “WsScalingAuditResult”WebSocket scaling diagnostics — pure helper that inspects a runtime app config and returns scaling-related warnings/infos.
Designed to be merged into the output of slingshot infra check. The function
is stateless and has no side effects.
Source: packages/slingshot-infra/src/config/websocketScalingAudit.ts
InfraSize
Section titled “InfraSize”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
OverrideSpec
Section titled “OverrideSpec”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
ProcessRunner
Section titled “ProcessRunner”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
WsDiagnosticSeverity
Section titled “WsDiagnosticSeverity”WebSocket scaling diagnostics — pure helper that inspects a runtime app config and returns scaling-related warnings/infos.
Designed to be merged into the output of slingshot infra check. The function
is stateless and has no side effects.
Source: packages/slingshot-infra/src/config/websocketScalingAudit.ts