Skip to content

E3010: SAM templates that expand past 500 resources pass since 1.54.0 #4883

Open

Description

@hoganbr-amzn

CloudFormation Lint Version

1.58.0

What operating system are you using?

Linux

Describe the bug

Since #4491 (1.54.0) cfn-lint no longer runs the SAM transform, so E3010 counts Resources as written. Each AWS::Serverless::Function becomes at least two resources (the function and its role), so a SAM template that expands past 500 resources passes. CloudFormation runs the transform and then rejects the template on the 500-resource quota. Fn::ForEach output is still counted.

Expected behavior

E3010 on the template below, as on 1.53.1. The template macros page says: "Any processed template snippets must pass validation checks for a create stack, update stack, create stack set, or update stack set operation."

Reproduction template

The template has 260 SAM functions, written by this script (gen.py):

import json

fn = {"Type": "AWS::Serverless::Function",
      "Properties": {"Runtime": "python3.12", "Handler": "index.handler",
                     "InlineCode": "def handler(e, c): return 1"}}
tpl = {"AWSTemplateFormatVersion": "2010-09-09",
       "Transform": "AWS::Serverless-2016-10-31",
       "Resources": {f"Fn{i:04d}": fn for i in range(1, 261)}}
json.dump(tpl, open("sam-260-functions.json", "w"), indent=1)

cfn-lint --regions us-east-1 -- sam-260-functions.json prints nothing and exits 0 (the same with -c I). On 1.53.1:

E3010 'Resources' has more than 500 properties
sam-260-functions.json:4:2

CloudFormation, us-east-1, 2026-10-22: CREATE_FAILED with Template format error: Number of resources, 520, is greater than maximum allowed, 500. ValidateTemplate passes, because it does not run transforms.

Related: #4607 tracks rules that lost SAM coverage after #4491; E3010 is not on its lists.

Activity

  1. Varshith-Kali commented on Oct 24, 2026

    @Varshith-Kali
    Contributor

    I'd like to take this on. The regression is clear: since the SAM transform stopped running in #4491, E3010 counts pre-transform resources, so the 500-resource quota check can't fire on SAM templates that expand past the limit. My plan is to have E3010 count post-transform resources (consistent with how Fn::ForEach output is already counted) without re-enabling the transform for the rest of the ruleset. PR with a regression test coming.

  2. added a commit that references this issue on Nov 9, 2026
    2c0ae0c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions