aws-ia / taskcat

Test all the CloudFormation things! (with TaskCat)
https://aws-ia.github.io/taskcat/
Apache License 2.0
1.17k stars 213 forks source link

CFNParser throws exception even when cfnlint is disabled. #617

Open gattasrikanth opened 3 years ago

gattasrikanth commented 3 years ago

Describe the bug I have provided --lint-disable flag when running taskcat, but even then taskcat failed to proceed as there is an error with CFNParser.

To Reproduce Steps to reproduce the behavior:

  1. Are you testing a QuickStart or Custom template? Custom template
  2. Attach or link a copy of the template if possible (remove any sensitive info) AWS Solution
  3. Provide the parameters that you passed. (remove any sensitive info) defaults
  4. How did you install taskcat? (docker or pip3) pip3
  5. Are you using a profile, an instance role or access keys to run taskcat? profile
  6. Is your AWS environment configured via aws configure? no

Deploy the above template using the command line as below: taskcat --debug test run --no-delete --lint-disable --input-file /codebuild/output/src123456/src/tests/ci/taskcat1.yml

Expected behavior Taskcat failed with an error below cfnlint.decode.cfn_yaml.CfnParseError: Duplicate resource found "DependsOn" (line 768)

Screenshots NA

**Version (Please make sure you are running the latest version of taskcat)

tonynv commented 3 years ago

Not reproducible.

diranged commented 2 years ago

Awww @tonynv ... This is a real issue, can you re-open it to track it here as well as in the cfn-lint repo?

https://github.com/aws-cloudformation/cfn-lint/blob/v0.58.0/src/cfnlint/decode/cfn_yaml.py#L83-L87 is the root cause here, and I opened up an issue in the cfn-lint repo at https://github.com/aws-cloudformation/cfn-lint/issues/2211... but it manifests here in taskcat in a frustrating way for anyone who might use YAML anchors to shrink down their CFN templates.

PS ... you fix this for me, and I'll buy ya a beer.. you bring the Supra. :)

andrew-glenn commented 2 years ago

@diranged I gotchu.