Skip to content

Allow GetAtt outputs on SAM applications - #4665

Merged
kddejong merged 1 commit into
aws-cloudformation:mainfrom
0xTaoZ:agent/allow-sam-application-outputs
Aug 31, 2026
Merged

kddejong merged 1 commit into
aws-cloudformation:mainfrom
0xTaoZ:agent/allow-sam-application-outputs

Conversation

@0xTaoZ

@0xTaoZ 0xTaoZ commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #4659.

What changed

  • Treat AWS::Serverless::Application like nested stacks for Fn::GetAtt output attributes, allowing Outputs.*.
  • Add the same resource-type exception to the GetAtt format child rule.
  • Add regression coverage for E1010 and E1040 paths.

Why

SAM applications are transformed into nested CloudFormation stacks, and their outputs are documented as accessible through !GetAtt Application.Outputs.Name. After the SAM translator removal, the resource schema only exposed StackId, so Outputs.* was rejected as an unknown attribute.

Validation

  • .venv/bin/python -m pytest test/unit/rules/functions/test_getatt.py test/unit/rules/functions/test_getatt_format.py -q
  • .venv/bin/python -m pytest test/unit/rules/functions -q
  • .venv/bin/python -m pytest test/unit/module/schema -q
  • .venv/bin/ruff check src/cfnlint/schema/_getatts.py src/cfnlint/rules/functions/GetAttFormat.py test/unit/rules/functions/test_getatt.py test/unit/rules/functions/test_getatt_format.py
  • .venv/bin/ruff format --check src/cfnlint/schema/_getatts.py src/cfnlint/rules/functions/GetAttFormat.py test/unit/rules/functions/test_getatt.py test/unit/rules/functions/test_getatt_format.py
  • git diff --check
  • CLI smoke with the issue template in us-east-1

@codecov

codecov Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.62%. Comparing base (980f3dc) to head (68bca15).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4665      +/-   ##
==========================================
+ Coverage   94.57%   94.62%   +0.05%     
==========================================
  Files         432      432              
  Lines       15393    15448      +55     
  Branches     2983     2995      +12     
==========================================
+ Hits        14558    14618      +60     
+ Misses        456      453       -3     
+ Partials      379      377       -2     
Flag Coverage Δ
unittests 94.62% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kddejong
kddejong merged commit b0806d6 into aws-cloudformation:main Aug 31, 2026
21 checks passed
@0xTaoZ
0xTaoZ deleted the agent/allow-sam-application-outputs branch September 29, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E1010 false positive: GetAtt <app>.Outputs.* on AWS::Serverless::Application rejected since 1.54.0 (only StackId allowed)

2 participants