CloudFormation: 51,200-byte template limit is applied to templates referenced by S3 URL (CreateStack and CreateChangeSet)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- aws, rust
- Domain
- backend-api-design, cloud
Research direction
Start by locating the CloudFormation CreateStack and CreateChangeSet handlers and tracing how each processes TemplateURL versus TemplateBody. Check where the 51,200-byte validation is applied, then compare it with the documented 1 MB limit for S3 templates. Done means both operations accept a template larger than 51,200 bytes from S3 while inline templates still enforce the existing limit.
Written by the indexing model from the issue text.
Description
What happened
Creating a stack from a template stored in S3 fails when the template is larger than 51,200 bytes, even though the template is passed by URL rather than inline.
- Uploaded a 66,829-byte JSON template to an S3 bucket in the emulator and called CreateStack with TemplateURL. It failed with:
1 validation error detected: Value at 'templateBody' failed to satisfy constraint: Member must have length less than or equal to 51200 - CreateChangeSet with the same TemplateURL failed with the same error.
- For comparison, CreateStack with the same content passed as TemplateBody fails with the same message. That one matches AWS.
What you expected
Per the CloudFormation quotas documentation (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html), the 51,200-byte limit applies to a template body passed directly in a request, while a template stored in an S3 object may be up to 1 MB. A 66,829-byte template referenced by TemplateURL should therefore be accepted, as it is on AWS.
Steps to reproduce
- Install and start the emulator (Linux .deb package, default settings, endpoint https://127.0.0.1:9297, Region us-east-1). Pointed the client at it using the emulator's own config and credentials files, plus AWS_ENDPOINT_URL.
- Create an S3 bucket in the emulator and upload a JSON CloudFormation template larger than 51,200 bytes (the one used was 66,829 bytes).
- Call CreateStack (or CreateChangeSet) with TemplateURL set to the uploaded object.
Client: boto3 1.44.1 (Python). Reproduces every time.
Emulator version
Version: 1.0.322
Release date: 2026.11.10
Commit: 7753983c6e495ec3612695b1336bf4936fc7b7fd
Impact and workaround
Any stack whose template exceeds 51,200 bytes cannot be deployed on the emulator at all, including via the S3 route AWS provides for large templates. Workaround for now: split the template into smaller stacks, for example with nested stacks, each under 51,200 bytes.
Additional context
Smaller templates deploy fine through the same S3 route (verified with a small stack containing an S3 bucket and a DynamoDB table reaching CREATE_COMPLETE, with the provisioned resources usable), so the blocker is specifically the size check applied to S3-referenced templates.
- Dominant language
- Rust
- Stars
- 2.2k
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-emulator
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-emulator#30 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aws/aws-emulator#24 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
aws/aws-emulator#34 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
aws/aws-emulator#32 · 1 reaction ·
-
ConverseStream fails from AWS SDK for JavaScript v3: TLS ALPN 'no application protocol' (no h2)Open
Difficulty 4/5 3-5 days Newbie friendliness 47/100
aws/aws-emulator#31 ·
All issues in aws/aws-emulator
Similar issues
-
tormach-plasma refusal text with no machine reads "no machine is not declared a plasma machine"Openarea:post bug effort:low P2 source:agent
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Chat images never show without ImageMagick: ffprobe fallback uses an option string ffprobe 9 rejectsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
eliasstravik/herdr-projects#1011 ·
-
design-data-spec
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
adobe/spectrum-design-data#1744 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day