Open deleugpn opened 4 months ago
Thanks for reporting. I could reproduce the same output with the SAM CLI as well (by running sam package --template-file indentation-bug.yml
)
The package command is part of the CLI CloudFormation customization so the team maintaining the customization would need to take a look here. But I'm also not sure why running the validate-template command doesn't result in a ValidationError. So I'll try asking the CloudFormation team about the ValidateTemplate API as well.
Describe the bug
When running
aws cloudformation package
the output template mixes two lambda functions if the second one has an indentation bug.Expected Behavior
abort with a validation error
Current Behavior
All properties of the 2nd lambda overrides the properties of the 1st lambda. The 2nd lambda becomes
null
.Reproduction Steps
Create a template called
indentation-bug.yml
run
aws cloudformation package
Possible Solution
No response
Additional Information/Context
The current output from package:
Instead of silently mixing LambdaOne with LambdaTwo and causing a bug, it would be better to just error out on invalid template syntax.
CLI version used
2.17.14
Environment details (OS name and version, etc.)
ubuntu-latest (GitHub Actions), Mac M1