You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using a cloudformation registry schema with -s option. Our resource has no readOnlyProperties and when validating the schema would throw a KeyError:
KeyError: 'readOnlyProperties'
1:1: E0002 Unknown exception while processing rule E1019: Traceback (most recent call last):
File "/private/var/tmp/_bazel_mparsons/96ffd9bf0db81d44b013357bf9794629/sandbox/darwin-sandbox/16527/execroot/core/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/infra/ci/linter/linter.runfiles/pip_cfn_lint/site-packages/cfnlint/rules/__init__.py", line 322, in run_check
return check(*args)
^^^^^^^^^^^^
File "/private/var/tmp/_bazel_mparsons/96ffd9bf0db81d44b013357bf9794629/sandbox/darwin-sandbox/16527/execroot/core/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/infra/ci/linter/linter.runfiles/pip_cfn_lint/site-packages/cfnlint/rules/__init__.py", line 46, in wrapper
results = match_function(self, filename, cfn, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/tmp/_bazel_mparsons/96ffd9bf0db81d44b013357bf9794629/sandbox/darwin-sandbox/16527/execroot/core/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/infra/ci/linter/linter.runfiles/pip_cfn_lint/site-packages/cfnlint/rules/__init__.py", line 204, in matchall
return self.match(cfn) # pylint: disable=E1102
^^^^^^^^^^^^^^^
File "/private/var/tmp/_bazel_mparsons/96ffd9bf0db81d44b013357bf9794629/sandbox/darwin-sandbox/16527/execroot/core/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/infra/ci/linter/linter.runfiles/pip_cfn_lint/site-packages/cfnlint/rules/functions/Sub.py", line 176, in match
matches.extend(self._test_string(cfn, sub_value_obj, {}, tree))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/tmp/_bazel_mparsons/96ffd9bf0db81d44b013357bf9794629/sandbox/darwin-sandbox/16527/execroot/core/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/infra/ci/linter/linter.runfiles/pip_cfn_lint/site-packages/cfnlint/rules/functions/Sub.py", line 28, in _test_string
self._test_parameter(string_param, cfn, parameters, tree)
File "/private/var/tmp/_bazel_mparsons/96ffd9bf0db81d44b013357bf9794629/sandbox/darwin-sandbox/16527/execroot/core/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/infra/ci/linter/linter.runfiles/pip_cfn_lint/site-packages/cfnlint/rules/functions/Sub.py", line 115, in _test_parameter
get_atts = cfn.get_valid_getatts()
^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/tmp/_bazel_mparsons/96ffd9bf0db81d44b013357bf9794629/sandbox/darwin-sandbox/16527/execroot/core/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/infra/ci/linter/linter.runfiles/pip_cfn_lint/site-packages/cfnlint/template/template.py", line 426, in get_valid_getatts
for ro_property in schema["readOnlyProperties"]:
~~~~~~^^^^^^^^^^^^^^^^^^^^^^
However if you define this as a key with an empty list, it will throw a validation error:
Resource schema is invalid: [] is too short
Failed validating 'minItems' in schema['properties']['readOnlyProperties']:
{'items': {'format': 'json-pointer', 'type': 'string'},
'minItems': 1,
'type': 'array'}
On instance['readOnlyProperties']:
[]
CloudFormation Lint Version
0.86.2
What operating system are you using?
mac
Describe the bug
using a cloudformation registry schema with
-s
option. Our resource has noreadOnlyProperties
and when validating the schema would throw aKeyError
:However if you define this as a key with an empty list, it will throw a validation error:
Expected behavior
Not throw a key error.
Reproduction template
See attached schema.
schema.json
The text was updated successfully, but these errors were encountered: