Skip to content

Commit

Permalink
catch common resource schema issues in cfn validate
Browse files Browse the repository at this point in the history
encouraging explicit boolean values instead of defaults
  • Loading branch information
PatMyron committed Jun 22, 2021
1 parent 629ea86 commit d4ee256
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/rpdk/core/data_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ def load_resource_spec(resource_spec_file): # pylint: disable=R # noqa: C901
try:
property_type = property_details["type"]
property_keywords = property_details.keys()
if (
property_type == "array"
and "insertionOrder" not in property_keywords
):
LOG.warning(
"Explicitly specify value for insertionOrder for array: %s",
property_name,
)
keyword_mappings = [
(
{"integer", "number"},
Expand Down Expand Up @@ -316,6 +324,9 @@ def load_resource_spec(resource_spec_file): # pylint: disable=R # noqa: C901
"readOnlyProperties and conditionalCreateOnlyProperties MUST NOT have common properties"
)

if "taggable" not in resource_spec:
LOG.warning("Explicitly specify value for taggable")

# TODO: more general validation framework
if "remote" in resource_spec:
raise SpecValidationError(
Expand Down

0 comments on commit d4ee256

Please sign in to comment.