Syncploy

Safety Rails & Denial-of-Wallet Shield

The primary reason teams pay a 10x–50x PaaS tax on Vercel or Render isn't developer ergonomics—it is fear of an unbounded AWS bill.

On standard AWS (raw CDK, SAM, or Serverless Framework), concurrency defaults to account-wide limits (1,000+ instances), event streams retry for 24 continuous hours without dead-letter queues, and log groups never expire. A single accidental stream loop or public scraping flood can burn a $10,000+ credit limit overnight while CloudFormation deploys without a single warning.

Syncploy embeds a Pre-Flight Safety Engine directly into the compiler. In $<1\text{ms}$ during Abstract Syntax Tree (AST) parsing, Syncploy models the infrastructure topology as a directed graph, verifies mathematical blast-radius bounds, detects event cycles, and halts compilation before any resources can be synthesized or deployed.

---

1. Why Runtime Billing Alarms Fail#

Most engineering teams rely on AWS CloudWatch Billing Alarms or AWS Budgets. These are post-mortem notifications, not preventative guardrails:

FeatureAWS CloudWatch Billing AlarmSyncploy Pre-Flight Shield
Enforcement PointPost-execution (15 to 45 min delay)Pre-flight AST compilation (<1ms)
Mitigation ActionSends an email or SNS alertAborts compilation; 0 resources synthesized
Protection While Sleeping❌ None. Bill continues to surge until human intervention✅ Total. Unbounded code cannot deploy to AWS
Native Circuit Breaker❌ None. AWS provides no native auto-shutdown✅ Mathematical. Hardware compute liabilities hard-capped
Warning
AWS has no native "spend circuit breaker" for Lambda. When an account-level CloudWatch billing alarm triggers, it only dispatches a notification. Without custom auto-reaper automation, runaway Lambdas and unthrottled endpoints continue processing and billing at full velocity.

---

2. The Mathematical Blast-Radius Guarantee#

Denial-of-Wallet cannot be solved with rate limiting alone—rate limiters can be bypassed, spoofed, or misconfigured. True financial immunity requires mathematically bounding hardware liabilities in code.

Even if an unauthenticated endpoint is targeted by an unmitigated 500,000,000-request DDoS flood, its monthly compute spend cannot physically exceed the ceiling of its assigned resources:

$$\text{Max Monthly Compute} = \text{Concurrency} \times \frac{\text{Memory MB}}{1024} \times 2,592,000\text{s} \times \$0.0000166667$$

Hardware Ceiling Reference#

Reserved ConcurrencyMemory AllocationWorst-Case Sustained 24/7 SpendStandard AWS Default (1,000 Concurrency)
2128 MB$10.80 / mo$5,400.00 / mo
5256 MB$54.00 / mo$10,800.00 / mo
10512 MB$216.00 / mo$21,600.00 / mo
251024 MB$1,080.00 / mo$43,200.00 / mo

Syncploy rule WARN_DOW_UNRESERVED_CONCURRENCY statically requires an explicit concurrency cap on all public Function URLs and API routes:

typescript
// ❌ HAZARDOUS (Standard AWS): Scales to 1,000+ account instances under DDoS
export const webhook = api.post("/webhook", async (req) => {
  return { status: "received" };
});

// ✅ IMMUNIZED (Syncploy): Hardware-bounded to $27.00/mo under 24/7 sustained DDoS
export const webhook = api.post("/webhook", { concurrency: 5, memory: "128MB" }, async (req) => {
  return { status: "received" };
});

---

3. Tarjan's SCC Infinite Loop Killer#

In event-driven architectures, infinite recursion loops are the #1 cause of five-figure cloud bills ($10,000+ overnight charges).

A classic failure occurs when a Lambda consumes a DynamoDB Stream and writes back to that same table. Each write produces a new stream event, creating a continuous, self-amplifying execution avalanche:

typescript
┌────────────────────────────────────────────────────────┐
│               INFINITE RECURSION CYCLE                 │
│                                                        │
│   Table 'orders' ──(Stream Event)──► worker Lambda     │
│          ▲                                │            │
│          └───────────(table.put)──────────┘            │
└────────────────────────────────────────────────────────┘

Multi-hop cycles are equally catastrophic and virtually impossible to catch in manual code review:

$$\text{Table A} \longrightarrow \text{Worker 1} \longrightarrow \text{Queue B} \longrightarrow \text{Worker 2} \longrightarrow \text{Table A}$$

How the Compiler Traps Loops in <1ms#

  1. Trigger Edges: Compiler maps event sources (Table.stream, Queue.onMessage, Bucket.onObjectCreated) to consumer Lambdas.
  2. Mutation Edges: Compiler inspects function bodies for mutation calls (table.put, table.update, queue.send, bucket.put, topic.publish, HTTP fetch self-calls).
  3. Graph Construction: Constructs a directed bipartite graph $G = (V, E)$ where vertices are AWS constructs and edges are async mutations.
  4. Tarjan's SCC Algorithm: Executes Tarjan's Strongly Connected Components algorithm in $O(V + E)$ linear time ($<1\text{ms}$).
  5. Immediate Compilation Abort:
text
✖ [ERR_RECURSIVE_LOOP] in src/workers/order-sync.ts:
  • Infinite recursion loop detected:
    Table 'orders' ──► Stream Consumer 'syncOrders' ──► Table 'orders'

  • Cycle triggers self-amplifying Lambda executions, scaling to maximum account
    concurrency within seconds.

✖ Compilation aborted. 0 AWS resources modified.

---

4. The 4 Defensive Layers#

Syncploy's pre-flight compiler runs 26 deterministic safety rules across 4 operational layers:

Layer 1: Compute Blast-Radius Bounding#

  • Strict Concurrency Ceilings: Public Function URLs and API routes must declare explicit concurrency bounds (WARN_DOW_UNRESERVED_CONCURRENCY).
  • Stream Throttling: DynamoDB stream consumers are auto-bounded to prevent runaway concurrent batch workers (WARN_DOW_STREAM_UNBOUNDED).
  • Account Quota Sentinel: Aggregates reserved concurrency across the entire stack, warning if total $\ge 900$ to prevent starvation of critical services (WARN_DOW_CONCURRENCY_BUDGET_EXCEEDED).

Layer 2: Event-Driven Recursion & Poison-Pill Shields#

  • Tarjan's SCC Cycle Detection: Statically identifies 1-hop and multi-hop recursive cycles across tables, queues, and streams (ERR_RECURSIVE_LOOP).
  • SQS 6× Timeout Invariant: Enforces that queue visibilityTimeout is $\ge 6 \times$ consumer timeout to eliminate duplicate processing storms (ERR_SQS_TIMEOUT_MISMATCH, WARN_SQS_VISIBILITY_TIMEOUT_SHORT).
  • Mandatory Dead Letter Queues (DLQs): Active queues and stream consumers require DLQs (maxReceiveCount: 3) to isolate poison-pill records instead of retrying for days (WARN_DOW_MISSING_DLQ).
  • No Table Scans: Detects $O(N)$ full-table scans in request paths to prevent crawling bots from draining Read Capacity Units (WARN_DOW_DYNAMODB_SCAN).

Layer 3: Storage & Log Leak Neutralization#

  • Automatic 14-Day CloudWatch Log Rotation: Auto-synthesizes dedicated AWS::Logs::LogGroup resources with RetentionInDays: 14 for every Lambda. Eliminates default "Never Expire" log accumulation bills (INFO_DOW_LOG_ROTATION).
  • Automatic S3 Multipart Abort: Attaches AbortIncompleteMultipartUpload: { DaysAfterInitiation: 7 } to all buckets to purge orphan upload chunks (INFO_DOW_S3_MULTIPART_ABORT).

Layer 4: Financial Governance, Fraud Defense & Data Safety#

  • AWS Budgets Ceiling: Validates new Budget(...) constructs and ensures SNS alert topics are wired to real notification targets (WARN_DOW_BUDGET_NO_NOTIFICATION).
  • SMS International Toll Fraud Shield: Warns against unmonitored SNS SMS subscriptions and Cognito phone verification endpoints (WARN_DOW_SMS_TOLL_FRAUD).
  • Zero Data-Loss Replacement Gatekeeper: syncploy diff --check-replacement verifies that no stateful resource (DynamoDB table, S3 bucket) will be destroyed during updates (ERR_STATEFUL_REPLACEMENT).

---

5. Diagnostic Suppression & CI/CD Auditing#

In rare cases where recursion is intentionally bounded by application logic (such as a finite state-machine transition in DynamoDB), diagnostics can be suppressed with an explicit inline reason:

typescript
// syncploy-ignore ERR_RECURSIVE_LOOP reason="State machine terminates on status: 'COMPLETED'"
export const stateWorker = patientTable.stream({ batchSize: 10 }, async (record) => {
  if (record.status !== "COMPLETED") {
    await patientTable.put({ ...record, status: "COMPLETED" });
  }
});

Every suppressed diagnostic is verified during syncploy build and printed as an explicit audit trail in your CI/CD pipeline:

text
[AUDIT] 1 diagnostic suppressed:
  • ERR_RECURSIVE_LOOP in src/workers/stateWorker.ts: State machine terminates on status: 'COMPLETED'

Interactive Cloud Safety Rule Explorer

LIVE AUDIT CATALOG (70 RULES)

Explore, filter, and inspect all compile-time safety rules, recursion loop diagnostics, and budget guardrails. Switch between hazardous patterns and safe code remediations.

Showing 70 of 70 cloud safety & budget rules
FINANCIAL WARNINGWARN_DOW_UNRESERVED_CONCURRENCY• Lambda Function URLs / API Gateway
Layer 1: Compute Blast Radius

Unreserved Lambda Concurrency

Public Function URL or API route has no reserved concurrency cap.

Financial Impact: Uncapped scaling under DDoS or bot crawls scales Lambdas to account limits (1,000+ parallel instances), draining thousands in unbudgeted compute.
// ❌ HAZARDOUS: Unbounded scaling under DDoS
export const checkoutApi = api(
  { path: "/checkout", method: "POST", ingress: "function-url" },
  async (req) => {
    return Response.json({ success: true });
  }
);
Remediation:Add 'concurrency: <number>' to the api(...) options object to cap the theoretical maximum monthly spend.
FINANCIAL WARNINGWARN_DOW_PUBLIC_API_BURST• Lambda & API Gateway
Layer 1: Compute Blast Radius

High-Resource Public Wildcard CORS Endpoint

Public CORS endpoint allows origins ['*'] with heavy memory or duration allocations without concurrency bounds.

Financial Impact: High memory (≥512MB) combined with long timeouts (≥30s) and wildcard CORS creates an acute cost-amplification attack vector.
// ❌ HAZARDOUS: 1024MB memory + 60s timeout + wildcard CORS + no concurrency
export const processReport = api(
  {
    path: "/report",
    method: "POST",
    memory: 1024,
    timeout: "60s",
    cors: { allowOrigins: ["*"] },
  },
  async (req) => { /* heavy work */ }
);
Remediation:Configure 'concurrency: <number>' or restrict allowOrigins to trusted production domains.
FINANCIAL WARNINGWARN_DOW_STREAM_UNBOUNDED• DynamoDB Streams & Lambda
Layer 1: Compute Blast Radius

Unbounded DynamoDB Stream Concurrency

DynamoDB stream consumer has no concurrency limit configured.

Financial Impact: Heavy table write bursts cause DynamoDB shards to split rapidly, spawning dozens of parallel Lambda instances without backpressure.
// ❌ HAZARDOUS: Can scale to match all table shards simultaneously
export const streamWorker = auditTable.stream(
  { batchSize: 100 },
  async (record) => { /* ... */ }
);
Remediation:Add 'concurrency: <number>' to the table.stream(...) options object.
FINANCIAL WARNINGWARN_DOW_CONCURRENCY_BUDGET_EXCEEDED• AWS Lambda Service Quotas
Layer 1: Compute Blast Radius

Stack Reserved Concurrency Quota Depletion

Total reserved concurrency across all functions in the stack exceeds 900 of the 1,000 default account limit.

Financial Impact: Exhausting account unreserved concurrency quota (default 1,000) will cause all other Lambda functions across the AWS account to be throttled.
// ❌ HAZARDOUS: Sum of reserved concurrency across services > 900
export const api1 = api({ concurrency: 500 }, ...);
export const api2 = api({ concurrency: 450 }, ...);
Remediation:Reduce reserved allocations per function or request an AWS Service Quotas increase for Lambda Concurrent Executions.
FATAL ERRORERR_RECURSIVE_LOOP• DynamoDB Streams, SQS, SNS, S3
Layer 2: Recursion & Poison-Pills

Infinite Event Recursion Loop (Tarjan SCC)

An event consumer mutates or writes back directly or indirectly into its own event source (e.g. Table -> Stream -> Table.put).

Financial Impact: Exponential self-amplifying execution cascades ($10,000+ overnight charges in hours).
// ❌ HAZARDOUS: Writing back to the stream source table
export const auditWorker = patientTable.stream({ batchSize: 50 }, async (record) => {
  // BUG: Mutates the source table that triggered this stream!
  await patientTable.put({ id: record.id, updatedAt: Date.now() });
});
Remediation:Break the cycle by directing write mutations to a downstream table, queue, or prefix.
FINANCIAL WARNINGWARN_HTTP_RECURSIVE_LOOP• Lambda & HTTP Fetch
Layer 2: Recursion & Poison-Pills

HTTP Self-Invocation Circular Storm

API route makes an internal fetch() call targeting its own URL path.

Financial Impact: Circular HTTP invocations rapidly exhaust Lambda concurrency pool and lock instances until timeouts expire.
// ❌ HAZARDOUS: Fetching self via external HTTP
export const orderHandler = api({ path: "/orders", method: "POST" }, async (req) => {
  await fetch("https://api.mycompany.com/orders", { method: "POST" });
});
Remediation:Call the underlying TypeScript function directly rather than invoking your own public HTTP endpoint via fetch.
FATAL ERRORERR_SQS_TIMEOUT_MISMATCH• Amazon SQS & Lambda
Layer 2: Recursion & Poison-Pills

SQS Visibility Timeout Shorter Than Lambda Timeout

Queue visibilityTimeout is shorter than the consuming Lambda handler's timeout.

Financial Impact: SQS redelivers in-flight messages while the previous Lambda is still running, triggering duplicate execution avalanches and double-billing.
// ❌ HAZARDOUS: Visibility (30s) < Consumer Timeout (60s)
export const queue = new Queue("jobs", { visibilityTimeout: "30s" });
export const worker = queue.consumer({ timeout: "60s" }, async (msg) => { ... });
Remediation:Set queue visibilityTimeout to at least 6x the consumer Lambda timeout (e.g. timeout: 30s -> visibilityTimeout: 180s).
FINANCIAL WARNINGWARN_SQS_VISIBILITY_TIMEOUT_SHORT• Amazon SQS & Lambda
Layer 2: Recursion & Poison-Pills

Queue Visibility Timeout Below AWS 6x Safety Ratio

Queue visibilityTimeout is greater than consumer timeout, but less than the recommended 6x safety ratio.

Financial Impact: Under downstream network latency or database throttling, messages in flight risk premature redelivery and duplicate execution storms.
export const queue = new Queue("orders", { visibilityTimeout: "35s" });
export const worker = queue.consumer({ timeout: "30s" }, ...);
Remediation:Increase queue visibilityTimeout to ≥ 6x consumer timeout (AWS Architecture recommendation).
FINANCIAL WARNINGWARN_DOW_MISSING_DLQ• Amazon SQS
Layer 2: Recursion & Poison-Pills

Active SQS Queue Without Dead Letter Queue (DLQ)

Active queue has consumers attached but no deadLetterQueue redrive policy.

Financial Impact: Poison-pill messages containing malformed payloads trigger continuous failure loops for up to 14 days, burning compute cycles indefinitely.
// ❌ HAZARDOUS: Poison-pill messages will retry continuously
export const queue = new Queue("notifications", {
  visibilityTimeout: "180s",
});
Remediation:Configure 'deadLetterQueue: { maxReceiveCount: 3 }' on the Queue declaration.
FINANCIAL WARNINGWARN_DOW_STREAM_MISSING_DLQ• DynamoDB Streams & SQS
Layer 2: Recursion & Poison-Pills

DynamoDB Stream Without Failure Destination

Active DynamoDB stream consumer has no onFailure DLQ queue configured.

Financial Impact: Unprocessable poison-pill records either block stream shards or get dropped after retries without auditability.
export const stream = auditTable.stream({ batchSize: 50 }, async (record) => { ... });
Remediation:Configure 'onFailure: "myDlqQueue"' to safely isolate unprocessable stream records.
FINANCIAL WARNINGWARN_DOW_STREAM_RETRY_UNLIMITED• DynamoDB Streams
Layer 2: Recursion & Poison-Pills

DynamoDB Stream Unlimited Retries (-1)

DynamoDB stream consumer explicitly configured retryAttempts: -1.

Financial Impact: Retrying failing records for up to 24 hours locks stream shards and keeps Lambda instances continuously executing.
export const stream = auditTable.stream({ retryAttempts: -1 }, ...);
Remediation:Set 'retryAttempts: 3' (or 1-5) and attach an onFailure DLQ queue.
FINANCIAL WARNINGWARN_DOW_DYNAMODB_SCAN• Amazon DynamoDB
Layer 2: Recursion & Poison-Pills

DynamoDB Full Table Scan in Request Path

API route invokes table.scan() inside its execution body.

Financial Impact: O(N) read amplification: a single HTTP request scans every single item in the entire database, consuming hundreds of Read Capacity Units per call.
// ❌ HAZARDOUS: Scans entire table on every HTTP GET
export const listPatients = api({ path: "/patients", method: "GET" }, async () => {
  const all = await patientTable.scan();
  return Response.json(all);
});
Remediation:Replace table.scan() with indexed table.query() or ElectroDB secondary index lookups.
AUTO-IMMUNIZEDINFO_DOW_LOG_ROTATION• Amazon CloudWatch Logs
Layer 3: Storage & Log Leaks

Perpetual CloudWatch Log Accumulation Defense

Syncploy automatically synthesizes AWS::Logs::LogGroup with 14-day retention for every Lambda function.

Financial Impact: AWS Lambda by default creates log streams with Never Expire retention, quietly accumulating hundreds of gigabytes of permanent log storage charges.
// ❌ DEFAULT AWS: Creates unmanaged log group with infinite retention
export const myHandler = api({ path: "/run" }, async () => { ... });
Remediation:Automatic by default. Customize retention per handler via 'logRetentionInDays: <number>'.
AUTO-IMMUNIZEDINFO_DOW_S3_MULTIPART_ABORT• Amazon S3
Layer 3: Storage & Log Leaks

S3 Orphan Multipart Upload Cleanup

Syncploy automatically synthesizes AbortIncompleteMultipartUpload: { DaysAfterInitiation: 7 } on every bucket.

Financial Impact: Failed or abandoned multipart uploads leave orphan byte chunks in S3. These are invisible in bucket listings, yet AWS bills for their storage indefinitely.
// ❌ DEFAULT AWS: Abandoned upload fragments remain stored forever
export const bucket = new Bucket("uploads");
Remediation:Automatic by default on all declared Bucket constructs.
FINANCIAL WARNINGWARN_DOW_SMS_TOLL_FRAUD• Amazon SNS & Cognito
Layer 4: Financial Governance & Fraud

International SMS Toll Fraud Exposure

Topic has protocol: 'sms' or Cognito User Pool enables phone verification without explicit spend bounds.

Financial Impact: Attackers script automated requests to phone endpoints, generating thousands of premium international SMS messages at $0.50+/SMS.
// ❌ HAZARDOUS: Unmonitored SMS destination
export const auth = new Auth("portal", { signInMethod: "phone" });
Remediation:Use email verification, configure AWS SNS account-level SMS spend limits, and restrict destination country codes in the AWS Console.
FINANCIAL WARNINGWARN_DOW_HIGH_BLAST_RADIUS• AWS Budgets & CloudWatch
Layer 4: Financial Governance & Fraud

Continuous Monthly Liability Exceeds $100 Without Budget

Stack total continuous monthly compute liability exceeds $100, but no new Budget construct is declared.

Financial Impact: Combined concurrency compute ceiling across stack functions exceeds $100/mo without active financial alerting.
// ❌ HAZARDOUS: High compute liability without financial alerting
export const api1 = api({ concurrency: 100 }, ...); // ~$108/mo liability
Remediation:Declare 'new Budget("monthly-cap", { amount: <dollars>, topic: myTopic })' to actively track and alert on overruns.
FATAL ERRORERR_BUDGET_INVALID_AMOUNT• AWS Budgets
Layer 4: Financial Governance & Fraud

Budget Amount Missing or Invalid

Budget construct has missing, zero, or non-static amount literal.

Financial Impact: Budgets without positive static amounts fail synthesis and cannot enforce financial caps in CloudFormation.
export const budget = new Budget("cap", { amount: 0 });
Remediation:Pass a static positive literal number for 'amount' (e.g. amount: 50).
FATAL ERRORERR_BUDGET_INVALID_THRESHOLD• AWS Budgets
Layer 4: Financial Governance & Fraud

Budget Alert Threshold Invalid

Budget threshold must be a positive number literal representing a percentage (e.g. 80).

Financial Impact: Invalid or non-percentage thresholds prevent CloudWatch/SNS notifications from triggering when spend spikes.
export const budget = new Budget("cap", { amount: 50, threshold: -10 });
Remediation:Set 'threshold: <number>' between 1 and 1000 (e.g. 80 for 80% of budget).
FATAL ERRORERR_BUDGET_INVALID_UNIT• AWS Budgets
Layer 4: Financial Governance & Fraud

Budget Currency Unit Not ISO Code

Budget unit must be a 3-letter uppercase ISO currency code (e.g. 'USD', 'EUR', 'GBP').

Financial Impact: AWS Budgets rejects non-ISO currency codes during CloudFormation stack creation, failing deployment.
export const budget = new Budget("cap", { amount: 50, unit: "dollars" });
Remediation:Use standard 3-letter uppercase currency code like 'USD' or 'EUR'.
FATAL ERRORERR_BUDGET_INVALID_FILTER• AWS Budgets
Layer 4: Financial Governance & Fraud

Budget Stack Filter Invalid

Budget filterByStack must be a static boolean literal (true | false).

Financial Impact: Dynamic non-boolean stack filter expressions prevent deterministic CloudFormation tag cost filtering.
export const budget = new Budget("cap", { amount: 50, filterByStack: "yes" as any });
Remediation:Pass literal boolean 'filterByStack: true' or omit for account-wide tracking.
FATAL ERRORERR_DUPLICATE_BUDGET_ID• AWS Budgets
Layer 4: Financial Governance & Fraud

Duplicate Budget Identifier Declared

Two Budget constructs share the same constructor identifier.

Financial Impact: Duplicate budget constructs collide in the CloudFormation logical ID map and overwrite financial limits.
export const b1 = new Budget("monthly-cap", { amount: 50 });
export const b2 = new Budget("monthly-cap", { amount: 100 });
Remediation:Provide unique identifier strings for each declared Budget construct.
FATAL ERRORERR_DUPLICATE_BUDGET_NAME• AWS Budgets
Layer 4: Financial Governance & Fraud

Duplicate Physical AWS Budget Name

Two Budget constructs specify the same physical budgetName.

Financial Impact: AWS Budgets names are globally unique per AWS account. Duplicate names cause CloudFormation create failures.
export const b1 = new Budget("b1", { amount: 50, budgetName: "my-budget" });
export const b2 = new Budget("b2", { amount: 100, budgetName: "my-budget" });
Remediation:Assign distinct physical budgetName options or allow Syncploy to auto-generate unique stack-scoped names.
FINANCIAL WARNINGWARN_DOW_BUDGET_NO_NOTIFICATION• AWS Budgets & SNS
Layer 4: Financial Governance & Fraud

Silent Budget Without Alert Topic

Budget construct has no topic configured and no fallback alert topic was discovered in the stack.

Financial Impact: A budget without a notification topic cannot deliver alerts to engineers, leaving spending breaches unmonitored.
// ❌ HAZARDOUS: Silent budget records spend but alerts nobody
export const budget = new Budget("cap", { amount: 50 });
Remediation:Configure 'topic: myAlertTopic' on the Budget construct.
AUTO-IMMUNIZEDWARN_DOW_BUDGET_TAG_ACTIVATION• AWS Billing & Cost Management
Layer 4: Financial Governance & Fraud

Stack Cost Allocation Tag Activation Required

filterByStack: true requires activating the 'StackName' cost allocation tag in the AWS Billing console.

Financial Impact: Without activating user-defined Cost Allocation Tags in AWS Console, stack-scoped budget filters report $0 spend regardless of usage.
export const budget = new Budget("cap", { amount: 50, filterByStack: true });
Remediation:In AWS Billing Console, navigate to Cost Allocation Tags and activate 'StackName' so AWS populates tag-scoped metrics.
FATAL ERRORERR_BUDGET_UNRESOLVED_TOPIC• AWS Budgets & SNS
Layer 4: Financial Governance & Fraud

Budget Configured Non-Existent Alert Topic

Budget topic option does not resolve to any declared Topic construct in the stack.

Financial Impact: A budget linked to a non-existent SNS topic fails deployment and produces silent billing breaches.
export const budget = new Budget("cap", { amount: 50, topic: "missingTopic" });
Remediation:Verify the topic identifier or declare a matching 'new Topic(...)'.
FATAL ERRORERR_STATEFUL_REPLACEMENT• CloudFormation, DynamoDB & S3
Layer 4: Financial Governance & Fraud

Destructive Stateful Resource Replacement Intercepted

syncploy diff detected an update that causes CloudFormation to DESTROY and RECREATE a DynamoDB table or S3 bucket.

Financial Impact: Permanent, irreversible data loss caused by CloudFormation deleting and recreating production databases or audit buckets.
// ❌ HAZARDOUS: Changing physical TableName causes CloudFormation to drop the old table
export const table = new Table("ehr", { tableName: "new-table-name" });
Remediation:Match the existing physical resource name or pass --allow-stateful-replacement if recreation is intended.
FATAL ERRORERR_CFN_LOGICAL_ID• CloudFormation
Layer 4: Financial Governance & Fraud

Invalid CloudFormation Logical ID

Logical IDs in CloudFormation must be alphanumeric ([A-Za-z0-9]+).

Financial Impact: CloudFormation template validation failure prevents deployments and corrupts rollbacks.
export const table = new Table("ehr-db", { logicalId: "my_invalid-table!" });
Remediation:Remove non-alphanumeric characters from the logicalId property.
FATAL ERRORERR_CFN_RESOURCE_LIMIT• CloudFormation
Layer 4: Financial Governance & Fraud

CloudFormation 500 Resource Limit Exceeded

CloudFormation stacks cannot declare more than 500 resources.

Financial Impact: Stack deployment failure due to AWS CloudFormation hard resource limit.
// Monolithic stack with 501+ resources
Remediation:Decompose monolithic infrastructure into separate Syncploy service stacks.
FATAL ERRORERR_CFN_OUTPUT_LIMIT• CloudFormation
Layer 4: Financial Governance & Fraud

CloudFormation 60 Output Limit Exceeded

CloudFormation stacks cannot declare more than 60 outputs.

Financial Impact: Stack deployment failure due to AWS CloudFormation output quota breach.
// Stack declaring 61+ stack outputs
Remediation:Reduce stack outputs or use SSM parameters for cross-stack discovery.
FATAL ERRORERR_CFN_TEMPLATE_SIZE_LIMIT• CloudFormation
Layer 4: Financial Governance & Fraud

CloudFormation 1MB Template Size Limit Exceeded

Synthesized CloudFormation template JSON exceeds 1MB limit.

Financial Impact: Stack deployment failure due to AWS S3 template size limits (1MB maximum).
// Excessively bloated stack template
Remediation:Split resources into separate stack modules to reduce template size.
FATAL ERRORERR_API_PATH• API Gateway
Layer 1: Compute Blast Radius

Invalid API Gateway Route Path

API route path must start with a forward slash ('/').

Financial Impact: Route registration fails in API Gateway, causing broken endpoints and service outages.
export const getDoc = api({ path: "documents", method: "GET" }, ...);
Remediation:Prefix the API route path with '/' (e.g. '/documents').
FATAL ERRORERR_CORS_ORIGIN_PROTOCOL• API Gateway / Function URLs
Security & Construct Integrity

CORS Allowed Origin Missing Protocol

CORS allowed origin must include protocol (e.g. 'https://' or 'http://') or be '*'.

Financial Impact: Malformed CORS headers cause browser cross-origin preflight rejections or unintended open cross-origin access.
export const myApi = api({ cors: { allowOrigins: ["example.com"] } }, ...);
Remediation:Add 'https://' or 'http://' to the allowed origin entry.
FINANCIAL WARNINGWARN_FUNCTION_URL_AUTH_UNSUPPORTED• Lambda Function URLs
Security & Construct Integrity

Function URL Custom Auth Unsupported

Lambda Function URLs only support NONE or AWS_IAM auth types, not custom authorizers.

Financial Impact: Misconfigured ingress exposes endpoints publicly or drops authorization.
export const route = api({ ingress: "function-url", auth: "cognito" }, ...);
Remediation:Switch ingress to 'api-gateway' if using Cognito or custom JWT authorizers.
FINANCIAL WARNINGWARN_FUNCTION_URL_THROTTLE_UNSUPPORTED• Lambda Function URLs
Layer 1: Compute Blast Radius

Function URL Rate Limiting Unsupported

Function URLs do not support token-bucket throttle settings (burst/rate limits); use API Gateway or reserved concurrency.

Financial Impact: Absence of gateway-level token bucket rate limiting allows unthrottled burst traffic to invoke Lambdas.
export const route = api({ ingress: "function-url", throttle: { rateLimit: 100 } }, ...);
Remediation:Use ingress: 'api-gateway' for rate-limited routes or configure 'concurrency' on Function URLs.
FATAL ERRORERR_LAMBDA_MEMORY• AWS Lambda
Layer 1: Compute Blast Radius

Invalid Lambda Memory Allocation

Lambda memory must be between 128 MB and 10,240 MB.

Financial Impact: Deployment rejection or excessive over-provisioning spend.
export const handler = api({ memory: 64 }, ...);
Remediation:Set Lambda memory to a value between 128 and 10240 MB.
FATAL ERRORERR_LAMBDA_TIMEOUT• AWS Lambda
Layer 1: Compute Blast Radius

Invalid Lambda Execution Timeout

Lambda timeout must be between 1 second and 900 seconds (15 minutes).

Financial Impact: Deployment rejection or unexpected early termination of workloads.
export const handler = api({ timeout: "1000s" }, ...);
Remediation:Configure timeout within 1s to 900s.
FATAL ERRORERR_LAMBDA_CONCURRENCY• AWS Lambda
Layer 1: Compute Blast Radius

Invalid Lambda Concurrency Limit

Lambda reserved concurrency must be an integer >= 0.

Financial Impact: Invalid concurrency settings prevent Lambda function deployment.
export const handler = api({ concurrency: -5 }, ...);
Remediation:Set concurrency to a non-negative integer (e.g. 10).
FATAL ERRORERR_LAMBDA_FUNCTION_NAME• AWS Lambda
Layer 4: Financial Governance & Fraud

Invalid Lambda Function Name

Lambda function names must be 1-64 characters matching [a-zA-Z0-9-_]+.

Financial Impact: CloudFormation deployment validation error.
export const handler = api({ functionName: "my invalid func!" }, ...);
Remediation:Use alphanumeric characters, hyphens, and underscores up to 64 characters.
FATAL ERRORERR_DDB_TABLE_NAME• Amazon DynamoDB
Layer 3: Storage & Log Leaks

Invalid DynamoDB Table Name

DynamoDB table names must be 3-255 characters matching [a-zA-Z0-9_.-]+.

Financial Impact: Table creation failure in CloudFormation.
export const table = new Table("db", { tableName: "a" });
Remediation:Ensure tableName is between 3 and 255 characters with valid symbols.
FATAL ERRORERR_DDB_KEY_COLLISION• Amazon DynamoDB
Layer 3: Storage & Log Leaks

DynamoDB Partition Key and Sort Key Collision

Partition key and sort key attribute names cannot be identical.

Financial Impact: Fatal CloudFormation deployment failure.
export const table = new Table("db", { partitionKey: "id", sortKey: "id" });
Remediation:Use distinct attribute names for partitionKey and sortKey.
FATAL ERRORERR_DDB_GSI_LIMIT• Amazon DynamoDB
Layer 3: Storage & Log Leaks

DynamoDB Global Secondary Index Limit Exceeded

A DynamoDB table cannot exceed 20 Global Secondary Indexes.

Financial Impact: CloudFormation failure due to AWS hard quota of 20 GSIs per table.
// Table declaring 21+ global secondary indexes
Remediation:Consolidate GSIs using single-table design principles.
FATAL ERRORERR_DDB_GSI_COLLISION• Amazon DynamoDB
Layer 3: Storage & Log Leaks

DynamoDB GSI Index Name Collision

Duplicate GSI index names defined on the same DynamoDB table.

Financial Impact: Fatal CloudFormation template validation error.
// Two GSIs both named "byStatus"
Remediation:Assign unique index names to each Global Secondary Index.
FATAL ERRORERR_ELECTRO_KEY_MISMATCH• Amazon DynamoDB & ElectroDB
Layer 3: Storage & Log Leaks

ElectroDB Entities Partition Key Inconsistency

ElectroDB entities in the same service must share the identical primary key schema (pkField and skField).

Financial Impact: Incompatible schema writes corrupt single-table data layout and break query indexes.
// EntityA uses pkField: "pk", EntityB uses pkField: "id" in the same service
Remediation:Standardize pkField and skField across all ElectroDB entities in the service.
FATAL ERRORERR_ELECTRO_GSI_MISMATCH• Amazon DynamoDB & ElectroDB
Layer 3: Storage & Log Leaks

ElectroDB Entities GSI Definition Conflict

ElectroDB entities in the same service share a GSI index name but define conflicting index key attributes.

Financial Impact: Single-table index corruption resulting in failed queries or DynamoDB provision errors.
// EntityA defines gsi1 with pk: "gsi1pk", EntityB defines gsi1 with pk: "alt_pk"
Remediation:Align GSI attribute names across entities sharing the secondary index.
FATAL ERRORERR_ELECTRO_TABLE_KEY_MISMATCH• Amazon DynamoDB & ElectroDB
Layer 3: Storage & Log Leaks

Explicit Table Schema Conflicts with ElectroDB Entity

Explicit Table construct partitionKey/sortKey does not match the ElectroDB entity's primary index key fields.

Financial Impact: Schema mismatch prevents ElectroDB from querying or writing items to the synthesized DynamoDB table.
export const table = new Table("orders", { partitionKey: "orderId" }); // Entity uses "pk"
Remediation:Update the Table definition to match ElectroDB's pkField and skField.
FATAL ERRORERR_ELECTRO_DUPLICATE_ENTITY• Amazon DynamoDB & ElectroDB
Layer 3: Storage & Log Leaks

Duplicate ElectroDB Entity Name in Service

Two ElectroDB entities in the same service share the exact same entity name.

Financial Impact: Name collisions cause entity overwrite and unpredictable single-table item classification.
// Two Entity definitions with model.entity: "user"
Remediation:Give each ElectroDB entity in the service a distinct entity name.
FATAL ERRORERR_S3_BUCKET_NAME• Amazon S3
Layer 3: Storage & Log Leaks

Invalid S3 Bucket Name

S3 bucket names must be 3-63 characters, lowercase, and cannot contain underscores.

Financial Impact: Fatal CloudFormation creation failure.
export const bucket = new Bucket("my_bucket_name");
Remediation:Use lowercase letters, numbers, and hyphens (3-63 chars) without underscores.
FATAL ERRORERR_S3_OBJECT_LOCK• Amazon S3
Layer 3: Storage & Log Leaks

S3 Object Lock Requires Bucket Versioning

S3 Object Lock cannot be enabled unless bucket versioning is also enabled.

Financial Impact: CloudFormation rejection during S3 bucket provisioning.
export const bucket = new Bucket("audit", { objectLock: true, versioned: false });
Remediation:Enable versioned: true when configuring objectLock on S3 buckets.
FATAL ERRORERR_SQS_QUEUE_NAME• Amazon SQS
Layer 2: Recursion & Poison-Pills

Invalid SQS Queue Name

SQS queue names must be 1-80 characters matching [a-zA-Z0-9-_]+.

Financial Impact: Queue creation failure in CloudFormation.
export const queue = new Queue("invalid queue name!");
Remediation:Use alphanumeric characters, hyphens, and underscores up to 80 characters.
FATAL ERRORERR_SQS_FIFO_NAME• Amazon SQS
Layer 2: Recursion & Poison-Pills

SQS FIFO Queue Missing .fifo Suffix

SQS FIFO queues must end with the '.fifo' suffix.

Financial Impact: Fatal AWS deployment failure (AWS rejects FIFO queues without .fifo suffix).
export const queue = new Queue("orders", { fifo: true });
Remediation:Add '.fifo' suffix to the queue name (e.g. 'orders.fifo').
FATAL ERRORERR_SQS_VISIBILITY_TIMEOUT• Amazon SQS
Layer 2: Recursion & Poison-Pills

Invalid SQS Visibility Timeout

SQS visibilityTimeout must be between 0 seconds and 43,200 seconds (12 hours).

Financial Impact: Deployment failure in AWS SQS.
export const queue = new Queue("jobs", { visibilityTimeout: "50000s" });
Remediation:Configure visibilityTimeout between 0s and 43200s (12h).
FATAL ERRORERR_SQS_BATCH_SIZE• Amazon SQS & Lambda
Layer 2: Recursion & Poison-Pills

Invalid SQS Consumer Batch Size

SQS consumer batchSize must be between 1 and 10 (or up to 10,000 for standard queues with batchWindow).

Financial Impact: Event source mapping configuration error.
export const worker = queue.consumer({ batchSize: 50000 }, ...);
Remediation:Configure consumer batchSize within supported AWS limits.
FATAL ERRORERR_SQS_DLQ_CYCLE• Amazon SQS
Layer 2: Recursion & Poison-Pills

SQS Dead Letter Queue Self-Cycle

A queue cannot configure itself as its own deadLetterQueue.

Financial Impact: Poison-pill messages redelivered indefinitely into the same queue, causing infinite compute billing loops.
export const q = new Queue("jobs", { deadLetterQueue: { queue: "jobs" } });
Remediation:Target a distinct dead-letter queue.
FATAL ERRORERR_SQS_DLQ_MAX_RECEIVE• Amazon SQS
Layer 2: Recursion & Poison-Pills

Invalid SQS DLQ maxReceiveCount

deadLetterQueue.maxReceiveCount must be an integer >= 1.

Financial Impact: Improper retry policies cause messages to loop endlessly or drop prematurely.
export const q = new Queue("jobs", { deadLetterQueue: { queue: dlq, maxReceiveCount: 0 } });
Remediation:Set maxReceiveCount to a positive integer (recommended: 3 to 5).
FATAL ERRORERR_SNS_FIFO_NAME• Amazon SNS
Layer 2: Recursion & Poison-Pills

SNS FIFO Topic Missing .fifo Suffix

SNS FIFO topics must end with the '.fifo' suffix.

Financial Impact: Fatal AWS deployment failure.
export const topic = new Topic("events", { fifo: true });
Remediation:Add '.fifo' suffix to the topic name.
FATAL ERRORERR_SNS_SQS_ENDPOINT• Amazon SNS & SQS
Layer 2: Recursion & Poison-Pills

Invalid SNS SQS Subscription Target

SNS topic subscriber specifies an unresolved or invalid SQS queue endpoint.

Financial Impact: Broken pub/sub pipeline preventing critical event delivery.
topic.subscribe("invalid-sqs-target");
Remediation:Reference a valid declared Queue construct or queue ARN.
FATAL ERRORERR_SNS_LAMBDA_ENDPOINT• Amazon SNS & Lambda
Layer 2: Recursion & Poison-Pills

Invalid SNS Lambda Subscription Target

SNS topic subscription target does not resolve to a valid Lambda function.

Financial Impact: SNS subscription provisioning failure.
topic.subscribeFunction("nonExistentHandler");
Remediation:Target a declared Lambda handler function.
FATAL ERRORERR_SNS_EMAIL_ENDPOINT• Amazon SNS
Layer 4: Financial Governance & Fraud

Invalid SNS Email Subscription Address

SNS email subscription specifies a malformed email address.

Financial Impact: Subscription rejection and missing alert delivery.
topic.subscribeEmail("not-an-email");
Remediation:Provide a valid email address.
FATAL ERRORERR_SNS_FIREHOSE_ENDPOINT• Amazon SNS & Kinesis Firehose
Layer 3: Storage & Log Leaks

Invalid SNS Firehose Subscription Target

SNS topic subscription specifies an invalid or unresolvable DeliveryStream target.

Financial Impact: Broken analytics pipeline causing event loss.
topic.subscribeDeliveryStream("missingStream");
Remediation:Target a declared DeliveryStream construct.
FATAL ERRORERR_FIREHOSE_STREAM_NAME• Amazon Kinesis Data Firehose
Layer 3: Storage & Log Leaks

Invalid Firehose DeliveryStream Name

Firehose delivery stream names must be 1-64 characters matching [a-zA-Z0-9_.-]+.

Financial Impact: Deployment failure in CloudFormation.
export const stream = new DeliveryStream("invalid firehose name!");
Remediation:Use alphanumeric characters, hyphens, and underscores up to 64 characters.
FATAL ERRORERR_FIREHOSE_BUFFER_INTERVAL• Amazon Kinesis Data Firehose
Layer 3: Storage & Log Leaks

Invalid Firehose Buffer Interval

Firehose bufferInterval must be between 60 seconds and 900 seconds.

Financial Impact: CloudFormation configuration rejection.
export const stream = new DeliveryStream("events", { bufferInterval: 30 });
Remediation:Set bufferInterval between 60s and 900s.
FATAL ERRORERR_FIREHOSE_BUFFER_SIZE• Amazon Kinesis Data Firehose
Layer 3: Storage & Log Leaks

Invalid Firehose Buffer Size

Firehose bufferSize must be between 1 MB and 128 MB.

Financial Impact: CloudFormation configuration rejection.
export const stream = new DeliveryStream("events", { bufferSize: 256 });
Remediation:Configure bufferSize between 1MB and 128MB.
FATAL ERRORERR_STREAM_BATCH_SIZE• Amazon DynamoDB Streams & Lambda
Layer 1: Compute Blast Radius

Invalid DynamoDB Stream Batch Size

DynamoDB stream consumer batchSize must be between 1 and 10,000.

Financial Impact: Stream event source mapping failure.
table.stream({ batchSize: 20000 }, ...);
Remediation:Set stream batchSize between 1 and 10000.
FATAL ERRORERR_AUTH_PASSWORD_MIN_LENGTH• Amazon Cognito
Security & Construct Integrity

Cognito Password Policy minLength Below AWS Limit

Cognito UserPool passwordPolicy.minLength must be at least 6 characters.

Financial Impact: Cognito UserPool creation failure (AWS minimum is 6 characters).
export const auth = new Auth("users", { passwordPolicy: { minLength: 4 } });
Remediation:Set passwordPolicy.minLength >= 6 (recommended: >= 12).
FINANCIAL WARNINGWARN_AUTH_PASSWORD_LENGTH_SHORT• Amazon Cognito
Security & Construct Integrity

Cognito Password Minimum Length Less Than 8

Password minLength of 6 or 7 meets AWS hard floor but falls short of security best practices (8+ chars).

Financial Impact: Weak authentication credential vulnerabilities lead to account takeovers and credential stuffing attacks.
export const auth = new Auth("users", { passwordPolicy: { minLength: 6 } });
Remediation:Increase passwordPolicy.minLength to 8 or greater.
FINANCIAL WARNINGWARN_SECRET_LEAK• AWS Lambda & CloudFormation
Security & Construct Integrity

Hardcoded Secret In Environment Variable

Literal API key, token, or secret pattern detected in Lambda environment variables.

Financial Impact: Credential leakage allows malicious actors unauthorized access to cloud assets and upstream paid APIs.
export const api = api({ env: { STRIPE_KEY: "sk_live_1234567890" } }, ...);
Remediation:Use new Secret(...) or AWS Secrets Manager / SSM Parameter Store instead of hardcoded strings.
FATAL ERRORERR_IAM_ACTION_FORMAT• AWS IAM
Security & Construct Integrity

Malformed IAM Policy Action

IAM policy actions must match 'service:action' format (e.g. 'dynamodb:GetItem').

Financial Impact: IAM policy compilation rejection by AWS CloudFormation.
export const role = new Role("myRole", { actions: ["GetItem"] });
Remediation:Prefix the action with the AWS service namespace (e.g. 's3:GetObject').
FINANCIAL WARNINGWARN_IAM_LEAST_PRIVILEGE• AWS IAM
Security & Construct Integrity

Overly Permissive IAM Wildcard Action

Wildcard IAM action (e.g. '*' or 's3:*') grants broader permissions than required.

Financial Impact: Excessive IAM privileges expand attack blast radius across the AWS account.
export const role = new Role("worker", { actions: ["*"] });
Remediation:Scope down IAM actions to specific least-privilege operations.
FATAL ERRORERR_ALARM_EVALUATION_PERIODS• Amazon CloudWatch
Layer 4: Financial Governance & Fraud

Invalid CloudWatch Alarm Evaluation Periods

CloudWatch alarm evaluationPeriods must be an integer >= 1.

Financial Impact: Alarm creation rejection in CloudFormation.
export const alarm = new Alarm("errs", { evaluationPeriods: 0 });
Remediation:Set evaluationPeriods to an integer >= 1.
FATAL ERRORERR_BUDGET_INVALID_NAME• AWS Budgets
Layer 4: Financial Governance & Fraud

Invalid AWS Budget Name

AWS budget names must be 1-100 characters matching [a-zA-Z0-9=+_.:@/-]+.

Financial Impact: Budget creation failure in AWS Budgets API.
export const budget = new Budget("cap", { budgetName: "my invalid budget!" });
Remediation:Ensure budgetName is between 1 and 100 characters with valid characters.