How do I handle CloudFormation throttling errors in nested stacks?

Last updated: July 14, 2025

Context

When working with CloudFormation nested stacks, you may encounter throttling errors related to the DescribeChangeSet API call. These errors typically occur because AWS has rate limits on CloudFormation API calls that cannot be adjusted through Service Quotas, and nested stacks often require multiple DescribeChangeSet calls.

Example error message:

Creating change set failed: operation error CloudFormation: DescribeChangeSet, exceeded maximum number of attempts, 3, https response error StatusCode: 400, RequestID: xxxxx-xxxx-xxxx-xxxx-xxxxxxxx, api error Throttling: Rate exceeded

Answer

To handle CloudFormation throttling errors, you can configure backoff parameters using environment variables in your Spacelift stack. These variables control how the system retries API calls when encountering throttling:

  1. Navigate to your stack's environment variables settings

  2. Add the following variables as needed:

    • SPACELIFT_CF_BACKOFF_INITIAL_DELAY_MS: Sets the initial delay between retries in milliseconds (default: 1000ms)

    • SPACELIFT_CF_BACKOFF_MAX_DELAY_MS: Sets the maximum delay between retries in milliseconds (default: 30000ms)

    • SPACELIFT_CF_BACKOFF_FACTOR: Sets the multiplier for exponential backoff (default: 2.0)

If you continue to experience issues after configuring these parameters, you may want to consider alternative approaches such as:

  • Reviewing the architecture of your nested stacks to ensure they are optimally structured

  • If applicable, using stack dependencies to manage complex deployments (see Stack Dependencies documentation)