aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Feature request: `sam validate` should validate nested application templates

Open davidjb opened this issue 2 years ago • 4 comments

Describe your idea/feature/enhancement

It would be helpful that if a SAM template contained AWS::Serverless::Application resources with location Location files that SAM would automatically check these referenced files at the same time. Otherwise, running sam validate or sam validate --lint succeeds, provided the top-level template is valid, giving the false impression that these nested applications' templates are also valid and able to be deployed.

Proposal

Each referenced file could be checked and the console output indicate the specific file(s) that are problematic; cfn-lint supports checking multiple templates in one invocation.

Additional Details

Currently it's possible to specify multiple templates inside .cflintrc but these are ignored by SAM.

davidjb avatar Sep 22 '23 06:09 davidjb

Thanks @davidjb for the suggestion. I will bring it to the team for prioritization.

mildaniel avatar Sep 25 '23 01:09 mildaniel

I have also encountered this issue.

I have been led astray by the documentation which states the .cfnlintrc configurations will be used for sam validate --lint.

Since SAM is pre-installed on the github action runners this would save me having to install cfn-lint directly to run the lint to my specifications.

dothomson avatar Feb 20 '25 13:02 dothomson

This is still a problem

ribtoks avatar Apr 20 '25 11:04 ribtoks

Is this in scope for addressing at some point in the near future?

grayburnd avatar Aug 24 '25 19:08 grayburnd