aws-cloudformation / cloudformation-cli

The CloudFormation Provider Development Toolkit allows you to author your own resource providers and modules that can be used by CloudFormation.
Apache License 2.0
318 stars 161 forks source link

cfn submit does not work with a new version of cfn-lint #1076

Closed zafodB closed 3 months ago

zafodB commented 3 months ago

The cfn-lint package is a dependency for cloudformation-cli. A new version of this package (1.3.0) was released today. Since cloudformation-cli specifies the dependency as cfn-lint>=0.78.1, the new version will be installed during a fresh installation.

This breaks the command cfn submit, with rpdk.log containing the following error message:

Traceback (most recent call last):
  File "(redacted)\Lib\site-packages\rpdk\core\cli.py", line 105, in main
    args.command(args)
  File "(redacted)\Lib\site-packages\rpdk\core\submit.py", line 14, in submit
    project.load()
  File "(redacted)\Lib\site-packages\rpdk\core\project.py", line 619, in load
    self._load_modules_project()
  File "(redacted)\Lib\site-packages\rpdk\core\project.py", line 642, in _load_modules_project
    self._validate_fragments(template_fragment)
  File "(redacted)\Lib\site-packages\rpdk\core\project.py", line 673, in _validate_fragments
    template_fragment.validate_fragments()
  File "(redacted)\Lib\site-packages\rpdk\core\fragment\generator.py", line 78, in validate_fragments
    print_cfn_lint_warnings(self.fragment_dir)
  File "(redacted)\Lib\site-packages\rpdk\core\fragment\lint_warning_printer.py", line 13, in print_cfn_lint_warnings
    lint_warnings = __get_cfn_lint_matches(fragment_dir)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "(redacted)\Lib\site-packages\rpdk\core\fragment\lint_warning_printer.py", line 51, in __get_cfn_lint_matches
    matches = cfnlint.core.run_checks(filepath, template, rules, regions)
              ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'cfnlint.core' has no attribute 'run_checks'

When testing this, no other configuration changes have been made, other than the version of cfn-lint package.

When an older version - for example cfn-lint==0.87.7 - is (re)installed, the command works as expected.

kddejong commented 3 months ago

We brought back what cloudformation-cli is depending on in cfn-lint>v1.3.1. Try to upgrade cfn-lint and try again.