cfn-lint version: (cfn-lint --version) 0.30.1
Description of issue.


startswith getting called indirectly in E1010
bit of an odd use case I'd rather not explicitly check in every rule though, maybe there's somewhere earlier like rules/__init__.py this could be caught?
The code lines you pointed out are all using either cfn.template.get('Resources', {}).items() or cfn.get_resources().items(). If we can change all instances of the former to the latter, maybe we can make a change within cfn.get_resources():
results = {}
for k, v in resources.items():
if isinstance(v, dict):
existing_resource_type = v.get('Type', None)
if not isinstance(existing_resource_type, six.string_types):
raise ValueError("A resource type has to be a string")
if (existing_resource_type in resource_type) or (not resource_type and existing_resource_type is not None):
results[k] = v
return results
@miparnisari I completely agree catching it in get_resources(). I tried to make the functions like cfn.get_resources() return resources only if they are valid. No value in returning something if the Type is a number or not even specified. It should be a safe way to get back "valid" resources that any rule or even other core functionality can use.